diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6d6180a..2b0cd2b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: run: | nimble develop cd examples/desktop - nimble build -Y + nimble buildDesktop -Y # Generate the Docs - name: Generate documentation diff --git a/.vscode/launch.json b/.vscode/launch.json index f26e750..3cfbe4c 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -9,6 +9,15 @@ "program": "${workspaceFolder}/examples/desktop/bin/desktop", "args": [], "cwd": "${workspaceFolder}/examples/desktop", + }, + { + "type": "lldb", + "request": "launch", + "name": "Nim: Debug Editor", + "preLaunchTask": "Debug Komodo Editor", + "program": "${workspaceFolder}/komodoeditor/bin/komodoeditor", + "args": [], + "cwd": "${workspaceFolder}/komodoeditor", } ] } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index c935e49..27ebb6d 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -4,27 +4,34 @@ { "label": "Build Komodo Desktop Example", "type": "shell", - "command": "cd examples/desktop; nimble build", + "command": "cd examples/desktop; nimble buildDesktop", "problemMatcher": [], "group": "build", }, { "label": "Debug Komodo Desktop Example", "type": "shell", - "command": "cd examples/desktop; nimble debug", + "command": "cd komodoeditor; nimble debugDesktop", "problemMatcher": [], "group": "build", }, { "label": "Run Komodo Desktop Example", "type": "shell", - "command": "cd examples/desktop; nimble example", + "command": "cd examples/desktop; nimble runDesktop", "problemMatcher": [], "group": { "kind": "build", "isDefault": true }, }, + { + "label": "Debug Komodo Editor", + "type": "shell", + "command": "cd komodoeditor; nimble debugEditor", + "problemMatcher": [], + "group": "build", + }, { "label": "Format code", "type": "shell", diff --git a/README.md b/README.md index 0abb028..8de3da0 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ scoop install nim ``` #### Raylib Setup -Copy the libraries found in the project's `lib/windows` directory to `C:\Windows\System32`. +Copy the libraries found in the project's `libs/raylib/windows` directory to `C:\Windows\System32`. ### Mac OS @@ -63,7 +63,7 @@ choosenim stable ``` #### Raylib Setup -Either copy the `libraylib.so` file from `lib/linux` into `/usr/local/lib`, or follow the install instructions found on [raylib's repo wiki](https://github.com/raysan5/raylib/wiki/Working-on-GNU-Linux) to build from source and install like so: +Either copy the `libraylib.so` file from `libs/raylib/linux` into `/usr/local/lib`, or follow the install instructions found on [raylib's repo wiki](https://github.com/raysan5/raylib/wiki/Working-on-GNU-Linux) to build from source and install like so: ```bash cd /tmp git clone https://github.com/raysan5/raylib.git raylib @@ -72,8 +72,8 @@ make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=SHARED sudo make install RAYLIB_LIBTYPE=SHARED ``` -## Raylib -### Important Links +## Important Links * [raylib bindings](https://github.com/Guevara-chan/Raylib-Forever) * [raylib cheatsheet](https://www.raylib.com/cheatsheet/cheatsheet.html) -* [raylib releases](https://github.com/raysan5/raylib/releases) \ No newline at end of file +* [raylib releases](https://github.com/raysan5/raylib/releases) +* [IUP documentation](http://webserver2.tecgraf.puc-rio.br/iup) \ No newline at end of file diff --git a/examples/desktop/desktop.nimble b/examples/desktop/desktop.nimble index f354284..19234f3 100644 --- a/examples/desktop/desktop.nimble +++ b/examples/desktop/desktop.nimble @@ -14,11 +14,11 @@ binDir = "bin" requires "nim >= 1.4.2" requires "komodo" -task build, "Build Desktop example": - exec "nimble --gc:orc -d:nimpretty build" +task buildDesktop, "Build Desktop example": + exec "nimble --gc:orc --threads:on -d:nimpretty build -Y" -task debug, "Debug Desktop example": - exec "nimble --gc:orc -g --debugger:native -d:nimpretty build" +task debugDesktop, "Debug Desktop example": + exec "nimble --gc:orc --threads:on -g --debugger:native -d:nimpretty build -Y" -task example, "Example": - exec "nimble --gc:orc -d:nimpretty run" +task runDesktop, "Example": + exec "nimble --gc:orc --threads:on -d:nimpretty run -Y" diff --git a/examples/desktop/src/desktop.nim b/examples/desktop/src/desktop.nim index d4af117..165a6fa 100644 --- a/examples/desktop/src/desktop.nim +++ b/examples/desktop/src/desktop.nim @@ -7,7 +7,7 @@ import komodo/ecs/systems import komodo/lib/graphics/color import komodo/lib/math -import test_behavior +# import test_behavior proc add_cube(game: Game) = @@ -43,66 +43,67 @@ proc add_cube(game: Game) = ) assert game.registerComponent(transform) -proc add_sprite(game: Game) = - let parent = newEntity() - assert game.registerEntity(parent) - assert game.deregisterEntity(parent) - assert not game.deregisterEntity(parent) - assert game.registerEntity(parent) - - let render_sprite_system = newRenderSpriteSystem() - assert game.registerSystem(render_sprite_system) - let sprite = newSpriteComponent( - parent, - "img/brainlet.png", - color = White, - ) - assert game.registerComponent(sprite) - - let render_text_system = newRenderTextSystem() - assert game.registerSystem(render_text_system) - let text = newTextComponent( - parent, - "Hello from desktop!", - fontSize = 24, - color = Black, - ) - assert game.registerComponent(text) - assert game.deregisterComponent(text) - assert not game.deregisterComponent(text) - assert game.registerComponent(text) - - let screen_size = game.screenSize() - let transform = newTransformComponent( - parent, - position = Vector3( - x: screen_size.x / 2, - y: screen_size.y / 2, - z: 0, - ), - rotation = Vector3( - x: 0, - y: 0, - z: 0, - ), - scale = Vector3( - x: 0.5, - y: 1, - z: 1, - ), - ) - assert game.registerComponent(transform) - - let behavior_system = newBehaviorSystem() - assert game.registerSystem(behavior_system) - let behavior = newTestBehavior( +when false: + proc add_sprite(game: Game) = + let parent = newEntity() + assert game.registerEntity(parent) + assert game.deregisterEntity(parent) + assert not game.deregisterEntity(parent) + assert game.registerEntity(parent) + + let render_sprite_system = newRenderSpriteSystem() + assert game.registerSystem(render_sprite_system) + let sprite = newSpriteComponent( + parent, + "img/brainlet.png", + color = White, + ) + assert game.registerComponent(sprite) + + let render_text_system = newRenderTextSystem() + assert game.registerSystem(render_text_system) + let text = newTextComponent( + parent, + "Hello from desktop!", + fontSize = 24, + color = Black, + ) + assert game.registerComponent(text) + assert game.deregisterComponent(text) + assert not game.deregisterComponent(text) + assert game.registerComponent(text) + + let screen_size = game.screenSize() + let transform = newTransformComponent( parent, - ) - assert game.registerComponent(behavior) - - assert game.deregisterSystem(behavior_system) - assert not game.deregisterSystem(behavior_system) - assert game.registerSystem(behavior_system) + position = Vector3( + x: screen_size.x / 2, + y: screen_size.y / 2, + z: 0, + ), + rotation = Vector3( + x: 0, + y: 0, + z: 0, + ), + scale = Vector3( + x: 0.5, + y: 1, + z: 1, + ), + ) + assert game.registerComponent(transform) + + let behavior_system = newBehaviorSystem() + assert game.registerSystem(behavior_system) + let behavior = newTestBehavior( + parent, + ) + assert game.registerComponent(behavior) + + assert game.deregisterSystem(behavior_system) + assert not game.deregisterSystem(behavior_system) + assert game.registerSystem(behavior_system) proc main() = var game = newGame() @@ -110,7 +111,8 @@ proc main() = game.clearColor = Blue game.add_cube() - game.add_sprite() + when false: + game.add_sprite() game.run() diff --git a/examples/desktop/src/test_behavior.nim b/examples/desktop/src/test_behavior.nim index 8766c16..ce57f57 100644 --- a/examples/desktop/src/test_behavior.nim +++ b/examples/desktop/src/test_behavior.nim @@ -1,6 +1,5 @@ include komodo/prelude -from komodo/game import executeOnSystems, instance, deregisterComponent, registerComponent behavior TestBehavior: fields: @@ -13,13 +12,13 @@ behavior TestBehavior: init: var transform = none[TransformComponent]() - let game = instance.get() - game.executeOnSystems(proc (system: System) = - if transform.isNone(): - transform = system.findComponentByParent[:TransformComponent]( - self.parent.get().id, - ) - ) + # TODO: Need to rethink game instance injection + # game.executeOnSystems(proc (system: System) = + # if transform.isNone(): + # transform = system.findComponentByParent[:TransformComponent]( + # self.parent.get().id, + # ) + # ) if transform.isNone(): logError("Failed to find transform") return @@ -44,7 +43,7 @@ behavior TestBehavior: z: position.z, ) if self.remove_action.isDown(): - let game = instance.get() + # let game = instance.get() discard game.deregisterComponent(self.transform.get()) discard game.registerComponent(self.transform.get()) diff --git a/komodoeditor/README.md b/komodoeditor/README.md new file mode 100644 index 0000000..ca725ac --- /dev/null +++ b/komodoeditor/README.md @@ -0,0 +1,47 @@ +# Komodo Editor +[Documentation](https://exokomodo.github.io/KomodoNim/komodo.html) + +## Setup + +### Windows + +#### Install Scoop +Follow the instructions found on [Scoop's website](https://scoop.sh), or run the following commmands: +```PowerShell +iwr -useb get.scoop.sh | iex +``` + +#### Install Nim +Install nim with +```PowerShell +scoop install nim +``` + +#### IUP Setup +Copy the `*.dll` and `*.lib` files from `libs/iup/windows` into `C:\Windows\System32` + +### Linux + +#### Install choosenim +Follow the install instructions found on [choosenim's repo](https://github.com/dom96/choosenim), or run the following commands: +```bash +curl https://nim-lang.org/choosenim/init.sh -sSf | sh +``` +You will need to update your path in your `.bashrc`: +```bash +export PATH=~/.nimble/bin:$PATH +``` + +#### Install Nim +Install nim with +```bash +choosenim stable +``` + +#### IUP Setup +Copy the `*.so` and `*.a` files from `libs/iup/linux` into `/usr/local/lib` + +## Important Links +* [IUP Documentation](http://webserver2.tecgraf.puc-rio.br/iup) +* [IUP Windows download](https://sourceforge.net/projects/iup/files/3.30/Windows%20Libraries/Dynamic/iup-3.30_Win64_dll16_lib.zip/download) +* [IUP Linux download](https://sourceforge.net/projects/iup/files/3.30/Linux%20Libraries/iup-3.30_Linux54_64_lib.tar.gz/download) diff --git a/komodoeditor/komodoeditor.nimble b/komodoeditor/komodoeditor.nimble new file mode 100644 index 0000000..fcba3ec --- /dev/null +++ b/komodoeditor/komodoeditor.nimble @@ -0,0 +1,25 @@ +# Package + +version = "0.1.0" +author = "James Orson" +description = "GUI editor for the Komodo game engine" +license = "MIT" +srcDir = "src" +bin = @["komodoeditor"] +binDir = "bin" + + +# Dependencies + +requires "nim >= 1.4.2" +requires "komodo" +requires "iup" + +task buildEditor, "Build Komodo Editor": + exec "nimble --gc:orc --threads:on -d:nimpretty build -Y" + +task debugEditor, "Debug Komodo Editor": + exec "nimble --gc:orc --threads:on -g --debugger:native -d:nimpretty build -Y" + +task runEditor, "Run": + exec "nimble --gc:orc --threads:on -d:nimpretty run -Y" diff --git a/komodoeditor/libs/iup/linux/include/iup.h b/komodoeditor/libs/iup/linux/include/iup.h new file mode 100644 index 0000000..5522a64 --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iup.h @@ -0,0 +1,516 @@ +/** \file + * \brief User API + * IUP - A Portable User Interface Toolkit + * Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil + * http://www.tecgraf.puc-rio.br/iup mailto:iup@tecgraf.puc-rio.br + * + * See Copyright Notice at the end of this file + */ + +#ifndef __IUP_H +#define __IUP_H + +#include "iupkey.h" +#include "iupdef.h" +#include "iup_export.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +#define IUP_NAME "IUP - Portable User Interface" +#define IUP_DESCRIPTION "Multi-platform Toolkit for Building Graphical User Interfaces" +#define IUP_COPYRIGHT "Copyright (C) 1994-2020 Tecgraf/PUC-Rio" +#define IUP_VERSION "3.30" /* bug fixes are reported only by IupVersion functions */ +#define IUP_VERSION_NUMBER 330000 +#define IUP_VERSION_DATE "2020/07/30" /* does not include bug fix releases */ + +typedef struct Ihandle_ Ihandle; +typedef int (*Icallback)(Ihandle*); + + +/************************************************************************/ +/* Main API */ +/************************************************************************/ + +IUP_API int IupOpen (int *argc, char ***argv); +IUP_API void IupClose (void); +IUP_API int IupIsOpened (void); + +IUPIMGLIB_API void IupImageLibOpen(void); + +IUP_API int IupMainLoop (void); +IUP_API int IupLoopStep (void); +IUP_API int IupLoopStepWait (void); +IUP_API int IupMainLoopLevel (void); +IUP_API void IupFlush (void); +IUP_API void IupExitLoop (void); +IUP_API void IupPostMessage (Ihandle* ih, const char* s, int i, double d, void* p); + +IUP_API int IupRecordInput(const char* filename, int mode); +IUP_API int IupPlayInput(const char* filename); + +IUP_API void IupUpdate (Ihandle* ih); +IUP_API void IupUpdateChildren(Ihandle* ih); +IUP_API void IupRedraw (Ihandle* ih, int children); +IUP_API void IupRefresh (Ihandle* ih); +IUP_API void IupRefreshChildren(Ihandle* ih); + +IUP_API int IupExecute(const char *filename, const char* parameters); +IUP_API int IupExecuteWait(const char *filename, const char* parameters); +IUP_API int IupHelp(const char* url); +IUP_API void IupLog(const char* type, const char* format, ...); + +IUP_API char* IupLoad (const char *filename); +IUP_API char* IupLoadBuffer (const char *buffer); + +IUP_API char* IupVersion (void); +IUP_API char* IupVersionDate (void); +IUP_API int IupVersionNumber (void); +IUP_API void IupVersionShow (void); + +IUP_API void IupSetLanguage (const char *lng); +IUP_API char* IupGetLanguage (void); +IUP_API void IupSetLanguageString(const char* name, const char* str); +IUP_API void IupStoreLanguageString(const char* name, const char* str); +IUP_API char* IupGetLanguageString(const char* name); +IUP_API void IupSetLanguagePack(Ihandle* ih); + +IUP_API void IupDestroy (Ihandle* ih); +IUP_API void IupDetach (Ihandle* child); +IUP_API Ihandle* IupAppend (Ihandle* ih, Ihandle* child); +IUP_API Ihandle* IupInsert (Ihandle* ih, Ihandle* ref_child, Ihandle* child); +IUP_API Ihandle* IupGetChild (Ihandle* ih, int pos); +IUP_API int IupGetChildPos (Ihandle* ih, Ihandle* child); +IUP_API int IupGetChildCount(Ihandle* ih); +IUP_API Ihandle* IupGetNextChild (Ihandle* ih, Ihandle* child); +IUP_API Ihandle* IupGetBrother (Ihandle* ih); +IUP_API Ihandle* IupGetParent (Ihandle* ih); +IUP_API Ihandle* IupGetDialog (Ihandle* ih); +IUP_API Ihandle* IupGetDialogChild(Ihandle* ih, const char* name); +IUP_API int IupReparent (Ihandle* ih, Ihandle* new_parent, Ihandle* ref_child); + +IUP_API int IupPopup (Ihandle* ih, int x, int y); +IUP_API int IupShow (Ihandle* ih); +IUP_API int IupShowXY (Ihandle* ih, int x, int y); +IUP_API int IupHide (Ihandle* ih); +IUP_API int IupMap (Ihandle* ih); +IUP_API void IupUnmap (Ihandle* ih); + +IUP_API void IupResetAttribute(Ihandle* ih, const char* name); +IUP_API int IupGetAllAttributes(Ihandle* ih, char** names, int n); +IUP_API void IupCopyAttributes(Ihandle* src_ih, Ihandle* dst_ih); +IUP_API Ihandle* IupSetAtt(const char* handle_name, Ihandle* ih, const char* name, ...); +IUP_API Ihandle* IupSetAttributes (Ihandle* ih, const char *str); +IUP_API char* IupGetAttributes (Ihandle* ih); + +IUP_API void IupSetAttribute (Ihandle* ih, const char* name, const char* value); +IUP_API void IupSetStrAttribute(Ihandle* ih, const char* name, const char* value); +IUP_API void IupSetStrf (Ihandle* ih, const char* name, const char* format, ...); +IUP_API void IupSetInt (Ihandle* ih, const char* name, int value); +IUP_API void IupSetFloat (Ihandle* ih, const char* name, float value); +IUP_API void IupSetDouble (Ihandle* ih, const char* name, double value); +IUP_API void IupSetRGB (Ihandle* ih, const char* name, unsigned char r, unsigned char g, unsigned char b); +IUP_API void IupSetRGBA (Ihandle* ih, const char* name, unsigned char r, unsigned char g, unsigned char b, unsigned char a); + +IUP_API char* IupGetAttribute(Ihandle* ih, const char* name); +IUP_API int IupGetInt (Ihandle* ih, const char* name); +IUP_API int IupGetInt2 (Ihandle* ih, const char* name); +IUP_API int IupGetIntInt (Ihandle* ih, const char* name, int *i1, int *i2); +IUP_API float IupGetFloat (Ihandle* ih, const char* name); +IUP_API double IupGetDouble(Ihandle* ih, const char* name); +IUP_API void IupGetRGB (Ihandle* ih, const char* name, unsigned char *r, unsigned char *g, unsigned char *b); +IUP_API void IupGetRGBA (Ihandle* ih, const char* name, unsigned char *r, unsigned char *g, unsigned char *b, unsigned char *a); + +IUP_API void IupSetAttributeId(Ihandle* ih, const char* name, int id, const char *value); +IUP_API void IupSetStrAttributeId(Ihandle* ih, const char* name, int id, const char *value); +IUP_API void IupSetStrfId(Ihandle* ih, const char* name, int id, const char* format, ...); +IUP_API void IupSetIntId(Ihandle* ih, const char* name, int id, int value); +IUP_API void IupSetFloatId(Ihandle* ih, const char* name, int id, float value); +IUP_API void IupSetDoubleId(Ihandle* ih, const char* name, int id, double value); +IUP_API void IupSetRGBId(Ihandle* ih, const char* name, int id, unsigned char r, unsigned char g, unsigned char b); + +IUP_API char* IupGetAttributeId(Ihandle* ih, const char* name, int id); +IUP_API int IupGetIntId(Ihandle* ih, const char* name, int id); +IUP_API float IupGetFloatId(Ihandle* ih, const char* name, int id); +IUP_API double IupGetDoubleId(Ihandle* ih, const char* name, int id); +IUP_API void IupGetRGBId(Ihandle* ih, const char* name, int id, unsigned char *r, unsigned char *g, unsigned char *b); + +IUP_API void IupSetAttributeId2(Ihandle* ih, const char* name, int lin, int col, const char* value); +IUP_API void IupSetStrAttributeId2(Ihandle* ih, const char* name, int lin, int col, const char* value); +IUP_API void IupSetStrfId2(Ihandle* ih, const char* name, int lin, int col, const char* format, ...); +IUP_API void IupSetIntId2(Ihandle* ih, const char* name, int lin, int col, int value); +IUP_API void IupSetFloatId2(Ihandle* ih, const char* name, int lin, int col, float value); +IUP_API void IupSetDoubleId2(Ihandle* ih, const char* name, int lin, int col, double value); +IUP_API void IupSetRGBId2(Ihandle* ih, const char* name, int lin, int col, unsigned char r, unsigned char g, unsigned char b); + +IUP_API char* IupGetAttributeId2(Ihandle* ih, const char* name, int lin, int col); +IUP_API int IupGetIntId2(Ihandle* ih, const char* name, int lin, int col); +IUP_API float IupGetFloatId2(Ihandle* ih, const char* name, int lin, int col); +IUP_API double IupGetDoubleId2(Ihandle* ih, const char* name, int lin, int col); +IUP_API void IupGetRGBId2(Ihandle* ih, const char* name, int lin, int col, unsigned char *r, unsigned char *g, unsigned char *b); + +IUP_API void IupSetGlobal (const char* name, const char* value); +IUP_API void IupSetStrGlobal(const char* name, const char* value); +IUP_API char* IupGetGlobal (const char* name); + +IUP_API Ihandle* IupSetFocus (Ihandle* ih); +IUP_API Ihandle* IupGetFocus (void); +IUP_API Ihandle* IupPreviousField(Ihandle* ih); +IUP_API Ihandle* IupNextField (Ihandle* ih); + +IUP_API Icallback IupGetCallback (Ihandle* ih, const char *name); +IUP_API Icallback IupSetCallback (Ihandle* ih, const char *name, Icallback func); +IUP_API Ihandle* IupSetCallbacks(Ihandle* ih, const char *name, Icallback func, ...); + +IUP_API Icallback IupGetFunction(const char *name); +IUP_API Icallback IupSetFunction(const char *name, Icallback func); + +IUP_API Ihandle* IupGetHandle (const char *name); +IUP_API Ihandle* IupSetHandle (const char *name, Ihandle* ih); +IUP_API int IupGetAllNames (char** names, int n); +IUP_API int IupGetAllDialogs(char** names, int n); +IUP_API char* IupGetName (Ihandle* ih); + +IUP_API void IupSetAttributeHandle(Ihandle* ih, const char* name, Ihandle* ih_named); +IUP_API Ihandle* IupGetAttributeHandle(Ihandle* ih, const char* name); +IUP_API void IupSetAttributeHandleId(Ihandle* ih, const char* name, int id, Ihandle* ih_named); +IUP_API Ihandle* IupGetAttributeHandleId(Ihandle* ih, const char* name, int id); +IUP_API void IupSetAttributeHandleId2(Ihandle* ih, const char* name, int lin, int col, Ihandle* ih_named); +IUP_API Ihandle* IupGetAttributeHandleId2(Ihandle* ih, const char* name, int lin, int col); + +IUP_API char* IupGetClassName(Ihandle* ih); +IUP_API char* IupGetClassType(Ihandle* ih); +IUP_API int IupGetAllClasses(char** names, int n); +IUP_API int IupGetClassAttributes(const char* classname, char** names, int n); +IUP_API int IupGetClassCallbacks(const char* classname, char** names, int n); +IUP_API void IupSaveClassAttributes(Ihandle* ih); +IUP_API void IupCopyClassAttributes(Ihandle* src_ih, Ihandle* dst_ih); +IUP_API void IupSetClassDefaultAttribute(const char* classname, const char *name, const char* value); +IUP_API int IupClassMatch(Ihandle* ih, const char* classname); + +IUP_API Ihandle* IupCreate (const char *classname); +IUP_API Ihandle* IupCreatev(const char *classname, void* *params); +IUP_API Ihandle* IupCreatep(const char *classname, void* first, ...); + +/************************************************************************/ +/* Elements */ +/************************************************************************/ + +IUP_API Ihandle* IupFill (void); +IUP_API Ihandle* IupSpace(void); + +IUP_API Ihandle* IupRadio (Ihandle* child); +IUP_API Ihandle* IupVbox (Ihandle* child, ...); +IUP_API Ihandle* IupVboxv (Ihandle* *children); +IUP_API Ihandle* IupZbox (Ihandle* child, ...); +IUP_API Ihandle* IupZboxv (Ihandle* *children); +IUP_API Ihandle* IupHbox (Ihandle* child, ...); +IUP_API Ihandle* IupHboxv (Ihandle* *children); + +IUP_API Ihandle* IupNormalizer (Ihandle* ih_first, ...); +IUP_API Ihandle* IupNormalizerv(Ihandle* *ih_list); + +IUP_API Ihandle* IupCbox (Ihandle* child, ...); +IUP_API Ihandle* IupCboxv (Ihandle* *children); +IUP_API Ihandle* IupSbox (Ihandle* child); +IUP_API Ihandle* IupSplit (Ihandle* child1, Ihandle* child2); +IUP_API Ihandle* IupScrollBox (Ihandle* child); +IUP_API Ihandle* IupFlatScrollBox(Ihandle* child); +IUP_API Ihandle* IupGridBox (Ihandle* child, ...); +IUP_API Ihandle* IupGridBoxv (Ihandle* *children); +IUP_API Ihandle* IupMultiBox (Ihandle* child, ...); +IUP_API Ihandle* IupMultiBoxv (Ihandle **children); +IUP_API Ihandle* IupExpander(Ihandle* child); +IUP_API Ihandle* IupDetachBox (Ihandle* child); +IUP_API Ihandle* IupBackgroundBox(Ihandle* child); + +IUP_API Ihandle* IupFrame (Ihandle* child); +IUP_API Ihandle* IupFlatFrame (Ihandle* child); + +IUP_API Ihandle* IupImage (int width, int height, const unsigned char* pixels); +IUP_API Ihandle* IupImageRGB (int width, int height, const unsigned char* pixels); +IUP_API Ihandle* IupImageRGBA (int width, int height, const unsigned char* pixels); + +IUP_API Ihandle* IupItem (const char* title, const char* action); +IUP_API Ihandle* IupSubmenu (const char* title, Ihandle* child); +IUP_API Ihandle* IupSeparator (void); +IUP_API Ihandle* IupMenu (Ihandle* child, ...); +IUP_API Ihandle* IupMenuv (Ihandle* *children); + +IUP_API Ihandle* IupButton (const char* title, const char* action); +IUP_API Ihandle* IupFlatButton (const char* title); +IUP_API Ihandle* IupFlatToggle (const char* title); +IUP_API Ihandle* IupDropButton (Ihandle* dropchild); +IUP_API Ihandle* IupFlatLabel (const char* title); +IUP_API Ihandle* IupFlatSeparator(void); +IUP_API Ihandle* IupCanvas (const char* action); +IUP_API Ihandle* IupDialog (Ihandle* child); +IUP_API Ihandle* IupUser (void); +IUP_API Ihandle* IupThread (void); +IUP_API Ihandle* IupLabel (const char* title); +IUP_API Ihandle* IupList (const char* action); +IUP_API Ihandle* IupFlatList (void); +IUP_API Ihandle* IupText (const char* action); +IUP_API Ihandle* IupMultiLine (const char* action); +IUP_API Ihandle* IupToggle (const char* title, const char* action); +IUP_API Ihandle* IupTimer (void); +IUP_API Ihandle* IupClipboard (void); +IUP_API Ihandle* IupProgressBar(void); +IUP_API Ihandle* IupVal (const char *type); +IUP_API Ihandle* IupFlatVal (const char *type); +IUP_API Ihandle* IupFlatTree (void); +IUP_API Ihandle* IupTabs (Ihandle* child, ...); +IUP_API Ihandle* IupTabsv (Ihandle* *children); +IUP_API Ihandle* IupFlatTabs (Ihandle* first, ...); +IUP_API Ihandle* IupFlatTabsv (Ihandle* *children); +IUP_API Ihandle* IupTree (void); +IUP_API Ihandle* IupLink (const char* url, const char* title); +IUP_API Ihandle* IupAnimatedLabel(Ihandle* animation); +IUP_API Ihandle* IupDatePick (void); +IUP_API Ihandle* IupCalendar (void); +IUP_API Ihandle* IupColorbar (void); +IUP_API Ihandle* IupGauge (void); +IUP_API Ihandle* IupDial (const char* type); +IUP_API Ihandle* IupColorBrowser(void); + +/* Old controls, use SPIN attribute of IupText */ +IUP_API Ihandle* IupSpin (void); +IUP_API Ihandle* IupSpinbox (Ihandle* child); + + +/************************************************************************/ +/* Utilities */ +/************************************************************************/ + +/* String compare utility */ +IUP_API int IupStringCompare(const char* str1, const char* str2, int casesensitive, int lexicographic); + +/* IupImage utilities */ +IUP_API int IupSaveImageAsText(Ihandle* ih, const char* filename, const char* format, const char* name); +IUP_API Ihandle* IupImageGetHandle(const char* name); + +/* IupText and IupScintilla utilities */ +IUP_API void IupTextConvertLinColToPos(Ihandle* ih, int lin, int col, int *pos); +IUP_API void IupTextConvertPosToLinCol(Ihandle* ih, int pos, int *lin, int *col); + +/* IupText, IupList, IupTree, IupMatrix and IupScintilla utility */ +IUP_API int IupConvertXYToPos(Ihandle* ih, int x, int y); + +/* OLD names, kept for backward compatibility, will never be removed. */ +IUP_API void IupStoreGlobal(const char* name, const char* value); +IUP_API void IupStoreAttribute(Ihandle* ih, const char* name, const char* value); +IUP_API void IupSetfAttribute(Ihandle* ih, const char* name, const char* format, ...); +IUP_API void IupStoreAttributeId(Ihandle* ih, const char* name, int id, const char *value); +IUP_API void IupSetfAttributeId(Ihandle* ih, const char* name, int id, const char* f, ...); +IUP_API void IupStoreAttributeId2(Ihandle* ih, const char* name, int lin, int col, const char* value); +IUP_API void IupSetfAttributeId2(Ihandle* ih, const char* name, int lin, int col, const char* format, ...); + +/* IupTree and IupFlatTree utilities (work for both) */ +IUP_API int IupTreeSetUserId(Ihandle* ih, int id, void* userid); +IUP_API void* IupTreeGetUserId(Ihandle* ih, int id); +IUP_API int IupTreeGetId(Ihandle* ih, void *userid); +IUP_API void IupTreeSetAttributeHandle(Ihandle* ih, const char* name, int id, Ihandle* ih_named); /* deprecated, use IupSetAttributeHandleId */ + + +/************************************************************************/ +/* Pre-defined dialogs */ +/************************************************************************/ + +IUP_API Ihandle* IupFileDlg(void); +IUP_API Ihandle* IupMessageDlg(void); +IUP_API Ihandle* IupColorDlg(void); +IUP_API Ihandle* IupFontDlg(void); +IUP_API Ihandle* IupProgressDlg(void); + +IUP_API int IupGetFile(char *arq); +IUP_API void IupMessage(const char *title, const char *msg); +IUP_API void IupMessagef(const char *title, const char *format, ...); +IUP_API void IupMessageError(Ihandle* parent, const char* message); +IUP_API int IupMessageAlarm(Ihandle* parent, const char* title, const char *message, const char *buttons); +IUP_API int IupAlarm(const char *title, const char *msg, const char *b1, const char *b2, const char *b3); +IUP_API int IupScanf(const char *format, ...); +IUP_API int IupListDialog(int type, const char *title, int size, const char** list, + int op, int max_col, int max_lin, int* marks); +IUP_API int IupGetText(const char* title, char* text, int maxsize); +IUP_API int IupGetColor(int x, int y, unsigned char* r, unsigned char* g, unsigned char* b); + +typedef int (*Iparamcb)(Ihandle* dialog, int param_index, void* user_data); +IUP_API int IupGetParam(const char* title, Iparamcb action, void* user_data, const char* format,...); +IUP_API int IupGetParamv(const char* title, Iparamcb action, void* user_data, const char* format, int param_count, int param_extra, void** param_data); +IUP_API Ihandle* IupParam(const char* format); +IUP_API Ihandle* IupParamBox(Ihandle* param, ...); +IUP_API Ihandle* IupParamBoxv(Ihandle* *param_array); + +IUP_API Ihandle* IupLayoutDialog(Ihandle* dialog); +IUP_API Ihandle* IupElementPropertiesDialog(Ihandle* parent, Ihandle* elem); +IUP_API Ihandle* IupGlobalsDialog(void); +IUP_API Ihandle* IupClassInfoDialog(Ihandle* parent); + + +#ifdef __cplusplus +} +#endif + +/************************************************************************/ +/* Common Flags and Return Values */ +/************************************************************************/ +#define IUP_ERROR 1 +#define IUP_NOERROR 0 +#define IUP_OPENED -1 +#define IUP_INVALID -1 +#define IUP_INVALID_ID -10 + + +/************************************************************************/ +/* Callback Return Values */ +/************************************************************************/ +#define IUP_IGNORE -1 +#define IUP_DEFAULT -2 +#define IUP_CLOSE -3 +#define IUP_CONTINUE -4 + +/************************************************************************/ +/* IupPopup and IupShowXY Parameter Values */ +/************************************************************************/ +#define IUP_CENTER 0xFFFF /* 65535 */ +#define IUP_LEFT 0xFFFE /* 65534 */ +#define IUP_RIGHT 0xFFFD /* 65533 */ +#define IUP_MOUSEPOS 0xFFFC /* 65532 */ +#define IUP_CURRENT 0xFFFB /* 65531 */ +#define IUP_CENTERPARENT 0xFFFA /* 65530 */ +#define IUP_LEFTPARENT 0xFFF9 /* 65529 */ +#define IUP_RIGHTPARENT 0xFFF8 /* 65528 */ +#define IUP_TOP IUP_LEFT +#define IUP_BOTTOM IUP_RIGHT +#define IUP_TOPPARENT IUP_LEFTPARENT +#define IUP_BOTTOMPARENT IUP_RIGHTPARENT + +/************************************************************************/ +/* SHOW_CB Callback Values */ +/************************************************************************/ +enum{IUP_SHOW, IUP_RESTORE, IUP_MINIMIZE, IUP_MAXIMIZE, IUP_HIDE}; + +/************************************************************************/ +/* SCROLL_CB Callback Values */ +/************************************************************************/ +enum{IUP_SBUP, IUP_SBDN, IUP_SBPGUP, IUP_SBPGDN, IUP_SBPOSV, IUP_SBDRAGV, + IUP_SBLEFT, IUP_SBRIGHT, IUP_SBPGLEFT, IUP_SBPGRIGHT, IUP_SBPOSH, IUP_SBDRAGH}; + +/************************************************************************/ +/* Mouse Button Values and Macros */ +/************************************************************************/ +#define IUP_BUTTON1 '1' +#define IUP_BUTTON2 '2' +#define IUP_BUTTON3 '3' +#define IUP_BUTTON4 '4' +#define IUP_BUTTON5 '5' + +#define iup_isshift(_s) (_s[0]=='S') +#define iup_iscontrol(_s) (_s[1]=='C') +#define iup_isbutton1(_s) (_s[2]=='1') +#define iup_isbutton2(_s) (_s[3]=='2') +#define iup_isbutton3(_s) (_s[4]=='3') +#define iup_isdouble(_s) (_s[5]=='D') +#define iup_isalt(_s) (_s[6]=='A') +#define iup_issys(_s) (_s[7]=='Y') +#define iup_isbutton4(_s) (_s[8]=='4') +#define iup_isbutton5(_s) (_s[9]=='5') + +/* Old definitions for backward compatibility */ +#define isshift iup_isshift +#define iscontrol iup_iscontrol +#define isbutton1 iup_isbutton1 +#define isbutton2 iup_isbutton2 +#define isbutton3 iup_isbutton3 +#define isdouble iup_isdouble +#define isalt iup_isalt +#define issys iup_issys +#define isbutton4 iup_isbutton4 +#define isbutton5 iup_isbutton5 + + +/************************************************************************/ +/* Pre-Defined Masks */ +/************************************************************************/ +#define IUP_MASK_FLOAT "[+/-]?(/d+/.?/d*|/./d+)" +#define IUP_MASK_UFLOAT "(/d+/.?/d*|/./d+)" +#define IUP_MASK_EFLOAT "[+/-]?(/d+/.?/d*|/./d+)([eE][+/-]?/d+)?" +#define IUP_MASK_UEFLOAT "(/d+/.?/d*|/./d+)([eE][+/-]?/d+)?" +#define IUP_MASK_FLOATCOMMA "[+/-]?(/d+/,?/d*|/,/d+)" +#define IUP_MASK_UFLOATCOMMA "(/d+/,?/d*|/,/d+)" +#define IUP_MASK_INT "[+/-]?/d+" +#define IUP_MASK_UINT "/d+" + +/* Old definitions for backward compatibility */ +#define IUPMASK_FLOAT IUP_MASK_FLOAT +#define IUPMASK_UFLOAT IUP_MASK_UFLOAT +#define IUPMASK_EFLOAT IUP_MASK_EFLOAT +#define IUPMASK_INT IUP_MASK_INT +#define IUPMASK_UINT IUP_MASK_UINT + + +/************************************************************************/ +/* IupGetParam Callback situations */ +/************************************************************************/ +#define IUP_GETPARAM_BUTTON1 -1 +#define IUP_GETPARAM_INIT -2 +#define IUP_GETPARAM_BUTTON2 -3 +#define IUP_GETPARAM_BUTTON3 -4 +#define IUP_GETPARAM_CLOSE -5 +#define IUP_GETPARAM_MAP -6 +#define IUP_GETPARAM_OK IUP_GETPARAM_BUTTON1 +#define IUP_GETPARAM_CANCEL IUP_GETPARAM_BUTTON2 +#define IUP_GETPARAM_HELP IUP_GETPARAM_BUTTON3 + +/************************************************************************/ +/* Used by IupColorbar */ +/************************************************************************/ +#define IUP_PRIMARY -1 +#define IUP_SECONDARY -2 + +/************************************************************************/ +/* Record Input Modes */ +/************************************************************************/ +enum {IUP_RECBINARY, IUP_RECTEXT}; + + +/************************************************************************/ +/* Replacement for the WinMain in Windows, */ +/* this allows the application to start from "main". */ +/* Used only for Watcom. */ +/************************************************************************/ +#if defined (__WATCOMC__) +#ifdef __cplusplus +extern "C" { +int IupMain (int argc, char** argv); /* In C++ we have to declare the prototype */ +} +#endif +#define main IupMain /* this is the trick for Watcom and MetroWerks */ +#endif + +/****************************************************************************** +* Copyright (C) 1994-2019 Tecgraf/PUC-Rio. +* +* Permission is hereby granted, free of charge, to any person obtaining +* a copy of this software and associated documentation files (the +* "Software"), to deal in the Software without restriction, including +* without limitation the rights to use, copy, modify, merge, publish, +* distribute, sublicense, and/or sell copies of the Software, and to +* permit persons to whom the Software is furnished to do so, subject to +* the following conditions: +* +* The above copyright notice and this permission notice shall be +* included in all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +******************************************************************************/ + +#endif diff --git a/komodoeditor/libs/iup/linux/include/iup_class_cbs.hpp b/komodoeditor/libs/iup/linux/include/iup_class_cbs.hpp new file mode 100644 index 0000000..237ae9e --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iup_class_cbs.hpp @@ -0,0 +1,464 @@ +/** \file + * \brief Class Callback Utilities. + */ + +#ifndef __IUP_CLASS_CBS_HPP +#define __IUP_CLASS_CBS_HPP + + +#define IUP_CLASS_GET_OBJECT(__ih, __class) dynamic_cast<__class*>((__class*)IupGetAttribute(__ih, #__class "->this")) + + +#define IUP_CLASS_INITCALLBACK(__ih, __class) \ + IupSetAttribute(__ih, #__class "->this", (char*)this) + +#define IUP_CLASS_SETCALLBACK(__ih, __name, __cb) \ + IupSetCallback(__ih, __name, (Icallback)CB_##__cb) + + + +#ifdef __IUP_PLUS_H + +#define IUP_PLUS_GET_OBJECT(__elem, __class) dynamic_cast<__class*>((__class*)IupGetAttribute(__elem.GetHandle(), #__class "->this")) + +#define IUP_PLUS_INITCALLBACK(__elem, __class) \ + IupSetAttribute(__elem.GetHandle(), #__class "->this", (char*)this) + +#define IUP_PLUS_SETCALLBACK(__elem, __name, __cb) \ + IupSetCallback(__elem.GetHandle(), __name, (Icallback)CB_##__cb) + +#endif + + + +#define IUP_CLASS_DECLARECALLBACK_IFn(__class, __cb) \ + int __cb(Ihandle* ih); \ +static int CB_##__cb(Ihandle* ih) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFni(__class, __cb) \ + int __cb(Ihandle* ih, int i1); \ +static int CB_##__cb(Ihandle* ih, int i1) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFnii(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniii(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2, int i3); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2, int i3) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, i3); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniiii(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2, int i3, int i4); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2, int i3, int i4) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, i3, i4); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniiiii(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2, int i3, int i4, int i5); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2, int i3, int i4, int i5) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, i3, i4, i5); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniiiiii(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2, int i3, int i4, int i5, int i6); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2, int i3, int i4, int i5, int i6) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, i3, i4, i5, i6); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniiiiiiC(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2, int i3, int i4, int i5, int i6, struct _cdCanvas* canvas); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2, int i3, int i4, int i5, int i6, struct _cdCanvas* canvas) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, i3, i4, i5, i6, canvas); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFnC(__class, __cb) \ + int __cb(Ihandle* ih, struct _cdCanvas* canvas); \ +static int CB_##__cb(Ihandle* ih, struct _cdCanvas* canvas) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, canvas); \ +} + +#define IUP_CLASS_DECLARECALLBACK_dIFnii(__class, __cb) \ + double __cb(Ihandle* ih, int i1, int i2); \ +static double CB_##__cb(Ihandle* ih, int i1, int i2) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2); \ +} + +#define IUP_CLASS_DECLARECALLBACK_sIFni(__class, __cb) \ + char* __cb(Ihandle* ih, int i1); \ +static char* CB_##__cb(Ihandle* ih, int i1) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1); \ +} + +#define IUP_CLASS_DECLARECALLBACK_sIFnii(__class, __cb) \ + char* __cb(Ihandle* ih, int i1, int i2); \ +static char* CB_##__cb(Ihandle* ih, int i1, int i2) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2); \ +} + +#define IUP_CLASS_DECLARECALLBACK_sIFniis(__class, __cb) \ + char* __cb(Ihandle* ih, int i1, int i2, char* s); \ +static char* CB_##__cb(Ihandle* ih, int i1, int i2, char* s) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, s); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFnff(__class, __cb) \ + int __cb(Ihandle* ih, float f1, float f2); \ +static int CB_##__cb(Ihandle* ih, float f1, float f2) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, f1, f2); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniff(__class, __cb) \ + int __cb(Ihandle* ih, int i1, float f1, float f2); \ +static int CB_##__cb(Ihandle* ih, int i1, float f1, float f2) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, f1, f2); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFnfiis(__class, __cb) \ + int __cb(Ihandle* ih, float f1, int i1, int i2, char* s); \ +static int CB_##__cb(Ihandle* ih, float f1, int i1, int i2, char* s) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, f1, i1, i2, s); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFnd(__class, __cb) \ + int __cb(Ihandle* ih, double d1); \ +static int CB_##__cb(Ihandle* ih, double d1) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, d1); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFndds(__class, __cb) \ + int __cb(Ihandle* ih, double d1, double d2, char* s); \ +static int CB_##__cb(Ihandle* ih, double d1, double d2, char* s) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, d1, d2, s); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniid(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2, double d1); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2, double d1) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, d1); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniidd(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2, double d1, double d2); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2, double d1, double d2) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, d1, d2); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniiddi(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2, double d1, double d2, int i3); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2, double d1, double d2, int i3) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, d1, d2, i3); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniidds(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2, double d1, double d2, char* s); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2, double d1, double d2, char* s) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, d1, d2, s); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniiIII(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2, int *I1, int *I2, int *I3); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2, int *I1, int *I2, int *I3) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, I1, I2, I3); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniIIII(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int *I1, int *I2, int *I3, int *I4); \ +static int CB_##__cb(Ihandle* ih, int i1, int *I1, int *I2, int *I3, int *I4) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, I1, I2, I3, I4); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFnIi(__class, __cb) \ + int __cb(Ihandle* ih, int *I1, int i1); \ +static int CB_##__cb(Ihandle* ih, int *I1, int i1) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, I1, i1); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFnccc(__class, __cb) \ + int __cb(Ihandle* ih, char c1, char c2, char c3); \ +static int CB_##__cb(Ihandle* ih, char c1, char c2, char c3) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, c1, c2, c3); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFnis(__class, __cb) \ + int __cb(Ihandle* ih, int i1, char* s); \ +static int CB_##__cb(Ihandle* ih, int i1, char* s) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, s); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniis(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2, char* s); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2, char* s) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, s); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniiis(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2, int i3, char* s); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2, int i3, char* s) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, i3, s); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniiiis(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2, int i3, int i4, char* s); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2, int i3, int i4, char* s) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, i3, i4, s); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniiiiis(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2, int i3, int i4, int i5, char* s); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2, int i3, int i4, int i5, char* s) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, i3, i4, i5, s); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniiiiiis(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2, int i3, int i4, int i5, int i6, char* s); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2, int i3, int i4, int i5, int i6, char* s) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, i3, i4, i5, i6, s); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFnss(__class, __cb) \ + int __cb(Ihandle* ih, char* s1, char* s2); \ +static int CB_##__cb(Ihandle* ih, char* s1, char* s2) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, s1, s2); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFns(__class, __cb) \ + int __cb(Ihandle* ih, char* s1); \ +static int CB_##__cb(Ihandle* ih, char* s1) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, s1); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFnsi(__class, __cb) \ + int __cb(Ihandle* ih, char* s1, int i1); \ +static int CB_##__cb(Ihandle* ih, char* s1, int i1) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, s1, i1); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFnsii(__class, __cb) \ + int __cb(Ihandle* ih, char* s1, int i1, int i2); \ +static int CB_##__cb(Ihandle* ih, char* s1, int i1, int i2) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, s1, i1, i2); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFnsiii(__class, __cb) \ + int __cb(Ihandle* ih, char* s1, int i1, int i2, int i3); \ +static int CB_##__cb(Ihandle* ih, char* s1, int i1, int i2, int i3) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, s1, i1, i2, i3); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFnnii(__class, __cb) \ + int __cb(Ihandle* ih, Ihandle* ih1, int i1, int i2); \ +static int CB_##__cb(Ihandle* ih, Ihandle* ih1, int i1, int i2) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, ih1, i1, i2); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFnnn(__class, __cb) \ + int __cb(Ihandle* ih, Ihandle* ih1, Ihandle *ih2); \ +static int CB_##__cb(Ihandle* ih, Ihandle* ih1, Ihandle *ih2) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, ih1, ih2); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniinsii(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2, Ihandle* ih1, char* s, int i3, int i4); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2, Ihandle* ih1, char* s, int i3, int i4) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, ih1, s, i3, i4); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFnsVi(__class, __cb) \ + int __cb(Ihandle* ih, char* s1, void* V1, int i1); \ +static int CB_##__cb(Ihandle* ih, char* s1, void* V1, int i1) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, s1, V1, i1); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFnsViii(__class, __cb) \ + int __cb(Ihandle* ih, char* s1, void* V1, int i1, int i2, int i3); \ +static int CB_##__cb(Ihandle* ih, char* s1, void* V1, int i1, int i2, int i3) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, s1, V1, i1, i2, i3); \ +} + + + +/* #define IUP_CLASS_DEBUG */ +#ifdef IUP_CLASS_DEBUG +class IUP_CLASS_DUMMY +{ + // Used to check for errors in the definitions + IUP_CLASS_DECLARECALLBACK_IFn(IUP_CLASS_DUMMY, IFn); + IUP_CLASS_DECLARECALLBACK_IFni(IUP_CLASS_DUMMY, IFni); + IUP_CLASS_DECLARECALLBACK_IFnii(IUP_CLASS_DUMMY, IFnii); + IUP_CLASS_DECLARECALLBACK_IFniii(IUP_CLASS_DUMMY, IFniii); + IUP_CLASS_DECLARECALLBACK_IFniiii(IUP_CLASS_DUMMY, IFniiii); + IUP_CLASS_DECLARECALLBACK_IFniiiii(IUP_CLASS_DUMMY, IFniiiii); + IUP_CLASS_DECLARECALLBACK_IFniiiiii(IUP_CLASS_DUMMY, IFniiiiii); + IUP_CLASS_DECLARECALLBACK_IFniiiiiiC(IUP_CLASS_DUMMY, IFniiiiiiC); + IUP_CLASS_DECLARECALLBACK_IFnC(IUP_CLASS_DUMMY, IFnC); + IUP_CLASS_DECLARECALLBACK_dIFnii(IUP_CLASS_DUMMY, dIFnii); + IUP_CLASS_DECLARECALLBACK_sIFni(IUP_CLASS_DUMMY, sIFni); + IUP_CLASS_DECLARECALLBACK_sIFnii(IUP_CLASS_DUMMY, sIFnii); + IUP_CLASS_DECLARECALLBACK_sIFniis(IUP_CLASS_DUMMY, sIFniis); + IUP_CLASS_DECLARECALLBACK_IFnff(IUP_CLASS_DUMMY, IFnff); + IUP_CLASS_DECLARECALLBACK_IFniff(IUP_CLASS_DUMMY, IFniff); + IUP_CLASS_DECLARECALLBACK_IFnfiis(IUP_CLASS_DUMMY, IFnfiis); + IUP_CLASS_DECLARECALLBACK_IFnd(IUP_CLASS_DUMMY, IFnd); + IUP_CLASS_DECLARECALLBACK_IFndds(IUP_CLASS_DUMMY, IFndds); + IUP_CLASS_DECLARECALLBACK_IFniid(IUP_CLASS_DUMMY, IFniid); + IUP_CLASS_DECLARECALLBACK_IFniidd(IUP_CLASS_DUMMY, IFniidd); + IUP_CLASS_DECLARECALLBACK_IFniiddi(IUP_CLASS_DUMMY, IFniiddi); + IUP_CLASS_DECLARECALLBACK_IFniidds(IUP_CLASS_DUMMY, IFniidds); + IUP_CLASS_DECLARECALLBACK_IFniiIII(IUP_CLASS_DUMMY, IFniiIII); + IUP_CLASS_DECLARECALLBACK_IFniIIII(IUP_CLASS_DUMMY, IFniIIII); + IUP_CLASS_DECLARECALLBACK_IFnIi(IUP_CLASS_DUMMY, IFnIi); + IUP_CLASS_DECLARECALLBACK_IFnccc(IUP_CLASS_DUMMY, IFnccc); + IUP_CLASS_DECLARECALLBACK_IFnis(IUP_CLASS_DUMMY, IFnis); + IUP_CLASS_DECLARECALLBACK_IFniis(IUP_CLASS_DUMMY, IFniis); + IUP_CLASS_DECLARECALLBACK_IFniiis(IUP_CLASS_DUMMY, IFniiis); + IUP_CLASS_DECLARECALLBACK_IFniiiis(IUP_CLASS_DUMMY, IFniiiis); + IUP_CLASS_DECLARECALLBACK_IFniiiiis(IUP_CLASS_DUMMY, IFniiiiis); + IUP_CLASS_DECLARECALLBACK_IFniiiiiis(IUP_CLASS_DUMMY, IFniiiiiis); + IUP_CLASS_DECLARECALLBACK_IFnss(IUP_CLASS_DUMMY, IFnss); + IUP_CLASS_DECLARECALLBACK_IFns(IUP_CLASS_DUMMY, IFns); + IUP_CLASS_DECLARECALLBACK_IFnsi(IUP_CLASS_DUMMY, IFnsi); + IUP_CLASS_DECLARECALLBACK_IFnsii(IUP_CLASS_DUMMY, IFnsii); + IUP_CLASS_DECLARECALLBACK_IFnsiii(IUP_CLASS_DUMMY, IFnsiii); + IUP_CLASS_DECLARECALLBACK_IFnnii(IUP_CLASS_DUMMY, IFnnii); + IUP_CLASS_DECLARECALLBACK_IFnnn(IUP_CLASS_DUMMY, IFnnn); + IUP_CLASS_DECLARECALLBACK_IFniinsii(IUP_CLASS_DUMMY, IFniinsii); + IUP_CLASS_DECLARECALLBACK_IFnsVi(IUP_CLASS_DUMMY, IFnsVi); + IUP_CLASS_DECLARECALLBACK_IFnsViii(IUP_CLASS_DUMMY, IFnsViii); +}; + +class SampleClass +{ + int sample_count; + +public: + SampleClass() + { + sample_count = 0; + + Ihandle* button1 = IupButton("Inc", NULL); + Ihandle* button2 = IupButton("Dec", NULL); + Ihandle* dialog = IupDialog(IupHbox(button1, button2, NULL)); + + // 1) Register "this" object as a callback receiver (need only once) + IUP_CLASS_INITCALLBACK(dialog, SampleClass); + + // 2) Associate the callback with the button + IUP_CLASS_SETCALLBACK(button1, "ACTION", ButtonAction1); + IUP_CLASS_SETCALLBACK(button2, "ACTION", ButtonAction2); + + IupShow(dialog); + }; + +protected: + // 3) Declare the callback as a member function + IUP_CLASS_DECLARECALLBACK_IFn(SampleClass, ButtonAction1); + IUP_CLASS_DECLARECALLBACK_IFn(SampleClass, ButtonAction2); +}; + +// 4) Define the callback as a member function +int SampleClass::ButtonAction1(Ihandle*) +{ + sample_count++; + return IUP_DEFAULT; +} +int SampleClass::ButtonAction2(Ihandle*) +{ + sample_count--; + return IUP_DEFAULT; +} + +#endif // IUP_CLASS_DEBUG + +#endif diff --git a/komodoeditor/libs/iup/linux/include/iup_config.h b/komodoeditor/libs/iup/linux/include/iup_config.h new file mode 100644 index 0000000..a70f7b5 --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iup_config.h @@ -0,0 +1,60 @@ +/** \file + * \brief Configuration file Utilities + * + * See Copyright Notice in "iup.h" + */ + +#ifndef IUP_CONFIG_H +#define IUP_CONFIG_H + +#if defined(__cplusplus) +extern "C" { +#endif + + +IUP_API Ihandle* IupConfig(void); + +IUP_API int IupConfigLoad(Ihandle* ih); +IUP_API int IupConfigSave(Ihandle* ih); + +/****************************************************************/ + +IUP_API void IupConfigSetVariableStr(Ihandle* ih, const char* group, const char* key, const char* value); +IUP_API void IupConfigSetVariableStrId(Ihandle* ih, const char* group, const char* key, int id, const char* value); +IUP_API void IupConfigSetVariableInt(Ihandle* ih, const char* group, const char* key, int value); +IUP_API void IupConfigSetVariableIntId(Ihandle* ih, const char* group, const char* key, int id, int value); +IUP_API void IupConfigSetVariableDouble(Ihandle* ih, const char* group, const char* key, double value); +IUP_API void IupConfigSetVariableDoubleId(Ihandle* ih, const char* group, const char* key, int id, double value); + +IUP_API const char* IupConfigGetVariableStr(Ihandle* ih, const char* group, const char* key); +IUP_API const char* IupConfigGetVariableStrId(Ihandle* ih, const char* group, const char* key, int id); +IUP_API int IupConfigGetVariableInt(Ihandle* ih, const char* group, const char* key); +IUP_API int IupConfigGetVariableIntId(Ihandle* ih, const char* group, const char* key, int id); +IUP_API double IupConfigGetVariableDouble(Ihandle* ih, const char* group, const char* key); +IUP_API double IupConfigGetVariableDoubleId(Ihandle* ih, const char* group, const char* key, int id); + +IUP_API const char* IupConfigGetVariableStrDef(Ihandle* ih, const char* group, const char* key, const char* def); +IUP_API const char* IupConfigGetVariableStrIdDef(Ihandle* ih, const char* group, const char* key, int id, const char* def); +IUP_API int IupConfigGetVariableIntDef(Ihandle* ih, const char* group, const char* key, int def); +IUP_API int IupConfigGetVariableIntIdDef(Ihandle* ih, const char* group, const char* key, int id, int def); +IUP_API double IupConfigGetVariableDoubleDef(Ihandle* ih, const char* group, const char* key, double def); +IUP_API double IupConfigGetVariableDoubleIdDef(Ihandle* ih, const char* group, const char* key, int id, double def); + +IUP_API void IupConfigCopy(Ihandle* ih1, Ihandle* ih2, const char* exclude_prefix); + +/****************************************************************/ + +IUP_API void IupConfigSetListVariable(Ihandle* ih, const char *group, const char* key, const char* value, int add); + +IUP_API void IupConfigRecentInit(Ihandle* ih, Ihandle* menu, Icallback recent_cb, int max_recent); +IUP_API void IupConfigRecentUpdate(Ihandle* ih, const char* filename); + +IUP_API void IupConfigDialogShow(Ihandle* ih, Ihandle* dialog, const char* name); +IUP_API void IupConfigDialogClosed(Ihandle* ih, Ihandle* dialog, const char* name); + + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/linux/include/iup_export.h b/komodoeditor/libs/iup/linux/include/iup_export.h new file mode 100644 index 0000000..9e1e208 --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iup_export.h @@ -0,0 +1,83 @@ +#ifndef __IUP_EXPORT_H +#define __IUP_EXPORT_H + +#ifndef DOXYGEN_SHOULD_IGNORE_THIS +/** @cond DOXYGEN_SHOULD_IGNORE_THIS */ + +/* Mark the official functions */ +#ifndef IUP_API +#ifdef IUP_BUILD_LIBRARY + #ifdef __EMSCRIPTEN__ + #include + #define IUP_API EMSCRIPTEN_KEEPALIVE + #elif WIN32 + #define IUP_API __declspec(dllexport) + #elif defined(__GNUC__) && __GNUC__ >= 4 + #define IUP_API __attribute__ ((visibility("default"))) + #else + #define IUP_API + #endif +#else + #define IUP_API +#endif /* IUP_BUILD_LIBRARY */ +#endif /* IUP_API */ + +/* Mark the internal SDK functions (some not official but need to be exported) */ +#ifndef IUP_SDK_API +#ifdef IUP_BUILD_LIBRARY + #ifdef __EMSCRIPTEN__ + #include + #define IUP_SDK_API EMSCRIPTEN_KEEPALIVE + #elif WIN32 + #define IUP_SDK_API __declspec(dllexport) + #elif defined(__GNUC__) && __GNUC__ >= 4 + #define IUP_SDK_API __attribute__ ((visibility("default"))) + #else + #define IUP_SDK_API + #endif +#else + #define IUP_SDK_API +#endif /* IUP_BUILD_LIBRARY */ +#endif /* IUP_SDK_API */ + +/* Mark the driver functions that need to be exported */ +#ifndef IUP_DRV_API +#ifdef IUP_BUILD_LIBRARY +#ifdef __EMSCRIPTEN__ +#include +#define IUP_DRV_API EMSCRIPTEN_KEEPALIVE +#elif WIN32 +#define IUP_DRV_API __declspec(dllexport) +#elif defined(__GNUC__) && __GNUC__ >= 4 +#define IUP_DRV_API __attribute__ ((visibility("default"))) +#else +#define IUP_DRV_API +#endif +#else +#define IUP_DRV_API +#endif /* IUP_BUILD_LIBRARY */ +#endif /* IUP_DRV_API */ + +/* Mark the IupImageLib function, it does not have a header of its own */ +#ifndef IUPIMGLIB_API +#ifdef IUPIMGLIB_BUILD_LIBRARY + #ifdef __EMSCRIPTEN__ + #include + #define IUPIMGLIB_API EMSCRIPTEN_KEEPALIVE + #elif WIN32 + #define IUPIMGLIB_API __declspec(dllexport) + #elif defined(__GNUC__) && __GNUC__ >= 4 + #define IUPIMGLIB_API __attribute__ ((visibility("default"))) + #else + #define IUPIMGLIB_API + #endif +#else + #define IUPIMGLIB_API +#endif /* IUPIMGLIB_BUILD_LIBRARY */ +#endif /* IUPIMGLIB_API */ + +/** @endcond DOXYGEN_SHOULD_IGNORE_THIS */ +#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ + + +#endif /* __IUP_EXPORT_H */ diff --git a/komodoeditor/libs/iup/linux/include/iup_mglplot.h b/komodoeditor/libs/iup/linux/include/iup_mglplot.h new file mode 100644 index 0000000..058c2e8 --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iup_mglplot.h @@ -0,0 +1,70 @@ +/** \file + * \brief Plot component for Iup. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUP_MGLPLOT_H +#define __IUP_MGLPLOT_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Initialize IupMglPlot widget class */ +void IupMglPlotOpen(void); + +/* Create an IupMglPlot widget instance */ +Ihandle* IupMglPlot(void); + +/***********************************************/ +/* Additional API */ + +/* Linear Data Only */ +void IupMglPlotBegin(Ihandle *ih, int dim); +void IupMglPlotAdd1D(Ihandle *ih, const char* name, double y); +void IupMglPlotAdd2D(Ihandle *ih, double x, double y); +void IupMglPlotAdd3D(Ihandle *ih, double x, double y, double z); +int IupMglPlotEnd(Ihandle *ih); + +/* Linear (dim=1,2,3), Planar (dim=1), Volumetric (dim=1) */ +int IupMglPlotNewDataSet(Ihandle *ih, int dim); + +/* Linear Data Only */ +void IupMglPlotInsert1D(Ihandle* ih, int ds_index, int sample_index, const char** names, const double* y, int count); +void IupMglPlotInsert2D(Ihandle* ih, int ds_index, int sample_index, const double* x, const double* y, int count); +void IupMglPlotInsert3D(Ihandle* ih, int ds_index, int sample_index, const double* x, const double* y, const double* z, int count); + +/* Linear Data Only */ +void IupMglPlotSet1D(Ihandle* ih, int ds_index, const char** names, const double* y, int count); +void IupMglPlotSet2D(Ihandle* ih, int ds_index, const double* x, const double* y, int count); +void IupMglPlotSet3D(Ihandle* ih, int ds_index, const double* x, const double* y, const double* z, int count); +void IupMglPlotSetFormula(Ihandle* ih, int ds_index, const char* formulaX, const char* formulaY, const char* formulaZ, int count); + +/* Linear (dim=1), Planar (dim=1), Volumetric (dim=1) */ +void IupMglPlotSetData(Ihandle* ih, int ds_index, const double* data, int count_x, int count_y, int count_z); +void IupMglPlotLoadData(Ihandle* ih, int ds_index, const char* filename, int count_x, int count_y, int count_z); +void IupMglPlotSetFromFormula(Ihandle* ih, int ds_index, const char* formula, int count_x, int count_y, int count_z); + +/* Only inside callbacks */ +void IupMglPlotTransform(Ihandle* ih, double x, double y, double z, int *ix, int *iy); +void IupMglPlotTransformTo(Ihandle* ih, int ix, int iy, double *x, double *y, double *z); + +/* Only inside callbacks */ +void IupMglPlotDrawMark(Ihandle* ih, double x, double y, double z); +void IupMglPlotDrawLine(Ihandle* ih, double x1, double y1, double z1, double x2, double y2, double z2); +void IupMglPlotDrawText(Ihandle* ih, const char* text, double x, double y, double z); + +void IupMglPlotPaintTo(Ihandle *ih, const char* format, int w, int h, double dpi, void *data); + +/***********************************************/ + +/* Utility label for showing TeX labels */ +Ihandle* IupMglLabel(const char* title); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/linux/include/iup_plot.h b/komodoeditor/libs/iup/linux/include/iup_plot.h new file mode 100644 index 0000000..adef607 --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iup_plot.h @@ -0,0 +1,70 @@ +/** \file + * \brief Plot component for Iup. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUP_PLOT_H +#define __IUP_PLOT_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Initialize IupPlot widget class */ +void IupPlotOpen(void); + +/* Create an IupPlot widget instance */ +Ihandle* IupPlot(void); + +/***********************************************/ +/* Additional API */ + +void IupPlotBegin(Ihandle *ih, int strXdata); +void IupPlotAdd(Ihandle *ih, double x, double y); +void IupPlotAddStr(Ihandle *ih, const char* x, double y); +void IupPlotAddSegment(Ihandle *ih, double x, double y); +int IupPlotEnd(Ihandle *ih); + +int IupPlotLoadData(Ihandle* ih, const char* filename, int strXdata); + +/* available only when linking with "iupluaplot" */ +int IupPlotSetFormula(Ihandle* ih, int sample_count, const char* formula, const char* init); + +void IupPlotInsert(Ihandle *ih, int ds_index, int sample_index, double x, double y); +void IupPlotInsertStr(Ihandle *ih, int ds_index, int sample_index, const char* x, double y); +void IupPlotInsertSegment(Ihandle *ih, int ds_index, int sample_index, double x, double y); + +void IupPlotInsertStrSamples(Ihandle* ih, int ds_index, int sample_index, const char** x, double* y, int count); +void IupPlotInsertSamples(Ihandle* ih, int ds_index, int sample_index, double *x, double *y, int count); + +void IupPlotAddSamples(Ihandle* ih, int ds_index, double *x, double *y, int count); +void IupPlotAddStrSamples(Ihandle* ih, int ds_index, const char** x, double* y, int count); + +void IupPlotGetSample(Ihandle* ih, int ds_index, int sample_index, double *x, double *y); +void IupPlotGetSampleStr(Ihandle* ih, int ds_index, int sample_index, const char* *x, double *y); +int IupPlotGetSampleSelection(Ihandle* ih, int ds_index, int sample_index); +double IupPlotGetSampleExtra(Ihandle* ih, int ds_index, int sample_index); +void IupPlotSetSample(Ihandle* ih, int ds_index, int sample_index, double x, double y); +void IupPlotSetSampleStr(Ihandle* ih, int ds_index, int sample_index, const char* x, double y); +void IupPlotSetSampleSelection(Ihandle* ih, int ds_index, int sample_index, int selected); +void IupPlotSetSampleExtra(Ihandle* ih, int ds_index, int sample_index, double extra); + +void IupPlotTransform(Ihandle* ih, double x, double y, double *cnv_x, double *cnv_y); +void IupPlotTransformTo(Ihandle* ih, double cnv_x, double cnv_y, double *x, double *y); + +int IupPlotFindSample(Ihandle* ih, double cnv_x, double cnv_y, int *ds_index, int *sample_index); +int IupPlotFindSegment(Ihandle* ih, double cnv_x, double cnv_y, int *ds_index, int *sample_index1, int *sample_index2); + +struct _cdCanvas; + +void IupPlotPaintTo(Ihandle *ih, struct _cdCanvas* cnv); + +/***********************************************/ + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/linux/include/iup_plus.h b/komodoeditor/libs/iup/linux/include/iup_plus.h new file mode 100644 index 0000000..b86d797 --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iup_plus.h @@ -0,0 +1,1204 @@ +/** \file + * \brief Name space for C++ high level API + * + * See Copyright Notice in iup.h + */ + +#ifndef __IUP_PLUS_H +#define __IUP_PLUS_H + + +#include "iup.h" +#include "iupkey.h" +#include "iupdraw.h" +#include "iup_class_cbs.hpp" +#include "iupcontrols.h" +#include "iupgl.h" +#include "iupglcontrols.h" +#include "iupim.h" +#include "iup_config.h" +#include "iup_mglplot.h" +#include "iup_plot.h" +#include "iupole.h" +#include "iupweb.h" +#include "iup_scintilla.h" +#include "iuptuio.h" + + + +/** \brief Name space for C++ high level API + * + * \par + * Defines wrapper classes for all C structures. + * + * See \ref iup_plus.h + */ +namespace Iup +{ + inline char* Version() { return IupVersion(); } + inline char* VersionDate() { return IupVersionDate(); } + inline int VersionNumber() { return IupVersionNumber(); } + + inline int Open(int &argc, char **&argv) { return IupOpen(&argc, &argv); } + inline void Close() { IupClose(); } + inline void ImageLibOpen() { IupImageLibOpen(); } + + inline int MainLoop() { return IupMainLoop(); } + inline int LoopStep() { return IupLoopStep(); } + inline int LoopStepWait() { return IupLoopStepWait(); } + inline int MainLoopLevel() { return IupMainLoopLevel(); } + inline void Flush() { IupFlush(); } + inline void ExitLoop() { IupExitLoop(); } + + inline int RecordInput(const char* filename, int mode) { return IupRecordInput(filename, mode); } + inline int PlayInput(const char* filename) { return IupPlayInput(filename); } + + inline int Help(const char* url) { return IupHelp(url); } + inline void Log(const char* type, const char* str) { IupLog(type, "%s", str); } + inline const char* Load(const char *filename) { return IupLoad(filename); } + inline const char* LoadBuffer(const char *buffer) { return IupLoadBuffer(buffer); } + + inline void SetLanguage(const char *lng) { IupSetLanguage(lng); } + inline const char* GetLanguage() { return IupGetLanguage(); } + inline void SetLanguageString(const char* name, const char* str) { IupSetLanguageString(name, str); } + inline void StoreLanguageString(const char* name, const char* str) { IupStoreLanguageString(name, str); } + inline const char* GetLanguageString(const char* name) { return IupGetLanguageString(name); } + + inline int GetAllClasses(char** names, int n) { return IupGetAllClasses(names, n); } + inline int GetClassAttributes(const char* classname, char** names, int n) { return IupGetClassAttributes(classname, names, n); } + inline int GetClassCallbacks(const char* classname, char** names, int n) { return IupGetClassCallbacks(classname, names, n); } + inline void SetClassDefaultAttribute(const char* classname, const char *name, const char* value) { IupSetClassDefaultAttribute(classname, name, value); } + + inline void SetGlobal(const char* name, const char* value) { IupSetGlobal(name, value); } + inline void SetStringGlobal(const char* name, const char* value) { IupSetStrGlobal(name, value); } + inline char* GetGlobal(const char* name) { return IupGetGlobal(name); } + + inline int GetFile(char* filename) { return IupGetFile(filename); } + inline void Message(const char *title, const char *msg) { IupMessage(title, msg); } + inline int Alarm(const char *title, const char *msg, const char *b1, const char *b2, const char *b3) { return IupAlarm(title, msg, b1, b2, b3); } + inline int ListDialog(int type, const char *title, int size, const char** list, int op, int max_col, int max_lin, int* marks) { return IupListDialog(type, title, size, list, op, max_col, max_lin, marks); } + inline int GetText(const char* title, char* text, int maxsize = 10240) { return IupGetText(title, text, maxsize); } + inline int GetColor(int x, int y, unsigned char &r, unsigned char &g, unsigned char &b) { return IupGetColor(x, y, &r, &g, &b); } + inline int GetParamv(const char* title, Iparamcb action, void* user_data, const char* format, int param_count, int param_extra, void** param_data) + { return IupGetParamv(title, action, user_data, format, param_count, param_extra, param_data); } + + inline int GetAllNames(char** names, int n) { return IupGetAllNames(names, n); } + inline int GetAllDialogs(char** names, int n) { return IupGetAllDialogs(names, n); } + + + class Element + { + protected: + Ihandle* ih; + + /* forbidden */ + Element() { ih = 0; }; + + public: + Element(Ihandle* ref_ih) { ih = ref_ih; } + Element(const Element& elem) : Element(elem.ih) {} + + virtual ~Element() + { + // The destructor does not destroy the element because all Iup::Element are just a reference to the Ihandle*, + // since several IUP elements are automatically destroyed when the dialog is destroyed. + // So to force an element to be destroyed explicitly call the Destroy method. + } + + Ihandle* GetHandle() const { return ih; } + + bool Failed() const { + return ih == 0; + } + + void SetAttribute(const char* name, const char* value) { IupSetAttribute(ih, name, value); } + char* GetAttribute(const char* name) { return IupGetAttribute(ih, name); } + void SetUserData(const char* name, void* data) { IupSetAttribute(ih, name, (char*)data); } + void* GetUserData(const char* name) { return (void*)IupGetAttribute(ih, name); } + void SetString(const char* name, const char* value) { IupSetStrAttribute(ih, name, value); } + const char* GetString(const char* name) { return IupGetAttribute(ih, name); } + void SetInteger(const char* name, int value) { IupSetInt(ih, name, value); } + int GetInteger(const char* name) { return IupGetInt(ih, name); } + void GetIntegerInteger(const char* name, int &i1, int &i2) { IupGetIntInt(ih, name, &i1, &i2); } + void SetNumber(const char* name, double value) { IupSetDouble(ih, name, value); } + double GetNumber(const char* name) { return IupGetDouble(ih, name); } + void SetRGB(const char* name, unsigned char r, unsigned char g, unsigned char b) { IupSetRGB(ih, name, r, g, b); } + void GetRGB(const char* name, unsigned char &r, unsigned char &g, unsigned char &b) { IupGetRGB(ih, name, &r, &g, &b); } + void SetRGBA(const char* name, unsigned char r, unsigned char g, unsigned char b, unsigned char a) { IupSetRGBA(ih, name, r, g, b, a); } + void GetRGBA(const char* name, unsigned char &r, unsigned char &g, unsigned char &b, unsigned char &a) { IupGetRGBA(ih, name, &r, &g, &b, &a); } + + void SetAttributeId(const char* name, int id, const char* value) { IupSetAttributeId(ih, name, id, value); } + char* GetAttributeId(const char* name, int id) { return IupGetAttributeId(ih, name, id); } + void SetUserDataId(const char* name, int id, void* data) { IupSetAttributeId(ih, name, id, (char*)data); } + void* GetUserDataId(const char* name, int id) { return (void*)IupGetAttributeId(ih, name, id); } + void SetStringId(const char* name, int id, const char* value) { IupSetStrAttributeId(ih, name, id, value); } + const char* GetStringId(const char* name, int id) { return IupGetAttributeId(ih, name, id); } + void SetIntegerId(const char* name, int id, int value) { IupSetIntId(ih, name, id, value); } + int GetIntegerId(const char* name, int id) { return IupGetIntId(ih, name, id); } + void SetNumberId(const char* name, int id, double value) { IupSetDoubleId(ih, name, id, value); } + double GetNumberId(const char* name, int id) { return IupGetDoubleId(ih, name, id); } + void SetRGBId(const char* name, int id, unsigned char r, unsigned char g, unsigned char b) { IupSetRGBId(ih, name, id, r, g, b); } + void GetRGBId(const char* name, int id, unsigned char &r, unsigned char &g, unsigned char &b) { IupGetRGBId(ih, name, id, &r, &g, &b); } + + void SetAttributeId2(const char* name, int lin, int col, const char* value) { IupSetAttributeId2(ih, name, lin, col, value); } + char* GetAttributeId2(const char* name, int lin, int col) { return IupGetAttributeId2(ih, name, lin, col); } + void SetUserDataId2(const char* name, int lin, int col, void* data) { IupSetAttributeId2(ih, name, lin, col, (char*)data); } + void* GetUserDataId2(const char* name, int lin, int col) { return (void*)IupGetAttributeId2(ih, name, lin, col); } + void SetStringId2(const char* name, int lin, int col, const char* value) { IupSetStrAttributeId2(ih, name, lin, col, value); } + const char* GetStringId2(const char* name, int lin, int col) { return IupGetAttributeId2(ih, name, lin, col); } + void SetIntegerId2(const char* name, int lin, int col, int value) { IupSetIntId2(ih, name, lin, col, value); } + int GetIntegerId2(const char* name, int lin, int col) { return IupGetIntId2(ih, name, lin, col); } + void SetNumberId2(const char* name, int lin, int col, double value) { IupSetDoubleId2(ih, name, lin, col, value); } + double GetNumberId2(const char* name, int lin, int col) { return IupGetDoubleId2(ih, name, lin, col); } + void SetRGBId2(const char* name, int lin, int col, unsigned char r, unsigned char g, unsigned char b) { IupSetRGBId2(ih, name, lin, col, r, g, b); } + void GetRGBId2(const char* name, int lin, int col, unsigned char &r, unsigned char &g, unsigned char &b) { IupGetRGBId2(ih, name, lin, col, &r, &g, &b); } + + Element SetAttributes(const char* str) { return IupSetAttributes(ih, str); } + void ResetAttribute(const char* name) { IupResetAttribute(ih, name); } + int GetAllAttributes(char** names, int n) { return IupGetAllAttributes(ih, names, n); } + void CopyAttributes(Ihandle* dst_ih) { IupCopyAttributes(ih, dst_ih); } + void SetAttributeHandle(const char* name, const Element& elem) { IupSetAttributeHandle(ih, name, elem.GetHandle()); } + Element GetAttributeHandle(const char* name) { return IupGetAttributeHandle(ih, name); } + void SetAttributeHandleId(const char* name, int id, const Element& elem) { IupSetAttributeHandleId(ih, name, id, elem.GetHandle()); } + Element GetAttributeHandleId(const char* name, int id) { return IupGetAttributeHandleId(ih, name, id); } + void SetAttributeHandleId2(const char* name, int lin, int col, const Element& elem) { IupSetAttributeHandleId2(ih, name, lin, col, elem.GetHandle()); } + Element GetAttributeHandleId2(const char* name, int lin, int col) { return IupGetAttributeHandleId2(ih, name, lin, col); } + + Icallback GetCallback(const char *name) { return IupGetCallback(ih, name); } + Icallback SetCallback(const char *name, Icallback func) { return IupSetCallback(ih, name, func); } + + void Destroy() { IupDestroy(ih); } + + int Map() { return IupMap(ih); } + void Unmap() { IupUnmap(ih); } + + char* GetName() { return IupGetName(ih); } + + char* GetClassName() { return IupGetClassName(ih); } + char* GetClassType() { return IupGetClassType(ih); } + void SaveClassAttributes() { IupSaveClassAttributes(ih); } + void CopyClassAttributesTo(const Element& dst) { IupCopyClassAttributes(ih, dst.ih); } + int ClassMatch(const char* classname) { return IupClassMatch(ih, classname); } + + }; + + inline Icallback GetFunction(const char *name) { return IupGetFunction(name); } + inline Icallback SetFunction(const char *name, Icallback func) { return IupSetFunction(name, func); } + inline Element GetHandle(const char *name) { return Element(IupGetHandle(name)); } + inline Element SetHandle(const char *name, const Element& elem) { return Element(IupSetHandle(name, elem.GetHandle())); } + inline void SetLanguagePack(const Element& elem) { IupSetLanguagePack(elem.GetHandle()); } + + class Dialog; + class Container; + + class Control : public Element + { + public: + Control(Ihandle* _ih) : Element(_ih) {} + Control(const Control& control) : Element(control.ih) {} + Control(const Element& elem) : Element(elem.GetHandle()) {} + + Control SetAttributes(const char* str) { IupSetAttributes(ih, str); return *this; } + + void Update() { IupUpdate(ih); } + void Redraw() { IupRedraw(ih, 0); } + void Refresh() { IupRefresh(ih); } + + void Detach(const Control& child) { IupDetach(child.ih); } + + Control GetBrother() { return Control(IupGetBrother(ih)); } + Container GetParent(); + Dialog GetDialog(); + Control GetDialogChild(const char* name) { return Control(IupGetDialogChild(ih, name)); } + int Reparent(const Container& new_parent, const Control& ref_child); + + Control SetFocus() { return Control(IupSetFocus(ih)); } + Control PreviousField() { return Control(IupPreviousField(ih)); } + Control NextField() { return Control(IupNextField(ih)); } + + void ConvertLinColToPos(int lin, int col, int &pos) { IupTextConvertLinColToPos(ih, lin, col, &pos); } + void ConvertPosToLinCol(int pos, int &lin, int &col) { IupTextConvertPosToLinCol(ih, pos, &lin, &col); } + int ConvertXYToPos(int x, int y) { return IupConvertXYToPos(ih, x, y); } + }; + + inline Control GetFocus() { return Control(IupGetFocus()); } + + class Container : public Control + { + public: + Container(Ihandle* _ih) : Control(_ih) {} + Container(const Container& container) : Control(container.ih) {} + Container(const Control& control) : Control(control.GetHandle()) {} + Container(const Element& elem) : Control(elem.GetHandle()) {} + + Container(Ihandle* _ih, const Control* child_array, int count) : Control(_ih) { + for (int i = 0; i < count; i++) + IupAppend(ih, child_array[i].GetHandle()); + } + Container(Ihandle* _ih, Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) + : Control(_ih) { + if (!child0.Failed()) IupAppend(ih, child0.GetHandle()); + if (!child1.Failed()) IupAppend(ih, child1.GetHandle()); + if (!child2.Failed()) IupAppend(ih, child2.GetHandle()); + if (!child3.Failed()) IupAppend(ih, child3.GetHandle()); + if (!child4.Failed()) IupAppend(ih, child4.GetHandle()); + if (!child5.Failed()) IupAppend(ih, child5.GetHandle()); + if (!child6.Failed()) IupAppend(ih, child6.GetHandle()); + if (!child7.Failed()) IupAppend(ih, child7.GetHandle()); + if (!child8.Failed()) IupAppend(ih, child8.GetHandle()); + if (!child9.Failed()) IupAppend(ih, child9.GetHandle()); + } + + Control Append(const Control& child) { return IupAppend(ih, child.GetHandle()); } + Control Insert(const Control& ref_child, const Control& child) { return IupInsert(ih, ref_child.GetHandle(), child.GetHandle()); } + Control GetChild(int pos) { return IupGetChild(ih, pos); } + int GetChildPos(const Control& child) { return IupGetChildPos(ih, child.GetHandle()); } + int GetChildCount() { return IupGetChildCount(ih); } + + Control GetFirstChild() { return Control(IupGetNextChild(ih, 0)); } + Control GetNextChild(const Control& ref_child) { return Control(IupGetNextChild(ih, ref_child.GetHandle())); } + + void UpdateChildren() { IupUpdateChildren(ih); } + void RedrawChildren() { IupRedraw(ih, 1); } + void RefreshChildren() { IupRefreshChildren(ih); } + }; + + class Dialog : public Container + { + public: + Dialog(const Dialog& dialog) : Container(dialog.GetHandle()) {} + Dialog(const Element& elem) : Container(elem.GetHandle()) {} + Dialog(Control child) : Container(IupDialog(child.GetHandle())) { } + Dialog(Container child) : Container(IupDialog(child.GetHandle())) { } + Dialog(Ihandle* _ih) : Container(_ih) {} + + int Popup(int x, int y) { return IupPopup(ih, x, y); } + int Show() { return IupShow(ih); } + int ShowXY(int x, int y) { return IupShowXY(ih, x, y); } + int Hide() { return IupHide(ih); } + }; + + inline Dialog Control::GetDialog() { return Dialog(IupGetDialog(ih)); } + inline Dialog LayoutDialog(const Dialog& dialog) { return Dialog(IupLayoutDialog(dialog.GetHandle())); } + inline Dialog GlobalsDialog() { return Dialog(IupGlobalsDialog()); } + inline Dialog ElementPropertiesDialog(const Dialog& parent, const Control& control) { return Dialog(IupElementPropertiesDialog(parent.GetHandle(), control.GetHandle())); } + inline Dialog ElementPropertiesDialog(const Control& control) { return Dialog(IupElementPropertiesDialog(0, control.GetHandle())); } + inline Dialog ClassInfoDialog(const Dialog& parent) { return Dialog(IupClassInfoDialog(parent.GetHandle())); } + inline Container Control::GetParent() { return Container(IupGetParent(ih)); } + inline int Control::Reparent(const Container& new_parent, const Control& ref_child) { return IupReparent(ih, new_parent.GetHandle(), ref_child.GetHandle()); } + + void MessageError(const Dialog& parent, const char* message) + { IupMessageError(parent.GetHandle(), message); } + int MessageAlarm(const Dialog& parent, const char* title, const char* message, const char* buttons) + { return IupMessageAlarm(parent.GetHandle(), title, message, buttons); } + + class Menu : public Container + { + public: + Menu() : Container(IupMenu(0)) {} + Menu(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) + : Container(IupMenu(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} + Menu(const Control *child_array, int count) : Container(IupMenu(0), child_array, count) {} + Menu(const Menu& menu) : Container(menu.GetHandle()) {} + Menu(Ihandle* _ih) : Container(_ih) {} + + int Popup(int x, int y) { return IupPopup(ih, x, y); } + }; + + class Image : public Element + { + public: + Image(Ihandle* _ih) : Element(_ih) {} + Image(const Element& elem) : Element(elem.GetHandle()) {} + Image(const char* name) : Element(IupImageGetHandle(name)) {} + + int SaveAsText(const char* filename, const char* iup_format, const char* name) { return IupSaveImageAsText(ih, filename, iup_format, name); } + +#ifdef __IM_PLUS_H + Image(const im::Image& image) : Element(IupImageFromImImage(image.GetHandle())) {} + Image Load(const char* filename) { return Image(IupLoadImage(filename)); } + int Save(const char* filename, const char* im_format) { return IupSaveImage(ih, filename, im_format); } + im::Image ToImImage() { return im::Image(IupImageToImImage(GetHandle())); } +#endif + }; + class Clipboard : public Element + { + public: + Clipboard() : Element(IupClipboard()) {} + Clipboard(Ihandle* _ih) : Element(_ih) {} + Clipboard(const Element& elem) : Element(elem.GetHandle()) {} + +#ifdef __IM_PLUS_H + void SetImage(const im::Image& image) { SetUserData("NATIVEIMAGE", IupGetImageNativeHandle(image.GetHandle())); } + im::Image GetImage(void) { return im::Image(IupGetNativeHandleImage(GetUserData("NATIVEIMAGE"))); } +#endif + }; + class User : public Element + { + public: + User() : Element(IupUser()) {} + User(Ihandle* _ih) : Element(_ih) {} + User(const Element& elem) : Element(elem.GetHandle()) {} + }; + class Thread : public Element + { + public: + Thread() : Element(IupThread()) {} + Thread(Ihandle* _ih) : Element(_ih) {} + Thread(const Element& elem) : Element(elem.GetHandle()) {} + }; + class Param : public Element + { + public: + Param(const char* format) : Element(IupParam(format)) {} + Param(Ihandle* _ih) : Element(_ih) {} + Param(const Element& elem) : Element(elem.GetHandle()) {} + }; + class Timer : public Element + { + public: + Timer() : Element(IupTimer()) {} + Timer(Ihandle* _ih) : Element(_ih) {} + Timer(const Element& elem) : Element(elem.GetHandle()) {} + }; + class Separator : public Control + { + public: + Separator() : Control(IupSeparator()) {} + Separator(Ihandle* _ih) : Control(_ih) {} + Separator(const Element& elem) : Control(elem.GetHandle()) {} + }; + class Item : public Control + { + public: + Item(const char* title = 0) : Control(IupItem(title, 0)) {} + Item(Ihandle* _ih) : Control(_ih) {} + Item(const Element& elem) : Control(elem.GetHandle()) {} + }; + class Canvas : public Control + { + public: + Canvas() : Control(IupCanvas(0)) {} + Canvas(Ihandle* _ih) : Control(_ih) {} + Canvas(const Element& elem) : Control(elem.GetHandle()) {} + + void DrawBegin() { IupDrawBegin(ih); } + void DrawEnd() { IupDrawEnd(ih); } + void DrawSetClipRect(int x1, int y1, int x2, int y2) { IupDrawSetClipRect(ih, x1, y1, x2, y2); } + void DrawGetClipRect(int *x1, int *y1, int *x2, int *y2) { IupDrawGetClipRect(ih, x1, y1, x2, y2); } + void DrawResetClip() { IupDrawResetClip(ih); } + void DrawParentBackground() { IupDrawParentBackground(ih); } + void DrawLine(int x1, int y1, int x2, int y2) { IupDrawLine(ih, x1, y1, x2, y2); } + void DrawRectangle(int x1, int y1, int x2, int y2) { IupDrawRectangle(ih, x1, y1, x2, y2); } + void DrawArc(int x1, int y1, int x2, int y2, double a1, double a2) { IupDrawArc(ih, x1, y1, x2, y2, a1, a2); } + void DrawPolygon(int* points, int count) { IupDrawPolygon(ih, points, count); } + void DrawText(const char* text, int len, int x, int y, int w, int h) { IupDrawText(ih, text, len, x, y, w, h); } + void DrawImage(const char* name, int x, int y, int w, int h) { IupDrawImage(ih, name, x, y, w, h); } + void DrawSelectRect(int x1, int y1, int x2, int y2) { IupDrawSelectRect(ih, x1, y1, x2, y2); } + void DrawFocusRect(int x1, int y1, int x2, int y2) { IupDrawFocusRect(ih, x1, y1, x2, y2); } + void DrawGetSize(int &w, int &h) { IupDrawGetSize(ih, &w, &h); } + void DrawGetTextSize(const char* str, int len, int &w, int &h) { IupDrawGetTextSize(ih, str, len, &w, &h); } + void DrawGetImageInfo(const char* name, int &w, int &h, int &bpp) { IupDrawGetImageInfo(name, &w, &h, &bpp); } + }; + class Link : public Control + { + public: + Link(const char* url = 0, const char* title = 0) : Control(IupLink(url, title)) {} + Link(Ihandle* _ih) : Control(_ih) {} + Link(const Element& elem) : Control(elem.GetHandle()) {} + }; + class Label : public Control + { + public: + Label(const char* title = 0) : Control(IupLabel(title)) {} + Label(Ihandle* _ih) : Control(_ih) {} + Label(const Element& elem) : Control(elem.GetHandle()) {} + }; + + class Button : public Control + { + public: + Button(const char* title = 0) : Control(IupButton(title, 0)) {} + Button(Ihandle* _ih) : Control(_ih) {} + Button(const Element& elem) : Control(elem.GetHandle()) {} + }; + class FlatButton : public Control + { + public: + FlatButton(const char* title = 0) : Control(IupFlatButton(title)) {} + FlatButton(Ihandle* _ih) : Control(_ih) {} + FlatButton(const Element& elem) : Control(elem.GetHandle()) {} + }; + class FlatToggle : public Control + { + public: + FlatToggle(const char* title = 0) : Control(IupFlatToggle(title)) {} + FlatToggle(Ihandle* _ih) : Control(_ih) {} + FlatToggle(const Element& elem) : Control(elem.GetHandle()) {} + }; + class FlatSeparator : public Control + { + public: + FlatSeparator() : Control(IupFlatSeparator()) {} + FlatSeparator(Ihandle* _ih) : Control(_ih) {} + FlatSeparator(const Element& elem) : Control(elem.GetHandle()) {} + }; + class Space : public Control + { + public: + Space() : Control(IupSpace()) {} + Space(Ihandle* _ih) : Control(_ih) {} + Space(const Element& elem) : Control(elem.GetHandle()) {} + }; + class DropButton : public Control + { + public: + DropButton() : Control(IupDropButton(0)) {} + DropButton(Control child) : Control(IupDropButton(child.GetHandle())) {} + DropButton(Ihandle* _ih) : Control(_ih) {} + DropButton(const Element& elem) : Control(elem.GetHandle()) {} + }; + class FlatLabel : public Control + { + public: + FlatLabel(const char* title = 0) : Control(IupFlatLabel(title)) {} + FlatLabel(Ihandle* _ih) : Control(_ih) {} + FlatLabel(const Element& elem) : Control(elem.GetHandle()) {} + }; + class AnimatedLabel : public Control + { + public: + AnimatedLabel(Element animation = (Ihandle*)0) : Control(IupAnimatedLabel(animation.GetHandle())) {} + AnimatedLabel(Ihandle* _ih) : Control(_ih) {} + AnimatedLabel(const Element& elem) : Control(elem.GetHandle()) {} + }; + class Toggle : public Control + { + public: + Toggle(const char* title = 0) : Control(IupToggle(title, 0)) {} + Toggle(Ihandle* _ih) : Control(_ih) {} + Toggle(const Element& elem) : Control(elem.GetHandle()) {} + }; + class Fill: public Control + { + public: + Fill() : Control(IupFill()) {} + Fill(Ihandle* _ih) : Control(_ih) {} + Fill(const Element& elem) : Control(elem.GetHandle()) {} + }; + class Spin: public Control + { + public: + Spin() : Control(IupSpin()) {} + Spin(Ihandle* _ih) : Control(_ih) {} + Spin(const Element& elem) : Control(elem.GetHandle()) {} + }; + class Tree: public Control + { + public: + Tree() : Control(IupTree()) {} + Tree(Ihandle* _ih) : Control(_ih) {} + Tree(const Element& elem) : Control(elem.GetHandle()) {} + + int SetUserId(int id, void* userid) { return IupTreeSetUserId(ih, id, userid); } + void* GetUserId(int id) { return IupTreeGetUserId(ih, id); } + int GetId(void *userid) { return IupTreeGetId(ih, userid); } + }; + class Val : public Control + { + public: + Val(const char* orientation = 0) : Control(IupVal(orientation)) {} + Val(Ihandle* _ih) : Control(_ih) {} + Val(const Element& elem) : Control(elem.GetHandle()) {} + }; + class FlatVal : public Control + { + public: + FlatVal(const char* orientation = 0) : Control(IupFlatVal(orientation)) {} + FlatVal(Ihandle* _ih) : Control(_ih) {} + FlatVal(const Element& elem) : Control(elem.GetHandle()) {} + }; + class FlatTree : public Control + { + public: + FlatTree() : Control(IupFlatTree()) {} + FlatTree(Ihandle* _ih) : Control(_ih) {} + FlatTree(const Element& elem) : Control(elem.GetHandle()) {} + }; + class ProgressBar : public Control + { + public: + ProgressBar() : Control(IupProgressBar()) {} + ProgressBar(Ihandle* _ih) : Control(_ih) {} + ProgressBar(const Element& elem) : Control(elem.GetHandle()) {} + }; + class List: public Control + { + public: + List() : Control(IupList(0)) {} + List(Ihandle* _ih) : Control(_ih) {} + List(const Element& elem) : Control(elem.GetHandle()) {} + }; + class FlatList : public Control + { + public: + FlatList() : Control(IupFlatList()) {} + FlatList(Ihandle* _ih) : Control(_ih) {} + FlatList(const Element& elem) : Control(elem.GetHandle()) {} + }; + class Text : public Control + { + public: + Text() : Control(IupText(0)) {} + Text(Ihandle* _ih) : Control(_ih) {} + Text(const Element& elem) : Control(elem.GetHandle()) {} + }; + + class Split : public Container + { + public: + Split() : Container(IupSplit(0, 0)) {} + Split(Control child) : Container(IupSplit(child.GetHandle(), 0)) {} + Split(Control child1, Control child2) : Container(IupSplit(child1.GetHandle(), child2.GetHandle())) {} + Split(const Split& split) : Container(split.GetHandle()) {} + Split(Ihandle* _ih) : Container(_ih) {} + }; + class Submenu : public Container + { + public: + Submenu(const char* title = 0) : Container(IupSubmenu(title, 0)) {} + Submenu(const char* title, Control child) : Container(IupSubmenu(title, child.GetHandle())) {} + Submenu(const Submenu& container) : Container(container.GetHandle()) {} + Submenu(Ihandle* _ih) : Container(_ih) {} + }; + class Radio : public Container + { + public: + Radio() : Container(IupRadio(0)) {} + Radio(Control child) : Container(IupRadio(child.GetHandle())) {} + Radio(const Radio& container) : Container(container.GetHandle()) {} + Radio(Ihandle* _ih) : Container(_ih) {} + }; + class Sbox : public Container + { + public: + Sbox() : Container(IupSbox(0)) {} + Sbox(Control child) : Container(IupSbox(child.GetHandle())) {} + Sbox(const Sbox& container) : Container(container.GetHandle()) {} + Sbox(Ihandle* _ih) : Container(_ih) {} + }; + class ScrollBox : public Container + { + public: + ScrollBox() : Container(IupScrollBox(0)) {} + ScrollBox(Control child) : Container(IupScrollBox(child.GetHandle())) {} + ScrollBox(const ScrollBox& container) : Container(container.GetHandle()) {} + ScrollBox(Ihandle* _ih) : Container(_ih) {} + }; + class FlatScrollBox : public Container + { + public: + FlatScrollBox() : Container(IupFlatScrollBox(0)) {} + FlatScrollBox(Control child) : Container(IupFlatScrollBox(child.GetHandle())) {} + FlatScrollBox(const FlatScrollBox& container) : Container(container.GetHandle()) {} + FlatScrollBox(Ihandle* _ih) : Container(_ih) {} + }; + class Expander : public Container + { + public: + Expander(const Expander& container) : Container(container.GetHandle()) {} + Expander() : Container(IupExpander(0)) {} + Expander(Control child) : Container(IupExpander(child.GetHandle())) {} + Expander(Ihandle* _ih) : Container(_ih) {} + }; + class DetachBox : public Container + { + public: + DetachBox(const DetachBox& container) : Container(container.GetHandle()) {} + DetachBox() : Container(IupDetachBox(0)) {} + DetachBox(Control child) : Container(IupDetachBox(child.GetHandle())) {} + DetachBox(Ihandle* _ih) : Container(_ih) {} + }; + class BackgroundBox : public Container + { + public: + BackgroundBox() : Container(IupBackgroundBox(0)) {} + BackgroundBox(Control child) : Container(IupBackgroundBox(child.GetHandle())) {} + BackgroundBox(const BackgroundBox& container) : Container(container.GetHandle()) {} + BackgroundBox(Ihandle* _ih) : Container(_ih) {} + + void DrawBegin() { IupDrawBegin(ih); } + void DrawEnd() { IupDrawEnd(ih); } + void DrawSetClipRect(int x1, int y1, int x2, int y2) { IupDrawSetClipRect(ih, x1, y1, x2, y2); } + void DrawGetClipRect(int *x1, int *y1, int *x2, int *y2) { IupDrawGetClipRect(ih, x1, y1, x2, y2); } + void DrawResetClip() { IupDrawResetClip(ih); } + void DrawParentBackground() { IupDrawParentBackground(ih); } + void DrawLine(int x1, int y1, int x2, int y2) { IupDrawLine(ih, x1, y1, x2, y2); } + void DrawRectangle(int x1, int y1, int x2, int y2) { IupDrawRectangle(ih, x1, y1, x2, y2); } + void DrawArc(int x1, int y1, int x2, int y2, double a1, double a2) { IupDrawArc(ih, x1, y1, x2, y2, a1, a2); } + void DrawPolygon(int* points, int count) { IupDrawPolygon(ih, points, count); } + void DrawText(const char* text, int len, int x, int y, int w, int h) { IupDrawText(ih, text, len, x, y, w, h); } + void DrawImage(const char* name, int x, int y, int w, int h) { IupDrawImage(ih, name, x, y, w, h); } + void DrawSelectRect(int x1, int y1, int x2, int y2) { IupDrawSelectRect(ih, x1, y1, x2, y2); } + void DrawFocusRect(int x1, int y1, int x2, int y2) { IupDrawFocusRect(ih, x1, y1, x2, y2); } + void DrawGetSize(int &w, int &h) { IupDrawGetSize(ih, &w, &h); } + void DrawGetTextSize(const char* str, int len, int &w, int &h) { IupDrawGetTextSize(ih, str, len, &w, &h); } + void DrawGetImageInfo(const char* name, int &w, int &h, int &bpp) { IupDrawGetImageInfo(name, &w, &h, &bpp); } + }; + + class Frame : public Container + { + public: + Frame() : Container(IupFrame(0)) {} + Frame(Control child) : Container(IupFrame(child.GetHandle())) {} + Frame(const Frame& container) : Container(container.GetHandle()) {} + Frame(Ihandle* _ih) : Container(_ih) {} + }; + class FlatFrame : public Container + { + public: + FlatFrame() : Container(IupFlatFrame(0)) {} + FlatFrame(Control child) : Container(IupFlatFrame(child.GetHandle())) {} + FlatFrame(const FlatFrame& container) : Container(container.GetHandle()) {} + FlatFrame(Ihandle* _ih) : Container(_ih) {} + }; + class Spinbox : public Container + { + public: + Spinbox() : Container(IupSpinbox(0)) {} + Spinbox(Control child) : Container(IupSpinbox(child.GetHandle())) {} + Spinbox(const Spinbox& container) : Container(container.GetHandle()) {} + Spinbox(Ihandle* _ih) : Container(_ih) {} + }; + + class Vbox : public Container + { + Vbox(const Vbox& box) : Container(box.GetHandle()) {} /* to avoid hierarchy construction problems */ + public: + Vbox() : Container(IupVbox(0)) {} + Vbox(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) + : Container(IupVbox(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} + Vbox(const Control *child_array, int count) : Container(IupVbox(0), child_array, count) {} + Vbox(Ihandle* _ih) : Container(_ih) {} + }; + class Hbox : public Container + { + Hbox(const Hbox& box) : Container(box.GetHandle()) {} /* to avoid hierarchy construction problems */ + public: + Hbox() : Container(IupHbox(0)) {} + Hbox(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) + : Container(IupHbox(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} + Hbox(const Control *child_array, int count) : Container(IupHbox(0), child_array, count) {} + Hbox(Ihandle* _ih) : Container(_ih) {} + }; + class Zbox : public Container + { + public: + Zbox() : Container(IupZbox(0)) {} + Zbox(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) + : Container(IupZbox(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} + Zbox(const Control *child_array, int count) : Container(IupZbox(0), child_array, count) {} + Zbox(const Zbox& box) : Container(box.GetHandle()) {} + Zbox(Ihandle* _ih) : Container(_ih) {} + }; + class Cbox : public Container + { + public: + Cbox() : Container(IupCbox(0)) {} + Cbox(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) + : Container(IupCbox(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} + Cbox(const Control *child_array, int count) : Container(IupCbox(0), child_array, count) {} + Cbox(const Cbox& box) : Container(box.GetHandle()) {} + Cbox(Ihandle* _ih) : Container(_ih) {} + }; + class Tabs : public Container + { + public: + Tabs() : Container(IupTabs(0)) {} + Tabs(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) + : Container(IupTabs(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} + Tabs(const Control *child_array, int count) : Container(IupTabs(0), child_array, count) {} + Tabs(const Tabs& tabs) : Container(tabs.GetHandle()) {} + Tabs(Ihandle* _ih) : Container(_ih) {} + }; + class FlatTabs : public Container + { + public: + FlatTabs() : Container(IupFlatTabs(0)) {} + FlatTabs(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) + : Container(IupFlatTabs(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} + FlatTabs(const Control *child_array, int count) : Container(IupFlatTabs(0), child_array, count) {} + FlatTabs(const FlatTabs& tabs) : Container(tabs.GetHandle()) {} + FlatTabs(Ihandle* _ih) : Container(_ih) {} + }; + class GridBox : public Container + { + public: + GridBox() : Container(IupGridBox(0)) {} + GridBox(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) + : Container(IupGridBox(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} + GridBox(const Control *child_array, int count) : Container(IupGridBox(0), child_array, count) {} + GridBox(const GridBox& box) : Container(box.GetHandle()) {} + GridBox(Ihandle* _ih) : Container(_ih) {} + }; + class MultiBox : public Container + { + public: + MultiBox() : Container(IupMultiBox(0)) {} + MultiBox(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) + : Container(IupMultiBox(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} + MultiBox(const Control *child_array, int count) : Container(IupMultiBox(0), child_array, count) {} + MultiBox(const MultiBox& box) : Container(box.GetHandle()) {} + MultiBox(Ihandle* _ih) : Container(_ih) {} + }; + class ParamBox : public Container + { + public: + ParamBox() : Container(IupParamBox(0)) {} + ParamBox(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) + : Container(IupParamBox(child0.GetHandle(), child1.GetHandle(), child2.GetHandle(), child3.GetHandle(), child4.GetHandle(), child5.GetHandle(), child6.GetHandle(), child7.GetHandle(), child8.GetHandle(), child9.GetHandle(), 0)) {} + ParamBox(const Control *child_array, int count) : Container(IupParamBox(0), child_array, count) {} + ParamBox(const ParamBox& box) : Container(box.GetHandle()) {} + ParamBox(Ihandle* _ih) : Container(_ih) {} + }; + class Normalizer : public Container + { + public: + Normalizer() : Container(IupNormalizer(0)) {} + Normalizer(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) + : Container(IupNormalizer(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} + Normalizer(const Control *child_array, int count) : Container(IupNormalizer(0), child_array, count) {} + Normalizer(const Normalizer& elem) : Container(elem.GetHandle()) {} + Normalizer(Ihandle* _ih) : Container(_ih) {} + }; + + + class FileDlg : public Dialog + { + public: + FileDlg() : Dialog(IupFileDlg()) {} + }; + class MessageDlg : public Dialog + { + public: + MessageDlg() : Dialog(IupMessageDlg()) {} + }; + class ColorDlg : public Dialog + { + public: + ColorDlg() : Dialog(IupColorDlg()) {} + }; + class FontDlg : public Dialog + { + public: + FontDlg() : Dialog(IupFontDlg()) {} + }; + class ProgressDlg : public Dialog + { + public: + ProgressDlg() : Dialog(IupProgressDlg()) {} + }; + class ScintillaDlg : public Dialog + { + public: + ScintillaDlg() : Dialog(IupScintillaDlg()) {} + }; +#ifdef LUA_VERSION + public: + LuaScripterDlg(lua_State *L) : Dialog(IupLuaScripterDlg(L)) {} + }; +#endif + + class GLCanvas : public Control + { + public: + GLCanvas() : Control(IupGLCanvas(0)) {} + GLCanvas(Ihandle* _ih) : Control(_ih) {} + GLCanvas(const Element& elem) : Control(elem.GetHandle()) {} + + static void Open() { IupGLCanvasOpen(); } + + void MakeCurrent() { IupGLMakeCurrent(ih); } + int IsCurrent() { return IupGLIsCurrent(ih); } + void SwapBuffers() { IupGLSwapBuffers(ih); } + void Palette(int index, float r, float g, float b) { IupGLPalette(ih, index, r, g, b); } + void UseFont(int first, int count, int list_base) { IupGLUseFont(ih, first, count, list_base); } + + static void Wait(int gl) { IupGLWait(gl); } + }; + class GLBackgroundBox : public Container + { + public: + GLBackgroundBox() : Container(IupGLBackgroundBox(0)) {} + GLBackgroundBox(Control child) : Container(IupGLBackgroundBox(child.GetHandle())) {} + GLBackgroundBox(const GLBackgroundBox& container) : Container(container.GetHandle()) {} + GLBackgroundBox(Ihandle* _ih) : Container(_ih) {} + }; + + class Controls + { + public: + static void Open() { IupControlsOpen(); } + }; + class Dial : public Control + { + public: + Dial(const char* orientation = 0) : Control(IupDial(orientation)) {} + Dial(Ihandle* _ih) : Control(_ih) {} + Dial(const Element& elem) : Control(elem.GetHandle()) {} + }; + class Gauge : public Control + { + public: + Gauge() : Control(IupGauge()) {} + Gauge(Ihandle* _ih) : Control(_ih) {} + Gauge(const Element& elem) : Control(elem.GetHandle()) {} + }; + class ColorBrowser : public Control + { + public: + ColorBrowser() : Control(IupColorBrowser()) {} + ColorBrowser(Ihandle* _ih) : Control(_ih) {} + ColorBrowser(const Element& elem) : Control(elem.GetHandle()) {} + }; + class Cells : public Control + { + public: + Cells() : Control(IupCells()) {} + Cells(Ihandle* _ih) : Control(_ih) {} + Cells(const Element& elem) : Control(elem.GetHandle()) {} + }; + class Colorbar : public Control + { + public: + Colorbar() : Control(IupColorbar()) {} + Colorbar(Ihandle* _ih) : Control(_ih) {} + Colorbar(const Element& elem) : Control(elem.GetHandle()) {} + }; + class Matrix : public Control + { + public: + Matrix() : Control(IupMatrix(0)) {} + Matrix(Ihandle* _ih) : Control(_ih) {} + Matrix(const Element& elem) : Control(elem.GetHandle()) {} + + void SetFormula(int col, const char* formula, const char* init = 0) { IupMatrixSetFormula(ih, col, formula, init); } + void SetDynamic(const char* init = 0) { IupMatrixSetDynamic(ih, init); } + }; + class MatrixList : public Control + { + public: + MatrixList() : Control(IupMatrixList()) {} + MatrixList(Ihandle* _ih) : Control(_ih) {} + MatrixList(const Element& elem) : Control(elem.GetHandle()) {} + }; + class MatrixEx : public Control + { + public: + MatrixEx() : Control(IupMatrixEx()) {} + MatrixEx(Ihandle* _ih) : Control(_ih) {} + MatrixEx(const Element& elem) : Control(elem.GetHandle()) {} + }; + class GLControls + { + public: + static void Open() { IupGLControlsOpen(); } + }; + class GLSubCanvas : public Control + { + public: + GLSubCanvas() : Control(IupGLSubCanvas()) {} + GLSubCanvas(Ihandle* _ih) : Control(_ih) {} + GLSubCanvas(const Element& elem) : Control(elem.GetHandle()) {} + }; + class GLSeparator : public Control + { + public: + GLSeparator() : Control(IupGLSeparator()) {} + GLSeparator(Ihandle* _ih) : Control(_ih) {} + GLSeparator(const Element& elem) : Control(elem.GetHandle()) {} + }; + class GLProgressBar : public Control + { + public: + GLProgressBar() : Control(IupGLProgressBar()) {} + GLProgressBar(Ihandle* _ih) : Control(_ih) {} + GLProgressBar(const Element& elem) : Control(elem.GetHandle()) {} + }; + class GLVal : public Control + { + public: + GLVal() : Control(IupGLVal()) {} + GLVal(Ihandle* _ih) : Control(_ih) {} + GLVal(const Element& elem) : Control(elem.GetHandle()) {} + }; + class GLLabel : public Control + { + public: + GLLabel(const char* title = 0) : Control(IupGLLabel(title)) {} + GLLabel(Ihandle* _ih) : Control(_ih) {} + GLLabel(const Element& elem) : Control(elem.GetHandle()) {} + }; + class GLButton : public Control + { + public: + GLButton(const char* title = 0) : Control(IupGLButton(title)) {} + GLButton(Ihandle* _ih) : Control(_ih) {} + GLButton(const Element& elem) : Control(elem.GetHandle()) {} + }; + class GLToggle : public Control + { + public: + GLToggle(const char* title = 0) : Control(IupGLToggle(title)) {} + GLToggle(Ihandle* _ih) : Control(_ih) {} + GLToggle(const Element& elem) : Control(elem.GetHandle()) {} + }; + class GLLink : public Control + { + public: + GLLink(const char *url = 0, const char* title = 0) : Control(IupGLLink(url, title)) {} + GLLink(Ihandle* _ih) : Control(_ih) {} + GLLink(const Element& elem) : Control(elem.GetHandle()) {} + }; + class GLFrame : public Container + { + public: + GLFrame(Control child) : Container(IupGLFrame(child.GetHandle())) {} + GLFrame() : Container(IupGLFrame(0)) {} + GLFrame(const GLFrame& container) : Container(container.GetHandle()) {} + GLFrame(Ihandle* _ih) : Container(_ih) {} + }; + class GLExpander : public Container + { + public: + GLExpander(Control child) : Container(IupGLExpander(child.GetHandle())) {} + GLExpander() : Container(IupGLExpander(0)) {} + GLExpander(const GLExpander& container) : Container(container.GetHandle()) {} + GLExpander(Ihandle* _ih) : Container(_ih) {} + }; + class GLScrollBox : public Container + { + public: + GLScrollBox(Control child) : Container(IupGLScrollBox(child.GetHandle())) {} + GLScrollBox() : Container(IupGLScrollBox(0)) {} + GLScrollBox(const GLScrollBox& container) : Container(container.GetHandle()) {} + GLScrollBox(Ihandle* _ih) : Container(_ih) {} + }; + class GLSizeBox : public Container + { + public: + GLSizeBox(Control child) : Container(IupGLSizeBox(child.GetHandle())) {} + GLSizeBox() : Container(IupGLSizeBox(0)) {} + GLSizeBox(const GLSizeBox& container) : Container(container.GetHandle()) {} + GLSizeBox(Ihandle* _ih) : Container(_ih) {} + }; + class GLCanvasBox : public Container + { + public: + GLCanvasBox() : Container(IupGLCanvasBox(0)) {} + GLCanvasBox(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) + : Container(IupGLCanvasBox(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} + GLCanvasBox(const Control *child_array, int count) : Container(IupGLCanvasBox(0), child_array, count) {} + GLCanvasBox(const GLCanvasBox& container) : Container(container.GetHandle()) {} + GLCanvasBox(Ihandle* _ih) : Container(_ih) {} + }; + class Plot : public Control + { + public: + Plot() : Control(IupPlot()) {} + Plot(Ihandle* _ih) : Control(_ih) {} + Plot(const Element& elem) : Control(elem.GetHandle()) {} + + static void Open() { IupPlotOpen(); } + + void Begin(int strXdata) { IupPlotBegin(ih, strXdata); } + void Add(double x, double y) { IupPlotAdd(ih, x, y); } + void AddStr(const char* x, double y) { IupPlotAddStr(ih, x, y); } + void AddSegment(double x, double y) { IupPlotAddSegment(ih, x, y); } + int End() { return IupPlotEnd(ih); } + + int LoadData(const char* filename, int strXdata) { return IupPlotLoadData(ih, filename, strXdata); } + + int SetFormula(int sample_count, const char* formula, const char* init) { return IupPlotSetFormula(ih, sample_count, formula, init); } + + void Insert(int ds_index, int sample_index, double x, double y) { IupPlotInsert(ih, ds_index, sample_index, x, y); } + void InsertStr(int ds_index, int sample_index, const char* x, double y) { IupPlotInsertStr(ih, ds_index, sample_index, x, y); } + void InsertSegment(int ds_index, int sample_index, double x, double y) { IupPlotInsertSegment(ih, ds_index, sample_index, x, y); } + + void InsertStrSamples(int ds_index, int sample_index, const char** x, double* y, int count) { IupPlotInsertStrSamples(ih, ds_index, sample_index, x, y, count); } + void InsertSamples(int ds_index, int sample_index, double *x, double *y, int count) { IupPlotInsertSamples(ih, ds_index, sample_index, x, y, count); } + + void AddSamples(int ds_index, double *x, double *y, int count) { IupPlotAddSamples(ih, ds_index, x, y, count); } + void AddStrSamples(int ds_index, const char** x, double* y, int count) { IupPlotAddStrSamples(ih, ds_index, x, y, count); } + + void GetSample(int ds_index, int sample_index, double &x, double &y) { IupPlotGetSample(ih, ds_index, sample_index, &x, &y); } + void GetSampleStr(int ds_index, int sample_index, const char* &x, double &y) { IupPlotGetSampleStr(ih, ds_index, sample_index, &x, &y); } + int GetSampleSelection(int ds_index, int sample_index) { return IupPlotGetSampleSelection(ih, ds_index, sample_index); } + double GetSampleExtra(int ds_index, int sample_index) { return IupPlotGetSampleExtra(ih, ds_index, sample_index); } + void SetSample(int ds_index, int sample_index, double x, double y) { IupPlotSetSample(ih, ds_index, sample_index, x, y); } + void SetSampleStr(int ds_index, int sample_index, const char* x, double y) { IupPlotSetSampleStr(ih, ds_index, sample_index, x, y); } + void SetSampleSelection(int ds_index, int sample_index, int selected) { IupPlotSetSampleSelection(ih, ds_index, sample_index, selected); } + void SetSampleExtra(int ds_index, int sample_index, double extra) { IupPlotSetSampleExtra(ih, ds_index, sample_index, extra); } + + void Transform(double x, double y, double &cnv_x, double &cnv_y) { IupPlotTransform(ih, x, y, &cnv_x, &cnv_y); } + void TransformTo(double cnv_x, double cnv_y, double &x, double &y) { IupPlotTransformTo(ih, cnv_x, cnv_y, &x, &y); } + + int FindSample(double cnv_x, double cnv_y, int &ds_index, int &sample_index) { return IupPlotFindSample(ih, cnv_x, cnv_y, &ds_index, &sample_index); } + +#ifdef __CD_PLUS_H + void PaintTo(cd::Canvas& cd_canvas) { IupPlotPaintTo(ih, cd_canvas.GetHandle()); } +#endif + }; + class MglPlot : public Control + { + public: + MglPlot() : Control(IupMglPlot()) {} + MglPlot(Ihandle* _ih) : Control(_ih) {} + MglPlot(const Element& elem) : Control(elem.GetHandle()) {} + + static void Open() { IupMglPlotOpen(); } + + void Begin(int dim) { IupMglPlotBegin(ih, dim); } + void Add1D(const char* name, double y) { IupMglPlotAdd1D(ih, name, y); } + void Add2D(double x, double y) { IupMglPlotAdd2D(ih, x, y); } + void Add3D(double x, double y, double z) { IupMglPlotAdd3D(ih, x, y, z); } + int End() { return IupMglPlotEnd(ih); } + + int NewDataSet(int dim) { return IupMglPlotNewDataSet(ih, dim); } + + void Insert1D(int ds_index, int sample_index, const char** names, const double* y, int count) { IupMglPlotInsert1D(ih, ds_index, sample_index, names, y, count); } + void Insert2D(int ds_index, int sample_index, const double* x, const double* y, int count) { IupMglPlotInsert2D(ih, ds_index, sample_index, x, y, count); } + void Insert3D(int ds_index, int sample_index, const double* x, const double* y, const double* z, int count) { IupMglPlotInsert3D(ih, ds_index, sample_index, x, y, z, count); } + + void Set1D(int ds_index, const char** names, const double* y, int count) { IupMglPlotSet1D(ih, ds_index, names, y, count); } + void Set2D(int ds_index, const double* x, const double* y, int count) { IupMglPlotSet2D(ih, ds_index, x, y, count); } + void Set3D(int ds_index, const double* x, const double* y, const double* z, int count) { IupMglPlotSet3D(ih, ds_index, x, y, z, count); } + void SetFormula(int ds_index, const char* formulaX, const char* formulaY, const char* formulaZ, int count) { IupMglPlotSetFormula(ih, ds_index, formulaX, formulaY, formulaZ, count); } + + void SetData(int ds_index, const double* data, int count_x, int count_y, int count_z) { IupMglPlotSetData(ih, ds_index, data, count_x, count_y, count_z); } + void LoadData(int ds_index, const char* filename, int count_x, int count_y, int count_z) { IupMglPlotLoadData(ih, ds_index, filename, count_x, count_y, count_z); } + void SetFromFormula(int ds_index, const char* formula, int count_x, int count_y, int count_z) { IupMglPlotSetFromFormula(ih, ds_index, formula, count_x, count_y, count_z); } + + void Transform(double x, double y, double z, int &ix, int &iy) { IupMglPlotTransform(ih, x, y, z, &ix, &iy); } + void TransformTo(int ix, int iy, double &x, double &y, double &z) { IupMglPlotTransformTo(ih, ix, iy, &x, &y, &z); } + + void DrawMark(double x, double y, double z) { IupMglPlotDrawMark(ih, x, y, z); } + void DrawLine(double x1, double y1, double z1, double x2, double y2, double z2) { IupMglPlotDrawLine(ih, x1, y1, z1, x2, y2, z2); } + void DrawText(const char* text, double x, double y, double z) { IupMglPlotDrawText(ih, text, x, y, z); } + + void PaintTo(const char* format, int w, int h, double dpi, unsigned char* data) { IupMglPlotPaintTo(ih, format, w, h, dpi, (void*)data); } + void PaintTo(const char* format, int w, int h, double dpi, const char* filename) { IupMglPlotPaintTo(ih, format, w, h, dpi, (void*)filename); } + + }; + class MglLabel : public Control + { + public: + MglLabel(const char* title) : Control(IupMglLabel(title)) {} + MglLabel(Ihandle* _ih) : Control(_ih) {} + MglLabel(const Element& elem) : Control(elem.GetHandle()) {} + }; + class OleControl : public Control + { + public: + OleControl(const char* progid) : Control(IupOleControl(progid)) {} + OleControl(Ihandle* _ih) : Control(_ih) {} + OleControl(const Element& elem) : Control(elem.GetHandle()) {} + + static void Open() { IupOleControlOpen(); } + }; + class WebBrowser : public Control + { + public: + WebBrowser() : Control(IupWebBrowser()) {} + WebBrowser(Ihandle* _ih) : Control(_ih) {} + WebBrowser(const Element& elem) : Control(elem.GetHandle()) {} + + static void Open() { IupWebBrowserOpen(); } + }; + class Scintilla : public Control + { + public: + Scintilla(): Control(IupScintilla()) {} + Scintilla(Ihandle* _ih) : Control(_ih) {} + Scintilla(const Element& elem) : Control(elem.GetHandle()) {} + + static void Open() { IupScintillaOpen(); } + }; + class TuioClient : public Element + { + public: + TuioClient(int port) : Element(IupTuioClient(port)) {} + TuioClient(Ihandle* _ih) : Element(_ih) {} + TuioClient(const Element& elem) : Element(elem.GetHandle()) {} + + static void Open() { IupTuioOpen(); } + }; + + class Config: public Element + { + public: + Config(): Element(IupConfig()) { } + Config(Ihandle* _ih) : Element(_ih) {} + Config(const Element& elem) : Element(elem.GetHandle()) {} + + int LoadConfig() { return IupConfigLoad(ih); } + int SaveConfig() { return IupConfigSave(ih); } + + void SetVariableStrId(const char* group, const char* key, int id, const char* value) { IupConfigSetVariableStrId(ih, group, key, id, value); } + void SetVariableIntId(const char* group, const char* key, int id, int value) { IupConfigSetVariableIntId(ih, group, key, id, value); } + void SetVariableDoubleId(const char* group, const char* key, int id, double value) { IupConfigSetVariableDoubleId(ih, group, key, id, value); } + void SetVariableStr(const char* group, const char* key, const char* value) { IupConfigSetVariableStr(ih, group, key, value); } + void SetVariableInt(const char* group, const char* key, int value) { IupConfigSetVariableInt(ih, group, key, value); } + void SetVariableDouble(const char* group, const char* key, double value) { IupConfigSetVariableDouble(ih, group, key, value); } + + char* GetVariableStr(const char* group, const char* key) { return (char*)IupConfigGetVariableStr(ih, group, key); } + int GetVariableInt(const char* group, const char* key) { return IupConfigGetVariableInt(ih, group, key); } + double GetVariableDouble(const char* group, const char* key) { return IupConfigGetVariableDouble(ih, group, key); } + char* GetVariableStrId(const char* group, const char* key, int id) { return (char*)IupConfigGetVariableStrId(ih, group, key, id); } + int GetVariableIntId(const char* group, const char* key, int id) { return IupConfigGetVariableIntId(ih, group, key, id); } + double GetVariableDoubleId(const char* group, const char* key, int id) { return IupConfigGetVariableDoubleId(ih, group, key, id); } + + char* GetVariableStrDef(const char* group, const char* key, const char* def) { return (char*)IupConfigGetVariableStrDef(ih, group, key, def); } + int GetVariableIntDef(const char* group, const char* key, int def) { return IupConfigGetVariableIntDef(ih, group, key, def); } + double GetVariableDoubleDef(const char* group, const char* key, double def) { return IupConfigGetVariableDoubleDef(ih, group, key, def); } + char* GetVariableStrIdDef(const char* group, const char* key, int id, const char* def) { return (char*)IupConfigGetVariableStrIdDef(ih, group, key, id, def); } + int GetVariableIntIdDef(const char* group, const char* key, int id, int def) { return IupConfigGetVariableIntIdDef(ih, group, key, id, def); } + double GetVariableDoubleIdDef(const char* group, const char* key, int id, double def) { return IupConfigGetVariableDoubleIdDef(ih, group, key, id, def); } + + void Copy(const Config& config2, const char* exclude_prefix) { IupConfigCopy(ih, config2.GetHandle(), exclude_prefix); } + + void SetListVariable(const char *group, const char* key, const char* value, int add) { IupConfigSetListVariable(ih, group, key, value, add); } + + void RecentInit(Menu menu, Icallback recent_cb, int max_recent) { IupConfigRecentInit(ih, menu.GetHandle(), recent_cb, max_recent); } + void RecentUpdate(const char* filename) { IupConfigRecentUpdate(ih, filename); } + + void DialogShow(Dialog dialog, const char* name) { IupConfigDialogShow(ih, dialog.GetHandle(), name); } + void DialogClosed(Dialog dialog, const char* name) { IupConfigDialogClosed(ih, dialog.GetHandle(), name); } + }; +} + +#ifdef __CD_PLUS_H +namespace cd +{ + class CanvasIup : public Canvas + { + public: + CanvasIup(Iup::Canvas& iup_canvas) + : Canvas() { canvas = cdCreateCanvas(CD_IUP, iup_canvas.GetHandle()); } + }; + class CanvasIupDoubleBuffer : public Canvas + { + public: + CanvasIupDoubleBuffer(Iup::Canvas& iup_canvas) + : Canvas() { canvas = cdCreateCanvas(CD_IUPDBUFFER, iup_canvas.GetHandle()); } + }; + class CanvasIupDoubleBufferRGB : public Canvas + { + public: + CanvasIupDoubleBufferRGB(Iup::Canvas& iup_canvas) + : Canvas() { canvas = cdCreateCanvas(CD_IUPDBUFFERRGB, iup_canvas.GetHandle()); } + }; +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/linux/include/iup_scintilla.h b/komodoeditor/libs/iup/linux/include/iup_scintilla.h new file mode 100644 index 0000000..e78d308 --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iup_scintilla.h @@ -0,0 +1,29 @@ +/** \file + * \brief Scintilla control. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUP_SCINTILLA_H +#define __IUP_SCINTILLA_H + +#ifdef __cplusplus +extern "C" { +#endif + + +void IupScintillaOpen(void); + +Ihandle *IupScintilla(void); +Ihandle *IupScintillaDlg(void); + +#ifdef SCINTILLA_H +sptr_t IupScintillaSendMessage(Ihandle* ih, unsigned int iMessage, uptr_t wParam, sptr_t lParam); +#endif + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/linux/include/iup_varg.h b/komodoeditor/libs/iup/linux/include/iup_varg.h new file mode 100644 index 0000000..0408bd3 --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iup_varg.h @@ -0,0 +1,52 @@ +/** \file +* \brief IUP API with explicit variable argument parameters. +* +* See Copyright Notice in "iup.h" +*/ + +#ifndef __IUP_VARG_H +#define __IUP_VARG_H + +#include +#include "iup.h" + +#ifdef __cplusplus +extern "C" { +#endif + +IUP_API void IupLogV(const char* type, const char* format, va_list arglist); + +IUP_API Ihandle* IupSetAttV(const char* handle_name, Ihandle* ih, const char* name, va_list arglist); + +IUP_API void IupSetStrfV(Ihandle* ih, const char* name, const char* format, va_list arglist); +IUP_API void IupSetStrfIdV(Ihandle* ih, const char* name, int id, const char* format, va_list arglist); +IUP_API void IupSetStrfId2V(Ihandle* ih, const char* name, int lin, int col, const char* format, va_list arglist); + +IUP_API Ihandle* IupSetCallbacksV(Ihandle* ih, const char *name, Icallback func, va_list arglist); + +IUP_API Ihandle* IupCreateV(const char *classname, void* first, va_list arglist); +IUP_API Ihandle* IupVboxV(Ihandle* child, va_list arglist); +IUP_API Ihandle* IupZboxV(Ihandle* child, va_list arglist); +IUP_API Ihandle* IupHboxV(Ihandle* child,va_list arglist); +IUP_API Ihandle* IupNormalizerV(Ihandle* ih_first, va_list arglist); +IUP_API Ihandle* IupCboxV(Ihandle* child, va_list arglist); +IUP_API Ihandle* IupGridBoxV(Ihandle* child, va_list arglist); +IUP_API Ihandle* IupMultiBoxV(Ihandle* child, va_list arglist); +IUP_API Ihandle* IupMenuV(Ihandle* child,va_list arglist); +IUP_API Ihandle* IupTabsV(Ihandle* child, va_list arglist); +IUP_API Ihandle* IupFlatTabsV(Ihandle* child, va_list arglist); + +IUP_API void IupMessageV(const char *title, const char *format, va_list arglist); +IUP_API Ihandle* IupParamBoxV(Ihandle* param, va_list arglist); +IUP_API int IupGetParamV(const char* title, Iparamcb action, void* user_data, const char* format, va_list arglist); + +/* must include iupglcontrols before this file to enable this declaration */ +#ifdef __IUPGLCONTROLS_H +#ifndef IUP_GLCONTROLS_API +#define IUP_GLCONTROLS_API +#endif +IUP_GLCONTROLS_API Ihandle* IupGLCanvasBoxV(Ihandle* child, va_list arglist); +#endif + + +#endif diff --git a/komodoeditor/libs/iup/linux/include/iupcbs.h b/komodoeditor/libs/iup/linux/include/iupcbs.h new file mode 100644 index 0000000..17d1afa --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iupcbs.h @@ -0,0 +1,79 @@ +/** \file + * \brief Contains all function pointer typedefs. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPCBS_H +#define __IUPCBS_H + +struct _cdCanvas; + +typedef int (*IFidle)(void); /* idle */ +typedef void (*IFentry)(void); /* entry */ + +typedef void (*IFi)(int); /* globalentermodal_cb, globalleavemodal_cb, */ +typedef void (*IFs)(char*); /* openurl_cb */ +typedef void (*IFii)(int, int); /* globalkeypress_cb */ +typedef void (*IFiis)(int, int, char*); /* globalmotion_cb, openfiles_cb */ +typedef void (*IFiiiis)(int, int, int, int, char*); /* globalbutton_cb */ +typedef void (*IFfiis)(float,int,int,char*); /* globalwheel_cb */ +typedef void (*IFvs)(void*, char*); /* handleadd_cb, handleremove_cb, imagecreate_cb, imagedestroy_cb */ + +typedef int (*IFn)(Ihandle*); /* default definition, same as Icallback */ +typedef int (*IFni)(Ihandle*, int); /* k_any, show_cb, toggle_action, spin_cb, branchopen_cb, branchclose_cb, executeleaf_cb, showrename_cb, rightclick_cb, extended_cb, height_cb, width_cb */ +typedef int (*IFnii)(Ihandle*, int, int); /* resize_cb, caret_cb, matrix_mousemove_cb, enteritem_cb, leaveitem_cb, scrolltop_cb, dropcheck_cb, selection_cb, select_cb, switch_cb, scrolling_cb, vspan_cb, hspan_cb */ +typedef int (*IFniii)(Ihandle*, int, int, int); /* trayclick_cb, edition_cb */ +typedef int (*IFniiii)(Ihandle*, int, int, int, int); /* dragdrop_cb */ +typedef int (*IFniiiiiiC)(Ihandle*, int, int, int, int, int, int, struct _cdCanvas*); /* draw_cb */ +typedef int (*IFniiiiii)(Ihandle*, int, int, int, int, int, int); /* OLD draw_cb */ +typedef int (*IFnsidv)(Ihandle*, char*, int, double, void*); /* postmessage_cb */ + +typedef int (*IFnff)(Ihandle*, float, float); /* canvas_action */ +typedef int (*IFniff)(Ihandle*,int,float,float); /* scroll_cb */ +typedef int (*IFnfiis)(Ihandle*,float,int,int,char*); /* wheel_cb */ + +typedef int (*IFnsVi)(Ihandle*, char*, void*, int); /* dragdata_cb */ +typedef int (*IFnsViii)(Ihandle*, char*, void*, int, int, int); /* dropdata_cb */ +typedef int (*IFnsiii)(Ihandle*, char*, int, int, int); /* dropfiles_cb */ +typedef int (*IFnssi)(Ihandle*, char*, char*, int); /* dragfilecreatename_cb */ + +typedef int (*IFnnii)(Ihandle*, Ihandle*, int, int); /* drop_cb */ +typedef int (*IFnn)(Ihandle*, Ihandle*); /* savemarkers_cb, restoremarkers_cb */ +typedef int (*IFnnn)(Ihandle*, Ihandle*, Ihandle*); /* tabchange_cb */ +typedef int (*IFnss)(Ihandle*, char *, char *); /* file_cb */ +typedef int (*IFns)(Ihandle*, char *); /* multiselect_cb */ +typedef int (*IFnsi)(Ihandle*, char *, int); /* copydata_cb */ +typedef int (*IFnis)(Ihandle*, int, char *); /* text_action, multiline_action, edit_cb, rename_cb */ +typedef int (*IFnsii)(Ihandle*, char*, int, int); /* list_action */ +typedef int (*IFniis)(Ihandle*, int, int, char*); /* motion_cb, click_cb, value_edit_cb */ +typedef int (*IFniiis)(Ihandle*, int, int, int, char*); /* touch_cb, dblclick_cb */ +typedef int (*IFniiiis)(Ihandle*, int, int, int, int, char*); /* button_cb, matrix_action, mousemotion_cb */ +typedef int (*IFniiiiiis)(Ihandle*, int, int, int, int, int, int, char*); /* mouseclick_cb */ + +typedef int (*IFnIi)(Ihandle*, int*, int); /* multiselection_cb, multiunselection_cb */ +typedef int (*IFnd)(Ihandle*, double); /* mousemove_cb, button_press_cb, button_release_cb */ +typedef int (*IFniiIII)(Ihandle*, int, int, int*, int*, int*); /* fgcolor_cb, bgcolor_cb */ +typedef int (*IFniinsii)(Ihandle*, int, int, Ihandle*, char*, int, int); /* dropselect_cb */ +typedef int (*IFnccc)(Ihandle*, unsigned char, unsigned char, unsigned char); /* drag_cb, change_cb */ +typedef int (*IFniIIII)(Ihandle*, int, int*, int*, int*, int*); /* multitouch_cb */ + +typedef int (*IFnC)(Ihandle*, struct _cdCanvas*); /* postdraw_cb, predraw_cb */ +typedef int (*IFniidd)(Ihandle*, int, int, double, double); /* delete_cb */ +typedef int (*IFniiddi)(Ihandle*, int, int, double, double, int); /* select_cb */ +typedef int (*IFniiddiddi)(Ihandle*, int, int, double, double, int, double, double, int); /* clicksegment_cb */ +typedef int (*IFniidds)(Ihandle*, int, int, double, double, char*); /* plotbutton_cb */ +typedef int (*IFndds)(Ihandle*, double, double, char*); /* plotmotion_cb */ +typedef int (*IFnssds)(Ihandle*, char*, char*, double, char*); /* plottickformat_cb */ +typedef int (*IFnni)(Ihandle*, Ihandle*, int); + +typedef char* (*sIFnii)(Ihandle*, int, int); /* value_cb, font_cb */ +typedef char* (*sIFni)(Ihandle*, int); /* cell_cb */ +typedef char* (*sIFniis)(Ihandle*, int, int, char*); /* translatevalue_cb */ + +typedef double (*dIFnii)(Ihandle*, int, int); /* numericgetvalue_cb */ +typedef int (*IFniid)(Ihandle*, int, int, double); /* numericsetvalue_cb */ + +typedef void (*IFniiv)(Ihandle*, int, int, void*); /* android_onactivityresult_cb */ + +#endif diff --git a/komodoeditor/libs/iup/linux/include/iupcontrols.h b/komodoeditor/libs/iup/linux/include/iupcontrols.h new file mode 100644 index 0000000..7675d52 --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iupcontrols.h @@ -0,0 +1,31 @@ +/** \file + * \brief initializes dial, gauge, colorbrowser, colorbar controls. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPCONTROLS_H +#define __IUPCONTROLS_H + +#ifdef __cplusplus +extern "C" { +#endif + + +int IupControlsOpen(void); + +Ihandle* IupCells(void); +Ihandle* IupMatrix(const char *action); +Ihandle* IupMatrixList(void); +Ihandle* IupMatrixEx(void); + +/* available only when linking with "iupluamatrix" */ +void IupMatrixSetFormula(Ihandle* ih, int col, const char* formula, const char* init); +void IupMatrixSetDynamic(Ihandle* ih, const char* init); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/linux/include/iupdef.h b/komodoeditor/libs/iup/linux/include/iupdef.h new file mode 100644 index 0000000..8f427b1 --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iupdef.h @@ -0,0 +1,683 @@ +/** \file + * \brief Callbacks, Attributes and Attribute Values definitions. + * Avoid using these definitions. Use the strings instead. + * + * See Copyright Notice in iup.h + */ + +#ifndef __IUPDEF_H +#define __IUPDEF_H + +/* ATTENTION: these are OLD definitions and they are NOT updated anymore since IUP 3.0 */ +/* Avoid using them, directly use the strings instead. */ +/* Define __IUPDEF_H to avoid the inclusion of this header */ + +#define IUP_RUN "RUN" +#define IUP_ENGLISH "ENGLISH" +#define IUP_PORTUGUESE "PORTUGUESE" +#define IUP_SBH "SBH" +#define IUP_SBV "SBV" + +/************************************************************************/ +/* Callbacks */ +/************************************************************************/ + +#define IUP_IDLE_ACTION "IDLE_ACTION" + +#define IUP_ACTION "ACTION" +#define IUP_GETFOCUS_CB "GETFOCUS_CB" +#define IUP_KILLFOCUS_CB "KILLFOCUS_CB" +#define IUP_K_ANY "K_ANY" +#define IUP_KEYPRESS_CB "KEYPRESS_CB" +#define IUP_HELP_CB "HELP_CB" + +#define IUP_SCROLL_CB "SCROLL_CB" +#define IUP_RESIZE_CB "RESIZE_CB" +#define IUP_MOTION_CB "MOTION_CB" +#define IUP_BUTTON_CB "BUTTON_CB" +#define IUP_ENTERWINDOW_CB "ENTERWINDOW_CB" +#define IUP_LEAVEWINDOW_CB "LEAVEWINDOW_CB" +#define IUP_WHEEL_CB "WHEEL_CB" + +#define IUP_MASK_CB "MASK_CB" +#define IUP_OPEN_CB "OPEN_CB" +#define IUP_HIGHLIGHT_CB "HIGHLIGHT_CB" +#define IUP_MENUCLOSE_CB "MENUCLOSE_CB" + +#define IUP_MAP_CB "MAP_CB" +#define IUP_CLOSE_CB "CLOSE_CB" +#define IUP_SHOW_CB "SHOW_CB" + +#define IUP_DROPFILES_CB "DROPFILES_CB" +#define IUP_WOM_CB "WOM_CB" + +/************************************************************************/ +/* Attributes */ +/************************************************************************/ + +#define IUP_DIRECTION "DIRECTION" +#define IUP_ACTIVE "ACTIVE" +#define IUP_BGCOLOR "BGCOLOR" +#define IUP_FRAMECOLOR "FRAMECOLOR" +#define IUP_FGCOLOR "FGCOLOR" +#define IUP_COLOR "COLOR" +#define IUP_WID "WID" +#define IUP_SIZE "SIZE" +#define IUP_RASTERSIZE "RASTERSIZE" +#define IUP_TITLE "TITLE" +#define IUP_VALUE "VALUE" +#define IUP_VISIBLE "VISIBLE" +#define IUP_FONT "FONT" +#define IUP_TIP "TIP" +#define IUP_EXPAND "EXPAND" +#define IUP_SEPARATOR "SEPARATOR" + +#define IUP_HOTSPOT "HOTSPOT" +#define IUP_HEIGHT "HEIGHT" +#define IUP_WIDTH "WIDTH" + +#define IUP_KEY "KEY" + +#define IUP_MULTIPLE "MULTIPLE" +#define IUP_DROPDOWN "DROPDOWN" +#define IUP_VISIBLE_ITEMS "VISIBLE_ITEMS" + +#define IUP_MARGIN "MARGIN" +#define IUP_GAP "GAP" +#define IUP_ALIGNMENT "ALIGNMENT" + +#define IUP_IMAGE "IMAGE" +#define IUP_IMINACTIVE "IMINACTIVE" +#define IUP_IMPRESS "IMPRESS" +#define IUP_WIN_SAVEBITS "WIN_SAVEBITS" + +#define IUP_NC "NC" +#define IUP_MASK "MASK" + +#define IUP_APPEND "APPEND" +#define IUP_BORDER "BORDER" + +#define IUP_CARET "CARET" +#define IUP_SELECTION "SELECTION" +#define IUP_SELECTEDTEXT "SELECTEDTEXT" +#define IUP_INSERT "INSERT" + +#define IUP_CONID "CONID" +#define IUP_CURSOR "CURSOR" + +#define IUP_ICON "ICON" +#define IUP_MENUBOX "MENUBOX" +#define IUP_MINBOX "MINBOX" +#define IUP_MAXBOX "MAXBOX" +#define IUP_RESIZE "RESIZE" +#define IUP_MENU "MENU" +#define IUP_STARTFOCUS "STARTFOCUS" +#define IUP_PARENTDIALOG "PARENTDIALOG" +#define IUP_SHRINK "SHRINK" +#define IUP_DEFAULTENTER "DEFAULTENTER" +#define IUP_DEFAULTESC "DEFAULTESC" +#define IUP_X "X" +#define IUP_Y "Y" +#define IUP_TOOLBOX "TOOLBOX" +#define IUP_CONTROL "CONTROL" +#define IUP_READONLY "READONLY" + +#define IUP_SCROLLBAR "SCROLLBAR" +#define IUP_POSY "POSY" +#define IUP_POSX "POSX" +#define IUP_DX "DX" +#define IUP_DY "DY" +#define IUP_XMAX "XMAX" +#define IUP_XMIN "XMIN" +#define IUP_YMAX "YMAX" +#define IUP_YMIN "YMIN" + +#define IUP_RED "255 0 0" +#define IUP_GREEN "0 255 0" +#define IUP_BLUE "0 0 255" + +#define IUP_MIN "MIN" +#define IUP_MAX "MAX" + +#define IUP_TIME "TIME" +#define IUP_DRAG "DRAG" +#define IUP_DROP "DROP" +#define IUP_REPAINT "REPAINT" +#define IUP_TOPMOST "TOPMOST" +#define IUP_CLIPCHILDREN "CLIPCHILDREN" + +#define IUP_DIALOGTYPE "DIALOGTYPE" +#define IUP_FILE "FILE" +#define IUP_MULTIPLEFILES "MULTIPLEFILES" +#define IUP_FILTER "FILTER" +#define IUP_FILTERUSED "FILTERUSED" +#define IUP_FILTERINFO "FILTERINFO" +#define IUP_EXTFILTER "EXTFILTER" +#define IUP_DIRECTORY "DIRECTORY" +#define IUP_ALLOWNEW "ALLOWNEW" +#define IUP_NOOVERWRITEPROMPT "NOOVERWRITEPROMPT" +#define IUP_NOCHANGEDIR "NOCHANGEDIR" +#define IUP_FILEEXIST "FILEEXIST" +#define IUP_STATUS "STATUS" + +#define IUP_LOCKLOOP "LOCKLOOP" +#define IUP_SYSTEM "SYSTEM" +#define IUP_DRIVER "DRIVER" +#define IUP_SCREENSIZE "SCREENSIZE" +#define IUP_SYSTEMLANGUAGE "SYSTEMLANGUAGE" +#define IUP_COMPUTERNAME "COMPUTERNAME" +#define IUP_USERNAME "USERNAME" + +#define IUP_OPEN "OPEN" +#define IUP_SAVE "SAVE" +#define IUP_DIR "DIR" + +#define IUP_HORIZONTAL "HORIZONTAL" +#define IUP_VERTICAL "VERTICAL" + +/************************************************************************/ +/* Attribute Values */ +/************************************************************************/ + +#define IUP_YES "YES" +#define IUP_NO "NO" +#define IUP_ON "ON" +#define IUP_OFF "OFF" + +#define IUP_ACENTER "ACENTER" +#define IUP_ALEFT "ALEFT" +#define IUP_ARIGHT "ARIGHT" +#define IUP_ATOP "ATOP" +#define IUP_ABOTTOM "ABOTTOM" + +#define IUP_NORTH "NORTH" +#define IUP_SOUTH "SOUTH" +#define IUP_WEST "WEST" +#define IUP_EAST "EAST" +#define IUP_NE "NE" +#define IUP_SE "SE" +#define IUP_NW "NW" +#define IUP_SW "SW" + +#define IUP_FULLSCREEN "FULLSCREEN" +#define IUP_FULL "FULL" +#define IUP_HALF "HALF" +#define IUP_THIRD "THIRD" +#define IUP_QUARTER "QUARTER" +#define IUP_EIGHTH "EIGHTH" + +#define IUP_ARROW "ARROW" +#define IUP_BUSY "BUSY" +#define IUP_RESIZE_N "RESIZE_N" +#define IUP_RESIZE_S "RESIZE_S" +#define IUP_RESIZE_E "RESIZE_E" +#define IUP_RESIZE_W "RESIZE_W" +#define IUP_RESIZE_NE "RESIZE_NE" +#define IUP_RESIZE_NW "RESIZE_NW" +#define IUP_RESIZE_SE "RESIZE_SE" +#define IUP_RESIZE_SW "RESIZE_SW" +#define IUP_MOVE "MOVE" +#define IUP_HAND "HAND" +#define IUP_NONE "NONE" +#define IUP_IUP "IUP" +#define IUP_CROSS "CROSS" +#define IUP_PEN "PEN" +#define IUP_TEXT "TEXT" +#define IUP_RESIZE_C "RESIZE_C" +#define IUP_OPENHAND "OPENHAND" + +/************************************************************************/ +/* Keys */ +/************************************************************************/ + +#define IUP_K_exclam "K_exclam" +#define IUP_K_quotedbl "K_quotedbl" +#define IUP_K_numbersign "K_numbersign" +#define IUP_K_dollar "K_dollar" +#define IUP_K_percent "K_percent" +#define IUP_K_ampersand "K_ampersand" +#define IUP_K_quoteright "K_quoteright" +#define IUP_K_parentleft "K_parentleft" +#define IUP_K_parentright "K_parentright" +#define IUP_K_asterisk "K_asterisk" +#define IUP_K_plus "K_plus" +#define IUP_K_comma "K_comma" +#define IUP_K_minus "K_minus" +#define IUP_K_period "K_period" +#define IUP_K_slash "K_slash" +#define IUP_K_0 "K_0" +#define IUP_K_1 "K_1" +#define IUP_K_2 "K_2" +#define IUP_K_3 "K_3" +#define IUP_K_4 "K_4" +#define IUP_K_5 "K_5" +#define IUP_K_6 "K_6" +#define IUP_K_7 "K_7" +#define IUP_K_8 "K_8" +#define IUP_K_9 "K_9" +#define IUP_K_colon "K_colon" +#define IUP_K_semicolon "K_semicolon " +#define IUP_K_less "K_less" +#define IUP_K_equal "K_equal" +#define IUP_K_greater "K_greater" +#define IUP_K_question "K_question" +#define IUP_K_at "K_at" +#define IUP_K_A "K_A" +#define IUP_K_B "K_B" +#define IUP_K_C "K_C" +#define IUP_K_D "K_D" +#define IUP_K_E "K_E" +#define IUP_K_F "K_F" +#define IUP_K_G "K_G" +#define IUP_K_H "K_H" +#define IUP_K_I "K_I" +#define IUP_K_J "K_J" +#define IUP_K_K "K_K" +#define IUP_K_L "K_L" +#define IUP_K_M "K_M" +#define IUP_K_N "K_N" +#define IUP_K_O "K_O" +#define IUP_K_P "K_P" +#define IUP_K_Q "K_Q" +#define IUP_K_R "K_R" +#define IUP_K_S "K_S" +#define IUP_K_T "K_T" +#define IUP_K_U "K_U" +#define IUP_K_V "K_V" +#define IUP_K_W "K_W" +#define IUP_K_X "K_X" +#define IUP_K_Y "K_Y" +#define IUP_K_Z "K_Z" +#define IUP_K_bracketleft "K_bracketleft" +#define IUP_K_backslash "K_backslash" +#define IUP_K_bracketright "K_bracketright" +#define IUP_K_circum "K_circum" +#define IUP_K_underscore "K_underscore" +#define IUP_K_quoteleft "K_quoteleft" +#define IUP_K_a "K_a" +#define IUP_K_b "K_b" +#define IUP_K_c "K_c" +#define IUP_K_d "K_d" +#define IUP_K_e "K_e" +#define IUP_K_f "K_f" +#define IUP_K_g "K_g" +#define IUP_K_h "K_h" +#define IUP_K_i "K_i" +#define IUP_K_j "K_j" +#define IUP_K_k "K_k" +#define IUP_K_l "K_l" +#define IUP_K_m "K_m" +#define IUP_K_n "K_n" +#define IUP_K_o "K_o" +#define IUP_K_p "K_p" +#define IUP_K_q "K_q" +#define IUP_K_r "K_r" +#define IUP_K_s "K_s" +#define IUP_K_t "K_t" +#define IUP_K_u "K_u" +#define IUP_K_v "K_v" +#define IUP_K_w "K_w" +#define IUP_K_x "K_x" +#define IUP_K_y "K_y" +#define IUP_K_z "K_z" +#define IUP_K_braceleft "K_braceleft" +#define IUP_K_bar "K_bar" +#define IUP_K_braceright "K_braceright" +#define IUP_K_tilde "K_tilde" + +#define IUP_K_cA "K_cA" +#define IUP_K_cB "K_cB" +#define IUP_K_cC "K_cC" +#define IUP_K_cD "K_cD" +#define IUP_K_cE "K_cE" +#define IUP_K_cF "K_cF" +#define IUP_K_cG "K_cG" +#define IUP_K_cJ "K_cJ" +#define IUP_K_cK "K_cK" +#define IUP_K_cL "K_cL" +#define IUP_K_cN "K_cN" +#define IUP_K_cO "K_cO" +#define IUP_K_cP "K_cP" +#define IUP_K_cQ "K_cQ" +#define IUP_K_cR "K_cR" +#define IUP_K_cS "K_cS" +#define IUP_K_cT "K_cT" +#define IUP_K_cU "K_cU" +#define IUP_K_cV "K_cV" +#define IUP_K_cW "K_cW" +#define IUP_K_cX "K_cX" +#define IUP_K_cY "K_cY" +#define IUP_K_cZ "K_cZ" +#define IUP_K_mA "K_mA" +#define IUP_K_mB "K_mB" +#define IUP_K_mC "K_mC" +#define IUP_K_mD "K_mD" +#define IUP_K_mE "K_mE" +#define IUP_K_mF "K_mF" +#define IUP_K_mG "K_mG" +#define IUP_K_mH "K_mH" +#define IUP_K_mI "K_mI" +#define IUP_K_mJ "K_mJ" +#define IUP_K_mK "K_mK" +#define IUP_K_mL "K_mL" +#define IUP_K_mM "K_mM" +#define IUP_K_mN "K_mN" +#define IUP_K_mO "K_mO" +#define IUP_K_mP "K_mP" +#define IUP_K_mQ "K_mQ" +#define IUP_K_mR "K_mR" +#define IUP_K_mS "K_mS" +#define IUP_K_mT "K_mT" +#define IUP_K_mU "K_mU" +#define IUP_K_mV "K_mV" +#define IUP_K_mW "K_mW" +#define IUP_K_mX "K_mX" +#define IUP_K_mY "K_mY" +#define IUP_K_mZ "K_mZ" +#define IUP_K_BS "K_BS" +#define IUP_K_TAB "K_TAB" +#define IUP_K_CR "K_CR" +#define IUP_K_SP "K_SP" +#define IUP_K_ESC "K_ESC" +#define IUP_K_sCR "K_sCR" +#define IUP_K_sTAB "K_sTAB" +#define IUP_K_cTAB "K_cTAB" +#define IUP_K_mTAB "K_mTAB" +#define IUP_K_HOME "K_HOME" +#define IUP_K_UP "K_UP" +#define IUP_K_PGUP "K_PGUP" +#define IUP_K_LEFT "K_LEFT" +#define IUP_K_RIGHT "K_RIGHT" +#define IUP_K_END "K_END" +#define IUP_K_DOWN "K_DOWN" +#define IUP_K_PGDN "K_PGDN" +#define IUP_K_MIDDLE "K_MIDDLE" +#define IUP_K_INS "K_INS" +#define IUP_K_DEL "K_DEL" +#define IUP_K_sHOME "K_sHOME" +#define IUP_K_sUP "K_sUP" +#define IUP_K_sPGUP "K_sPGUP" +#define IUP_K_sLEFT "K_sLEFT" +#define IUP_K_sRIGHT "K_sRIGHT" +#define IUP_K_sEND "K_sEND" +#define IUP_K_sDOWN "K_sDOWN" +#define IUP_K_sPGDN "K_sPGDN" +#define IUP_K_cHOME "K_cHOME" +#define IUP_K_cPGUP "K_cPGUP" +#define IUP_K_cLEFT "K_cLEFT" +#define IUP_K_cRIGHT "K_cRIGHT" +#define IUP_K_cEND "K_cEND" +#define IUP_K_cPGDN "K_cPGDN" +#define IUP_K_cUP "K_cUP" +#define IUP_K_cDOWN "K_cDOWN" +#define IUP_K_cMIDDLE "K_cMIDDLE" +#define IUP_K_cINS "K_cINS" +#define IUP_K_cDEL "K_cDEL" +#define IUP_K_mHOME "K_mHOME" +#define IUP_K_mPGUP "K_mPGUP" +#define IUP_K_mLEFT "K_mLEFT" +#define IUP_K_mRIGHT "K_mRIGHT" +#define IUP_K_mEND "K_mEND" +#define IUP_K_mPGDN "K_mPGDN" +#define IUP_K_mUP "K_mUP" +#define IUP_K_mDOWN "K_mDOWN" +#define IUP_K_mINS "K_mINS" +#define IUP_K_mDEL "K_mDEL" +#define IUP_K_F1 "K_F1" +#define IUP_K_F2 "K_F2" +#define IUP_K_F3 "K_F3" +#define IUP_K_F4 "K_F4" +#define IUP_K_F5 "K_F5" +#define IUP_K_F6 "K_F6" +#define IUP_K_F7 "K_F7" +#define IUP_K_F8 "K_F8" +#define IUP_K_F9 "K_F9" +#define IUP_K_F10 "K_F10" +#define IUP_K_F11 "K_F11" +#define IUP_K_F12 "K_F12" +#define IUP_K_sF1 "K_sF1" +#define IUP_K_sF2 "K_sF2" +#define IUP_K_sF3 "K_sF3" +#define IUP_K_sF4 "K_sF4" +#define IUP_K_sF5 "K_sF5" +#define IUP_K_sF6 "K_sF6" +#define IUP_K_sF7 "K_sF7" +#define IUP_K_sF8 "K_sF8" +#define IUP_K_sF9 "K_sF9" +#define IUP_K_sF10 "K_sF10" +#define IUP_K_sF11 "K_sF11" +#define IUP_K_sF12 "K_sF12" +#define IUP_K_cF1 "K_cF1" +#define IUP_K_cF2 "K_cF2" +#define IUP_K_cF3 "K_cF3" +#define IUP_K_cF4 "K_cF4" +#define IUP_K_cF5 "K_cF5" +#define IUP_K_cF6 "K_cF6" +#define IUP_K_cF7 "K_cF7" +#define IUP_K_cF8 "K_cF8" +#define IUP_K_cF9 "K_cF9" +#define IUP_K_cF10 "K_cF10" +#define IUP_K_cF11 "K_cF11" +#define IUP_K_cF12 "K_cF12" +#define IUP_K_mF1 "K_mF1" +#define IUP_K_mF2 "K_mF2" +#define IUP_K_mF3 "K_mF3" +#define IUP_K_mF4 "K_mF4" +#define IUP_K_mF5 "K_mF5" +#define IUP_K_mF6 "K_mF6" +#define IUP_K_mF7 "K_mF7" +#define IUP_K_mF8 "K_mF8" +#define IUP_K_mF9 "K_mF9" +#define IUP_K_mF10 "K_mF10" +#define IUP_K_m1 "K_m1" +#define IUP_K_m2 "K_m2" +#define IUP_K_m3 "K_m3" +#define IUP_K_m4 "K_m4" +#define IUP_K_m5 "K_m5" +#define IUP_K_m6 "K_m6" +#define IUP_K_m7 "K_m7" +#define IUP_K_m8 "K_m8" +#define IUP_K_m9 "K_m9" +#define IUP_K_m0 "K_m0" + +/************/ +/* Colorbar */ +/************/ + +#define IUP_NUM_PARTS "NUM_PARTS" +#define IUP_NUM_CELLS "NUM_CELLS" +#define IUP_CELL "CELL" +#define IUP_PREVIEW_SIZE "PREVIEW_SIZE" +#define IUP_SHOW_PREVIEW "SHOW_PREVIEW" +#define IUP_SHOW_SECONDARY "SHOW_SECONDARY" +#define IUP_PRIMARY_CELL "PRIMARY_CELL" +#define IUP_SECONDARY_CELL "SECONDARY_CELL" +#define IUP_ORIENTATION "ORIENTATION" +#define IUP_SQUARED "SQUARED" +#define IUP_SHADOWED "SHADOWED" +#define IUP_BUFFERIZE "BUFFERIZE" +#define IUP_TRANSPARENCY "TRANSPARENCY" +#define IUP_CELL_CB "CELL_CB" +#define IUP_EXTENDED_CB "EXTENDED_CB" +#define IUP_SELECT_CB "SELECT_CB" +#define IUP_SWITCH_CB "SWITCH_CB" +#define IUP_VERTICAL "VERTICAL" +#define IUP_HORIZONTAL "HORIZONTAL" + +/************/ +/* Cells */ +/************/ + +#define IUP_ALL "ALL" +#define IUP_BOXED "BOXED" +#define IUP_CLIPPED "CLIPPED" +#define IUP_TRANSPARENT "TRANSPARENT" +#define IUP_NON_SCROLLABLE_LINES "NON_SCROLLABLE_LINES" +#define IUP_NON_SCROLLABLE_COLS "NON_SCROLLABLE_COLS" +#define IUP_ORIGIN "ORIGIN" +#define IUP_NO_COLOR "NO_COLOR" +#define IUP_FIRST_LINE "FIRST_LINE" +#define IUP_FIRST_COL "FIRST_COL" +#define IUP_DOUBLE_BUFFER "DOUBLE_BUFFER" +#define IUP_LIMITS "LIMITS" +#define IUP_CANVAS "CANVAS" +#define IUP_IMAGE_CANVAS "IMAGE_CANVAS" +#define IUP_FULL_VISIBLE "FULL_VISIBLE" +#define IUP_MOUSECLICK_CB "MOUSECLICK_CB" +#define IUP_MOUSEMOTION_CB "MOUSEMOTION_CB" +#define IUP_DRAW_CB "DRAW_CB" +#define IUP_WIDTH_CB "WIDTH_CB" +#define IUP_HEIGHT_CB "HEIGHT_CB" +#define IUP_NLINES_CB "NLINES_CB" +#define IUP_NCOLS_CB "NCOLS_CB" +#define IUP_HSPAN_CB "HSPAN_CB" +#define IUP_VSPAN_CB "VSPAN_CB" +#define IUP_SCROLLING_CB "SCROLLING_CB" + +/*****************/ +/* ColorBrowser */ +/*****************/ + +#define IUP_RGB "RGB" +#define IUP_CHANGE_CB "CHANGE_CB" +#define IUP_DRAG_CB "DRAG_CB" + +/*****************/ +/* Val */ +/*****************/ + +#define ICTL_MOUSEMOVE_CB "MOUSEMOVE_CB" +#define ICTL_BUTTON_PRESS_CB "BUTTON_PRESS_CB" +#define ICTL_BUTTON_RELEASE_CB "BUTTON_RELEASE_CB" +#define ICTL_HORIZONTAL "HORIZONTAL" +#define ICTL_VERTICAL "VERTICAL" +#define ICTL_SHOWTICKS "SHOWTICKS" + +/*****************/ +/* Tabs */ +/*****************/ + +#define ICTL_TOP "TOP" +#define ICTL_BOTTOM "BOTTOM" +#define ICTL_LEFT "LEFT" +#define ICTL_RIGHT "RIGHT" +#define ICTL_TABTYPE "TABTYPE" +#define ICTL_TABTITLE "TABTITLE" +#define ICTL_TABSIZE "TABSIZE" +#define ICTL_TABCHANGE_CB "TABCHANGE_CB" +#define ICTL_FONT "FONT" +#define ICTL_FONT_ACTIVE "FONT_ACTIVE" +#define ICTL_FONT_INACTIVE "FONT_INACTIVE" + +/*****************/ +/* Gauge */ +/*****************/ + +#define ICTL_SHOW_TEXT "SHOW_TEXT" +#define ICTL_DASHED "DASHED" +#define ICTL_MARGIN "MARGIN" +#define ICTL_TEXT "TEXT" + +/*****************/ +/* Dial */ +/*****************/ + +#define ICTL_DENSITY "DENSITY" +#define ICTL_HORIZONTAL "HORIZONTAL" +#define ICTL_VERTICAL "VERTICAL" +#define ICTL_CIRCULAR "CIRCULAR" +#define ICTL_UNIT "UNIT" + +/*****************/ +/* Matrix */ +/*****************/ + +#define IUP_ENTERITEM_CB "ENTERITEM_CB" +#define IUP_LEAVEITEM_CB "LEAVEITEM_CB" +#define IUP_EDITION_CB "EDITION_CB" +#define IUP_CLICK_CB "CLICK_CB" +#define IUP_DROP_CB "DROP_CB" +#define IUP_DROPSELECT_CB "DROPSELECT_CB" +#define IUP_DROPCHECK_CB "DROPCHECK_CB" +#define IUP_SCROLL_CB "SCROLL_CB" +#define IUP_VALUE_CB "VALUE_CB" +#define IUP_VALUE_EDIT_CB "VALUE_EDIT_CB" +#define IUP_FIELD_CB "FIELD_CB" +#define IUP_RESIZEMATRIX "RESIZEMATRIX" +#define IUP_ADDLIN "ADDLIN" +#define IUP_ADDCOL "ADDCOL" +#define IUP_DELLIN "DELLIN" +#define IUP_DELCOL "DELCOL" +#define IUP_NUMLIN "NUMLIN" +#define IUP_NUMCOL "NUMCOL" +#define IUP_NUMLIN_VISIBLE "NUMLIN_VISIBLE" +#define IUP_NUMCOL_VISIBLE "NUMCOL_VISIBLE" +#define IUP_MARKED "MARKED" +#define IUP_WIDTHDEF "WIDTHDEF" +#define IUP_HEIGHTDEF "HEIGHTDEF" +#define IUP_AREA "AREA" +#define IUP_MARK_MODE "MARK_MODE" +#define IUP_LIN "LIN" +#define IUP_COL "COL" +#define IUP_LINCOL "LINCOL" +#define IUP_CELL "CELL" +#define IUP_EDIT_MODE "EDIT_MODE" +#define IUP_FOCUS_CELL "FOCUS_CELL" +#define IUP_ORIGIN "ORIGIN" +#define IUP_REDRAW "REDRAW" +#define IUP_PREVIOUSVALUE "PREVIOUSVALUE" +#define IUP_MOUSEMOVE_CB "MOUSEMOVE_CB" + +/*****************/ +/* Tree */ +/*****************/ + +#define IUP_ADDLEAF "ADDLEAF" +#define IUP_ADDBRANCH "ADDBRANCH" +#define IUP_DELNODE "DELNODE" +#define IUP_IMAGELEAF "IMAGELEAF" +#define IUP_IMAGEBRANCHCOLLAPSED "IMAGEBRANCHCOLLAPSED" +#define IUP_IMAGEBRANCHEXPANDED "IMAGEBRANCHEXPANDED" +#define IUP_IMAGEEXPANDED "IMAGEEXPANDED" +#define IUP_KIND "KIND" +#define IUP_PARENT "PARENT" +#define IUP_DEPTH "DEPTH" +#define IUP_MARKED "MARKED" +#define IUP_ADDEXPANDED "ADDEXPANDED" +#define IUP_CTRL "CTRL" +#define IUP_SHIFT "SHIFT" +#define IUP_STATE "STATE" +#define IUP_STARTING "STARTING" +#define IUP_LEAF "LEAF" +#define IUP_BRANCH "BRANCH" +#define IUP_SELECTED "SELECTED" +#define IUP_CHILDREN "CHILDREN" +#define IUP_MARKED "MARKED" +#define IUP_ROOT "ROOT" +#define IUP_LAST "LAST" +#define IUP_PGUP "PGUP" +#define IUP_PGDN "PGDN" +#define IUP_NEXT "NEXT" +#define IUP_PREVIOUS "PREVIOUS" +#define IUP_INVERT "INVERT" +#define IUP_BLOCK "BLOCK" +#define IUP_CLEARALL "CLEARALL" +#define IUP_MARKALL "MARKALL" +#define IUP_INVERTALL "INVERTALL" +#define IUP_REDRAW "REDRAW" +#define IUP_COLLAPSED "COLLAPSED" +#define IUP_EXPANDED "EXPANDED" +#define IUP_SELECTION_CB "SELECTION_CB" +#define IUP_BRANCHOPEN_CB "BRANCHOPEN_CB" +#define IUP_BRANCHCLOSE_CB "BRANCHCLOSE_CB" +#define IUP_RIGHTCLICK_CB "RIGHTCLICK_CB" +#define IUP_EXECUTELEAF_CB "EXECUTELEAF_CB" +#define IUP_RENAMENODE_CB "RENAMENODE_CB" +#define IUP_IMGLEAF "IMGLEAF" +#define IUP_IMGCOLLAPSED "IMGCOLLAPSED" +#define IUP_IMGEXPANDED "IMGEXPANDED" +#define IUP_IMGBLANK "IMGBLANK" +#define IUP_IMGPAPER "IMGPAPER" + +#endif + diff --git a/komodoeditor/libs/iup/linux/include/iupdraw.h b/komodoeditor/libs/iup/linux/include/iupdraw.h new file mode 100644 index 0000000..5e9c079 --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iupdraw.h @@ -0,0 +1,47 @@ +/** \file + * \brief Canvas Draw API + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPDRAW_H +#define __IUPDRAW_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* all functions can be used only in IUP canvas and inside the ACTION callback */ + +IUP_API void IupDrawBegin(Ihandle* ih); +IUP_API void IupDrawEnd(Ihandle* ih); + +/* all functions can be called only between calls to Begin and End */ + +IUP_API void IupDrawSetClipRect(Ihandle* ih, int x1, int y1, int x2, int y2); +IUP_API void IupDrawGetClipRect(Ihandle* ih, int *x1, int *y1, int *x2, int *y2); +IUP_API void IupDrawResetClip(Ihandle* ih); + +/* color controlled by the attribute DRAWCOLOR */ +/* line style or fill controlled by the attribute DRAWSTYLE */ + +IUP_API void IupDrawParentBackground(Ihandle* ih); +IUP_API void IupDrawLine(Ihandle* ih, int x1, int y1, int x2, int y2); +IUP_API void IupDrawRectangle(Ihandle* ih, int x1, int y1, int x2, int y2); +IUP_API void IupDrawArc(Ihandle* ih, int x1, int y1, int x2, int y2, double a1, double a2); +IUP_API void IupDrawPolygon(Ihandle* ih, int* points, int count); +IUP_API void IupDrawText(Ihandle* ih, const char* text, int len, int x, int y, int w, int h); +IUP_API void IupDrawImage(Ihandle* ih, const char* name, int x, int y, int w, int h); +IUP_API void IupDrawSelectRect(Ihandle* ih, int x1, int y1, int x2, int y2); +IUP_API void IupDrawFocusRect(Ihandle* ih, int x1, int y1, int x2, int y2); + +IUP_API void IupDrawGetSize(Ihandle* ih, int *w, int *h); +IUP_API void IupDrawGetTextSize(Ihandle* ih, const char* text, int len, int *w, int *h); +IUP_API void IupDrawGetImageInfo(const char* name, int *w, int *h, int *bpp); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/linux/include/iupdraw_cd.h b/komodoeditor/libs/iup/linux/include/iupdraw_cd.h new file mode 100644 index 0000000..554fe69 --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iupdraw_cd.h @@ -0,0 +1,21 @@ +/** \file + * \brief IupDraw CD driver + * + * See Copyright Notice in iup.h + */ + +#ifndef __CD_IUPDRAW_H +#define __CD_IUPDRAW_H + +#ifdef __cplusplus +extern "C" { +#endif + +cdContext* cdContextIupDraw(void); +#define CD_IUPDRAW cdContextIupDraw() + +#ifdef __cplusplus +} +#endif + +#endif /* ifndef __CD_IUPDRAW_ */ diff --git a/komodoeditor/libs/iup/linux/include/iupfiledlg.h b/komodoeditor/libs/iup/linux/include/iupfiledlg.h new file mode 100644 index 0000000..48a37b9 --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iupfiledlg.h @@ -0,0 +1,24 @@ +/** \file + * \brief New FileDlg (Windows Only). + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPFILEDLG_H +#define __IUPFILEDLG_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* the only exported function, + once called it will replace regular IupFileDlg */ + +int IupNewFileDlgOpen(void); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/linux/include/iupgl.h b/komodoeditor/libs/iup/linux/include/iupgl.h new file mode 100644 index 0000000..fa0f869 --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iupgl.h @@ -0,0 +1,97 @@ +/** \file + * \brief OpenGL canvas for Iup. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPGL_H +#define __IUPGL_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Attributes +** To set the appropriate visual (pixel format) the following +** attributes may be specified. Their values should be set +** before the canvas is mapped to the scrren. +** After mapping, changing their values has no effect. +*/ +#ifndef IUP_BUFFER /* IUP_SINGLE (defaut) or IUP_DOUBLE */ +#define IUP_BUFFER "BUFFER" +#endif +#ifndef IUP_STEREO /* IUP_NO (defaut) or IUP_YES */ +#define IUP_STEREO "STEREO" +#endif +#ifndef IUP_BUFFER_SIZE /* Number of bits if index mode */ +#define IUP_BUFFER_SIZE "BUFFER_SIZE" +#endif +#ifndef IUP_RED_SIZE /* Number of red bits */ +#define IUP_RED_SIZE "RED_SIZE" +#endif +#ifndef IUP_GREEN_SIZE /* Number of green bits */ +#define IUP_GREEN_SIZE "GREEN_SIZE" +#endif +#ifndef IUP_BLUE_SIZE /* Number of blue bits */ +#define IUP_BLUE_SIZE "BLUE_SIZE" +#endif +#ifndef IUP_ALPHA_SIZE /* Number of alpha bits */ +#define IUP_ALPHA_SIZE "ALPHA_SIZE" +#endif +#ifndef IUP_DEPTH_SIZE /* Number of bits in depth buffer */ +#define IUP_DEPTH_SIZE "DEPTH_SIZE" +#endif +#ifndef IUP_STENCIL_SIZE /* Number of bits in stencil buffer */ +#define IUP_STENCIL_SIZE "STENCIL_SIZE" +#endif +#ifndef IUP_ACCUM_RED_SIZE /* Number of red bits in accum. buffer */ +#define IUP_ACCUM_RED_SIZE "ACCUM_RED_SIZE" +#endif +#ifndef IUP_ACCUM_GREEN_SIZE /* Number of green bits in accum. buffer */ +#define IUP_ACCUM_GREEN_SIZE "ACCUM_GREEN_SIZE" +#endif +#ifndef IUP_ACCUM_BLUE_SIZE /* Number of blue bits in accum. buffer */ +#define IUP_ACCUM_BLUE_SIZE "ACCUM_BLUE_SIZE" +#endif +#ifndef IUP_ACCUM_ALPHA_SIZE /* Number of alpha bits in accum. buffer */ +#define IUP_ACCUM_ALPHA_SIZE "ACCUM_ALPHA_SIZE" +#endif + + +/* Attribute values */ +#ifndef IUP_DOUBLE +#define IUP_DOUBLE "DOUBLE" +#endif +#ifndef IUP_SINGLE +#define IUP_SINGLE "SINGLE" +#endif +#ifndef IUP_INDEX +#define IUP_INDEX "INDEX" +#endif +#ifndef IUP_RGBA +#define IUP_RGBA "RGBA" +#endif +#ifndef IUP_YES +#define IUP_YES "YES" +#endif +#ifndef IUP_NO +#define IUP_NO "NO" +#endif + +void IupGLCanvasOpen(void); + +Ihandle *IupGLCanvas(const char *action); +Ihandle* IupGLBackgroundBox(Ihandle* child); + +void IupGLMakeCurrent(Ihandle* ih); +int IupGLIsCurrent(Ihandle* ih); +void IupGLSwapBuffers(Ihandle* ih); +void IupGLPalette(Ihandle* ih, int index, float r, float g, float b); +void IupGLUseFont(Ihandle* ih, int first, int count, int list_base); +void IupGLWait(int gl); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/linux/include/iupglcontrols.h b/komodoeditor/libs/iup/linux/include/iupglcontrols.h new file mode 100644 index 0000000..0132608 --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iupglcontrols.h @@ -0,0 +1,47 @@ +/** \file + * \brief GL Controls. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPGLCONTROLS_H +#define __IUPGLCONTROLS_H + +#ifdef __cplusplus +extern "C" { +#endif + + +int IupGLControlsOpen(void); + +Ihandle* IupGLCanvasBoxv(Ihandle** children); +Ihandle* IupGLCanvasBox(Ihandle* child, ...); + +Ihandle* IupGLSubCanvas(void); + +Ihandle* IupGLLabel(const char* title); +Ihandle* IupGLSeparator(void); +Ihandle* IupGLButton(const char* title); +Ihandle* IupGLToggle(const char* title); +Ihandle* IupGLLink(const char *url, const char * title); +Ihandle* IupGLProgressBar(void); +Ihandle* IupGLVal(void); +Ihandle* IupGLFrame(Ihandle* child); +Ihandle* IupGLExpander(Ihandle* child); +Ihandle* IupGLScrollBox(Ihandle* child); +Ihandle* IupGLSizeBox(Ihandle* child); +Ihandle* IupGLText(void); + + +/* Utilities */ +void IupGLDrawImage(Ihandle* ih, const char* name, int x, int y, int active); +void IupGLDrawText(Ihandle* ih, const char* str, int len, int x, int y); +void IupGLDrawGetTextSize(Ihandle* ih, const char* str, int *w, int *h); +void IupGLDrawGetImageInfo(const char* name, int *w, int *h, int *bpp); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/linux/include/iupim.h b/komodoeditor/libs/iup/linux/include/iupim.h new file mode 100644 index 0000000..185660a --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iupim.h @@ -0,0 +1,36 @@ +/** \file + * \brief Utilities using IM + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPIM_H +#define __IUPIM_H + +#if defined(__cplusplus) +extern "C" { +#endif + + +void IupImOpen(void); /* optional */ + +Ihandle* IupLoadImage(const char* filename); +int IupSaveImage(Ihandle* ih, const char* filename, const char* format); + +Ihandle* IupLoadAnimation(const char* filename); +Ihandle* IupLoadAnimationFrames(const char** filename_list, int file_count); + +#ifdef __IM_IMAGE_H +imImage* IupGetNativeHandleImage(void* handle); +void* IupGetImageNativeHandle(const imImage* image); + +Ihandle* IupImageFromImImage(const imImage* image); +imImage* IupImageToImImage(Ihandle* iup_image); +#endif + + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/linux/include/iupkey.h b/komodoeditor/libs/iup/linux/include/iupkey.h new file mode 100644 index 0000000..42d8f17 --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iupkey.h @@ -0,0 +1,533 @@ +/** \file + * \brief Keyboard Keys definitions. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPKEY_H +#define __IUPKEY_H + +/* from 32 to 126, all character sets are equal, + the key code is the same as the ASCii character code. */ + +#define K_SP ' ' /* 32 (0x20) */ +#define K_exclam '!' /* 33 */ +#define K_quotedbl '\"' /* 34 */ +#define K_numbersign '#' /* 35 */ +#define K_dollar '$' /* 36 */ +#define K_percent '%' /* 37 */ +#define K_ampersand '&' /* 38 */ +#define K_apostrophe '\'' /* 39 */ +#define K_parentleft '(' /* 40 */ +#define K_parentright ')' /* 41 */ +#define K_asterisk '*' /* 42 */ +#define K_plus '+' /* 43 */ +#define K_comma ',' /* 44 */ +#define K_minus '-' /* 45 */ +#define K_period '.' /* 46 */ +#define K_slash '/' /* 47 */ +#define K_0 '0' /* 48 (0x30) */ +#define K_1 '1' /* 49 */ +#define K_2 '2' /* 50 */ +#define K_3 '3' /* 51 */ +#define K_4 '4' /* 52 */ +#define K_5 '5' /* 53 */ +#define K_6 '6' /* 54 */ +#define K_7 '7' /* 55 */ +#define K_8 '8' /* 56 */ +#define K_9 '9' /* 57 */ +#define K_colon ':' /* 58 */ +#define K_semicolon ';' /* 59 */ +#define K_less '<' /* 60 */ +#define K_equal '=' /* 61 */ +#define K_greater '>' /* 62 */ +#define K_question '?' /* 63 */ +#define K_at '@' /* 64 */ +#define K_A 'A' /* 65 (0x41) */ +#define K_B 'B' /* 66 */ +#define K_C 'C' /* 67 */ +#define K_D 'D' /* 68 */ +#define K_E 'E' /* 69 */ +#define K_F 'F' /* 70 */ +#define K_G 'G' /* 71 */ +#define K_H 'H' /* 72 */ +#define K_I 'I' /* 73 */ +#define K_J 'J' /* 74 */ +#define K_K 'K' /* 75 */ +#define K_L 'L' /* 76 */ +#define K_M 'M' /* 77 */ +#define K_N 'N' /* 78 */ +#define K_O 'O' /* 79 */ +#define K_P 'P' /* 80 */ +#define K_Q 'Q' /* 81 */ +#define K_R 'R' /* 82 */ +#define K_S 'S' /* 83 */ +#define K_T 'T' /* 84 */ +#define K_U 'U' /* 85 */ +#define K_V 'V' /* 86 */ +#define K_W 'W' /* 87 */ +#define K_X 'X' /* 88 */ +#define K_Y 'Y' /* 89 */ +#define K_Z 'Z' /* 90 */ +#define K_bracketleft '[' /* 91 */ +#define K_backslash '\\' /* 92 */ +#define K_bracketright ']' /* 93 */ +#define K_circum '^' /* 94 */ +#define K_underscore '_' /* 95 */ +#define K_grave '`' /* 96 */ +#define K_a 'a' /* 97 (0x61) */ +#define K_b 'b' /* 98 */ +#define K_c 'c' /* 99 */ +#define K_d 'd' /* 100 */ +#define K_e 'e' /* 101 */ +#define K_f 'f' /* 102 */ +#define K_g 'g' /* 103 */ +#define K_h 'h' /* 104 */ +#define K_i 'i' /* 105 */ +#define K_j 'j' /* 106 */ +#define K_k 'k' /* 107 */ +#define K_l 'l' /* 108 */ +#define K_m 'm' /* 109 */ +#define K_n 'n' /* 110 */ +#define K_o 'o' /* 111 */ +#define K_p 'p' /* 112 */ +#define K_q 'q' /* 113 */ +#define K_r 'r' /* 114 */ +#define K_s 's' /* 115 */ +#define K_t 't' /* 116 */ +#define K_u 'u' /* 117 */ +#define K_v 'v' /* 118 */ +#define K_w 'w' /* 119 */ +#define K_x 'x' /* 120 */ +#define K_y 'y' /* 121 */ +#define K_z 'z' /* 122 */ +#define K_braceleft '{' /* 123 */ +#define K_bar '|' /* 124 */ +#define K_braceright '}' /* 125 */ +#define K_tilde '~' /* 126 (0x7E) */ + +/* Printable ASCii keys */ + +#define iup_isprint(_c) ((_c) > 31 && (_c) < 127) + +/* also define the escape sequences that have keys associated */ + +#define K_BS '\b' /* 8 */ +#define K_TAB '\t' /* 9 */ +#define K_LF '\n' /* 10 (0x0A) not a real key, is a combination of CR with a modifier, just to document */ +#define K_CR '\r' /* 13 (0x0D) */ + +/* backward compatible definitions */ + +#define K_quoteleft K_grave +#define K_quoteright K_apostrophe +#define isxkey iup_isXkey + +/* IUP Extended Key Codes, range start at 128 */ + +#define iup_isXkey(_c) ((_c) >= 128) + +/* These use the same definition as X11 and GDK. + This also means that any X11 or GDK definition can also be used. */ + +#define K_PAUSE 0xFF13 +#define K_ESC 0xFF1B +#define K_HOME 0xFF50 +#define K_LEFT 0xFF51 +#define K_UP 0xFF52 +#define K_RIGHT 0xFF53 +#define K_DOWN 0xFF54 +#define K_PGUP 0xFF55 +#define K_PGDN 0xFF56 +#define K_END 0xFF57 +#define K_MIDDLE 0xFF0B +#define K_Print 0xFF61 +#define K_INS 0xFF63 +#define K_Menu 0xFF67 +#define K_DEL 0xFFFF +#define K_F1 0xFFBE +#define K_F2 0xFFBF +#define K_F3 0xFFC0 +#define K_F4 0xFFC1 +#define K_F5 0xFFC2 +#define K_F6 0xFFC3 +#define K_F7 0xFFC4 +#define K_F8 0xFFC5 +#define K_F9 0xFFC6 +#define K_F10 0xFFC7 +#define K_F11 0xFFC8 +#define K_F12 0xFFC9 +#define K_F13 0xFFCA +#define K_F14 0xFFCB +#define K_F15 0xFFCC +#define K_F16 0xFFCD +#define K_F17 0xFFCE +#define K_F18 0xFFCF +#define K_F19 0xFFD0 +#define K_F20 0xFFD1 + +/* no Shift/Ctrl/Alt */ +#define K_LSHIFT 0xFFE1 +#define K_RSHIFT 0xFFE2 +#define K_LCTRL 0xFFE3 +#define K_RCTRL 0xFFE4 +#define K_LALT 0xFFE9 +#define K_RALT 0xFFEA + +#define K_NUM 0xFF7F +#define K_SCROLL 0xFF14 +#define K_CAPS 0xFFE5 + +/* Mac clear button. Value randomly picked trying to avoid clashing with an existing value. */ +#define K_CLEAR 0xFFD2 +/* Help button if anybody has it. Value randomly picked trying to avoid clashing with an existing value. */ +#define K_HELP 0xFFD3 + +/* Also, these are the same as the Latin-1 definition */ + +#define K_ccedilla 0x00E7 +#define K_Ccedilla 0x00C7 +#define K_acute 0x00B4 /* no Shift/Ctrl/Alt */ +#define K_diaeresis 0x00A8 + +/******************************************************/ +/* Modifiers use last 4 bits. Since IUP 3.9 */ +/* These modifiers definitions are specific to IUP */ +/******************************************************/ + +#define iup_isShiftXkey(_c) (((_c) & 0x10000000) != 0) +#define iup_isCtrlXkey(_c) (((_c) & 0x20000000) != 0) +#define iup_isAltXkey(_c) (((_c) & 0x40000000) != 0) +#define iup_isSysXkey(_c) (((_c) & 0x80000000) != 0) + +#define iup_XkeyBase(_c) ((_c) & 0x0FFFFFFF) +#define iup_XkeyShift(_c) ((_c) | 0x10000000) /* Shift */ +#define iup_XkeyCtrl(_c) ((_c) | 0x20000000) /* Ctrl */ +#define iup_XkeyAlt(_c) ((_c) | 0x40000000) /* Alt */ +#define iup_XkeySys(_c) ((_c) | 0x80000000) /* Sys (Win or Apple) - notice that using "int" will display a negative value */ + +/* These definitions are here for backward compatibility + and to simplify some key combination usage. + But since IUP 3.9, modifiers can be combined with any key + and they can be mixed together. */ + +#define K_sHOME iup_XkeyShift(K_HOME ) +#define K_sUP iup_XkeyShift(K_UP ) +#define K_sPGUP iup_XkeyShift(K_PGUP ) +#define K_sLEFT iup_XkeyShift(K_LEFT ) +#define K_sMIDDLE iup_XkeyShift(K_MIDDLE ) +#define K_sRIGHT iup_XkeyShift(K_RIGHT ) +#define K_sEND iup_XkeyShift(K_END ) +#define K_sDOWN iup_XkeyShift(K_DOWN ) +#define K_sPGDN iup_XkeyShift(K_PGDN ) +#define K_sINS iup_XkeyShift(K_INS ) +#define K_sDEL iup_XkeyShift(K_DEL ) +#define K_sSP iup_XkeyShift(K_SP ) +#define K_sTAB iup_XkeyShift(K_TAB ) +#define K_sCR iup_XkeyShift(K_CR ) +#define K_sBS iup_XkeyShift(K_BS ) +#define K_sPAUSE iup_XkeyShift(K_PAUSE ) +#define K_sESC iup_XkeyShift(K_ESC ) +#define K_sCLEAR iup_XkeyShift(K_CLEAR ) +#define K_sF1 iup_XkeyShift(K_F1 ) +#define K_sF2 iup_XkeyShift(K_F2 ) +#define K_sF3 iup_XkeyShift(K_F3 ) +#define K_sF4 iup_XkeyShift(K_F4 ) +#define K_sF5 iup_XkeyShift(K_F5 ) +#define K_sF6 iup_XkeyShift(K_F6 ) +#define K_sF7 iup_XkeyShift(K_F7 ) +#define K_sF8 iup_XkeyShift(K_F8 ) +#define K_sF9 iup_XkeyShift(K_F9 ) +#define K_sF10 iup_XkeyShift(K_F10 ) +#define K_sF11 iup_XkeyShift(K_F11 ) +#define K_sF12 iup_XkeyShift(K_F12 ) +#define K_sF13 iup_XkeyShift(K_F13 ) +#define K_sF14 iup_XkeyShift(K_F14 ) +#define K_sF15 iup_XkeyShift(K_F15 ) +#define K_sF16 iup_XkeyShift(K_F16 ) +#define K_sF17 iup_XkeyShift(K_F17 ) +#define K_sF18 iup_XkeyShift(K_F18 ) +#define K_sF19 iup_XkeyShift(K_F19 ) +#define K_sF20 iup_XkeyShift(K_F20 ) +#define K_sPrint iup_XkeyShift(K_Print ) +#define K_sMenu iup_XkeyShift(K_Menu ) + +#define K_cHOME iup_XkeyCtrl(K_HOME ) +#define K_cUP iup_XkeyCtrl(K_UP ) +#define K_cPGUP iup_XkeyCtrl(K_PGUP ) +#define K_cLEFT iup_XkeyCtrl(K_LEFT ) +#define K_cMIDDLE iup_XkeyCtrl(K_MIDDLE ) +#define K_cRIGHT iup_XkeyCtrl(K_RIGHT ) +#define K_cEND iup_XkeyCtrl(K_END ) +#define K_cDOWN iup_XkeyCtrl(K_DOWN ) +#define K_cPGDN iup_XkeyCtrl(K_PGDN ) +#define K_cINS iup_XkeyCtrl(K_INS ) +#define K_cDEL iup_XkeyCtrl(K_DEL ) +#define K_cSP iup_XkeyCtrl(K_SP ) +#define K_cTAB iup_XkeyCtrl(K_TAB ) +#define K_cCR iup_XkeyCtrl(K_CR ) +#define K_cBS iup_XkeyCtrl(K_BS ) +#define K_cPAUSE iup_XkeyCtrl(K_PAUSE ) +#define K_cESC iup_XkeyCtrl(K_ESC ) +#define K_cCLEAR iup_XkeyCtrl(K_CLEAR ) +#define K_cCcedilla iup_XkeyCtrl(K_Ccedilla) +#define K_cF1 iup_XkeyCtrl(K_F1 ) +#define K_cF2 iup_XkeyCtrl(K_F2 ) +#define K_cF3 iup_XkeyCtrl(K_F3 ) +#define K_cF4 iup_XkeyCtrl(K_F4 ) +#define K_cF5 iup_XkeyCtrl(K_F5 ) +#define K_cF6 iup_XkeyCtrl(K_F6 ) +#define K_cF7 iup_XkeyCtrl(K_F7 ) +#define K_cF8 iup_XkeyCtrl(K_F8 ) +#define K_cF9 iup_XkeyCtrl(K_F9 ) +#define K_cF10 iup_XkeyCtrl(K_F10 ) +#define K_cF11 iup_XkeyCtrl(K_F11 ) +#define K_cF12 iup_XkeyCtrl(K_F12 ) +#define K_cF13 iup_XkeyCtrl(K_F13 ) +#define K_cF14 iup_XkeyCtrl(K_F14 ) +#define K_cF15 iup_XkeyCtrl(K_F15 ) +#define K_cF16 iup_XkeyCtrl(K_F16 ) +#define K_cF17 iup_XkeyCtrl(K_F17 ) +#define K_cF18 iup_XkeyCtrl(K_F18 ) +#define K_cF19 iup_XkeyCtrl(K_F19 ) +#define K_cF20 iup_XkeyCtrl(K_F20 ) +#define K_cPrint iup_XkeyCtrl(K_Print ) +#define K_cMenu iup_XkeyCtrl(K_Menu ) + +#define K_mHOME iup_XkeyAlt(K_HOME ) +#define K_mUP iup_XkeyAlt(K_UP ) +#define K_mPGUP iup_XkeyAlt(K_PGUP ) +#define K_mLEFT iup_XkeyAlt(K_LEFT ) +#define K_mMIDDLE iup_XkeyAlt(K_MIDDLE ) +#define K_mRIGHT iup_XkeyAlt(K_RIGHT ) +#define K_mEND iup_XkeyAlt(K_END ) +#define K_mDOWN iup_XkeyAlt(K_DOWN ) +#define K_mPGDN iup_XkeyAlt(K_PGDN ) +#define K_mINS iup_XkeyAlt(K_INS ) +#define K_mDEL iup_XkeyAlt(K_DEL ) +#define K_mSP iup_XkeyAlt(K_SP ) +#define K_mTAB iup_XkeyAlt(K_TAB ) +#define K_mCR iup_XkeyAlt(K_CR ) +#define K_mBS iup_XkeyAlt(K_BS ) +#define K_mPAUSE iup_XkeyAlt(K_PAUSE ) +#define K_mESC iup_XkeyAlt(K_ESC ) +#define K_mCLEAR iup_XkeyAlt(K_CLEAR ) +#define K_mCcedilla iup_XkeyAlt(K_Ccedilla) +#define K_mF1 iup_XkeyAlt(K_F1 ) +#define K_mF2 iup_XkeyAlt(K_F2 ) +#define K_mF3 iup_XkeyAlt(K_F3 ) +#define K_mF4 iup_XkeyAlt(K_F4 ) +#define K_mF5 iup_XkeyAlt(K_F5 ) +#define K_mF6 iup_XkeyAlt(K_F6 ) +#define K_mF7 iup_XkeyAlt(K_F7 ) +#define K_mF8 iup_XkeyAlt(K_F8 ) +#define K_mF9 iup_XkeyAlt(K_F9 ) +#define K_mF10 iup_XkeyAlt(K_F10 ) +#define K_mF11 iup_XkeyAlt(K_F11 ) +#define K_mF12 iup_XkeyAlt(K_F12 ) +#define K_mF13 iup_XkeyAlt(K_F13 ) +#define K_mF14 iup_XkeyAlt(K_F14 ) +#define K_mF15 iup_XkeyAlt(K_F15 ) +#define K_mF16 iup_XkeyAlt(K_F16 ) +#define K_mF17 iup_XkeyAlt(K_F17 ) +#define K_mF18 iup_XkeyAlt(K_F18 ) +#define K_mF19 iup_XkeyAlt(K_F19 ) +#define K_mF20 iup_XkeyAlt(K_F20 ) +#define K_mPrint iup_XkeyAlt(K_Print ) +#define K_mMenu iup_XkeyAlt(K_Menu ) + +#define K_yHOME iup_XkeySys(K_HOME ) +#define K_yUP iup_XkeySys(K_UP ) +#define K_yPGUP iup_XkeySys(K_PGUP ) +#define K_yLEFT iup_XkeySys(K_LEFT ) +#define K_yMIDDLE iup_XkeySys(K_MIDDLE ) +#define K_yRIGHT iup_XkeySys(K_RIGHT ) +#define K_yEND iup_XkeySys(K_END ) +#define K_yDOWN iup_XkeySys(K_DOWN ) +#define K_yPGDN iup_XkeySys(K_PGDN ) +#define K_yINS iup_XkeySys(K_INS ) +#define K_yDEL iup_XkeySys(K_DEL ) +#define K_ySP iup_XkeySys(K_SP ) +#define K_yTAB iup_XkeySys(K_TAB ) +#define K_yCR iup_XkeySys(K_CR ) +#define K_yBS iup_XkeySys(K_BS ) +#define K_yPAUSE iup_XkeySys(K_PAUSE ) +#define K_yESC iup_XkeySys(K_ESC ) +#define K_yCLEAR iup_XkeySys(K_CLEAR ) +#define K_yCcedilla iup_XkeySys(K_Ccedilla) +#define K_yF1 iup_XkeySys(K_F1 ) +#define K_yF2 iup_XkeySys(K_F2 ) +#define K_yF3 iup_XkeySys(K_F3 ) +#define K_yF4 iup_XkeySys(K_F4 ) +#define K_yF5 iup_XkeySys(K_F5 ) +#define K_yF6 iup_XkeySys(K_F6 ) +#define K_yF7 iup_XkeySys(K_F7 ) +#define K_yF8 iup_XkeySys(K_F8 ) +#define K_yF9 iup_XkeySys(K_F9 ) +#define K_yF10 iup_XkeySys(K_F10 ) +#define K_yF11 iup_XkeySys(K_F11 ) +#define K_yF12 iup_XkeySys(K_F12 ) +#define K_yF13 iup_XkeySys(K_F13 ) +#define K_yF14 iup_XkeySys(K_F14 ) +#define K_yF15 iup_XkeySys(K_F15 ) +#define K_yF16 iup_XkeySys(K_F16 ) +#define K_yF17 iup_XkeySys(K_F17 ) +#define K_yF18 iup_XkeySys(K_F18 ) +#define K_yF19 iup_XkeySys(K_F19 ) +#define K_yF20 iup_XkeySys(K_F20 ) +#define K_yPrint iup_XkeySys(K_Print ) +#define K_yMenu iup_XkeySys(K_Menu ) + +#define K_sPlus iup_XkeyShift(K_plus ) +#define K_sComma iup_XkeyShift(K_comma ) +#define K_sMinus iup_XkeyShift(K_minus ) +#define K_sPeriod iup_XkeyShift(K_period ) +#define K_sSlash iup_XkeyShift(K_slash ) +#define K_sAsterisk iup_XkeyShift(K_asterisk) + +#define K_cA iup_XkeyCtrl(K_A) +#define K_cB iup_XkeyCtrl(K_B) +#define K_cC iup_XkeyCtrl(K_C) +#define K_cD iup_XkeyCtrl(K_D) +#define K_cE iup_XkeyCtrl(K_E) +#define K_cF iup_XkeyCtrl(K_F) +#define K_cG iup_XkeyCtrl(K_G) +#define K_cH iup_XkeyCtrl(K_H) +#define K_cI iup_XkeyCtrl(K_I) +#define K_cJ iup_XkeyCtrl(K_J) +#define K_cK iup_XkeyCtrl(K_K) +#define K_cL iup_XkeyCtrl(K_L) +#define K_cM iup_XkeyCtrl(K_M) +#define K_cN iup_XkeyCtrl(K_N) +#define K_cO iup_XkeyCtrl(K_O) +#define K_cP iup_XkeyCtrl(K_P) +#define K_cQ iup_XkeyCtrl(K_Q) +#define K_cR iup_XkeyCtrl(K_R) +#define K_cS iup_XkeyCtrl(K_S) +#define K_cT iup_XkeyCtrl(K_T) +#define K_cU iup_XkeyCtrl(K_U) +#define K_cV iup_XkeyCtrl(K_V) +#define K_cW iup_XkeyCtrl(K_W) +#define K_cX iup_XkeyCtrl(K_X) +#define K_cY iup_XkeyCtrl(K_Y) +#define K_cZ iup_XkeyCtrl(K_Z) +#define K_c1 iup_XkeyCtrl(K_1) +#define K_c2 iup_XkeyCtrl(K_2) +#define K_c3 iup_XkeyCtrl(K_3) +#define K_c4 iup_XkeyCtrl(K_4) +#define K_c5 iup_XkeyCtrl(K_5) +#define K_c6 iup_XkeyCtrl(K_6) +#define K_c7 iup_XkeyCtrl(K_7) +#define K_c8 iup_XkeyCtrl(K_8) +#define K_c9 iup_XkeyCtrl(K_9) +#define K_c0 iup_XkeyCtrl(K_0) +#define K_cPlus iup_XkeyCtrl(K_plus ) +#define K_cComma iup_XkeyCtrl(K_comma ) +#define K_cMinus iup_XkeyCtrl(K_minus ) +#define K_cPeriod iup_XkeyCtrl(K_period ) +#define K_cSlash iup_XkeyCtrl(K_slash ) +#define K_cSemicolon iup_XkeyCtrl(K_semicolon ) +#define K_cEqual iup_XkeyCtrl(K_equal ) +#define K_cBracketleft iup_XkeyCtrl(K_bracketleft ) +#define K_cBracketright iup_XkeyCtrl(K_bracketright) +#define K_cBackslash iup_XkeyCtrl(K_backslash ) +#define K_cAsterisk iup_XkeyCtrl(K_asterisk ) + +#define K_mA iup_XkeyAlt(K_A) +#define K_mB iup_XkeyAlt(K_B) +#define K_mC iup_XkeyAlt(K_C) +#define K_mD iup_XkeyAlt(K_D) +#define K_mE iup_XkeyAlt(K_E) +#define K_mF iup_XkeyAlt(K_F) +#define K_mG iup_XkeyAlt(K_G) +#define K_mH iup_XkeyAlt(K_H) +#define K_mI iup_XkeyAlt(K_I) +#define K_mJ iup_XkeyAlt(K_J) +#define K_mK iup_XkeyAlt(K_K) +#define K_mL iup_XkeyAlt(K_L) +#define K_mM iup_XkeyAlt(K_M) +#define K_mN iup_XkeyAlt(K_N) +#define K_mO iup_XkeyAlt(K_O) +#define K_mP iup_XkeyAlt(K_P) +#define K_mQ iup_XkeyAlt(K_Q) +#define K_mR iup_XkeyAlt(K_R) +#define K_mS iup_XkeyAlt(K_S) +#define K_mT iup_XkeyAlt(K_T) +#define K_mU iup_XkeyAlt(K_U) +#define K_mV iup_XkeyAlt(K_V) +#define K_mW iup_XkeyAlt(K_W) +#define K_mX iup_XkeyAlt(K_X) +#define K_mY iup_XkeyAlt(K_Y) +#define K_mZ iup_XkeyAlt(K_Z) +#define K_m1 iup_XkeyAlt(K_1) +#define K_m2 iup_XkeyAlt(K_2) +#define K_m3 iup_XkeyAlt(K_3) +#define K_m4 iup_XkeyAlt(K_4) +#define K_m5 iup_XkeyAlt(K_5) +#define K_m6 iup_XkeyAlt(K_6) +#define K_m7 iup_XkeyAlt(K_7) +#define K_m8 iup_XkeyAlt(K_8) +#define K_m9 iup_XkeyAlt(K_9) +#define K_m0 iup_XkeyAlt(K_0) +#define K_mPlus iup_XkeyAlt(K_plus ) +#define K_mComma iup_XkeyAlt(K_comma ) +#define K_mMinus iup_XkeyAlt(K_minus ) +#define K_mPeriod iup_XkeyAlt(K_period ) +#define K_mSlash iup_XkeyAlt(K_slash ) +#define K_mSemicolon iup_XkeyAlt(K_semicolon ) +#define K_mEqual iup_XkeyAlt(K_equal ) +#define K_mBracketleft iup_XkeyAlt(K_bracketleft ) +#define K_mBracketright iup_XkeyAlt(K_bracketright) +#define K_mBackslash iup_XkeyAlt(K_backslash ) +#define K_mAsterisk iup_XkeyAlt(K_asterisk ) + +#define K_yA iup_XkeySys(K_A) +#define K_yB iup_XkeySys(K_B) +#define K_yC iup_XkeySys(K_C) +#define K_yD iup_XkeySys(K_D) +#define K_yE iup_XkeySys(K_E) +#define K_yF iup_XkeySys(K_F) +#define K_yG iup_XkeySys(K_G) +#define K_yH iup_XkeySys(K_H) +#define K_yI iup_XkeySys(K_I) +#define K_yJ iup_XkeySys(K_J) +#define K_yK iup_XkeySys(K_K) +#define K_yL iup_XkeySys(K_L) +#define K_yM iup_XkeySys(K_M) +#define K_yN iup_XkeySys(K_N) +#define K_yO iup_XkeySys(K_O) +#define K_yP iup_XkeySys(K_P) +#define K_yQ iup_XkeySys(K_Q) +#define K_yR iup_XkeySys(K_R) +#define K_yS iup_XkeySys(K_S) +#define K_yT iup_XkeySys(K_T) +#define K_yU iup_XkeySys(K_U) +#define K_yV iup_XkeySys(K_V) +#define K_yW iup_XkeySys(K_W) +#define K_yX iup_XkeySys(K_X) +#define K_yY iup_XkeySys(K_Y) +#define K_yZ iup_XkeySys(K_Z) +#define K_y1 iup_XkeySys(K_1) +#define K_y2 iup_XkeySys(K_2) +#define K_y3 iup_XkeySys(K_3) +#define K_y4 iup_XkeySys(K_4) +#define K_y5 iup_XkeySys(K_5) +#define K_y6 iup_XkeySys(K_6) +#define K_y7 iup_XkeySys(K_7) +#define K_y8 iup_XkeySys(K_8) +#define K_y9 iup_XkeySys(K_9) +#define K_y0 iup_XkeySys(K_0) +#define K_yPlus iup_XkeySys(K_plus ) +#define K_yComma iup_XkeySys(K_comma ) +#define K_yMinus iup_XkeySys(K_minus ) +#define K_yPeriod iup_XkeySys(K_period ) +#define K_ySlash iup_XkeySys(K_slash ) +#define K_ySemicolon iup_XkeySys(K_semicolon ) +#define K_yEqual iup_XkeySys(K_equal ) +#define K_yBracketleft iup_XkeySys(K_bracketleft ) +#define K_yBracketright iup_XkeySys(K_bracketright) +#define K_yBackslash iup_XkeySys(K_backslash ) +#define K_yAsterisk iup_XkeySys(K_asterisk ) + + +#endif diff --git a/komodoeditor/libs/iup/linux/include/iuplua.h b/komodoeditor/libs/iup/linux/include/iuplua.h new file mode 100644 index 0000000..5893d13 --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iuplua.h @@ -0,0 +1,54 @@ +/** \file + * \brief IUP Binding for Lua. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPLUA_H +#define __IUPLUA_H + +#ifdef __cplusplus +extern "C" { +#endif + + +#ifndef DOXYGEN_SHOULD_IGNORE_THIS +/** @cond DOXYGEN_SHOULD_IGNORE_THIS */ +#ifndef IUPLUA_API +#ifdef IUPLUA_BUILD_LIBRARY + #ifdef __EMSCRIPTEN__ + #include + #define IUPLUA_API EMSCRIPTEN_KEEPALIVE + #elif WIN32 + #define IUPLUA_API __declspec(dllexport) + #elif defined(__GNUC__) && __GNUC__ >= 4 + #define IUPLUA_API __attribute__ ((visibility("default"))) + #else + #define IUPLUA_API + #endif +#else + #define IUPLUA_API +#endif /* IUPLUA_BUILD_LIBRARY */ +#endif /* IUPLUA_API */ +/** @endcond DOXYGEN_SHOULD_IGNORE_THIS */ +#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ + + +IUPLUA_API int iuplua_open(lua_State *L); +IUPLUA_API int iupkey_open(lua_State *L); /* does nothing, kept for backward compatibility */ +IUPLUA_API int iuplua_close(lua_State * L); + +/* utilities */ +IUPLUA_API int iuplua_isihandle(lua_State *L, int pos); +IUPLUA_API Ihandle* iuplua_checkihandle(lua_State *L, int pos); +IUPLUA_API void iuplua_pushihandle(lua_State *L, Ihandle *n); +IUPLUA_API int iuplua_dofile(lua_State *L, const char *filename); +IUPLUA_API int iuplua_dostring(lua_State *L, const char *string, const char *chunk_name); +IUPLUA_API int iuplua_dobuffer(lua_State *L, const char *buffer, int len, const char *chunk_name); +IUPLUA_API void iuplua_show_error_message(const char *pname, const char* msg); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/linux/include/iuplua_mglplot.h b/komodoeditor/libs/iup/linux/include/iuplua_mglplot.h new file mode 100644 index 0000000..75355c7 --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iuplua_mglplot.h @@ -0,0 +1,20 @@ +/** \file + * \brief IupMglPlot Binding for Lua. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPLUA_MGLPLOT_H +#define __IUPLUA_MGLPLOT_H + +#ifdef __cplusplus +extern "C" { +#endif + +int iup_mglplotlua_open (lua_State * L); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/linux/include/iuplua_plot.h b/komodoeditor/libs/iup/linux/include/iuplua_plot.h new file mode 100644 index 0000000..1a84c92 --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iuplua_plot.h @@ -0,0 +1,20 @@ +/** \file + * \brief iup_plot Binding for Lua. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPLUA_PLOT_H +#define __IUPLUA_PLOT_H + +#ifdef __cplusplus +extern "C" { +#endif + +int iup_plotlua_open (lua_State * L); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/linux/include/iuplua_scintilla.h b/komodoeditor/libs/iup/linux/include/iuplua_scintilla.h new file mode 100644 index 0000000..86618d6 --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iuplua_scintilla.h @@ -0,0 +1,20 @@ +/** \file + * \brief IupScintilla Binding for Lua. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPLUA_SCINTILLA_H +#define __IUPLUA_SCINTILLA_H + +#ifdef __cplusplus +extern "C" { +#endif + +int iup_scintillalua_open (lua_State * L); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/linux/include/iupluacontrols.h b/komodoeditor/libs/iup/linux/include/iupluacontrols.h new file mode 100644 index 0000000..1244607 --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iupluacontrols.h @@ -0,0 +1,20 @@ +/** \file + * \brief iupcontrols Binding for Lua. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPLUACONTROLS_H +#define __IUPLUACONTROLS_H + +#ifdef __cplusplus +extern "C" { +#endif + +int iupcontrolslua_open (lua_State * L); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/linux/include/iupluafiledlg.h b/komodoeditor/libs/iup/linux/include/iupluafiledlg.h new file mode 100644 index 0000000..465886f --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iupluafiledlg.h @@ -0,0 +1,20 @@ +/** \file + * \brief Binding of new iupfiledlg to Lua. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPLUAFILEDLG_H +#define __IUPLUAFILEDLG_H + +#ifdef __cplusplus +extern "C" { +#endif + +int iupfiledlglua_open (lua_State * L); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/linux/include/iupluagl.h b/komodoeditor/libs/iup/linux/include/iupluagl.h new file mode 100644 index 0000000..db71d26 --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iupluagl.h @@ -0,0 +1,20 @@ +/** \file + * \brief Binding of iupglcanvas to Lua. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPLUAGL_H +#define __IUPLUAGL_H + +#ifdef __cplusplus +extern "C" { +#endif + +int iupgllua_open (lua_State * L); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/linux/include/iupluaglcontrols.h b/komodoeditor/libs/iup/linux/include/iupluaglcontrols.h new file mode 100644 index 0000000..ebec46b --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iupluaglcontrols.h @@ -0,0 +1,20 @@ +/** \file + * \brief iupglcontrols Binding for Lua. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPLUAGLCONTROLS_H +#define __IUPLUAGLCONTROLS_H + +#ifdef __cplusplus +extern "C" { +#endif + +int iupglcontrolslua_open (lua_State * L); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/linux/include/iupluaim.h b/komodoeditor/libs/iup/linux/include/iupluaim.h new file mode 100644 index 0000000..77c7670 --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iupluaim.h @@ -0,0 +1,20 @@ +/** \file + * \brief Bindig of iupim functions to Lua. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPLUAIM_H +#define __IUPLUAIM_H + +#ifdef __cplusplus +extern "C" { +#endif + +int iupimlua_open(lua_State * L); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/linux/include/iupluaole.h b/komodoeditor/libs/iup/linux/include/iupluaole.h new file mode 100644 index 0000000..6c3a23f --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iupluaole.h @@ -0,0 +1,20 @@ +/** \file + * \brief Binding of iupolecontrol to Lua. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPLUAOLE_H +#define __IUPLUAOLE_H + +#ifdef __cplusplus +extern "C" { +#endif + +int iupolelua_open (lua_State * L); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/linux/include/iupluascripterdlg.h b/komodoeditor/libs/iup/linux/include/iupluascripterdlg.h new file mode 100644 index 0000000..695ee29 --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iupluascripterdlg.h @@ -0,0 +1,25 @@ +/** \file + * \brief IupLuaScripterDlg dialog and Lua binding + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPLUASCRIPTERDLG_H +#define __IUPLUASCRIPTERDLG_H + +#ifdef __cplusplus +extern "C" { +#endif + +void IupLuaScripterDlgOpen(lua_State * L); + +Ihandle* IupLuaScripterDlg(void); + +/* Lua binding */ +int iupluascripterdlglua_open(lua_State * L); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/linux/include/iupluatuio.h b/komodoeditor/libs/iup/linux/include/iupluatuio.h new file mode 100644 index 0000000..334de4b --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iupluatuio.h @@ -0,0 +1,20 @@ +/** \file + * \brief Binding of iuptuio to Lua. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPLUATUIO_H +#define __IUPLUATUIO_H + +#ifdef __cplusplus +extern "C" { +#endif + +int iuptuiolua_open (lua_State * L); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/linux/include/iupluaweb.h b/komodoeditor/libs/iup/linux/include/iupluaweb.h new file mode 100644 index 0000000..0556d98 --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iupluaweb.h @@ -0,0 +1,42 @@ +/** \file + * \brief Binding of iupwebbrowser to Lua. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPLUAWEB_H +#define __IUPLUAWEB_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef DOXYGEN_SHOULD_IGNORE_THIS +/** @cond DOXYGEN_SHOULD_IGNORE_THIS */ +#ifndef IUPLUAWEB_API +#ifdef IUPLUAWEB_BUILD_LIBRARY + #ifdef __EMSCRIPTEN__ + #include + #define IUPLUAWEB_API EMSCRIPTEN_KEEPALIVE + #elif WIN32 + #define IUPLUAWEB_API __declspec(dllexport) + #elif defined(__GNUC__) && __GNUC__ >= 4 + #define IUPLUAWEB_API __attribute__ ((visibility("default"))) + #else + #define IUPLUAWEB_API + #endif +#else + #define IUPLUAWEB_API +#endif /* IUPLUAWEB_BUILD_LIBRARY */ +#endif /* IUPLUAWEB_API */ +/** @endcond DOXYGEN_SHOULD_IGNORE_THIS */ +#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ + + +IUPLUAWEB_API int iupweblua_open (lua_State * L); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/linux/include/iupole.h b/komodoeditor/libs/iup/linux/include/iupole.h new file mode 100644 index 0000000..4e7aed3 --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iupole.h @@ -0,0 +1,45 @@ +/** \file + * \brief Ole control. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPOLE_H +#define __IUPOLE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef DOXYGEN_SHOULD_IGNORE_THIS + /** @cond DOXYGEN_SHOULD_IGNORE_THIS */ +#ifndef IUPOLE_API +#ifdef IUPOLE_BUILD_LIBRARY +#ifdef __EMSCRIPTEN__ +#include +#define IUPOLE_API EMSCRIPTEN_KEEPALIVE +#elif WIN32 +#define IUPOLE_API __declspec(dllexport) +#elif defined(__GNUC__) && __GNUC__ >= 4 +#define IUPOLE_API __attribute__ ((visibility("default"))) +#else +#define IUPOLE_API +#endif +#else +#define IUPOLE_API +#endif /* IUP_BUILD_LIBRARY */ +#endif /* IUPOLE_API */ + /** @endcond DOXYGEN_SHOULD_IGNORE_THIS */ +#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ + + +IUPOLE_API Ihandle *IupOleControl(const char* progid); + +IUPOLE_API int IupOleControlOpen(void); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/linux/include/iuptuio.h b/komodoeditor/libs/iup/linux/include/iuptuio.h new file mode 100644 index 0000000..4638181 --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iuptuio.h @@ -0,0 +1,21 @@ +/** \file + * \brief IupTuioClient control + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPTUIO_H +#define __IUPTUIO_H + +#if defined(__cplusplus) +extern "C" { +#endif + +int IupTuioOpen(void); +Ihandle* IupTuioClient(int port); + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/linux/include/iupweb.h b/komodoeditor/libs/iup/linux/include/iupweb.h new file mode 100644 index 0000000..3b72838 --- /dev/null +++ b/komodoeditor/libs/iup/linux/include/iupweb.h @@ -0,0 +1,45 @@ +/** \file + * \brief Web control. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPWEB_H +#define __IUPWEB_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef DOXYGEN_SHOULD_IGNORE_THIS +/** @cond DOXYGEN_SHOULD_IGNORE_THIS */ +#ifndef IUPWEB_API +#ifdef IUPWEB_BUILD_LIBRARY + #ifdef __EMSCRIPTEN__ + #include + #define IUPWEB_API EMSCRIPTEN_KEEPALIVE + #elif WIN32 + #define IUPWEB_API __declspec(dllexport) + #elif defined(__GNUC__) && __GNUC__ >= 4 + #define IUPWEB_API __attribute__ ((visibility("default"))) + #else + #define IUPWEB_API + #endif +#else + #define IUPWEB_API +#endif /* IUP_BUILD_LIBRARY */ +#endif /* IUPWEB_API */ +/** @endcond DOXYGEN_SHOULD_IGNORE_THIS */ +#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ + + +IUPWEB_API int IupWebBrowserOpen(void); + +IUPWEB_API Ihandle *IupWebBrowser(void); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/linux/libiup.a b/komodoeditor/libs/iup/linux/libiup.a new file mode 100644 index 0000000..9392d8f Binary files /dev/null and b/komodoeditor/libs/iup/linux/libiup.a differ diff --git a/komodoeditor/libs/iup/linux/libiup.so b/komodoeditor/libs/iup/linux/libiup.so new file mode 100644 index 0000000..54e84b9 Binary files /dev/null and b/komodoeditor/libs/iup/linux/libiup.so differ diff --git a/komodoeditor/libs/iup/linux/libiup_mglplot.a b/komodoeditor/libs/iup/linux/libiup_mglplot.a new file mode 100644 index 0000000..d9a421c Binary files /dev/null and b/komodoeditor/libs/iup/linux/libiup_mglplot.a differ diff --git a/komodoeditor/libs/iup/linux/libiup_mglplot.so b/komodoeditor/libs/iup/linux/libiup_mglplot.so new file mode 100644 index 0000000..ca8e99d Binary files /dev/null and b/komodoeditor/libs/iup/linux/libiup_mglplot.so differ diff --git a/komodoeditor/libs/iup/linux/libiup_plot.a b/komodoeditor/libs/iup/linux/libiup_plot.a new file mode 100644 index 0000000..ab5b2d9 Binary files /dev/null and b/komodoeditor/libs/iup/linux/libiup_plot.a differ diff --git a/komodoeditor/libs/iup/linux/libiup_plot.so b/komodoeditor/libs/iup/linux/libiup_plot.so new file mode 100644 index 0000000..0e6a180 Binary files /dev/null and b/komodoeditor/libs/iup/linux/libiup_plot.so differ diff --git a/komodoeditor/libs/iup/linux/libiup_scintilla.a b/komodoeditor/libs/iup/linux/libiup_scintilla.a new file mode 100644 index 0000000..398a984 Binary files /dev/null and b/komodoeditor/libs/iup/linux/libiup_scintilla.a differ diff --git a/komodoeditor/libs/iup/linux/libiup_scintilla.so b/komodoeditor/libs/iup/linux/libiup_scintilla.so new file mode 100644 index 0000000..93320d0 Binary files /dev/null and b/komodoeditor/libs/iup/linux/libiup_scintilla.so differ diff --git a/komodoeditor/libs/iup/linux/libiupcd.a b/komodoeditor/libs/iup/linux/libiupcd.a new file mode 100644 index 0000000..87350e2 Binary files /dev/null and b/komodoeditor/libs/iup/linux/libiupcd.a differ diff --git a/komodoeditor/libs/iup/linux/libiupcd.so b/komodoeditor/libs/iup/linux/libiupcd.so new file mode 100644 index 0000000..8527dfd Binary files /dev/null and b/komodoeditor/libs/iup/linux/libiupcd.so differ diff --git a/komodoeditor/libs/iup/linux/libiupcontrols.a b/komodoeditor/libs/iup/linux/libiupcontrols.a new file mode 100644 index 0000000..8c49a7b Binary files /dev/null and b/komodoeditor/libs/iup/linux/libiupcontrols.a differ diff --git a/komodoeditor/libs/iup/linux/libiupcontrols.so b/komodoeditor/libs/iup/linux/libiupcontrols.so new file mode 100644 index 0000000..e4d93d0 Binary files /dev/null and b/komodoeditor/libs/iup/linux/libiupcontrols.so differ diff --git a/komodoeditor/libs/iup/linux/libiupgl.a b/komodoeditor/libs/iup/linux/libiupgl.a new file mode 100644 index 0000000..3e8dad4 Binary files /dev/null and b/komodoeditor/libs/iup/linux/libiupgl.a differ diff --git a/komodoeditor/libs/iup/linux/libiupgl.so b/komodoeditor/libs/iup/linux/libiupgl.so new file mode 100644 index 0000000..eff9e3e Binary files /dev/null and b/komodoeditor/libs/iup/linux/libiupgl.so differ diff --git a/komodoeditor/libs/iup/linux/libiupglcontrols.a b/komodoeditor/libs/iup/linux/libiupglcontrols.a new file mode 100644 index 0000000..c9fb40c Binary files /dev/null and b/komodoeditor/libs/iup/linux/libiupglcontrols.a differ diff --git a/komodoeditor/libs/iup/linux/libiupglcontrols.so b/komodoeditor/libs/iup/linux/libiupglcontrols.so new file mode 100644 index 0000000..6f7c265 Binary files /dev/null and b/komodoeditor/libs/iup/linux/libiupglcontrols.so differ diff --git a/komodoeditor/libs/iup/linux/libiupim.a b/komodoeditor/libs/iup/linux/libiupim.a new file mode 100644 index 0000000..8b377bd Binary files /dev/null and b/komodoeditor/libs/iup/linux/libiupim.a differ diff --git a/komodoeditor/libs/iup/linux/libiupim.so b/komodoeditor/libs/iup/linux/libiupim.so new file mode 100644 index 0000000..0294f81 Binary files /dev/null and b/komodoeditor/libs/iup/linux/libiupim.so differ diff --git a/komodoeditor/libs/iup/linux/libiupimglib.a b/komodoeditor/libs/iup/linux/libiupimglib.a new file mode 100644 index 0000000..90bacc4 Binary files /dev/null and b/komodoeditor/libs/iup/linux/libiupimglib.a differ diff --git a/komodoeditor/libs/iup/linux/libiupimglib.so b/komodoeditor/libs/iup/linux/libiupimglib.so new file mode 100644 index 0000000..269b67e Binary files /dev/null and b/komodoeditor/libs/iup/linux/libiupimglib.so differ diff --git a/komodoeditor/libs/iup/linux/libiuptuio.a b/komodoeditor/libs/iup/linux/libiuptuio.a new file mode 100644 index 0000000..446509a Binary files /dev/null and b/komodoeditor/libs/iup/linux/libiuptuio.a differ diff --git a/komodoeditor/libs/iup/linux/libiuptuio.so b/komodoeditor/libs/iup/linux/libiuptuio.so new file mode 100644 index 0000000..587b886 Binary files /dev/null and b/komodoeditor/libs/iup/linux/libiuptuio.so differ diff --git a/komodoeditor/libs/iup/linux/libiupweb.a b/komodoeditor/libs/iup/linux/libiupweb.a new file mode 100644 index 0000000..7f2e81f Binary files /dev/null and b/komodoeditor/libs/iup/linux/libiupweb.a differ diff --git a/komodoeditor/libs/iup/linux/libiupweb.so b/komodoeditor/libs/iup/linux/libiupweb.so new file mode 100644 index 0000000..5047672 Binary files /dev/null and b/komodoeditor/libs/iup/linux/libiupweb.so differ diff --git a/komodoeditor/libs/iup/windows/freetype6.dll b/komodoeditor/libs/iup/windows/freetype6.dll new file mode 100644 index 0000000..53f0a3f Binary files /dev/null and b/komodoeditor/libs/iup/windows/freetype6.dll differ diff --git a/komodoeditor/libs/iup/windows/freetype6.lib b/komodoeditor/libs/iup/windows/freetype6.lib new file mode 100644 index 0000000..2bdb7cd Binary files /dev/null and b/komodoeditor/libs/iup/windows/freetype6.lib differ diff --git a/komodoeditor/libs/iup/windows/ftgl.dll b/komodoeditor/libs/iup/windows/ftgl.dll new file mode 100644 index 0000000..3dabdad Binary files /dev/null and b/komodoeditor/libs/iup/windows/ftgl.dll differ diff --git a/komodoeditor/libs/iup/windows/ftgl.lib b/komodoeditor/libs/iup/windows/ftgl.lib new file mode 100644 index 0000000..b7ff0a6 Binary files /dev/null and b/komodoeditor/libs/iup/windows/ftgl.lib differ diff --git a/komodoeditor/libs/iup/windows/include/iup.h b/komodoeditor/libs/iup/windows/include/iup.h new file mode 100644 index 0000000..5522a64 --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iup.h @@ -0,0 +1,516 @@ +/** \file + * \brief User API + * IUP - A Portable User Interface Toolkit + * Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil + * http://www.tecgraf.puc-rio.br/iup mailto:iup@tecgraf.puc-rio.br + * + * See Copyright Notice at the end of this file + */ + +#ifndef __IUP_H +#define __IUP_H + +#include "iupkey.h" +#include "iupdef.h" +#include "iup_export.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +#define IUP_NAME "IUP - Portable User Interface" +#define IUP_DESCRIPTION "Multi-platform Toolkit for Building Graphical User Interfaces" +#define IUP_COPYRIGHT "Copyright (C) 1994-2020 Tecgraf/PUC-Rio" +#define IUP_VERSION "3.30" /* bug fixes are reported only by IupVersion functions */ +#define IUP_VERSION_NUMBER 330000 +#define IUP_VERSION_DATE "2020/07/30" /* does not include bug fix releases */ + +typedef struct Ihandle_ Ihandle; +typedef int (*Icallback)(Ihandle*); + + +/************************************************************************/ +/* Main API */ +/************************************************************************/ + +IUP_API int IupOpen (int *argc, char ***argv); +IUP_API void IupClose (void); +IUP_API int IupIsOpened (void); + +IUPIMGLIB_API void IupImageLibOpen(void); + +IUP_API int IupMainLoop (void); +IUP_API int IupLoopStep (void); +IUP_API int IupLoopStepWait (void); +IUP_API int IupMainLoopLevel (void); +IUP_API void IupFlush (void); +IUP_API void IupExitLoop (void); +IUP_API void IupPostMessage (Ihandle* ih, const char* s, int i, double d, void* p); + +IUP_API int IupRecordInput(const char* filename, int mode); +IUP_API int IupPlayInput(const char* filename); + +IUP_API void IupUpdate (Ihandle* ih); +IUP_API void IupUpdateChildren(Ihandle* ih); +IUP_API void IupRedraw (Ihandle* ih, int children); +IUP_API void IupRefresh (Ihandle* ih); +IUP_API void IupRefreshChildren(Ihandle* ih); + +IUP_API int IupExecute(const char *filename, const char* parameters); +IUP_API int IupExecuteWait(const char *filename, const char* parameters); +IUP_API int IupHelp(const char* url); +IUP_API void IupLog(const char* type, const char* format, ...); + +IUP_API char* IupLoad (const char *filename); +IUP_API char* IupLoadBuffer (const char *buffer); + +IUP_API char* IupVersion (void); +IUP_API char* IupVersionDate (void); +IUP_API int IupVersionNumber (void); +IUP_API void IupVersionShow (void); + +IUP_API void IupSetLanguage (const char *lng); +IUP_API char* IupGetLanguage (void); +IUP_API void IupSetLanguageString(const char* name, const char* str); +IUP_API void IupStoreLanguageString(const char* name, const char* str); +IUP_API char* IupGetLanguageString(const char* name); +IUP_API void IupSetLanguagePack(Ihandle* ih); + +IUP_API void IupDestroy (Ihandle* ih); +IUP_API void IupDetach (Ihandle* child); +IUP_API Ihandle* IupAppend (Ihandle* ih, Ihandle* child); +IUP_API Ihandle* IupInsert (Ihandle* ih, Ihandle* ref_child, Ihandle* child); +IUP_API Ihandle* IupGetChild (Ihandle* ih, int pos); +IUP_API int IupGetChildPos (Ihandle* ih, Ihandle* child); +IUP_API int IupGetChildCount(Ihandle* ih); +IUP_API Ihandle* IupGetNextChild (Ihandle* ih, Ihandle* child); +IUP_API Ihandle* IupGetBrother (Ihandle* ih); +IUP_API Ihandle* IupGetParent (Ihandle* ih); +IUP_API Ihandle* IupGetDialog (Ihandle* ih); +IUP_API Ihandle* IupGetDialogChild(Ihandle* ih, const char* name); +IUP_API int IupReparent (Ihandle* ih, Ihandle* new_parent, Ihandle* ref_child); + +IUP_API int IupPopup (Ihandle* ih, int x, int y); +IUP_API int IupShow (Ihandle* ih); +IUP_API int IupShowXY (Ihandle* ih, int x, int y); +IUP_API int IupHide (Ihandle* ih); +IUP_API int IupMap (Ihandle* ih); +IUP_API void IupUnmap (Ihandle* ih); + +IUP_API void IupResetAttribute(Ihandle* ih, const char* name); +IUP_API int IupGetAllAttributes(Ihandle* ih, char** names, int n); +IUP_API void IupCopyAttributes(Ihandle* src_ih, Ihandle* dst_ih); +IUP_API Ihandle* IupSetAtt(const char* handle_name, Ihandle* ih, const char* name, ...); +IUP_API Ihandle* IupSetAttributes (Ihandle* ih, const char *str); +IUP_API char* IupGetAttributes (Ihandle* ih); + +IUP_API void IupSetAttribute (Ihandle* ih, const char* name, const char* value); +IUP_API void IupSetStrAttribute(Ihandle* ih, const char* name, const char* value); +IUP_API void IupSetStrf (Ihandle* ih, const char* name, const char* format, ...); +IUP_API void IupSetInt (Ihandle* ih, const char* name, int value); +IUP_API void IupSetFloat (Ihandle* ih, const char* name, float value); +IUP_API void IupSetDouble (Ihandle* ih, const char* name, double value); +IUP_API void IupSetRGB (Ihandle* ih, const char* name, unsigned char r, unsigned char g, unsigned char b); +IUP_API void IupSetRGBA (Ihandle* ih, const char* name, unsigned char r, unsigned char g, unsigned char b, unsigned char a); + +IUP_API char* IupGetAttribute(Ihandle* ih, const char* name); +IUP_API int IupGetInt (Ihandle* ih, const char* name); +IUP_API int IupGetInt2 (Ihandle* ih, const char* name); +IUP_API int IupGetIntInt (Ihandle* ih, const char* name, int *i1, int *i2); +IUP_API float IupGetFloat (Ihandle* ih, const char* name); +IUP_API double IupGetDouble(Ihandle* ih, const char* name); +IUP_API void IupGetRGB (Ihandle* ih, const char* name, unsigned char *r, unsigned char *g, unsigned char *b); +IUP_API void IupGetRGBA (Ihandle* ih, const char* name, unsigned char *r, unsigned char *g, unsigned char *b, unsigned char *a); + +IUP_API void IupSetAttributeId(Ihandle* ih, const char* name, int id, const char *value); +IUP_API void IupSetStrAttributeId(Ihandle* ih, const char* name, int id, const char *value); +IUP_API void IupSetStrfId(Ihandle* ih, const char* name, int id, const char* format, ...); +IUP_API void IupSetIntId(Ihandle* ih, const char* name, int id, int value); +IUP_API void IupSetFloatId(Ihandle* ih, const char* name, int id, float value); +IUP_API void IupSetDoubleId(Ihandle* ih, const char* name, int id, double value); +IUP_API void IupSetRGBId(Ihandle* ih, const char* name, int id, unsigned char r, unsigned char g, unsigned char b); + +IUP_API char* IupGetAttributeId(Ihandle* ih, const char* name, int id); +IUP_API int IupGetIntId(Ihandle* ih, const char* name, int id); +IUP_API float IupGetFloatId(Ihandle* ih, const char* name, int id); +IUP_API double IupGetDoubleId(Ihandle* ih, const char* name, int id); +IUP_API void IupGetRGBId(Ihandle* ih, const char* name, int id, unsigned char *r, unsigned char *g, unsigned char *b); + +IUP_API void IupSetAttributeId2(Ihandle* ih, const char* name, int lin, int col, const char* value); +IUP_API void IupSetStrAttributeId2(Ihandle* ih, const char* name, int lin, int col, const char* value); +IUP_API void IupSetStrfId2(Ihandle* ih, const char* name, int lin, int col, const char* format, ...); +IUP_API void IupSetIntId2(Ihandle* ih, const char* name, int lin, int col, int value); +IUP_API void IupSetFloatId2(Ihandle* ih, const char* name, int lin, int col, float value); +IUP_API void IupSetDoubleId2(Ihandle* ih, const char* name, int lin, int col, double value); +IUP_API void IupSetRGBId2(Ihandle* ih, const char* name, int lin, int col, unsigned char r, unsigned char g, unsigned char b); + +IUP_API char* IupGetAttributeId2(Ihandle* ih, const char* name, int lin, int col); +IUP_API int IupGetIntId2(Ihandle* ih, const char* name, int lin, int col); +IUP_API float IupGetFloatId2(Ihandle* ih, const char* name, int lin, int col); +IUP_API double IupGetDoubleId2(Ihandle* ih, const char* name, int lin, int col); +IUP_API void IupGetRGBId2(Ihandle* ih, const char* name, int lin, int col, unsigned char *r, unsigned char *g, unsigned char *b); + +IUP_API void IupSetGlobal (const char* name, const char* value); +IUP_API void IupSetStrGlobal(const char* name, const char* value); +IUP_API char* IupGetGlobal (const char* name); + +IUP_API Ihandle* IupSetFocus (Ihandle* ih); +IUP_API Ihandle* IupGetFocus (void); +IUP_API Ihandle* IupPreviousField(Ihandle* ih); +IUP_API Ihandle* IupNextField (Ihandle* ih); + +IUP_API Icallback IupGetCallback (Ihandle* ih, const char *name); +IUP_API Icallback IupSetCallback (Ihandle* ih, const char *name, Icallback func); +IUP_API Ihandle* IupSetCallbacks(Ihandle* ih, const char *name, Icallback func, ...); + +IUP_API Icallback IupGetFunction(const char *name); +IUP_API Icallback IupSetFunction(const char *name, Icallback func); + +IUP_API Ihandle* IupGetHandle (const char *name); +IUP_API Ihandle* IupSetHandle (const char *name, Ihandle* ih); +IUP_API int IupGetAllNames (char** names, int n); +IUP_API int IupGetAllDialogs(char** names, int n); +IUP_API char* IupGetName (Ihandle* ih); + +IUP_API void IupSetAttributeHandle(Ihandle* ih, const char* name, Ihandle* ih_named); +IUP_API Ihandle* IupGetAttributeHandle(Ihandle* ih, const char* name); +IUP_API void IupSetAttributeHandleId(Ihandle* ih, const char* name, int id, Ihandle* ih_named); +IUP_API Ihandle* IupGetAttributeHandleId(Ihandle* ih, const char* name, int id); +IUP_API void IupSetAttributeHandleId2(Ihandle* ih, const char* name, int lin, int col, Ihandle* ih_named); +IUP_API Ihandle* IupGetAttributeHandleId2(Ihandle* ih, const char* name, int lin, int col); + +IUP_API char* IupGetClassName(Ihandle* ih); +IUP_API char* IupGetClassType(Ihandle* ih); +IUP_API int IupGetAllClasses(char** names, int n); +IUP_API int IupGetClassAttributes(const char* classname, char** names, int n); +IUP_API int IupGetClassCallbacks(const char* classname, char** names, int n); +IUP_API void IupSaveClassAttributes(Ihandle* ih); +IUP_API void IupCopyClassAttributes(Ihandle* src_ih, Ihandle* dst_ih); +IUP_API void IupSetClassDefaultAttribute(const char* classname, const char *name, const char* value); +IUP_API int IupClassMatch(Ihandle* ih, const char* classname); + +IUP_API Ihandle* IupCreate (const char *classname); +IUP_API Ihandle* IupCreatev(const char *classname, void* *params); +IUP_API Ihandle* IupCreatep(const char *classname, void* first, ...); + +/************************************************************************/ +/* Elements */ +/************************************************************************/ + +IUP_API Ihandle* IupFill (void); +IUP_API Ihandle* IupSpace(void); + +IUP_API Ihandle* IupRadio (Ihandle* child); +IUP_API Ihandle* IupVbox (Ihandle* child, ...); +IUP_API Ihandle* IupVboxv (Ihandle* *children); +IUP_API Ihandle* IupZbox (Ihandle* child, ...); +IUP_API Ihandle* IupZboxv (Ihandle* *children); +IUP_API Ihandle* IupHbox (Ihandle* child, ...); +IUP_API Ihandle* IupHboxv (Ihandle* *children); + +IUP_API Ihandle* IupNormalizer (Ihandle* ih_first, ...); +IUP_API Ihandle* IupNormalizerv(Ihandle* *ih_list); + +IUP_API Ihandle* IupCbox (Ihandle* child, ...); +IUP_API Ihandle* IupCboxv (Ihandle* *children); +IUP_API Ihandle* IupSbox (Ihandle* child); +IUP_API Ihandle* IupSplit (Ihandle* child1, Ihandle* child2); +IUP_API Ihandle* IupScrollBox (Ihandle* child); +IUP_API Ihandle* IupFlatScrollBox(Ihandle* child); +IUP_API Ihandle* IupGridBox (Ihandle* child, ...); +IUP_API Ihandle* IupGridBoxv (Ihandle* *children); +IUP_API Ihandle* IupMultiBox (Ihandle* child, ...); +IUP_API Ihandle* IupMultiBoxv (Ihandle **children); +IUP_API Ihandle* IupExpander(Ihandle* child); +IUP_API Ihandle* IupDetachBox (Ihandle* child); +IUP_API Ihandle* IupBackgroundBox(Ihandle* child); + +IUP_API Ihandle* IupFrame (Ihandle* child); +IUP_API Ihandle* IupFlatFrame (Ihandle* child); + +IUP_API Ihandle* IupImage (int width, int height, const unsigned char* pixels); +IUP_API Ihandle* IupImageRGB (int width, int height, const unsigned char* pixels); +IUP_API Ihandle* IupImageRGBA (int width, int height, const unsigned char* pixels); + +IUP_API Ihandle* IupItem (const char* title, const char* action); +IUP_API Ihandle* IupSubmenu (const char* title, Ihandle* child); +IUP_API Ihandle* IupSeparator (void); +IUP_API Ihandle* IupMenu (Ihandle* child, ...); +IUP_API Ihandle* IupMenuv (Ihandle* *children); + +IUP_API Ihandle* IupButton (const char* title, const char* action); +IUP_API Ihandle* IupFlatButton (const char* title); +IUP_API Ihandle* IupFlatToggle (const char* title); +IUP_API Ihandle* IupDropButton (Ihandle* dropchild); +IUP_API Ihandle* IupFlatLabel (const char* title); +IUP_API Ihandle* IupFlatSeparator(void); +IUP_API Ihandle* IupCanvas (const char* action); +IUP_API Ihandle* IupDialog (Ihandle* child); +IUP_API Ihandle* IupUser (void); +IUP_API Ihandle* IupThread (void); +IUP_API Ihandle* IupLabel (const char* title); +IUP_API Ihandle* IupList (const char* action); +IUP_API Ihandle* IupFlatList (void); +IUP_API Ihandle* IupText (const char* action); +IUP_API Ihandle* IupMultiLine (const char* action); +IUP_API Ihandle* IupToggle (const char* title, const char* action); +IUP_API Ihandle* IupTimer (void); +IUP_API Ihandle* IupClipboard (void); +IUP_API Ihandle* IupProgressBar(void); +IUP_API Ihandle* IupVal (const char *type); +IUP_API Ihandle* IupFlatVal (const char *type); +IUP_API Ihandle* IupFlatTree (void); +IUP_API Ihandle* IupTabs (Ihandle* child, ...); +IUP_API Ihandle* IupTabsv (Ihandle* *children); +IUP_API Ihandle* IupFlatTabs (Ihandle* first, ...); +IUP_API Ihandle* IupFlatTabsv (Ihandle* *children); +IUP_API Ihandle* IupTree (void); +IUP_API Ihandle* IupLink (const char* url, const char* title); +IUP_API Ihandle* IupAnimatedLabel(Ihandle* animation); +IUP_API Ihandle* IupDatePick (void); +IUP_API Ihandle* IupCalendar (void); +IUP_API Ihandle* IupColorbar (void); +IUP_API Ihandle* IupGauge (void); +IUP_API Ihandle* IupDial (const char* type); +IUP_API Ihandle* IupColorBrowser(void); + +/* Old controls, use SPIN attribute of IupText */ +IUP_API Ihandle* IupSpin (void); +IUP_API Ihandle* IupSpinbox (Ihandle* child); + + +/************************************************************************/ +/* Utilities */ +/************************************************************************/ + +/* String compare utility */ +IUP_API int IupStringCompare(const char* str1, const char* str2, int casesensitive, int lexicographic); + +/* IupImage utilities */ +IUP_API int IupSaveImageAsText(Ihandle* ih, const char* filename, const char* format, const char* name); +IUP_API Ihandle* IupImageGetHandle(const char* name); + +/* IupText and IupScintilla utilities */ +IUP_API void IupTextConvertLinColToPos(Ihandle* ih, int lin, int col, int *pos); +IUP_API void IupTextConvertPosToLinCol(Ihandle* ih, int pos, int *lin, int *col); + +/* IupText, IupList, IupTree, IupMatrix and IupScintilla utility */ +IUP_API int IupConvertXYToPos(Ihandle* ih, int x, int y); + +/* OLD names, kept for backward compatibility, will never be removed. */ +IUP_API void IupStoreGlobal(const char* name, const char* value); +IUP_API void IupStoreAttribute(Ihandle* ih, const char* name, const char* value); +IUP_API void IupSetfAttribute(Ihandle* ih, const char* name, const char* format, ...); +IUP_API void IupStoreAttributeId(Ihandle* ih, const char* name, int id, const char *value); +IUP_API void IupSetfAttributeId(Ihandle* ih, const char* name, int id, const char* f, ...); +IUP_API void IupStoreAttributeId2(Ihandle* ih, const char* name, int lin, int col, const char* value); +IUP_API void IupSetfAttributeId2(Ihandle* ih, const char* name, int lin, int col, const char* format, ...); + +/* IupTree and IupFlatTree utilities (work for both) */ +IUP_API int IupTreeSetUserId(Ihandle* ih, int id, void* userid); +IUP_API void* IupTreeGetUserId(Ihandle* ih, int id); +IUP_API int IupTreeGetId(Ihandle* ih, void *userid); +IUP_API void IupTreeSetAttributeHandle(Ihandle* ih, const char* name, int id, Ihandle* ih_named); /* deprecated, use IupSetAttributeHandleId */ + + +/************************************************************************/ +/* Pre-defined dialogs */ +/************************************************************************/ + +IUP_API Ihandle* IupFileDlg(void); +IUP_API Ihandle* IupMessageDlg(void); +IUP_API Ihandle* IupColorDlg(void); +IUP_API Ihandle* IupFontDlg(void); +IUP_API Ihandle* IupProgressDlg(void); + +IUP_API int IupGetFile(char *arq); +IUP_API void IupMessage(const char *title, const char *msg); +IUP_API void IupMessagef(const char *title, const char *format, ...); +IUP_API void IupMessageError(Ihandle* parent, const char* message); +IUP_API int IupMessageAlarm(Ihandle* parent, const char* title, const char *message, const char *buttons); +IUP_API int IupAlarm(const char *title, const char *msg, const char *b1, const char *b2, const char *b3); +IUP_API int IupScanf(const char *format, ...); +IUP_API int IupListDialog(int type, const char *title, int size, const char** list, + int op, int max_col, int max_lin, int* marks); +IUP_API int IupGetText(const char* title, char* text, int maxsize); +IUP_API int IupGetColor(int x, int y, unsigned char* r, unsigned char* g, unsigned char* b); + +typedef int (*Iparamcb)(Ihandle* dialog, int param_index, void* user_data); +IUP_API int IupGetParam(const char* title, Iparamcb action, void* user_data, const char* format,...); +IUP_API int IupGetParamv(const char* title, Iparamcb action, void* user_data, const char* format, int param_count, int param_extra, void** param_data); +IUP_API Ihandle* IupParam(const char* format); +IUP_API Ihandle* IupParamBox(Ihandle* param, ...); +IUP_API Ihandle* IupParamBoxv(Ihandle* *param_array); + +IUP_API Ihandle* IupLayoutDialog(Ihandle* dialog); +IUP_API Ihandle* IupElementPropertiesDialog(Ihandle* parent, Ihandle* elem); +IUP_API Ihandle* IupGlobalsDialog(void); +IUP_API Ihandle* IupClassInfoDialog(Ihandle* parent); + + +#ifdef __cplusplus +} +#endif + +/************************************************************************/ +/* Common Flags and Return Values */ +/************************************************************************/ +#define IUP_ERROR 1 +#define IUP_NOERROR 0 +#define IUP_OPENED -1 +#define IUP_INVALID -1 +#define IUP_INVALID_ID -10 + + +/************************************************************************/ +/* Callback Return Values */ +/************************************************************************/ +#define IUP_IGNORE -1 +#define IUP_DEFAULT -2 +#define IUP_CLOSE -3 +#define IUP_CONTINUE -4 + +/************************************************************************/ +/* IupPopup and IupShowXY Parameter Values */ +/************************************************************************/ +#define IUP_CENTER 0xFFFF /* 65535 */ +#define IUP_LEFT 0xFFFE /* 65534 */ +#define IUP_RIGHT 0xFFFD /* 65533 */ +#define IUP_MOUSEPOS 0xFFFC /* 65532 */ +#define IUP_CURRENT 0xFFFB /* 65531 */ +#define IUP_CENTERPARENT 0xFFFA /* 65530 */ +#define IUP_LEFTPARENT 0xFFF9 /* 65529 */ +#define IUP_RIGHTPARENT 0xFFF8 /* 65528 */ +#define IUP_TOP IUP_LEFT +#define IUP_BOTTOM IUP_RIGHT +#define IUP_TOPPARENT IUP_LEFTPARENT +#define IUP_BOTTOMPARENT IUP_RIGHTPARENT + +/************************************************************************/ +/* SHOW_CB Callback Values */ +/************************************************************************/ +enum{IUP_SHOW, IUP_RESTORE, IUP_MINIMIZE, IUP_MAXIMIZE, IUP_HIDE}; + +/************************************************************************/ +/* SCROLL_CB Callback Values */ +/************************************************************************/ +enum{IUP_SBUP, IUP_SBDN, IUP_SBPGUP, IUP_SBPGDN, IUP_SBPOSV, IUP_SBDRAGV, + IUP_SBLEFT, IUP_SBRIGHT, IUP_SBPGLEFT, IUP_SBPGRIGHT, IUP_SBPOSH, IUP_SBDRAGH}; + +/************************************************************************/ +/* Mouse Button Values and Macros */ +/************************************************************************/ +#define IUP_BUTTON1 '1' +#define IUP_BUTTON2 '2' +#define IUP_BUTTON3 '3' +#define IUP_BUTTON4 '4' +#define IUP_BUTTON5 '5' + +#define iup_isshift(_s) (_s[0]=='S') +#define iup_iscontrol(_s) (_s[1]=='C') +#define iup_isbutton1(_s) (_s[2]=='1') +#define iup_isbutton2(_s) (_s[3]=='2') +#define iup_isbutton3(_s) (_s[4]=='3') +#define iup_isdouble(_s) (_s[5]=='D') +#define iup_isalt(_s) (_s[6]=='A') +#define iup_issys(_s) (_s[7]=='Y') +#define iup_isbutton4(_s) (_s[8]=='4') +#define iup_isbutton5(_s) (_s[9]=='5') + +/* Old definitions for backward compatibility */ +#define isshift iup_isshift +#define iscontrol iup_iscontrol +#define isbutton1 iup_isbutton1 +#define isbutton2 iup_isbutton2 +#define isbutton3 iup_isbutton3 +#define isdouble iup_isdouble +#define isalt iup_isalt +#define issys iup_issys +#define isbutton4 iup_isbutton4 +#define isbutton5 iup_isbutton5 + + +/************************************************************************/ +/* Pre-Defined Masks */ +/************************************************************************/ +#define IUP_MASK_FLOAT "[+/-]?(/d+/.?/d*|/./d+)" +#define IUP_MASK_UFLOAT "(/d+/.?/d*|/./d+)" +#define IUP_MASK_EFLOAT "[+/-]?(/d+/.?/d*|/./d+)([eE][+/-]?/d+)?" +#define IUP_MASK_UEFLOAT "(/d+/.?/d*|/./d+)([eE][+/-]?/d+)?" +#define IUP_MASK_FLOATCOMMA "[+/-]?(/d+/,?/d*|/,/d+)" +#define IUP_MASK_UFLOATCOMMA "(/d+/,?/d*|/,/d+)" +#define IUP_MASK_INT "[+/-]?/d+" +#define IUP_MASK_UINT "/d+" + +/* Old definitions for backward compatibility */ +#define IUPMASK_FLOAT IUP_MASK_FLOAT +#define IUPMASK_UFLOAT IUP_MASK_UFLOAT +#define IUPMASK_EFLOAT IUP_MASK_EFLOAT +#define IUPMASK_INT IUP_MASK_INT +#define IUPMASK_UINT IUP_MASK_UINT + + +/************************************************************************/ +/* IupGetParam Callback situations */ +/************************************************************************/ +#define IUP_GETPARAM_BUTTON1 -1 +#define IUP_GETPARAM_INIT -2 +#define IUP_GETPARAM_BUTTON2 -3 +#define IUP_GETPARAM_BUTTON3 -4 +#define IUP_GETPARAM_CLOSE -5 +#define IUP_GETPARAM_MAP -6 +#define IUP_GETPARAM_OK IUP_GETPARAM_BUTTON1 +#define IUP_GETPARAM_CANCEL IUP_GETPARAM_BUTTON2 +#define IUP_GETPARAM_HELP IUP_GETPARAM_BUTTON3 + +/************************************************************************/ +/* Used by IupColorbar */ +/************************************************************************/ +#define IUP_PRIMARY -1 +#define IUP_SECONDARY -2 + +/************************************************************************/ +/* Record Input Modes */ +/************************************************************************/ +enum {IUP_RECBINARY, IUP_RECTEXT}; + + +/************************************************************************/ +/* Replacement for the WinMain in Windows, */ +/* this allows the application to start from "main". */ +/* Used only for Watcom. */ +/************************************************************************/ +#if defined (__WATCOMC__) +#ifdef __cplusplus +extern "C" { +int IupMain (int argc, char** argv); /* In C++ we have to declare the prototype */ +} +#endif +#define main IupMain /* this is the trick for Watcom and MetroWerks */ +#endif + +/****************************************************************************** +* Copyright (C) 1994-2019 Tecgraf/PUC-Rio. +* +* Permission is hereby granted, free of charge, to any person obtaining +* a copy of this software and associated documentation files (the +* "Software"), to deal in the Software without restriction, including +* without limitation the rights to use, copy, modify, merge, publish, +* distribute, sublicense, and/or sell copies of the Software, and to +* permit persons to whom the Software is furnished to do so, subject to +* the following conditions: +* +* The above copyright notice and this permission notice shall be +* included in all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +******************************************************************************/ + +#endif diff --git a/komodoeditor/libs/iup/windows/include/iup_class_cbs.hpp b/komodoeditor/libs/iup/windows/include/iup_class_cbs.hpp new file mode 100644 index 0000000..237ae9e --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iup_class_cbs.hpp @@ -0,0 +1,464 @@ +/** \file + * \brief Class Callback Utilities. + */ + +#ifndef __IUP_CLASS_CBS_HPP +#define __IUP_CLASS_CBS_HPP + + +#define IUP_CLASS_GET_OBJECT(__ih, __class) dynamic_cast<__class*>((__class*)IupGetAttribute(__ih, #__class "->this")) + + +#define IUP_CLASS_INITCALLBACK(__ih, __class) \ + IupSetAttribute(__ih, #__class "->this", (char*)this) + +#define IUP_CLASS_SETCALLBACK(__ih, __name, __cb) \ + IupSetCallback(__ih, __name, (Icallback)CB_##__cb) + + + +#ifdef __IUP_PLUS_H + +#define IUP_PLUS_GET_OBJECT(__elem, __class) dynamic_cast<__class*>((__class*)IupGetAttribute(__elem.GetHandle(), #__class "->this")) + +#define IUP_PLUS_INITCALLBACK(__elem, __class) \ + IupSetAttribute(__elem.GetHandle(), #__class "->this", (char*)this) + +#define IUP_PLUS_SETCALLBACK(__elem, __name, __cb) \ + IupSetCallback(__elem.GetHandle(), __name, (Icallback)CB_##__cb) + +#endif + + + +#define IUP_CLASS_DECLARECALLBACK_IFn(__class, __cb) \ + int __cb(Ihandle* ih); \ +static int CB_##__cb(Ihandle* ih) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFni(__class, __cb) \ + int __cb(Ihandle* ih, int i1); \ +static int CB_##__cb(Ihandle* ih, int i1) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFnii(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniii(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2, int i3); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2, int i3) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, i3); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniiii(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2, int i3, int i4); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2, int i3, int i4) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, i3, i4); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniiiii(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2, int i3, int i4, int i5); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2, int i3, int i4, int i5) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, i3, i4, i5); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniiiiii(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2, int i3, int i4, int i5, int i6); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2, int i3, int i4, int i5, int i6) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, i3, i4, i5, i6); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniiiiiiC(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2, int i3, int i4, int i5, int i6, struct _cdCanvas* canvas); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2, int i3, int i4, int i5, int i6, struct _cdCanvas* canvas) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, i3, i4, i5, i6, canvas); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFnC(__class, __cb) \ + int __cb(Ihandle* ih, struct _cdCanvas* canvas); \ +static int CB_##__cb(Ihandle* ih, struct _cdCanvas* canvas) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, canvas); \ +} + +#define IUP_CLASS_DECLARECALLBACK_dIFnii(__class, __cb) \ + double __cb(Ihandle* ih, int i1, int i2); \ +static double CB_##__cb(Ihandle* ih, int i1, int i2) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2); \ +} + +#define IUP_CLASS_DECLARECALLBACK_sIFni(__class, __cb) \ + char* __cb(Ihandle* ih, int i1); \ +static char* CB_##__cb(Ihandle* ih, int i1) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1); \ +} + +#define IUP_CLASS_DECLARECALLBACK_sIFnii(__class, __cb) \ + char* __cb(Ihandle* ih, int i1, int i2); \ +static char* CB_##__cb(Ihandle* ih, int i1, int i2) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2); \ +} + +#define IUP_CLASS_DECLARECALLBACK_sIFniis(__class, __cb) \ + char* __cb(Ihandle* ih, int i1, int i2, char* s); \ +static char* CB_##__cb(Ihandle* ih, int i1, int i2, char* s) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, s); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFnff(__class, __cb) \ + int __cb(Ihandle* ih, float f1, float f2); \ +static int CB_##__cb(Ihandle* ih, float f1, float f2) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, f1, f2); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniff(__class, __cb) \ + int __cb(Ihandle* ih, int i1, float f1, float f2); \ +static int CB_##__cb(Ihandle* ih, int i1, float f1, float f2) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, f1, f2); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFnfiis(__class, __cb) \ + int __cb(Ihandle* ih, float f1, int i1, int i2, char* s); \ +static int CB_##__cb(Ihandle* ih, float f1, int i1, int i2, char* s) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, f1, i1, i2, s); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFnd(__class, __cb) \ + int __cb(Ihandle* ih, double d1); \ +static int CB_##__cb(Ihandle* ih, double d1) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, d1); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFndds(__class, __cb) \ + int __cb(Ihandle* ih, double d1, double d2, char* s); \ +static int CB_##__cb(Ihandle* ih, double d1, double d2, char* s) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, d1, d2, s); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniid(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2, double d1); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2, double d1) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, d1); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniidd(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2, double d1, double d2); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2, double d1, double d2) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, d1, d2); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniiddi(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2, double d1, double d2, int i3); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2, double d1, double d2, int i3) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, d1, d2, i3); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniidds(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2, double d1, double d2, char* s); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2, double d1, double d2, char* s) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, d1, d2, s); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniiIII(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2, int *I1, int *I2, int *I3); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2, int *I1, int *I2, int *I3) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, I1, I2, I3); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniIIII(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int *I1, int *I2, int *I3, int *I4); \ +static int CB_##__cb(Ihandle* ih, int i1, int *I1, int *I2, int *I3, int *I4) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, I1, I2, I3, I4); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFnIi(__class, __cb) \ + int __cb(Ihandle* ih, int *I1, int i1); \ +static int CB_##__cb(Ihandle* ih, int *I1, int i1) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, I1, i1); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFnccc(__class, __cb) \ + int __cb(Ihandle* ih, char c1, char c2, char c3); \ +static int CB_##__cb(Ihandle* ih, char c1, char c2, char c3) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, c1, c2, c3); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFnis(__class, __cb) \ + int __cb(Ihandle* ih, int i1, char* s); \ +static int CB_##__cb(Ihandle* ih, int i1, char* s) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, s); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniis(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2, char* s); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2, char* s) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, s); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniiis(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2, int i3, char* s); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2, int i3, char* s) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, i3, s); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniiiis(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2, int i3, int i4, char* s); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2, int i3, int i4, char* s) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, i3, i4, s); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniiiiis(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2, int i3, int i4, int i5, char* s); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2, int i3, int i4, int i5, char* s) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, i3, i4, i5, s); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniiiiiis(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2, int i3, int i4, int i5, int i6, char* s); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2, int i3, int i4, int i5, int i6, char* s) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, i3, i4, i5, i6, s); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFnss(__class, __cb) \ + int __cb(Ihandle* ih, char* s1, char* s2); \ +static int CB_##__cb(Ihandle* ih, char* s1, char* s2) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, s1, s2); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFns(__class, __cb) \ + int __cb(Ihandle* ih, char* s1); \ +static int CB_##__cb(Ihandle* ih, char* s1) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, s1); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFnsi(__class, __cb) \ + int __cb(Ihandle* ih, char* s1, int i1); \ +static int CB_##__cb(Ihandle* ih, char* s1, int i1) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, s1, i1); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFnsii(__class, __cb) \ + int __cb(Ihandle* ih, char* s1, int i1, int i2); \ +static int CB_##__cb(Ihandle* ih, char* s1, int i1, int i2) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, s1, i1, i2); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFnsiii(__class, __cb) \ + int __cb(Ihandle* ih, char* s1, int i1, int i2, int i3); \ +static int CB_##__cb(Ihandle* ih, char* s1, int i1, int i2, int i3) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, s1, i1, i2, i3); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFnnii(__class, __cb) \ + int __cb(Ihandle* ih, Ihandle* ih1, int i1, int i2); \ +static int CB_##__cb(Ihandle* ih, Ihandle* ih1, int i1, int i2) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, ih1, i1, i2); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFnnn(__class, __cb) \ + int __cb(Ihandle* ih, Ihandle* ih1, Ihandle *ih2); \ +static int CB_##__cb(Ihandle* ih, Ihandle* ih1, Ihandle *ih2) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, ih1, ih2); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFniinsii(__class, __cb) \ + int __cb(Ihandle* ih, int i1, int i2, Ihandle* ih1, char* s, int i3, int i4); \ +static int CB_##__cb(Ihandle* ih, int i1, int i2, Ihandle* ih1, char* s, int i3, int i4) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, i1, i2, ih1, s, i3, i4); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFnsVi(__class, __cb) \ + int __cb(Ihandle* ih, char* s1, void* V1, int i1); \ +static int CB_##__cb(Ihandle* ih, char* s1, void* V1, int i1) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, s1, V1, i1); \ +} + +#define IUP_CLASS_DECLARECALLBACK_IFnsViii(__class, __cb) \ + int __cb(Ihandle* ih, char* s1, void* V1, int i1, int i2, int i3); \ +static int CB_##__cb(Ihandle* ih, char* s1, void* V1, int i1, int i2, int i3) \ +{ \ + __class* obj = IUP_CLASS_GET_OBJECT(ih, __class); \ + return obj->__cb(ih, s1, V1, i1, i2, i3); \ +} + + + +/* #define IUP_CLASS_DEBUG */ +#ifdef IUP_CLASS_DEBUG +class IUP_CLASS_DUMMY +{ + // Used to check for errors in the definitions + IUP_CLASS_DECLARECALLBACK_IFn(IUP_CLASS_DUMMY, IFn); + IUP_CLASS_DECLARECALLBACK_IFni(IUP_CLASS_DUMMY, IFni); + IUP_CLASS_DECLARECALLBACK_IFnii(IUP_CLASS_DUMMY, IFnii); + IUP_CLASS_DECLARECALLBACK_IFniii(IUP_CLASS_DUMMY, IFniii); + IUP_CLASS_DECLARECALLBACK_IFniiii(IUP_CLASS_DUMMY, IFniiii); + IUP_CLASS_DECLARECALLBACK_IFniiiii(IUP_CLASS_DUMMY, IFniiiii); + IUP_CLASS_DECLARECALLBACK_IFniiiiii(IUP_CLASS_DUMMY, IFniiiiii); + IUP_CLASS_DECLARECALLBACK_IFniiiiiiC(IUP_CLASS_DUMMY, IFniiiiiiC); + IUP_CLASS_DECLARECALLBACK_IFnC(IUP_CLASS_DUMMY, IFnC); + IUP_CLASS_DECLARECALLBACK_dIFnii(IUP_CLASS_DUMMY, dIFnii); + IUP_CLASS_DECLARECALLBACK_sIFni(IUP_CLASS_DUMMY, sIFni); + IUP_CLASS_DECLARECALLBACK_sIFnii(IUP_CLASS_DUMMY, sIFnii); + IUP_CLASS_DECLARECALLBACK_sIFniis(IUP_CLASS_DUMMY, sIFniis); + IUP_CLASS_DECLARECALLBACK_IFnff(IUP_CLASS_DUMMY, IFnff); + IUP_CLASS_DECLARECALLBACK_IFniff(IUP_CLASS_DUMMY, IFniff); + IUP_CLASS_DECLARECALLBACK_IFnfiis(IUP_CLASS_DUMMY, IFnfiis); + IUP_CLASS_DECLARECALLBACK_IFnd(IUP_CLASS_DUMMY, IFnd); + IUP_CLASS_DECLARECALLBACK_IFndds(IUP_CLASS_DUMMY, IFndds); + IUP_CLASS_DECLARECALLBACK_IFniid(IUP_CLASS_DUMMY, IFniid); + IUP_CLASS_DECLARECALLBACK_IFniidd(IUP_CLASS_DUMMY, IFniidd); + IUP_CLASS_DECLARECALLBACK_IFniiddi(IUP_CLASS_DUMMY, IFniiddi); + IUP_CLASS_DECLARECALLBACK_IFniidds(IUP_CLASS_DUMMY, IFniidds); + IUP_CLASS_DECLARECALLBACK_IFniiIII(IUP_CLASS_DUMMY, IFniiIII); + IUP_CLASS_DECLARECALLBACK_IFniIIII(IUP_CLASS_DUMMY, IFniIIII); + IUP_CLASS_DECLARECALLBACK_IFnIi(IUP_CLASS_DUMMY, IFnIi); + IUP_CLASS_DECLARECALLBACK_IFnccc(IUP_CLASS_DUMMY, IFnccc); + IUP_CLASS_DECLARECALLBACK_IFnis(IUP_CLASS_DUMMY, IFnis); + IUP_CLASS_DECLARECALLBACK_IFniis(IUP_CLASS_DUMMY, IFniis); + IUP_CLASS_DECLARECALLBACK_IFniiis(IUP_CLASS_DUMMY, IFniiis); + IUP_CLASS_DECLARECALLBACK_IFniiiis(IUP_CLASS_DUMMY, IFniiiis); + IUP_CLASS_DECLARECALLBACK_IFniiiiis(IUP_CLASS_DUMMY, IFniiiiis); + IUP_CLASS_DECLARECALLBACK_IFniiiiiis(IUP_CLASS_DUMMY, IFniiiiiis); + IUP_CLASS_DECLARECALLBACK_IFnss(IUP_CLASS_DUMMY, IFnss); + IUP_CLASS_DECLARECALLBACK_IFns(IUP_CLASS_DUMMY, IFns); + IUP_CLASS_DECLARECALLBACK_IFnsi(IUP_CLASS_DUMMY, IFnsi); + IUP_CLASS_DECLARECALLBACK_IFnsii(IUP_CLASS_DUMMY, IFnsii); + IUP_CLASS_DECLARECALLBACK_IFnsiii(IUP_CLASS_DUMMY, IFnsiii); + IUP_CLASS_DECLARECALLBACK_IFnnii(IUP_CLASS_DUMMY, IFnnii); + IUP_CLASS_DECLARECALLBACK_IFnnn(IUP_CLASS_DUMMY, IFnnn); + IUP_CLASS_DECLARECALLBACK_IFniinsii(IUP_CLASS_DUMMY, IFniinsii); + IUP_CLASS_DECLARECALLBACK_IFnsVi(IUP_CLASS_DUMMY, IFnsVi); + IUP_CLASS_DECLARECALLBACK_IFnsViii(IUP_CLASS_DUMMY, IFnsViii); +}; + +class SampleClass +{ + int sample_count; + +public: + SampleClass() + { + sample_count = 0; + + Ihandle* button1 = IupButton("Inc", NULL); + Ihandle* button2 = IupButton("Dec", NULL); + Ihandle* dialog = IupDialog(IupHbox(button1, button2, NULL)); + + // 1) Register "this" object as a callback receiver (need only once) + IUP_CLASS_INITCALLBACK(dialog, SampleClass); + + // 2) Associate the callback with the button + IUP_CLASS_SETCALLBACK(button1, "ACTION", ButtonAction1); + IUP_CLASS_SETCALLBACK(button2, "ACTION", ButtonAction2); + + IupShow(dialog); + }; + +protected: + // 3) Declare the callback as a member function + IUP_CLASS_DECLARECALLBACK_IFn(SampleClass, ButtonAction1); + IUP_CLASS_DECLARECALLBACK_IFn(SampleClass, ButtonAction2); +}; + +// 4) Define the callback as a member function +int SampleClass::ButtonAction1(Ihandle*) +{ + sample_count++; + return IUP_DEFAULT; +} +int SampleClass::ButtonAction2(Ihandle*) +{ + sample_count--; + return IUP_DEFAULT; +} + +#endif // IUP_CLASS_DEBUG + +#endif diff --git a/komodoeditor/libs/iup/windows/include/iup_config.h b/komodoeditor/libs/iup/windows/include/iup_config.h new file mode 100644 index 0000000..a70f7b5 --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iup_config.h @@ -0,0 +1,60 @@ +/** \file + * \brief Configuration file Utilities + * + * See Copyright Notice in "iup.h" + */ + +#ifndef IUP_CONFIG_H +#define IUP_CONFIG_H + +#if defined(__cplusplus) +extern "C" { +#endif + + +IUP_API Ihandle* IupConfig(void); + +IUP_API int IupConfigLoad(Ihandle* ih); +IUP_API int IupConfigSave(Ihandle* ih); + +/****************************************************************/ + +IUP_API void IupConfigSetVariableStr(Ihandle* ih, const char* group, const char* key, const char* value); +IUP_API void IupConfigSetVariableStrId(Ihandle* ih, const char* group, const char* key, int id, const char* value); +IUP_API void IupConfigSetVariableInt(Ihandle* ih, const char* group, const char* key, int value); +IUP_API void IupConfigSetVariableIntId(Ihandle* ih, const char* group, const char* key, int id, int value); +IUP_API void IupConfigSetVariableDouble(Ihandle* ih, const char* group, const char* key, double value); +IUP_API void IupConfigSetVariableDoubleId(Ihandle* ih, const char* group, const char* key, int id, double value); + +IUP_API const char* IupConfigGetVariableStr(Ihandle* ih, const char* group, const char* key); +IUP_API const char* IupConfigGetVariableStrId(Ihandle* ih, const char* group, const char* key, int id); +IUP_API int IupConfigGetVariableInt(Ihandle* ih, const char* group, const char* key); +IUP_API int IupConfigGetVariableIntId(Ihandle* ih, const char* group, const char* key, int id); +IUP_API double IupConfigGetVariableDouble(Ihandle* ih, const char* group, const char* key); +IUP_API double IupConfigGetVariableDoubleId(Ihandle* ih, const char* group, const char* key, int id); + +IUP_API const char* IupConfigGetVariableStrDef(Ihandle* ih, const char* group, const char* key, const char* def); +IUP_API const char* IupConfigGetVariableStrIdDef(Ihandle* ih, const char* group, const char* key, int id, const char* def); +IUP_API int IupConfigGetVariableIntDef(Ihandle* ih, const char* group, const char* key, int def); +IUP_API int IupConfigGetVariableIntIdDef(Ihandle* ih, const char* group, const char* key, int id, int def); +IUP_API double IupConfigGetVariableDoubleDef(Ihandle* ih, const char* group, const char* key, double def); +IUP_API double IupConfigGetVariableDoubleIdDef(Ihandle* ih, const char* group, const char* key, int id, double def); + +IUP_API void IupConfigCopy(Ihandle* ih1, Ihandle* ih2, const char* exclude_prefix); + +/****************************************************************/ + +IUP_API void IupConfigSetListVariable(Ihandle* ih, const char *group, const char* key, const char* value, int add); + +IUP_API void IupConfigRecentInit(Ihandle* ih, Ihandle* menu, Icallback recent_cb, int max_recent); +IUP_API void IupConfigRecentUpdate(Ihandle* ih, const char* filename); + +IUP_API void IupConfigDialogShow(Ihandle* ih, Ihandle* dialog, const char* name); +IUP_API void IupConfigDialogClosed(Ihandle* ih, Ihandle* dialog, const char* name); + + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/windows/include/iup_export.h b/komodoeditor/libs/iup/windows/include/iup_export.h new file mode 100644 index 0000000..9e1e208 --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iup_export.h @@ -0,0 +1,83 @@ +#ifndef __IUP_EXPORT_H +#define __IUP_EXPORT_H + +#ifndef DOXYGEN_SHOULD_IGNORE_THIS +/** @cond DOXYGEN_SHOULD_IGNORE_THIS */ + +/* Mark the official functions */ +#ifndef IUP_API +#ifdef IUP_BUILD_LIBRARY + #ifdef __EMSCRIPTEN__ + #include + #define IUP_API EMSCRIPTEN_KEEPALIVE + #elif WIN32 + #define IUP_API __declspec(dllexport) + #elif defined(__GNUC__) && __GNUC__ >= 4 + #define IUP_API __attribute__ ((visibility("default"))) + #else + #define IUP_API + #endif +#else + #define IUP_API +#endif /* IUP_BUILD_LIBRARY */ +#endif /* IUP_API */ + +/* Mark the internal SDK functions (some not official but need to be exported) */ +#ifndef IUP_SDK_API +#ifdef IUP_BUILD_LIBRARY + #ifdef __EMSCRIPTEN__ + #include + #define IUP_SDK_API EMSCRIPTEN_KEEPALIVE + #elif WIN32 + #define IUP_SDK_API __declspec(dllexport) + #elif defined(__GNUC__) && __GNUC__ >= 4 + #define IUP_SDK_API __attribute__ ((visibility("default"))) + #else + #define IUP_SDK_API + #endif +#else + #define IUP_SDK_API +#endif /* IUP_BUILD_LIBRARY */ +#endif /* IUP_SDK_API */ + +/* Mark the driver functions that need to be exported */ +#ifndef IUP_DRV_API +#ifdef IUP_BUILD_LIBRARY +#ifdef __EMSCRIPTEN__ +#include +#define IUP_DRV_API EMSCRIPTEN_KEEPALIVE +#elif WIN32 +#define IUP_DRV_API __declspec(dllexport) +#elif defined(__GNUC__) && __GNUC__ >= 4 +#define IUP_DRV_API __attribute__ ((visibility("default"))) +#else +#define IUP_DRV_API +#endif +#else +#define IUP_DRV_API +#endif /* IUP_BUILD_LIBRARY */ +#endif /* IUP_DRV_API */ + +/* Mark the IupImageLib function, it does not have a header of its own */ +#ifndef IUPIMGLIB_API +#ifdef IUPIMGLIB_BUILD_LIBRARY + #ifdef __EMSCRIPTEN__ + #include + #define IUPIMGLIB_API EMSCRIPTEN_KEEPALIVE + #elif WIN32 + #define IUPIMGLIB_API __declspec(dllexport) + #elif defined(__GNUC__) && __GNUC__ >= 4 + #define IUPIMGLIB_API __attribute__ ((visibility("default"))) + #else + #define IUPIMGLIB_API + #endif +#else + #define IUPIMGLIB_API +#endif /* IUPIMGLIB_BUILD_LIBRARY */ +#endif /* IUPIMGLIB_API */ + +/** @endcond DOXYGEN_SHOULD_IGNORE_THIS */ +#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ + + +#endif /* __IUP_EXPORT_H */ diff --git a/komodoeditor/libs/iup/windows/include/iup_mglplot.h b/komodoeditor/libs/iup/windows/include/iup_mglplot.h new file mode 100644 index 0000000..058c2e8 --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iup_mglplot.h @@ -0,0 +1,70 @@ +/** \file + * \brief Plot component for Iup. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUP_MGLPLOT_H +#define __IUP_MGLPLOT_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Initialize IupMglPlot widget class */ +void IupMglPlotOpen(void); + +/* Create an IupMglPlot widget instance */ +Ihandle* IupMglPlot(void); + +/***********************************************/ +/* Additional API */ + +/* Linear Data Only */ +void IupMglPlotBegin(Ihandle *ih, int dim); +void IupMglPlotAdd1D(Ihandle *ih, const char* name, double y); +void IupMglPlotAdd2D(Ihandle *ih, double x, double y); +void IupMglPlotAdd3D(Ihandle *ih, double x, double y, double z); +int IupMglPlotEnd(Ihandle *ih); + +/* Linear (dim=1,2,3), Planar (dim=1), Volumetric (dim=1) */ +int IupMglPlotNewDataSet(Ihandle *ih, int dim); + +/* Linear Data Only */ +void IupMglPlotInsert1D(Ihandle* ih, int ds_index, int sample_index, const char** names, const double* y, int count); +void IupMglPlotInsert2D(Ihandle* ih, int ds_index, int sample_index, const double* x, const double* y, int count); +void IupMglPlotInsert3D(Ihandle* ih, int ds_index, int sample_index, const double* x, const double* y, const double* z, int count); + +/* Linear Data Only */ +void IupMglPlotSet1D(Ihandle* ih, int ds_index, const char** names, const double* y, int count); +void IupMglPlotSet2D(Ihandle* ih, int ds_index, const double* x, const double* y, int count); +void IupMglPlotSet3D(Ihandle* ih, int ds_index, const double* x, const double* y, const double* z, int count); +void IupMglPlotSetFormula(Ihandle* ih, int ds_index, const char* formulaX, const char* formulaY, const char* formulaZ, int count); + +/* Linear (dim=1), Planar (dim=1), Volumetric (dim=1) */ +void IupMglPlotSetData(Ihandle* ih, int ds_index, const double* data, int count_x, int count_y, int count_z); +void IupMglPlotLoadData(Ihandle* ih, int ds_index, const char* filename, int count_x, int count_y, int count_z); +void IupMglPlotSetFromFormula(Ihandle* ih, int ds_index, const char* formula, int count_x, int count_y, int count_z); + +/* Only inside callbacks */ +void IupMglPlotTransform(Ihandle* ih, double x, double y, double z, int *ix, int *iy); +void IupMglPlotTransformTo(Ihandle* ih, int ix, int iy, double *x, double *y, double *z); + +/* Only inside callbacks */ +void IupMglPlotDrawMark(Ihandle* ih, double x, double y, double z); +void IupMglPlotDrawLine(Ihandle* ih, double x1, double y1, double z1, double x2, double y2, double z2); +void IupMglPlotDrawText(Ihandle* ih, const char* text, double x, double y, double z); + +void IupMglPlotPaintTo(Ihandle *ih, const char* format, int w, int h, double dpi, void *data); + +/***********************************************/ + +/* Utility label for showing TeX labels */ +Ihandle* IupMglLabel(const char* title); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/windows/include/iup_plot.h b/komodoeditor/libs/iup/windows/include/iup_plot.h new file mode 100644 index 0000000..adef607 --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iup_plot.h @@ -0,0 +1,70 @@ +/** \file + * \brief Plot component for Iup. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUP_PLOT_H +#define __IUP_PLOT_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Initialize IupPlot widget class */ +void IupPlotOpen(void); + +/* Create an IupPlot widget instance */ +Ihandle* IupPlot(void); + +/***********************************************/ +/* Additional API */ + +void IupPlotBegin(Ihandle *ih, int strXdata); +void IupPlotAdd(Ihandle *ih, double x, double y); +void IupPlotAddStr(Ihandle *ih, const char* x, double y); +void IupPlotAddSegment(Ihandle *ih, double x, double y); +int IupPlotEnd(Ihandle *ih); + +int IupPlotLoadData(Ihandle* ih, const char* filename, int strXdata); + +/* available only when linking with "iupluaplot" */ +int IupPlotSetFormula(Ihandle* ih, int sample_count, const char* formula, const char* init); + +void IupPlotInsert(Ihandle *ih, int ds_index, int sample_index, double x, double y); +void IupPlotInsertStr(Ihandle *ih, int ds_index, int sample_index, const char* x, double y); +void IupPlotInsertSegment(Ihandle *ih, int ds_index, int sample_index, double x, double y); + +void IupPlotInsertStrSamples(Ihandle* ih, int ds_index, int sample_index, const char** x, double* y, int count); +void IupPlotInsertSamples(Ihandle* ih, int ds_index, int sample_index, double *x, double *y, int count); + +void IupPlotAddSamples(Ihandle* ih, int ds_index, double *x, double *y, int count); +void IupPlotAddStrSamples(Ihandle* ih, int ds_index, const char** x, double* y, int count); + +void IupPlotGetSample(Ihandle* ih, int ds_index, int sample_index, double *x, double *y); +void IupPlotGetSampleStr(Ihandle* ih, int ds_index, int sample_index, const char* *x, double *y); +int IupPlotGetSampleSelection(Ihandle* ih, int ds_index, int sample_index); +double IupPlotGetSampleExtra(Ihandle* ih, int ds_index, int sample_index); +void IupPlotSetSample(Ihandle* ih, int ds_index, int sample_index, double x, double y); +void IupPlotSetSampleStr(Ihandle* ih, int ds_index, int sample_index, const char* x, double y); +void IupPlotSetSampleSelection(Ihandle* ih, int ds_index, int sample_index, int selected); +void IupPlotSetSampleExtra(Ihandle* ih, int ds_index, int sample_index, double extra); + +void IupPlotTransform(Ihandle* ih, double x, double y, double *cnv_x, double *cnv_y); +void IupPlotTransformTo(Ihandle* ih, double cnv_x, double cnv_y, double *x, double *y); + +int IupPlotFindSample(Ihandle* ih, double cnv_x, double cnv_y, int *ds_index, int *sample_index); +int IupPlotFindSegment(Ihandle* ih, double cnv_x, double cnv_y, int *ds_index, int *sample_index1, int *sample_index2); + +struct _cdCanvas; + +void IupPlotPaintTo(Ihandle *ih, struct _cdCanvas* cnv); + +/***********************************************/ + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/windows/include/iup_plus.h b/komodoeditor/libs/iup/windows/include/iup_plus.h new file mode 100644 index 0000000..b86d797 --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iup_plus.h @@ -0,0 +1,1204 @@ +/** \file + * \brief Name space for C++ high level API + * + * See Copyright Notice in iup.h + */ + +#ifndef __IUP_PLUS_H +#define __IUP_PLUS_H + + +#include "iup.h" +#include "iupkey.h" +#include "iupdraw.h" +#include "iup_class_cbs.hpp" +#include "iupcontrols.h" +#include "iupgl.h" +#include "iupglcontrols.h" +#include "iupim.h" +#include "iup_config.h" +#include "iup_mglplot.h" +#include "iup_plot.h" +#include "iupole.h" +#include "iupweb.h" +#include "iup_scintilla.h" +#include "iuptuio.h" + + + +/** \brief Name space for C++ high level API + * + * \par + * Defines wrapper classes for all C structures. + * + * See \ref iup_plus.h + */ +namespace Iup +{ + inline char* Version() { return IupVersion(); } + inline char* VersionDate() { return IupVersionDate(); } + inline int VersionNumber() { return IupVersionNumber(); } + + inline int Open(int &argc, char **&argv) { return IupOpen(&argc, &argv); } + inline void Close() { IupClose(); } + inline void ImageLibOpen() { IupImageLibOpen(); } + + inline int MainLoop() { return IupMainLoop(); } + inline int LoopStep() { return IupLoopStep(); } + inline int LoopStepWait() { return IupLoopStepWait(); } + inline int MainLoopLevel() { return IupMainLoopLevel(); } + inline void Flush() { IupFlush(); } + inline void ExitLoop() { IupExitLoop(); } + + inline int RecordInput(const char* filename, int mode) { return IupRecordInput(filename, mode); } + inline int PlayInput(const char* filename) { return IupPlayInput(filename); } + + inline int Help(const char* url) { return IupHelp(url); } + inline void Log(const char* type, const char* str) { IupLog(type, "%s", str); } + inline const char* Load(const char *filename) { return IupLoad(filename); } + inline const char* LoadBuffer(const char *buffer) { return IupLoadBuffer(buffer); } + + inline void SetLanguage(const char *lng) { IupSetLanguage(lng); } + inline const char* GetLanguage() { return IupGetLanguage(); } + inline void SetLanguageString(const char* name, const char* str) { IupSetLanguageString(name, str); } + inline void StoreLanguageString(const char* name, const char* str) { IupStoreLanguageString(name, str); } + inline const char* GetLanguageString(const char* name) { return IupGetLanguageString(name); } + + inline int GetAllClasses(char** names, int n) { return IupGetAllClasses(names, n); } + inline int GetClassAttributes(const char* classname, char** names, int n) { return IupGetClassAttributes(classname, names, n); } + inline int GetClassCallbacks(const char* classname, char** names, int n) { return IupGetClassCallbacks(classname, names, n); } + inline void SetClassDefaultAttribute(const char* classname, const char *name, const char* value) { IupSetClassDefaultAttribute(classname, name, value); } + + inline void SetGlobal(const char* name, const char* value) { IupSetGlobal(name, value); } + inline void SetStringGlobal(const char* name, const char* value) { IupSetStrGlobal(name, value); } + inline char* GetGlobal(const char* name) { return IupGetGlobal(name); } + + inline int GetFile(char* filename) { return IupGetFile(filename); } + inline void Message(const char *title, const char *msg) { IupMessage(title, msg); } + inline int Alarm(const char *title, const char *msg, const char *b1, const char *b2, const char *b3) { return IupAlarm(title, msg, b1, b2, b3); } + inline int ListDialog(int type, const char *title, int size, const char** list, int op, int max_col, int max_lin, int* marks) { return IupListDialog(type, title, size, list, op, max_col, max_lin, marks); } + inline int GetText(const char* title, char* text, int maxsize = 10240) { return IupGetText(title, text, maxsize); } + inline int GetColor(int x, int y, unsigned char &r, unsigned char &g, unsigned char &b) { return IupGetColor(x, y, &r, &g, &b); } + inline int GetParamv(const char* title, Iparamcb action, void* user_data, const char* format, int param_count, int param_extra, void** param_data) + { return IupGetParamv(title, action, user_data, format, param_count, param_extra, param_data); } + + inline int GetAllNames(char** names, int n) { return IupGetAllNames(names, n); } + inline int GetAllDialogs(char** names, int n) { return IupGetAllDialogs(names, n); } + + + class Element + { + protected: + Ihandle* ih; + + /* forbidden */ + Element() { ih = 0; }; + + public: + Element(Ihandle* ref_ih) { ih = ref_ih; } + Element(const Element& elem) : Element(elem.ih) {} + + virtual ~Element() + { + // The destructor does not destroy the element because all Iup::Element are just a reference to the Ihandle*, + // since several IUP elements are automatically destroyed when the dialog is destroyed. + // So to force an element to be destroyed explicitly call the Destroy method. + } + + Ihandle* GetHandle() const { return ih; } + + bool Failed() const { + return ih == 0; + } + + void SetAttribute(const char* name, const char* value) { IupSetAttribute(ih, name, value); } + char* GetAttribute(const char* name) { return IupGetAttribute(ih, name); } + void SetUserData(const char* name, void* data) { IupSetAttribute(ih, name, (char*)data); } + void* GetUserData(const char* name) { return (void*)IupGetAttribute(ih, name); } + void SetString(const char* name, const char* value) { IupSetStrAttribute(ih, name, value); } + const char* GetString(const char* name) { return IupGetAttribute(ih, name); } + void SetInteger(const char* name, int value) { IupSetInt(ih, name, value); } + int GetInteger(const char* name) { return IupGetInt(ih, name); } + void GetIntegerInteger(const char* name, int &i1, int &i2) { IupGetIntInt(ih, name, &i1, &i2); } + void SetNumber(const char* name, double value) { IupSetDouble(ih, name, value); } + double GetNumber(const char* name) { return IupGetDouble(ih, name); } + void SetRGB(const char* name, unsigned char r, unsigned char g, unsigned char b) { IupSetRGB(ih, name, r, g, b); } + void GetRGB(const char* name, unsigned char &r, unsigned char &g, unsigned char &b) { IupGetRGB(ih, name, &r, &g, &b); } + void SetRGBA(const char* name, unsigned char r, unsigned char g, unsigned char b, unsigned char a) { IupSetRGBA(ih, name, r, g, b, a); } + void GetRGBA(const char* name, unsigned char &r, unsigned char &g, unsigned char &b, unsigned char &a) { IupGetRGBA(ih, name, &r, &g, &b, &a); } + + void SetAttributeId(const char* name, int id, const char* value) { IupSetAttributeId(ih, name, id, value); } + char* GetAttributeId(const char* name, int id) { return IupGetAttributeId(ih, name, id); } + void SetUserDataId(const char* name, int id, void* data) { IupSetAttributeId(ih, name, id, (char*)data); } + void* GetUserDataId(const char* name, int id) { return (void*)IupGetAttributeId(ih, name, id); } + void SetStringId(const char* name, int id, const char* value) { IupSetStrAttributeId(ih, name, id, value); } + const char* GetStringId(const char* name, int id) { return IupGetAttributeId(ih, name, id); } + void SetIntegerId(const char* name, int id, int value) { IupSetIntId(ih, name, id, value); } + int GetIntegerId(const char* name, int id) { return IupGetIntId(ih, name, id); } + void SetNumberId(const char* name, int id, double value) { IupSetDoubleId(ih, name, id, value); } + double GetNumberId(const char* name, int id) { return IupGetDoubleId(ih, name, id); } + void SetRGBId(const char* name, int id, unsigned char r, unsigned char g, unsigned char b) { IupSetRGBId(ih, name, id, r, g, b); } + void GetRGBId(const char* name, int id, unsigned char &r, unsigned char &g, unsigned char &b) { IupGetRGBId(ih, name, id, &r, &g, &b); } + + void SetAttributeId2(const char* name, int lin, int col, const char* value) { IupSetAttributeId2(ih, name, lin, col, value); } + char* GetAttributeId2(const char* name, int lin, int col) { return IupGetAttributeId2(ih, name, lin, col); } + void SetUserDataId2(const char* name, int lin, int col, void* data) { IupSetAttributeId2(ih, name, lin, col, (char*)data); } + void* GetUserDataId2(const char* name, int lin, int col) { return (void*)IupGetAttributeId2(ih, name, lin, col); } + void SetStringId2(const char* name, int lin, int col, const char* value) { IupSetStrAttributeId2(ih, name, lin, col, value); } + const char* GetStringId2(const char* name, int lin, int col) { return IupGetAttributeId2(ih, name, lin, col); } + void SetIntegerId2(const char* name, int lin, int col, int value) { IupSetIntId2(ih, name, lin, col, value); } + int GetIntegerId2(const char* name, int lin, int col) { return IupGetIntId2(ih, name, lin, col); } + void SetNumberId2(const char* name, int lin, int col, double value) { IupSetDoubleId2(ih, name, lin, col, value); } + double GetNumberId2(const char* name, int lin, int col) { return IupGetDoubleId2(ih, name, lin, col); } + void SetRGBId2(const char* name, int lin, int col, unsigned char r, unsigned char g, unsigned char b) { IupSetRGBId2(ih, name, lin, col, r, g, b); } + void GetRGBId2(const char* name, int lin, int col, unsigned char &r, unsigned char &g, unsigned char &b) { IupGetRGBId2(ih, name, lin, col, &r, &g, &b); } + + Element SetAttributes(const char* str) { return IupSetAttributes(ih, str); } + void ResetAttribute(const char* name) { IupResetAttribute(ih, name); } + int GetAllAttributes(char** names, int n) { return IupGetAllAttributes(ih, names, n); } + void CopyAttributes(Ihandle* dst_ih) { IupCopyAttributes(ih, dst_ih); } + void SetAttributeHandle(const char* name, const Element& elem) { IupSetAttributeHandle(ih, name, elem.GetHandle()); } + Element GetAttributeHandle(const char* name) { return IupGetAttributeHandle(ih, name); } + void SetAttributeHandleId(const char* name, int id, const Element& elem) { IupSetAttributeHandleId(ih, name, id, elem.GetHandle()); } + Element GetAttributeHandleId(const char* name, int id) { return IupGetAttributeHandleId(ih, name, id); } + void SetAttributeHandleId2(const char* name, int lin, int col, const Element& elem) { IupSetAttributeHandleId2(ih, name, lin, col, elem.GetHandle()); } + Element GetAttributeHandleId2(const char* name, int lin, int col) { return IupGetAttributeHandleId2(ih, name, lin, col); } + + Icallback GetCallback(const char *name) { return IupGetCallback(ih, name); } + Icallback SetCallback(const char *name, Icallback func) { return IupSetCallback(ih, name, func); } + + void Destroy() { IupDestroy(ih); } + + int Map() { return IupMap(ih); } + void Unmap() { IupUnmap(ih); } + + char* GetName() { return IupGetName(ih); } + + char* GetClassName() { return IupGetClassName(ih); } + char* GetClassType() { return IupGetClassType(ih); } + void SaveClassAttributes() { IupSaveClassAttributes(ih); } + void CopyClassAttributesTo(const Element& dst) { IupCopyClassAttributes(ih, dst.ih); } + int ClassMatch(const char* classname) { return IupClassMatch(ih, classname); } + + }; + + inline Icallback GetFunction(const char *name) { return IupGetFunction(name); } + inline Icallback SetFunction(const char *name, Icallback func) { return IupSetFunction(name, func); } + inline Element GetHandle(const char *name) { return Element(IupGetHandle(name)); } + inline Element SetHandle(const char *name, const Element& elem) { return Element(IupSetHandle(name, elem.GetHandle())); } + inline void SetLanguagePack(const Element& elem) { IupSetLanguagePack(elem.GetHandle()); } + + class Dialog; + class Container; + + class Control : public Element + { + public: + Control(Ihandle* _ih) : Element(_ih) {} + Control(const Control& control) : Element(control.ih) {} + Control(const Element& elem) : Element(elem.GetHandle()) {} + + Control SetAttributes(const char* str) { IupSetAttributes(ih, str); return *this; } + + void Update() { IupUpdate(ih); } + void Redraw() { IupRedraw(ih, 0); } + void Refresh() { IupRefresh(ih); } + + void Detach(const Control& child) { IupDetach(child.ih); } + + Control GetBrother() { return Control(IupGetBrother(ih)); } + Container GetParent(); + Dialog GetDialog(); + Control GetDialogChild(const char* name) { return Control(IupGetDialogChild(ih, name)); } + int Reparent(const Container& new_parent, const Control& ref_child); + + Control SetFocus() { return Control(IupSetFocus(ih)); } + Control PreviousField() { return Control(IupPreviousField(ih)); } + Control NextField() { return Control(IupNextField(ih)); } + + void ConvertLinColToPos(int lin, int col, int &pos) { IupTextConvertLinColToPos(ih, lin, col, &pos); } + void ConvertPosToLinCol(int pos, int &lin, int &col) { IupTextConvertPosToLinCol(ih, pos, &lin, &col); } + int ConvertXYToPos(int x, int y) { return IupConvertXYToPos(ih, x, y); } + }; + + inline Control GetFocus() { return Control(IupGetFocus()); } + + class Container : public Control + { + public: + Container(Ihandle* _ih) : Control(_ih) {} + Container(const Container& container) : Control(container.ih) {} + Container(const Control& control) : Control(control.GetHandle()) {} + Container(const Element& elem) : Control(elem.GetHandle()) {} + + Container(Ihandle* _ih, const Control* child_array, int count) : Control(_ih) { + for (int i = 0; i < count; i++) + IupAppend(ih, child_array[i].GetHandle()); + } + Container(Ihandle* _ih, Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) + : Control(_ih) { + if (!child0.Failed()) IupAppend(ih, child0.GetHandle()); + if (!child1.Failed()) IupAppend(ih, child1.GetHandle()); + if (!child2.Failed()) IupAppend(ih, child2.GetHandle()); + if (!child3.Failed()) IupAppend(ih, child3.GetHandle()); + if (!child4.Failed()) IupAppend(ih, child4.GetHandle()); + if (!child5.Failed()) IupAppend(ih, child5.GetHandle()); + if (!child6.Failed()) IupAppend(ih, child6.GetHandle()); + if (!child7.Failed()) IupAppend(ih, child7.GetHandle()); + if (!child8.Failed()) IupAppend(ih, child8.GetHandle()); + if (!child9.Failed()) IupAppend(ih, child9.GetHandle()); + } + + Control Append(const Control& child) { return IupAppend(ih, child.GetHandle()); } + Control Insert(const Control& ref_child, const Control& child) { return IupInsert(ih, ref_child.GetHandle(), child.GetHandle()); } + Control GetChild(int pos) { return IupGetChild(ih, pos); } + int GetChildPos(const Control& child) { return IupGetChildPos(ih, child.GetHandle()); } + int GetChildCount() { return IupGetChildCount(ih); } + + Control GetFirstChild() { return Control(IupGetNextChild(ih, 0)); } + Control GetNextChild(const Control& ref_child) { return Control(IupGetNextChild(ih, ref_child.GetHandle())); } + + void UpdateChildren() { IupUpdateChildren(ih); } + void RedrawChildren() { IupRedraw(ih, 1); } + void RefreshChildren() { IupRefreshChildren(ih); } + }; + + class Dialog : public Container + { + public: + Dialog(const Dialog& dialog) : Container(dialog.GetHandle()) {} + Dialog(const Element& elem) : Container(elem.GetHandle()) {} + Dialog(Control child) : Container(IupDialog(child.GetHandle())) { } + Dialog(Container child) : Container(IupDialog(child.GetHandle())) { } + Dialog(Ihandle* _ih) : Container(_ih) {} + + int Popup(int x, int y) { return IupPopup(ih, x, y); } + int Show() { return IupShow(ih); } + int ShowXY(int x, int y) { return IupShowXY(ih, x, y); } + int Hide() { return IupHide(ih); } + }; + + inline Dialog Control::GetDialog() { return Dialog(IupGetDialog(ih)); } + inline Dialog LayoutDialog(const Dialog& dialog) { return Dialog(IupLayoutDialog(dialog.GetHandle())); } + inline Dialog GlobalsDialog() { return Dialog(IupGlobalsDialog()); } + inline Dialog ElementPropertiesDialog(const Dialog& parent, const Control& control) { return Dialog(IupElementPropertiesDialog(parent.GetHandle(), control.GetHandle())); } + inline Dialog ElementPropertiesDialog(const Control& control) { return Dialog(IupElementPropertiesDialog(0, control.GetHandle())); } + inline Dialog ClassInfoDialog(const Dialog& parent) { return Dialog(IupClassInfoDialog(parent.GetHandle())); } + inline Container Control::GetParent() { return Container(IupGetParent(ih)); } + inline int Control::Reparent(const Container& new_parent, const Control& ref_child) { return IupReparent(ih, new_parent.GetHandle(), ref_child.GetHandle()); } + + void MessageError(const Dialog& parent, const char* message) + { IupMessageError(parent.GetHandle(), message); } + int MessageAlarm(const Dialog& parent, const char* title, const char* message, const char* buttons) + { return IupMessageAlarm(parent.GetHandle(), title, message, buttons); } + + class Menu : public Container + { + public: + Menu() : Container(IupMenu(0)) {} + Menu(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) + : Container(IupMenu(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} + Menu(const Control *child_array, int count) : Container(IupMenu(0), child_array, count) {} + Menu(const Menu& menu) : Container(menu.GetHandle()) {} + Menu(Ihandle* _ih) : Container(_ih) {} + + int Popup(int x, int y) { return IupPopup(ih, x, y); } + }; + + class Image : public Element + { + public: + Image(Ihandle* _ih) : Element(_ih) {} + Image(const Element& elem) : Element(elem.GetHandle()) {} + Image(const char* name) : Element(IupImageGetHandle(name)) {} + + int SaveAsText(const char* filename, const char* iup_format, const char* name) { return IupSaveImageAsText(ih, filename, iup_format, name); } + +#ifdef __IM_PLUS_H + Image(const im::Image& image) : Element(IupImageFromImImage(image.GetHandle())) {} + Image Load(const char* filename) { return Image(IupLoadImage(filename)); } + int Save(const char* filename, const char* im_format) { return IupSaveImage(ih, filename, im_format); } + im::Image ToImImage() { return im::Image(IupImageToImImage(GetHandle())); } +#endif + }; + class Clipboard : public Element + { + public: + Clipboard() : Element(IupClipboard()) {} + Clipboard(Ihandle* _ih) : Element(_ih) {} + Clipboard(const Element& elem) : Element(elem.GetHandle()) {} + +#ifdef __IM_PLUS_H + void SetImage(const im::Image& image) { SetUserData("NATIVEIMAGE", IupGetImageNativeHandle(image.GetHandle())); } + im::Image GetImage(void) { return im::Image(IupGetNativeHandleImage(GetUserData("NATIVEIMAGE"))); } +#endif + }; + class User : public Element + { + public: + User() : Element(IupUser()) {} + User(Ihandle* _ih) : Element(_ih) {} + User(const Element& elem) : Element(elem.GetHandle()) {} + }; + class Thread : public Element + { + public: + Thread() : Element(IupThread()) {} + Thread(Ihandle* _ih) : Element(_ih) {} + Thread(const Element& elem) : Element(elem.GetHandle()) {} + }; + class Param : public Element + { + public: + Param(const char* format) : Element(IupParam(format)) {} + Param(Ihandle* _ih) : Element(_ih) {} + Param(const Element& elem) : Element(elem.GetHandle()) {} + }; + class Timer : public Element + { + public: + Timer() : Element(IupTimer()) {} + Timer(Ihandle* _ih) : Element(_ih) {} + Timer(const Element& elem) : Element(elem.GetHandle()) {} + }; + class Separator : public Control + { + public: + Separator() : Control(IupSeparator()) {} + Separator(Ihandle* _ih) : Control(_ih) {} + Separator(const Element& elem) : Control(elem.GetHandle()) {} + }; + class Item : public Control + { + public: + Item(const char* title = 0) : Control(IupItem(title, 0)) {} + Item(Ihandle* _ih) : Control(_ih) {} + Item(const Element& elem) : Control(elem.GetHandle()) {} + }; + class Canvas : public Control + { + public: + Canvas() : Control(IupCanvas(0)) {} + Canvas(Ihandle* _ih) : Control(_ih) {} + Canvas(const Element& elem) : Control(elem.GetHandle()) {} + + void DrawBegin() { IupDrawBegin(ih); } + void DrawEnd() { IupDrawEnd(ih); } + void DrawSetClipRect(int x1, int y1, int x2, int y2) { IupDrawSetClipRect(ih, x1, y1, x2, y2); } + void DrawGetClipRect(int *x1, int *y1, int *x2, int *y2) { IupDrawGetClipRect(ih, x1, y1, x2, y2); } + void DrawResetClip() { IupDrawResetClip(ih); } + void DrawParentBackground() { IupDrawParentBackground(ih); } + void DrawLine(int x1, int y1, int x2, int y2) { IupDrawLine(ih, x1, y1, x2, y2); } + void DrawRectangle(int x1, int y1, int x2, int y2) { IupDrawRectangle(ih, x1, y1, x2, y2); } + void DrawArc(int x1, int y1, int x2, int y2, double a1, double a2) { IupDrawArc(ih, x1, y1, x2, y2, a1, a2); } + void DrawPolygon(int* points, int count) { IupDrawPolygon(ih, points, count); } + void DrawText(const char* text, int len, int x, int y, int w, int h) { IupDrawText(ih, text, len, x, y, w, h); } + void DrawImage(const char* name, int x, int y, int w, int h) { IupDrawImage(ih, name, x, y, w, h); } + void DrawSelectRect(int x1, int y1, int x2, int y2) { IupDrawSelectRect(ih, x1, y1, x2, y2); } + void DrawFocusRect(int x1, int y1, int x2, int y2) { IupDrawFocusRect(ih, x1, y1, x2, y2); } + void DrawGetSize(int &w, int &h) { IupDrawGetSize(ih, &w, &h); } + void DrawGetTextSize(const char* str, int len, int &w, int &h) { IupDrawGetTextSize(ih, str, len, &w, &h); } + void DrawGetImageInfo(const char* name, int &w, int &h, int &bpp) { IupDrawGetImageInfo(name, &w, &h, &bpp); } + }; + class Link : public Control + { + public: + Link(const char* url = 0, const char* title = 0) : Control(IupLink(url, title)) {} + Link(Ihandle* _ih) : Control(_ih) {} + Link(const Element& elem) : Control(elem.GetHandle()) {} + }; + class Label : public Control + { + public: + Label(const char* title = 0) : Control(IupLabel(title)) {} + Label(Ihandle* _ih) : Control(_ih) {} + Label(const Element& elem) : Control(elem.GetHandle()) {} + }; + + class Button : public Control + { + public: + Button(const char* title = 0) : Control(IupButton(title, 0)) {} + Button(Ihandle* _ih) : Control(_ih) {} + Button(const Element& elem) : Control(elem.GetHandle()) {} + }; + class FlatButton : public Control + { + public: + FlatButton(const char* title = 0) : Control(IupFlatButton(title)) {} + FlatButton(Ihandle* _ih) : Control(_ih) {} + FlatButton(const Element& elem) : Control(elem.GetHandle()) {} + }; + class FlatToggle : public Control + { + public: + FlatToggle(const char* title = 0) : Control(IupFlatToggle(title)) {} + FlatToggle(Ihandle* _ih) : Control(_ih) {} + FlatToggle(const Element& elem) : Control(elem.GetHandle()) {} + }; + class FlatSeparator : public Control + { + public: + FlatSeparator() : Control(IupFlatSeparator()) {} + FlatSeparator(Ihandle* _ih) : Control(_ih) {} + FlatSeparator(const Element& elem) : Control(elem.GetHandle()) {} + }; + class Space : public Control + { + public: + Space() : Control(IupSpace()) {} + Space(Ihandle* _ih) : Control(_ih) {} + Space(const Element& elem) : Control(elem.GetHandle()) {} + }; + class DropButton : public Control + { + public: + DropButton() : Control(IupDropButton(0)) {} + DropButton(Control child) : Control(IupDropButton(child.GetHandle())) {} + DropButton(Ihandle* _ih) : Control(_ih) {} + DropButton(const Element& elem) : Control(elem.GetHandle()) {} + }; + class FlatLabel : public Control + { + public: + FlatLabel(const char* title = 0) : Control(IupFlatLabel(title)) {} + FlatLabel(Ihandle* _ih) : Control(_ih) {} + FlatLabel(const Element& elem) : Control(elem.GetHandle()) {} + }; + class AnimatedLabel : public Control + { + public: + AnimatedLabel(Element animation = (Ihandle*)0) : Control(IupAnimatedLabel(animation.GetHandle())) {} + AnimatedLabel(Ihandle* _ih) : Control(_ih) {} + AnimatedLabel(const Element& elem) : Control(elem.GetHandle()) {} + }; + class Toggle : public Control + { + public: + Toggle(const char* title = 0) : Control(IupToggle(title, 0)) {} + Toggle(Ihandle* _ih) : Control(_ih) {} + Toggle(const Element& elem) : Control(elem.GetHandle()) {} + }; + class Fill: public Control + { + public: + Fill() : Control(IupFill()) {} + Fill(Ihandle* _ih) : Control(_ih) {} + Fill(const Element& elem) : Control(elem.GetHandle()) {} + }; + class Spin: public Control + { + public: + Spin() : Control(IupSpin()) {} + Spin(Ihandle* _ih) : Control(_ih) {} + Spin(const Element& elem) : Control(elem.GetHandle()) {} + }; + class Tree: public Control + { + public: + Tree() : Control(IupTree()) {} + Tree(Ihandle* _ih) : Control(_ih) {} + Tree(const Element& elem) : Control(elem.GetHandle()) {} + + int SetUserId(int id, void* userid) { return IupTreeSetUserId(ih, id, userid); } + void* GetUserId(int id) { return IupTreeGetUserId(ih, id); } + int GetId(void *userid) { return IupTreeGetId(ih, userid); } + }; + class Val : public Control + { + public: + Val(const char* orientation = 0) : Control(IupVal(orientation)) {} + Val(Ihandle* _ih) : Control(_ih) {} + Val(const Element& elem) : Control(elem.GetHandle()) {} + }; + class FlatVal : public Control + { + public: + FlatVal(const char* orientation = 0) : Control(IupFlatVal(orientation)) {} + FlatVal(Ihandle* _ih) : Control(_ih) {} + FlatVal(const Element& elem) : Control(elem.GetHandle()) {} + }; + class FlatTree : public Control + { + public: + FlatTree() : Control(IupFlatTree()) {} + FlatTree(Ihandle* _ih) : Control(_ih) {} + FlatTree(const Element& elem) : Control(elem.GetHandle()) {} + }; + class ProgressBar : public Control + { + public: + ProgressBar() : Control(IupProgressBar()) {} + ProgressBar(Ihandle* _ih) : Control(_ih) {} + ProgressBar(const Element& elem) : Control(elem.GetHandle()) {} + }; + class List: public Control + { + public: + List() : Control(IupList(0)) {} + List(Ihandle* _ih) : Control(_ih) {} + List(const Element& elem) : Control(elem.GetHandle()) {} + }; + class FlatList : public Control + { + public: + FlatList() : Control(IupFlatList()) {} + FlatList(Ihandle* _ih) : Control(_ih) {} + FlatList(const Element& elem) : Control(elem.GetHandle()) {} + }; + class Text : public Control + { + public: + Text() : Control(IupText(0)) {} + Text(Ihandle* _ih) : Control(_ih) {} + Text(const Element& elem) : Control(elem.GetHandle()) {} + }; + + class Split : public Container + { + public: + Split() : Container(IupSplit(0, 0)) {} + Split(Control child) : Container(IupSplit(child.GetHandle(), 0)) {} + Split(Control child1, Control child2) : Container(IupSplit(child1.GetHandle(), child2.GetHandle())) {} + Split(const Split& split) : Container(split.GetHandle()) {} + Split(Ihandle* _ih) : Container(_ih) {} + }; + class Submenu : public Container + { + public: + Submenu(const char* title = 0) : Container(IupSubmenu(title, 0)) {} + Submenu(const char* title, Control child) : Container(IupSubmenu(title, child.GetHandle())) {} + Submenu(const Submenu& container) : Container(container.GetHandle()) {} + Submenu(Ihandle* _ih) : Container(_ih) {} + }; + class Radio : public Container + { + public: + Radio() : Container(IupRadio(0)) {} + Radio(Control child) : Container(IupRadio(child.GetHandle())) {} + Radio(const Radio& container) : Container(container.GetHandle()) {} + Radio(Ihandle* _ih) : Container(_ih) {} + }; + class Sbox : public Container + { + public: + Sbox() : Container(IupSbox(0)) {} + Sbox(Control child) : Container(IupSbox(child.GetHandle())) {} + Sbox(const Sbox& container) : Container(container.GetHandle()) {} + Sbox(Ihandle* _ih) : Container(_ih) {} + }; + class ScrollBox : public Container + { + public: + ScrollBox() : Container(IupScrollBox(0)) {} + ScrollBox(Control child) : Container(IupScrollBox(child.GetHandle())) {} + ScrollBox(const ScrollBox& container) : Container(container.GetHandle()) {} + ScrollBox(Ihandle* _ih) : Container(_ih) {} + }; + class FlatScrollBox : public Container + { + public: + FlatScrollBox() : Container(IupFlatScrollBox(0)) {} + FlatScrollBox(Control child) : Container(IupFlatScrollBox(child.GetHandle())) {} + FlatScrollBox(const FlatScrollBox& container) : Container(container.GetHandle()) {} + FlatScrollBox(Ihandle* _ih) : Container(_ih) {} + }; + class Expander : public Container + { + public: + Expander(const Expander& container) : Container(container.GetHandle()) {} + Expander() : Container(IupExpander(0)) {} + Expander(Control child) : Container(IupExpander(child.GetHandle())) {} + Expander(Ihandle* _ih) : Container(_ih) {} + }; + class DetachBox : public Container + { + public: + DetachBox(const DetachBox& container) : Container(container.GetHandle()) {} + DetachBox() : Container(IupDetachBox(0)) {} + DetachBox(Control child) : Container(IupDetachBox(child.GetHandle())) {} + DetachBox(Ihandle* _ih) : Container(_ih) {} + }; + class BackgroundBox : public Container + { + public: + BackgroundBox() : Container(IupBackgroundBox(0)) {} + BackgroundBox(Control child) : Container(IupBackgroundBox(child.GetHandle())) {} + BackgroundBox(const BackgroundBox& container) : Container(container.GetHandle()) {} + BackgroundBox(Ihandle* _ih) : Container(_ih) {} + + void DrawBegin() { IupDrawBegin(ih); } + void DrawEnd() { IupDrawEnd(ih); } + void DrawSetClipRect(int x1, int y1, int x2, int y2) { IupDrawSetClipRect(ih, x1, y1, x2, y2); } + void DrawGetClipRect(int *x1, int *y1, int *x2, int *y2) { IupDrawGetClipRect(ih, x1, y1, x2, y2); } + void DrawResetClip() { IupDrawResetClip(ih); } + void DrawParentBackground() { IupDrawParentBackground(ih); } + void DrawLine(int x1, int y1, int x2, int y2) { IupDrawLine(ih, x1, y1, x2, y2); } + void DrawRectangle(int x1, int y1, int x2, int y2) { IupDrawRectangle(ih, x1, y1, x2, y2); } + void DrawArc(int x1, int y1, int x2, int y2, double a1, double a2) { IupDrawArc(ih, x1, y1, x2, y2, a1, a2); } + void DrawPolygon(int* points, int count) { IupDrawPolygon(ih, points, count); } + void DrawText(const char* text, int len, int x, int y, int w, int h) { IupDrawText(ih, text, len, x, y, w, h); } + void DrawImage(const char* name, int x, int y, int w, int h) { IupDrawImage(ih, name, x, y, w, h); } + void DrawSelectRect(int x1, int y1, int x2, int y2) { IupDrawSelectRect(ih, x1, y1, x2, y2); } + void DrawFocusRect(int x1, int y1, int x2, int y2) { IupDrawFocusRect(ih, x1, y1, x2, y2); } + void DrawGetSize(int &w, int &h) { IupDrawGetSize(ih, &w, &h); } + void DrawGetTextSize(const char* str, int len, int &w, int &h) { IupDrawGetTextSize(ih, str, len, &w, &h); } + void DrawGetImageInfo(const char* name, int &w, int &h, int &bpp) { IupDrawGetImageInfo(name, &w, &h, &bpp); } + }; + + class Frame : public Container + { + public: + Frame() : Container(IupFrame(0)) {} + Frame(Control child) : Container(IupFrame(child.GetHandle())) {} + Frame(const Frame& container) : Container(container.GetHandle()) {} + Frame(Ihandle* _ih) : Container(_ih) {} + }; + class FlatFrame : public Container + { + public: + FlatFrame() : Container(IupFlatFrame(0)) {} + FlatFrame(Control child) : Container(IupFlatFrame(child.GetHandle())) {} + FlatFrame(const FlatFrame& container) : Container(container.GetHandle()) {} + FlatFrame(Ihandle* _ih) : Container(_ih) {} + }; + class Spinbox : public Container + { + public: + Spinbox() : Container(IupSpinbox(0)) {} + Spinbox(Control child) : Container(IupSpinbox(child.GetHandle())) {} + Spinbox(const Spinbox& container) : Container(container.GetHandle()) {} + Spinbox(Ihandle* _ih) : Container(_ih) {} + }; + + class Vbox : public Container + { + Vbox(const Vbox& box) : Container(box.GetHandle()) {} /* to avoid hierarchy construction problems */ + public: + Vbox() : Container(IupVbox(0)) {} + Vbox(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) + : Container(IupVbox(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} + Vbox(const Control *child_array, int count) : Container(IupVbox(0), child_array, count) {} + Vbox(Ihandle* _ih) : Container(_ih) {} + }; + class Hbox : public Container + { + Hbox(const Hbox& box) : Container(box.GetHandle()) {} /* to avoid hierarchy construction problems */ + public: + Hbox() : Container(IupHbox(0)) {} + Hbox(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) + : Container(IupHbox(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} + Hbox(const Control *child_array, int count) : Container(IupHbox(0), child_array, count) {} + Hbox(Ihandle* _ih) : Container(_ih) {} + }; + class Zbox : public Container + { + public: + Zbox() : Container(IupZbox(0)) {} + Zbox(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) + : Container(IupZbox(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} + Zbox(const Control *child_array, int count) : Container(IupZbox(0), child_array, count) {} + Zbox(const Zbox& box) : Container(box.GetHandle()) {} + Zbox(Ihandle* _ih) : Container(_ih) {} + }; + class Cbox : public Container + { + public: + Cbox() : Container(IupCbox(0)) {} + Cbox(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) + : Container(IupCbox(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} + Cbox(const Control *child_array, int count) : Container(IupCbox(0), child_array, count) {} + Cbox(const Cbox& box) : Container(box.GetHandle()) {} + Cbox(Ihandle* _ih) : Container(_ih) {} + }; + class Tabs : public Container + { + public: + Tabs() : Container(IupTabs(0)) {} + Tabs(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) + : Container(IupTabs(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} + Tabs(const Control *child_array, int count) : Container(IupTabs(0), child_array, count) {} + Tabs(const Tabs& tabs) : Container(tabs.GetHandle()) {} + Tabs(Ihandle* _ih) : Container(_ih) {} + }; + class FlatTabs : public Container + { + public: + FlatTabs() : Container(IupFlatTabs(0)) {} + FlatTabs(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) + : Container(IupFlatTabs(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} + FlatTabs(const Control *child_array, int count) : Container(IupFlatTabs(0), child_array, count) {} + FlatTabs(const FlatTabs& tabs) : Container(tabs.GetHandle()) {} + FlatTabs(Ihandle* _ih) : Container(_ih) {} + }; + class GridBox : public Container + { + public: + GridBox() : Container(IupGridBox(0)) {} + GridBox(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) + : Container(IupGridBox(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} + GridBox(const Control *child_array, int count) : Container(IupGridBox(0), child_array, count) {} + GridBox(const GridBox& box) : Container(box.GetHandle()) {} + GridBox(Ihandle* _ih) : Container(_ih) {} + }; + class MultiBox : public Container + { + public: + MultiBox() : Container(IupMultiBox(0)) {} + MultiBox(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) + : Container(IupMultiBox(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} + MultiBox(const Control *child_array, int count) : Container(IupMultiBox(0), child_array, count) {} + MultiBox(const MultiBox& box) : Container(box.GetHandle()) {} + MultiBox(Ihandle* _ih) : Container(_ih) {} + }; + class ParamBox : public Container + { + public: + ParamBox() : Container(IupParamBox(0)) {} + ParamBox(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) + : Container(IupParamBox(child0.GetHandle(), child1.GetHandle(), child2.GetHandle(), child3.GetHandle(), child4.GetHandle(), child5.GetHandle(), child6.GetHandle(), child7.GetHandle(), child8.GetHandle(), child9.GetHandle(), 0)) {} + ParamBox(const Control *child_array, int count) : Container(IupParamBox(0), child_array, count) {} + ParamBox(const ParamBox& box) : Container(box.GetHandle()) {} + ParamBox(Ihandle* _ih) : Container(_ih) {} + }; + class Normalizer : public Container + { + public: + Normalizer() : Container(IupNormalizer(0)) {} + Normalizer(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) + : Container(IupNormalizer(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} + Normalizer(const Control *child_array, int count) : Container(IupNormalizer(0), child_array, count) {} + Normalizer(const Normalizer& elem) : Container(elem.GetHandle()) {} + Normalizer(Ihandle* _ih) : Container(_ih) {} + }; + + + class FileDlg : public Dialog + { + public: + FileDlg() : Dialog(IupFileDlg()) {} + }; + class MessageDlg : public Dialog + { + public: + MessageDlg() : Dialog(IupMessageDlg()) {} + }; + class ColorDlg : public Dialog + { + public: + ColorDlg() : Dialog(IupColorDlg()) {} + }; + class FontDlg : public Dialog + { + public: + FontDlg() : Dialog(IupFontDlg()) {} + }; + class ProgressDlg : public Dialog + { + public: + ProgressDlg() : Dialog(IupProgressDlg()) {} + }; + class ScintillaDlg : public Dialog + { + public: + ScintillaDlg() : Dialog(IupScintillaDlg()) {} + }; +#ifdef LUA_VERSION + public: + LuaScripterDlg(lua_State *L) : Dialog(IupLuaScripterDlg(L)) {} + }; +#endif + + class GLCanvas : public Control + { + public: + GLCanvas() : Control(IupGLCanvas(0)) {} + GLCanvas(Ihandle* _ih) : Control(_ih) {} + GLCanvas(const Element& elem) : Control(elem.GetHandle()) {} + + static void Open() { IupGLCanvasOpen(); } + + void MakeCurrent() { IupGLMakeCurrent(ih); } + int IsCurrent() { return IupGLIsCurrent(ih); } + void SwapBuffers() { IupGLSwapBuffers(ih); } + void Palette(int index, float r, float g, float b) { IupGLPalette(ih, index, r, g, b); } + void UseFont(int first, int count, int list_base) { IupGLUseFont(ih, first, count, list_base); } + + static void Wait(int gl) { IupGLWait(gl); } + }; + class GLBackgroundBox : public Container + { + public: + GLBackgroundBox() : Container(IupGLBackgroundBox(0)) {} + GLBackgroundBox(Control child) : Container(IupGLBackgroundBox(child.GetHandle())) {} + GLBackgroundBox(const GLBackgroundBox& container) : Container(container.GetHandle()) {} + GLBackgroundBox(Ihandle* _ih) : Container(_ih) {} + }; + + class Controls + { + public: + static void Open() { IupControlsOpen(); } + }; + class Dial : public Control + { + public: + Dial(const char* orientation = 0) : Control(IupDial(orientation)) {} + Dial(Ihandle* _ih) : Control(_ih) {} + Dial(const Element& elem) : Control(elem.GetHandle()) {} + }; + class Gauge : public Control + { + public: + Gauge() : Control(IupGauge()) {} + Gauge(Ihandle* _ih) : Control(_ih) {} + Gauge(const Element& elem) : Control(elem.GetHandle()) {} + }; + class ColorBrowser : public Control + { + public: + ColorBrowser() : Control(IupColorBrowser()) {} + ColorBrowser(Ihandle* _ih) : Control(_ih) {} + ColorBrowser(const Element& elem) : Control(elem.GetHandle()) {} + }; + class Cells : public Control + { + public: + Cells() : Control(IupCells()) {} + Cells(Ihandle* _ih) : Control(_ih) {} + Cells(const Element& elem) : Control(elem.GetHandle()) {} + }; + class Colorbar : public Control + { + public: + Colorbar() : Control(IupColorbar()) {} + Colorbar(Ihandle* _ih) : Control(_ih) {} + Colorbar(const Element& elem) : Control(elem.GetHandle()) {} + }; + class Matrix : public Control + { + public: + Matrix() : Control(IupMatrix(0)) {} + Matrix(Ihandle* _ih) : Control(_ih) {} + Matrix(const Element& elem) : Control(elem.GetHandle()) {} + + void SetFormula(int col, const char* formula, const char* init = 0) { IupMatrixSetFormula(ih, col, formula, init); } + void SetDynamic(const char* init = 0) { IupMatrixSetDynamic(ih, init); } + }; + class MatrixList : public Control + { + public: + MatrixList() : Control(IupMatrixList()) {} + MatrixList(Ihandle* _ih) : Control(_ih) {} + MatrixList(const Element& elem) : Control(elem.GetHandle()) {} + }; + class MatrixEx : public Control + { + public: + MatrixEx() : Control(IupMatrixEx()) {} + MatrixEx(Ihandle* _ih) : Control(_ih) {} + MatrixEx(const Element& elem) : Control(elem.GetHandle()) {} + }; + class GLControls + { + public: + static void Open() { IupGLControlsOpen(); } + }; + class GLSubCanvas : public Control + { + public: + GLSubCanvas() : Control(IupGLSubCanvas()) {} + GLSubCanvas(Ihandle* _ih) : Control(_ih) {} + GLSubCanvas(const Element& elem) : Control(elem.GetHandle()) {} + }; + class GLSeparator : public Control + { + public: + GLSeparator() : Control(IupGLSeparator()) {} + GLSeparator(Ihandle* _ih) : Control(_ih) {} + GLSeparator(const Element& elem) : Control(elem.GetHandle()) {} + }; + class GLProgressBar : public Control + { + public: + GLProgressBar() : Control(IupGLProgressBar()) {} + GLProgressBar(Ihandle* _ih) : Control(_ih) {} + GLProgressBar(const Element& elem) : Control(elem.GetHandle()) {} + }; + class GLVal : public Control + { + public: + GLVal() : Control(IupGLVal()) {} + GLVal(Ihandle* _ih) : Control(_ih) {} + GLVal(const Element& elem) : Control(elem.GetHandle()) {} + }; + class GLLabel : public Control + { + public: + GLLabel(const char* title = 0) : Control(IupGLLabel(title)) {} + GLLabel(Ihandle* _ih) : Control(_ih) {} + GLLabel(const Element& elem) : Control(elem.GetHandle()) {} + }; + class GLButton : public Control + { + public: + GLButton(const char* title = 0) : Control(IupGLButton(title)) {} + GLButton(Ihandle* _ih) : Control(_ih) {} + GLButton(const Element& elem) : Control(elem.GetHandle()) {} + }; + class GLToggle : public Control + { + public: + GLToggle(const char* title = 0) : Control(IupGLToggle(title)) {} + GLToggle(Ihandle* _ih) : Control(_ih) {} + GLToggle(const Element& elem) : Control(elem.GetHandle()) {} + }; + class GLLink : public Control + { + public: + GLLink(const char *url = 0, const char* title = 0) : Control(IupGLLink(url, title)) {} + GLLink(Ihandle* _ih) : Control(_ih) {} + GLLink(const Element& elem) : Control(elem.GetHandle()) {} + }; + class GLFrame : public Container + { + public: + GLFrame(Control child) : Container(IupGLFrame(child.GetHandle())) {} + GLFrame() : Container(IupGLFrame(0)) {} + GLFrame(const GLFrame& container) : Container(container.GetHandle()) {} + GLFrame(Ihandle* _ih) : Container(_ih) {} + }; + class GLExpander : public Container + { + public: + GLExpander(Control child) : Container(IupGLExpander(child.GetHandle())) {} + GLExpander() : Container(IupGLExpander(0)) {} + GLExpander(const GLExpander& container) : Container(container.GetHandle()) {} + GLExpander(Ihandle* _ih) : Container(_ih) {} + }; + class GLScrollBox : public Container + { + public: + GLScrollBox(Control child) : Container(IupGLScrollBox(child.GetHandle())) {} + GLScrollBox() : Container(IupGLScrollBox(0)) {} + GLScrollBox(const GLScrollBox& container) : Container(container.GetHandle()) {} + GLScrollBox(Ihandle* _ih) : Container(_ih) {} + }; + class GLSizeBox : public Container + { + public: + GLSizeBox(Control child) : Container(IupGLSizeBox(child.GetHandle())) {} + GLSizeBox() : Container(IupGLSizeBox(0)) {} + GLSizeBox(const GLSizeBox& container) : Container(container.GetHandle()) {} + GLSizeBox(Ihandle* _ih) : Container(_ih) {} + }; + class GLCanvasBox : public Container + { + public: + GLCanvasBox() : Container(IupGLCanvasBox(0)) {} + GLCanvasBox(Control child0, Control child1 = (Ihandle*)0, Control child2 = (Ihandle*)0, Control child3 = (Ihandle*)0, Control child4 = (Ihandle*)0, Control child5 = (Ihandle*)0, Control child6 = (Ihandle*)0, Control child7 = (Ihandle*)0, Control child8 = (Ihandle*)0, Control child9 = (Ihandle*)0) + : Container(IupGLCanvasBox(0), child0, child1, child2, child3, child4, child5, child6, child7, child8, child9) {} + GLCanvasBox(const Control *child_array, int count) : Container(IupGLCanvasBox(0), child_array, count) {} + GLCanvasBox(const GLCanvasBox& container) : Container(container.GetHandle()) {} + GLCanvasBox(Ihandle* _ih) : Container(_ih) {} + }; + class Plot : public Control + { + public: + Plot() : Control(IupPlot()) {} + Plot(Ihandle* _ih) : Control(_ih) {} + Plot(const Element& elem) : Control(elem.GetHandle()) {} + + static void Open() { IupPlotOpen(); } + + void Begin(int strXdata) { IupPlotBegin(ih, strXdata); } + void Add(double x, double y) { IupPlotAdd(ih, x, y); } + void AddStr(const char* x, double y) { IupPlotAddStr(ih, x, y); } + void AddSegment(double x, double y) { IupPlotAddSegment(ih, x, y); } + int End() { return IupPlotEnd(ih); } + + int LoadData(const char* filename, int strXdata) { return IupPlotLoadData(ih, filename, strXdata); } + + int SetFormula(int sample_count, const char* formula, const char* init) { return IupPlotSetFormula(ih, sample_count, formula, init); } + + void Insert(int ds_index, int sample_index, double x, double y) { IupPlotInsert(ih, ds_index, sample_index, x, y); } + void InsertStr(int ds_index, int sample_index, const char* x, double y) { IupPlotInsertStr(ih, ds_index, sample_index, x, y); } + void InsertSegment(int ds_index, int sample_index, double x, double y) { IupPlotInsertSegment(ih, ds_index, sample_index, x, y); } + + void InsertStrSamples(int ds_index, int sample_index, const char** x, double* y, int count) { IupPlotInsertStrSamples(ih, ds_index, sample_index, x, y, count); } + void InsertSamples(int ds_index, int sample_index, double *x, double *y, int count) { IupPlotInsertSamples(ih, ds_index, sample_index, x, y, count); } + + void AddSamples(int ds_index, double *x, double *y, int count) { IupPlotAddSamples(ih, ds_index, x, y, count); } + void AddStrSamples(int ds_index, const char** x, double* y, int count) { IupPlotAddStrSamples(ih, ds_index, x, y, count); } + + void GetSample(int ds_index, int sample_index, double &x, double &y) { IupPlotGetSample(ih, ds_index, sample_index, &x, &y); } + void GetSampleStr(int ds_index, int sample_index, const char* &x, double &y) { IupPlotGetSampleStr(ih, ds_index, sample_index, &x, &y); } + int GetSampleSelection(int ds_index, int sample_index) { return IupPlotGetSampleSelection(ih, ds_index, sample_index); } + double GetSampleExtra(int ds_index, int sample_index) { return IupPlotGetSampleExtra(ih, ds_index, sample_index); } + void SetSample(int ds_index, int sample_index, double x, double y) { IupPlotSetSample(ih, ds_index, sample_index, x, y); } + void SetSampleStr(int ds_index, int sample_index, const char* x, double y) { IupPlotSetSampleStr(ih, ds_index, sample_index, x, y); } + void SetSampleSelection(int ds_index, int sample_index, int selected) { IupPlotSetSampleSelection(ih, ds_index, sample_index, selected); } + void SetSampleExtra(int ds_index, int sample_index, double extra) { IupPlotSetSampleExtra(ih, ds_index, sample_index, extra); } + + void Transform(double x, double y, double &cnv_x, double &cnv_y) { IupPlotTransform(ih, x, y, &cnv_x, &cnv_y); } + void TransformTo(double cnv_x, double cnv_y, double &x, double &y) { IupPlotTransformTo(ih, cnv_x, cnv_y, &x, &y); } + + int FindSample(double cnv_x, double cnv_y, int &ds_index, int &sample_index) { return IupPlotFindSample(ih, cnv_x, cnv_y, &ds_index, &sample_index); } + +#ifdef __CD_PLUS_H + void PaintTo(cd::Canvas& cd_canvas) { IupPlotPaintTo(ih, cd_canvas.GetHandle()); } +#endif + }; + class MglPlot : public Control + { + public: + MglPlot() : Control(IupMglPlot()) {} + MglPlot(Ihandle* _ih) : Control(_ih) {} + MglPlot(const Element& elem) : Control(elem.GetHandle()) {} + + static void Open() { IupMglPlotOpen(); } + + void Begin(int dim) { IupMglPlotBegin(ih, dim); } + void Add1D(const char* name, double y) { IupMglPlotAdd1D(ih, name, y); } + void Add2D(double x, double y) { IupMglPlotAdd2D(ih, x, y); } + void Add3D(double x, double y, double z) { IupMglPlotAdd3D(ih, x, y, z); } + int End() { return IupMglPlotEnd(ih); } + + int NewDataSet(int dim) { return IupMglPlotNewDataSet(ih, dim); } + + void Insert1D(int ds_index, int sample_index, const char** names, const double* y, int count) { IupMglPlotInsert1D(ih, ds_index, sample_index, names, y, count); } + void Insert2D(int ds_index, int sample_index, const double* x, const double* y, int count) { IupMglPlotInsert2D(ih, ds_index, sample_index, x, y, count); } + void Insert3D(int ds_index, int sample_index, const double* x, const double* y, const double* z, int count) { IupMglPlotInsert3D(ih, ds_index, sample_index, x, y, z, count); } + + void Set1D(int ds_index, const char** names, const double* y, int count) { IupMglPlotSet1D(ih, ds_index, names, y, count); } + void Set2D(int ds_index, const double* x, const double* y, int count) { IupMglPlotSet2D(ih, ds_index, x, y, count); } + void Set3D(int ds_index, const double* x, const double* y, const double* z, int count) { IupMglPlotSet3D(ih, ds_index, x, y, z, count); } + void SetFormula(int ds_index, const char* formulaX, const char* formulaY, const char* formulaZ, int count) { IupMglPlotSetFormula(ih, ds_index, formulaX, formulaY, formulaZ, count); } + + void SetData(int ds_index, const double* data, int count_x, int count_y, int count_z) { IupMglPlotSetData(ih, ds_index, data, count_x, count_y, count_z); } + void LoadData(int ds_index, const char* filename, int count_x, int count_y, int count_z) { IupMglPlotLoadData(ih, ds_index, filename, count_x, count_y, count_z); } + void SetFromFormula(int ds_index, const char* formula, int count_x, int count_y, int count_z) { IupMglPlotSetFromFormula(ih, ds_index, formula, count_x, count_y, count_z); } + + void Transform(double x, double y, double z, int &ix, int &iy) { IupMglPlotTransform(ih, x, y, z, &ix, &iy); } + void TransformTo(int ix, int iy, double &x, double &y, double &z) { IupMglPlotTransformTo(ih, ix, iy, &x, &y, &z); } + + void DrawMark(double x, double y, double z) { IupMglPlotDrawMark(ih, x, y, z); } + void DrawLine(double x1, double y1, double z1, double x2, double y2, double z2) { IupMglPlotDrawLine(ih, x1, y1, z1, x2, y2, z2); } + void DrawText(const char* text, double x, double y, double z) { IupMglPlotDrawText(ih, text, x, y, z); } + + void PaintTo(const char* format, int w, int h, double dpi, unsigned char* data) { IupMglPlotPaintTo(ih, format, w, h, dpi, (void*)data); } + void PaintTo(const char* format, int w, int h, double dpi, const char* filename) { IupMglPlotPaintTo(ih, format, w, h, dpi, (void*)filename); } + + }; + class MglLabel : public Control + { + public: + MglLabel(const char* title) : Control(IupMglLabel(title)) {} + MglLabel(Ihandle* _ih) : Control(_ih) {} + MglLabel(const Element& elem) : Control(elem.GetHandle()) {} + }; + class OleControl : public Control + { + public: + OleControl(const char* progid) : Control(IupOleControl(progid)) {} + OleControl(Ihandle* _ih) : Control(_ih) {} + OleControl(const Element& elem) : Control(elem.GetHandle()) {} + + static void Open() { IupOleControlOpen(); } + }; + class WebBrowser : public Control + { + public: + WebBrowser() : Control(IupWebBrowser()) {} + WebBrowser(Ihandle* _ih) : Control(_ih) {} + WebBrowser(const Element& elem) : Control(elem.GetHandle()) {} + + static void Open() { IupWebBrowserOpen(); } + }; + class Scintilla : public Control + { + public: + Scintilla(): Control(IupScintilla()) {} + Scintilla(Ihandle* _ih) : Control(_ih) {} + Scintilla(const Element& elem) : Control(elem.GetHandle()) {} + + static void Open() { IupScintillaOpen(); } + }; + class TuioClient : public Element + { + public: + TuioClient(int port) : Element(IupTuioClient(port)) {} + TuioClient(Ihandle* _ih) : Element(_ih) {} + TuioClient(const Element& elem) : Element(elem.GetHandle()) {} + + static void Open() { IupTuioOpen(); } + }; + + class Config: public Element + { + public: + Config(): Element(IupConfig()) { } + Config(Ihandle* _ih) : Element(_ih) {} + Config(const Element& elem) : Element(elem.GetHandle()) {} + + int LoadConfig() { return IupConfigLoad(ih); } + int SaveConfig() { return IupConfigSave(ih); } + + void SetVariableStrId(const char* group, const char* key, int id, const char* value) { IupConfigSetVariableStrId(ih, group, key, id, value); } + void SetVariableIntId(const char* group, const char* key, int id, int value) { IupConfigSetVariableIntId(ih, group, key, id, value); } + void SetVariableDoubleId(const char* group, const char* key, int id, double value) { IupConfigSetVariableDoubleId(ih, group, key, id, value); } + void SetVariableStr(const char* group, const char* key, const char* value) { IupConfigSetVariableStr(ih, group, key, value); } + void SetVariableInt(const char* group, const char* key, int value) { IupConfigSetVariableInt(ih, group, key, value); } + void SetVariableDouble(const char* group, const char* key, double value) { IupConfigSetVariableDouble(ih, group, key, value); } + + char* GetVariableStr(const char* group, const char* key) { return (char*)IupConfigGetVariableStr(ih, group, key); } + int GetVariableInt(const char* group, const char* key) { return IupConfigGetVariableInt(ih, group, key); } + double GetVariableDouble(const char* group, const char* key) { return IupConfigGetVariableDouble(ih, group, key); } + char* GetVariableStrId(const char* group, const char* key, int id) { return (char*)IupConfigGetVariableStrId(ih, group, key, id); } + int GetVariableIntId(const char* group, const char* key, int id) { return IupConfigGetVariableIntId(ih, group, key, id); } + double GetVariableDoubleId(const char* group, const char* key, int id) { return IupConfigGetVariableDoubleId(ih, group, key, id); } + + char* GetVariableStrDef(const char* group, const char* key, const char* def) { return (char*)IupConfigGetVariableStrDef(ih, group, key, def); } + int GetVariableIntDef(const char* group, const char* key, int def) { return IupConfigGetVariableIntDef(ih, group, key, def); } + double GetVariableDoubleDef(const char* group, const char* key, double def) { return IupConfigGetVariableDoubleDef(ih, group, key, def); } + char* GetVariableStrIdDef(const char* group, const char* key, int id, const char* def) { return (char*)IupConfigGetVariableStrIdDef(ih, group, key, id, def); } + int GetVariableIntIdDef(const char* group, const char* key, int id, int def) { return IupConfigGetVariableIntIdDef(ih, group, key, id, def); } + double GetVariableDoubleIdDef(const char* group, const char* key, int id, double def) { return IupConfigGetVariableDoubleIdDef(ih, group, key, id, def); } + + void Copy(const Config& config2, const char* exclude_prefix) { IupConfigCopy(ih, config2.GetHandle(), exclude_prefix); } + + void SetListVariable(const char *group, const char* key, const char* value, int add) { IupConfigSetListVariable(ih, group, key, value, add); } + + void RecentInit(Menu menu, Icallback recent_cb, int max_recent) { IupConfigRecentInit(ih, menu.GetHandle(), recent_cb, max_recent); } + void RecentUpdate(const char* filename) { IupConfigRecentUpdate(ih, filename); } + + void DialogShow(Dialog dialog, const char* name) { IupConfigDialogShow(ih, dialog.GetHandle(), name); } + void DialogClosed(Dialog dialog, const char* name) { IupConfigDialogClosed(ih, dialog.GetHandle(), name); } + }; +} + +#ifdef __CD_PLUS_H +namespace cd +{ + class CanvasIup : public Canvas + { + public: + CanvasIup(Iup::Canvas& iup_canvas) + : Canvas() { canvas = cdCreateCanvas(CD_IUP, iup_canvas.GetHandle()); } + }; + class CanvasIupDoubleBuffer : public Canvas + { + public: + CanvasIupDoubleBuffer(Iup::Canvas& iup_canvas) + : Canvas() { canvas = cdCreateCanvas(CD_IUPDBUFFER, iup_canvas.GetHandle()); } + }; + class CanvasIupDoubleBufferRGB : public Canvas + { + public: + CanvasIupDoubleBufferRGB(Iup::Canvas& iup_canvas) + : Canvas() { canvas = cdCreateCanvas(CD_IUPDBUFFERRGB, iup_canvas.GetHandle()); } + }; +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/windows/include/iup_scintilla.h b/komodoeditor/libs/iup/windows/include/iup_scintilla.h new file mode 100644 index 0000000..e78d308 --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iup_scintilla.h @@ -0,0 +1,29 @@ +/** \file + * \brief Scintilla control. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUP_SCINTILLA_H +#define __IUP_SCINTILLA_H + +#ifdef __cplusplus +extern "C" { +#endif + + +void IupScintillaOpen(void); + +Ihandle *IupScintilla(void); +Ihandle *IupScintillaDlg(void); + +#ifdef SCINTILLA_H +sptr_t IupScintillaSendMessage(Ihandle* ih, unsigned int iMessage, uptr_t wParam, sptr_t lParam); +#endif + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/windows/include/iup_varg.h b/komodoeditor/libs/iup/windows/include/iup_varg.h new file mode 100644 index 0000000..0408bd3 --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iup_varg.h @@ -0,0 +1,52 @@ +/** \file +* \brief IUP API with explicit variable argument parameters. +* +* See Copyright Notice in "iup.h" +*/ + +#ifndef __IUP_VARG_H +#define __IUP_VARG_H + +#include +#include "iup.h" + +#ifdef __cplusplus +extern "C" { +#endif + +IUP_API void IupLogV(const char* type, const char* format, va_list arglist); + +IUP_API Ihandle* IupSetAttV(const char* handle_name, Ihandle* ih, const char* name, va_list arglist); + +IUP_API void IupSetStrfV(Ihandle* ih, const char* name, const char* format, va_list arglist); +IUP_API void IupSetStrfIdV(Ihandle* ih, const char* name, int id, const char* format, va_list arglist); +IUP_API void IupSetStrfId2V(Ihandle* ih, const char* name, int lin, int col, const char* format, va_list arglist); + +IUP_API Ihandle* IupSetCallbacksV(Ihandle* ih, const char *name, Icallback func, va_list arglist); + +IUP_API Ihandle* IupCreateV(const char *classname, void* first, va_list arglist); +IUP_API Ihandle* IupVboxV(Ihandle* child, va_list arglist); +IUP_API Ihandle* IupZboxV(Ihandle* child, va_list arglist); +IUP_API Ihandle* IupHboxV(Ihandle* child,va_list arglist); +IUP_API Ihandle* IupNormalizerV(Ihandle* ih_first, va_list arglist); +IUP_API Ihandle* IupCboxV(Ihandle* child, va_list arglist); +IUP_API Ihandle* IupGridBoxV(Ihandle* child, va_list arglist); +IUP_API Ihandle* IupMultiBoxV(Ihandle* child, va_list arglist); +IUP_API Ihandle* IupMenuV(Ihandle* child,va_list arglist); +IUP_API Ihandle* IupTabsV(Ihandle* child, va_list arglist); +IUP_API Ihandle* IupFlatTabsV(Ihandle* child, va_list arglist); + +IUP_API void IupMessageV(const char *title, const char *format, va_list arglist); +IUP_API Ihandle* IupParamBoxV(Ihandle* param, va_list arglist); +IUP_API int IupGetParamV(const char* title, Iparamcb action, void* user_data, const char* format, va_list arglist); + +/* must include iupglcontrols before this file to enable this declaration */ +#ifdef __IUPGLCONTROLS_H +#ifndef IUP_GLCONTROLS_API +#define IUP_GLCONTROLS_API +#endif +IUP_GLCONTROLS_API Ihandle* IupGLCanvasBoxV(Ihandle* child, va_list arglist); +#endif + + +#endif diff --git a/komodoeditor/libs/iup/windows/include/iupcbs.h b/komodoeditor/libs/iup/windows/include/iupcbs.h new file mode 100644 index 0000000..17d1afa --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iupcbs.h @@ -0,0 +1,79 @@ +/** \file + * \brief Contains all function pointer typedefs. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPCBS_H +#define __IUPCBS_H + +struct _cdCanvas; + +typedef int (*IFidle)(void); /* idle */ +typedef void (*IFentry)(void); /* entry */ + +typedef void (*IFi)(int); /* globalentermodal_cb, globalleavemodal_cb, */ +typedef void (*IFs)(char*); /* openurl_cb */ +typedef void (*IFii)(int, int); /* globalkeypress_cb */ +typedef void (*IFiis)(int, int, char*); /* globalmotion_cb, openfiles_cb */ +typedef void (*IFiiiis)(int, int, int, int, char*); /* globalbutton_cb */ +typedef void (*IFfiis)(float,int,int,char*); /* globalwheel_cb */ +typedef void (*IFvs)(void*, char*); /* handleadd_cb, handleremove_cb, imagecreate_cb, imagedestroy_cb */ + +typedef int (*IFn)(Ihandle*); /* default definition, same as Icallback */ +typedef int (*IFni)(Ihandle*, int); /* k_any, show_cb, toggle_action, spin_cb, branchopen_cb, branchclose_cb, executeleaf_cb, showrename_cb, rightclick_cb, extended_cb, height_cb, width_cb */ +typedef int (*IFnii)(Ihandle*, int, int); /* resize_cb, caret_cb, matrix_mousemove_cb, enteritem_cb, leaveitem_cb, scrolltop_cb, dropcheck_cb, selection_cb, select_cb, switch_cb, scrolling_cb, vspan_cb, hspan_cb */ +typedef int (*IFniii)(Ihandle*, int, int, int); /* trayclick_cb, edition_cb */ +typedef int (*IFniiii)(Ihandle*, int, int, int, int); /* dragdrop_cb */ +typedef int (*IFniiiiiiC)(Ihandle*, int, int, int, int, int, int, struct _cdCanvas*); /* draw_cb */ +typedef int (*IFniiiiii)(Ihandle*, int, int, int, int, int, int); /* OLD draw_cb */ +typedef int (*IFnsidv)(Ihandle*, char*, int, double, void*); /* postmessage_cb */ + +typedef int (*IFnff)(Ihandle*, float, float); /* canvas_action */ +typedef int (*IFniff)(Ihandle*,int,float,float); /* scroll_cb */ +typedef int (*IFnfiis)(Ihandle*,float,int,int,char*); /* wheel_cb */ + +typedef int (*IFnsVi)(Ihandle*, char*, void*, int); /* dragdata_cb */ +typedef int (*IFnsViii)(Ihandle*, char*, void*, int, int, int); /* dropdata_cb */ +typedef int (*IFnsiii)(Ihandle*, char*, int, int, int); /* dropfiles_cb */ +typedef int (*IFnssi)(Ihandle*, char*, char*, int); /* dragfilecreatename_cb */ + +typedef int (*IFnnii)(Ihandle*, Ihandle*, int, int); /* drop_cb */ +typedef int (*IFnn)(Ihandle*, Ihandle*); /* savemarkers_cb, restoremarkers_cb */ +typedef int (*IFnnn)(Ihandle*, Ihandle*, Ihandle*); /* tabchange_cb */ +typedef int (*IFnss)(Ihandle*, char *, char *); /* file_cb */ +typedef int (*IFns)(Ihandle*, char *); /* multiselect_cb */ +typedef int (*IFnsi)(Ihandle*, char *, int); /* copydata_cb */ +typedef int (*IFnis)(Ihandle*, int, char *); /* text_action, multiline_action, edit_cb, rename_cb */ +typedef int (*IFnsii)(Ihandle*, char*, int, int); /* list_action */ +typedef int (*IFniis)(Ihandle*, int, int, char*); /* motion_cb, click_cb, value_edit_cb */ +typedef int (*IFniiis)(Ihandle*, int, int, int, char*); /* touch_cb, dblclick_cb */ +typedef int (*IFniiiis)(Ihandle*, int, int, int, int, char*); /* button_cb, matrix_action, mousemotion_cb */ +typedef int (*IFniiiiiis)(Ihandle*, int, int, int, int, int, int, char*); /* mouseclick_cb */ + +typedef int (*IFnIi)(Ihandle*, int*, int); /* multiselection_cb, multiunselection_cb */ +typedef int (*IFnd)(Ihandle*, double); /* mousemove_cb, button_press_cb, button_release_cb */ +typedef int (*IFniiIII)(Ihandle*, int, int, int*, int*, int*); /* fgcolor_cb, bgcolor_cb */ +typedef int (*IFniinsii)(Ihandle*, int, int, Ihandle*, char*, int, int); /* dropselect_cb */ +typedef int (*IFnccc)(Ihandle*, unsigned char, unsigned char, unsigned char); /* drag_cb, change_cb */ +typedef int (*IFniIIII)(Ihandle*, int, int*, int*, int*, int*); /* multitouch_cb */ + +typedef int (*IFnC)(Ihandle*, struct _cdCanvas*); /* postdraw_cb, predraw_cb */ +typedef int (*IFniidd)(Ihandle*, int, int, double, double); /* delete_cb */ +typedef int (*IFniiddi)(Ihandle*, int, int, double, double, int); /* select_cb */ +typedef int (*IFniiddiddi)(Ihandle*, int, int, double, double, int, double, double, int); /* clicksegment_cb */ +typedef int (*IFniidds)(Ihandle*, int, int, double, double, char*); /* plotbutton_cb */ +typedef int (*IFndds)(Ihandle*, double, double, char*); /* plotmotion_cb */ +typedef int (*IFnssds)(Ihandle*, char*, char*, double, char*); /* plottickformat_cb */ +typedef int (*IFnni)(Ihandle*, Ihandle*, int); + +typedef char* (*sIFnii)(Ihandle*, int, int); /* value_cb, font_cb */ +typedef char* (*sIFni)(Ihandle*, int); /* cell_cb */ +typedef char* (*sIFniis)(Ihandle*, int, int, char*); /* translatevalue_cb */ + +typedef double (*dIFnii)(Ihandle*, int, int); /* numericgetvalue_cb */ +typedef int (*IFniid)(Ihandle*, int, int, double); /* numericsetvalue_cb */ + +typedef void (*IFniiv)(Ihandle*, int, int, void*); /* android_onactivityresult_cb */ + +#endif diff --git a/komodoeditor/libs/iup/windows/include/iupcontrols.h b/komodoeditor/libs/iup/windows/include/iupcontrols.h new file mode 100644 index 0000000..7675d52 --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iupcontrols.h @@ -0,0 +1,31 @@ +/** \file + * \brief initializes dial, gauge, colorbrowser, colorbar controls. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPCONTROLS_H +#define __IUPCONTROLS_H + +#ifdef __cplusplus +extern "C" { +#endif + + +int IupControlsOpen(void); + +Ihandle* IupCells(void); +Ihandle* IupMatrix(const char *action); +Ihandle* IupMatrixList(void); +Ihandle* IupMatrixEx(void); + +/* available only when linking with "iupluamatrix" */ +void IupMatrixSetFormula(Ihandle* ih, int col, const char* formula, const char* init); +void IupMatrixSetDynamic(Ihandle* ih, const char* init); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/windows/include/iupdef.h b/komodoeditor/libs/iup/windows/include/iupdef.h new file mode 100644 index 0000000..8f427b1 --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iupdef.h @@ -0,0 +1,683 @@ +/** \file + * \brief Callbacks, Attributes and Attribute Values definitions. + * Avoid using these definitions. Use the strings instead. + * + * See Copyright Notice in iup.h + */ + +#ifndef __IUPDEF_H +#define __IUPDEF_H + +/* ATTENTION: these are OLD definitions and they are NOT updated anymore since IUP 3.0 */ +/* Avoid using them, directly use the strings instead. */ +/* Define __IUPDEF_H to avoid the inclusion of this header */ + +#define IUP_RUN "RUN" +#define IUP_ENGLISH "ENGLISH" +#define IUP_PORTUGUESE "PORTUGUESE" +#define IUP_SBH "SBH" +#define IUP_SBV "SBV" + +/************************************************************************/ +/* Callbacks */ +/************************************************************************/ + +#define IUP_IDLE_ACTION "IDLE_ACTION" + +#define IUP_ACTION "ACTION" +#define IUP_GETFOCUS_CB "GETFOCUS_CB" +#define IUP_KILLFOCUS_CB "KILLFOCUS_CB" +#define IUP_K_ANY "K_ANY" +#define IUP_KEYPRESS_CB "KEYPRESS_CB" +#define IUP_HELP_CB "HELP_CB" + +#define IUP_SCROLL_CB "SCROLL_CB" +#define IUP_RESIZE_CB "RESIZE_CB" +#define IUP_MOTION_CB "MOTION_CB" +#define IUP_BUTTON_CB "BUTTON_CB" +#define IUP_ENTERWINDOW_CB "ENTERWINDOW_CB" +#define IUP_LEAVEWINDOW_CB "LEAVEWINDOW_CB" +#define IUP_WHEEL_CB "WHEEL_CB" + +#define IUP_MASK_CB "MASK_CB" +#define IUP_OPEN_CB "OPEN_CB" +#define IUP_HIGHLIGHT_CB "HIGHLIGHT_CB" +#define IUP_MENUCLOSE_CB "MENUCLOSE_CB" + +#define IUP_MAP_CB "MAP_CB" +#define IUP_CLOSE_CB "CLOSE_CB" +#define IUP_SHOW_CB "SHOW_CB" + +#define IUP_DROPFILES_CB "DROPFILES_CB" +#define IUP_WOM_CB "WOM_CB" + +/************************************************************************/ +/* Attributes */ +/************************************************************************/ + +#define IUP_DIRECTION "DIRECTION" +#define IUP_ACTIVE "ACTIVE" +#define IUP_BGCOLOR "BGCOLOR" +#define IUP_FRAMECOLOR "FRAMECOLOR" +#define IUP_FGCOLOR "FGCOLOR" +#define IUP_COLOR "COLOR" +#define IUP_WID "WID" +#define IUP_SIZE "SIZE" +#define IUP_RASTERSIZE "RASTERSIZE" +#define IUP_TITLE "TITLE" +#define IUP_VALUE "VALUE" +#define IUP_VISIBLE "VISIBLE" +#define IUP_FONT "FONT" +#define IUP_TIP "TIP" +#define IUP_EXPAND "EXPAND" +#define IUP_SEPARATOR "SEPARATOR" + +#define IUP_HOTSPOT "HOTSPOT" +#define IUP_HEIGHT "HEIGHT" +#define IUP_WIDTH "WIDTH" + +#define IUP_KEY "KEY" + +#define IUP_MULTIPLE "MULTIPLE" +#define IUP_DROPDOWN "DROPDOWN" +#define IUP_VISIBLE_ITEMS "VISIBLE_ITEMS" + +#define IUP_MARGIN "MARGIN" +#define IUP_GAP "GAP" +#define IUP_ALIGNMENT "ALIGNMENT" + +#define IUP_IMAGE "IMAGE" +#define IUP_IMINACTIVE "IMINACTIVE" +#define IUP_IMPRESS "IMPRESS" +#define IUP_WIN_SAVEBITS "WIN_SAVEBITS" + +#define IUP_NC "NC" +#define IUP_MASK "MASK" + +#define IUP_APPEND "APPEND" +#define IUP_BORDER "BORDER" + +#define IUP_CARET "CARET" +#define IUP_SELECTION "SELECTION" +#define IUP_SELECTEDTEXT "SELECTEDTEXT" +#define IUP_INSERT "INSERT" + +#define IUP_CONID "CONID" +#define IUP_CURSOR "CURSOR" + +#define IUP_ICON "ICON" +#define IUP_MENUBOX "MENUBOX" +#define IUP_MINBOX "MINBOX" +#define IUP_MAXBOX "MAXBOX" +#define IUP_RESIZE "RESIZE" +#define IUP_MENU "MENU" +#define IUP_STARTFOCUS "STARTFOCUS" +#define IUP_PARENTDIALOG "PARENTDIALOG" +#define IUP_SHRINK "SHRINK" +#define IUP_DEFAULTENTER "DEFAULTENTER" +#define IUP_DEFAULTESC "DEFAULTESC" +#define IUP_X "X" +#define IUP_Y "Y" +#define IUP_TOOLBOX "TOOLBOX" +#define IUP_CONTROL "CONTROL" +#define IUP_READONLY "READONLY" + +#define IUP_SCROLLBAR "SCROLLBAR" +#define IUP_POSY "POSY" +#define IUP_POSX "POSX" +#define IUP_DX "DX" +#define IUP_DY "DY" +#define IUP_XMAX "XMAX" +#define IUP_XMIN "XMIN" +#define IUP_YMAX "YMAX" +#define IUP_YMIN "YMIN" + +#define IUP_RED "255 0 0" +#define IUP_GREEN "0 255 0" +#define IUP_BLUE "0 0 255" + +#define IUP_MIN "MIN" +#define IUP_MAX "MAX" + +#define IUP_TIME "TIME" +#define IUP_DRAG "DRAG" +#define IUP_DROP "DROP" +#define IUP_REPAINT "REPAINT" +#define IUP_TOPMOST "TOPMOST" +#define IUP_CLIPCHILDREN "CLIPCHILDREN" + +#define IUP_DIALOGTYPE "DIALOGTYPE" +#define IUP_FILE "FILE" +#define IUP_MULTIPLEFILES "MULTIPLEFILES" +#define IUP_FILTER "FILTER" +#define IUP_FILTERUSED "FILTERUSED" +#define IUP_FILTERINFO "FILTERINFO" +#define IUP_EXTFILTER "EXTFILTER" +#define IUP_DIRECTORY "DIRECTORY" +#define IUP_ALLOWNEW "ALLOWNEW" +#define IUP_NOOVERWRITEPROMPT "NOOVERWRITEPROMPT" +#define IUP_NOCHANGEDIR "NOCHANGEDIR" +#define IUP_FILEEXIST "FILEEXIST" +#define IUP_STATUS "STATUS" + +#define IUP_LOCKLOOP "LOCKLOOP" +#define IUP_SYSTEM "SYSTEM" +#define IUP_DRIVER "DRIVER" +#define IUP_SCREENSIZE "SCREENSIZE" +#define IUP_SYSTEMLANGUAGE "SYSTEMLANGUAGE" +#define IUP_COMPUTERNAME "COMPUTERNAME" +#define IUP_USERNAME "USERNAME" + +#define IUP_OPEN "OPEN" +#define IUP_SAVE "SAVE" +#define IUP_DIR "DIR" + +#define IUP_HORIZONTAL "HORIZONTAL" +#define IUP_VERTICAL "VERTICAL" + +/************************************************************************/ +/* Attribute Values */ +/************************************************************************/ + +#define IUP_YES "YES" +#define IUP_NO "NO" +#define IUP_ON "ON" +#define IUP_OFF "OFF" + +#define IUP_ACENTER "ACENTER" +#define IUP_ALEFT "ALEFT" +#define IUP_ARIGHT "ARIGHT" +#define IUP_ATOP "ATOP" +#define IUP_ABOTTOM "ABOTTOM" + +#define IUP_NORTH "NORTH" +#define IUP_SOUTH "SOUTH" +#define IUP_WEST "WEST" +#define IUP_EAST "EAST" +#define IUP_NE "NE" +#define IUP_SE "SE" +#define IUP_NW "NW" +#define IUP_SW "SW" + +#define IUP_FULLSCREEN "FULLSCREEN" +#define IUP_FULL "FULL" +#define IUP_HALF "HALF" +#define IUP_THIRD "THIRD" +#define IUP_QUARTER "QUARTER" +#define IUP_EIGHTH "EIGHTH" + +#define IUP_ARROW "ARROW" +#define IUP_BUSY "BUSY" +#define IUP_RESIZE_N "RESIZE_N" +#define IUP_RESIZE_S "RESIZE_S" +#define IUP_RESIZE_E "RESIZE_E" +#define IUP_RESIZE_W "RESIZE_W" +#define IUP_RESIZE_NE "RESIZE_NE" +#define IUP_RESIZE_NW "RESIZE_NW" +#define IUP_RESIZE_SE "RESIZE_SE" +#define IUP_RESIZE_SW "RESIZE_SW" +#define IUP_MOVE "MOVE" +#define IUP_HAND "HAND" +#define IUP_NONE "NONE" +#define IUP_IUP "IUP" +#define IUP_CROSS "CROSS" +#define IUP_PEN "PEN" +#define IUP_TEXT "TEXT" +#define IUP_RESIZE_C "RESIZE_C" +#define IUP_OPENHAND "OPENHAND" + +/************************************************************************/ +/* Keys */ +/************************************************************************/ + +#define IUP_K_exclam "K_exclam" +#define IUP_K_quotedbl "K_quotedbl" +#define IUP_K_numbersign "K_numbersign" +#define IUP_K_dollar "K_dollar" +#define IUP_K_percent "K_percent" +#define IUP_K_ampersand "K_ampersand" +#define IUP_K_quoteright "K_quoteright" +#define IUP_K_parentleft "K_parentleft" +#define IUP_K_parentright "K_parentright" +#define IUP_K_asterisk "K_asterisk" +#define IUP_K_plus "K_plus" +#define IUP_K_comma "K_comma" +#define IUP_K_minus "K_minus" +#define IUP_K_period "K_period" +#define IUP_K_slash "K_slash" +#define IUP_K_0 "K_0" +#define IUP_K_1 "K_1" +#define IUP_K_2 "K_2" +#define IUP_K_3 "K_3" +#define IUP_K_4 "K_4" +#define IUP_K_5 "K_5" +#define IUP_K_6 "K_6" +#define IUP_K_7 "K_7" +#define IUP_K_8 "K_8" +#define IUP_K_9 "K_9" +#define IUP_K_colon "K_colon" +#define IUP_K_semicolon "K_semicolon " +#define IUP_K_less "K_less" +#define IUP_K_equal "K_equal" +#define IUP_K_greater "K_greater" +#define IUP_K_question "K_question" +#define IUP_K_at "K_at" +#define IUP_K_A "K_A" +#define IUP_K_B "K_B" +#define IUP_K_C "K_C" +#define IUP_K_D "K_D" +#define IUP_K_E "K_E" +#define IUP_K_F "K_F" +#define IUP_K_G "K_G" +#define IUP_K_H "K_H" +#define IUP_K_I "K_I" +#define IUP_K_J "K_J" +#define IUP_K_K "K_K" +#define IUP_K_L "K_L" +#define IUP_K_M "K_M" +#define IUP_K_N "K_N" +#define IUP_K_O "K_O" +#define IUP_K_P "K_P" +#define IUP_K_Q "K_Q" +#define IUP_K_R "K_R" +#define IUP_K_S "K_S" +#define IUP_K_T "K_T" +#define IUP_K_U "K_U" +#define IUP_K_V "K_V" +#define IUP_K_W "K_W" +#define IUP_K_X "K_X" +#define IUP_K_Y "K_Y" +#define IUP_K_Z "K_Z" +#define IUP_K_bracketleft "K_bracketleft" +#define IUP_K_backslash "K_backslash" +#define IUP_K_bracketright "K_bracketright" +#define IUP_K_circum "K_circum" +#define IUP_K_underscore "K_underscore" +#define IUP_K_quoteleft "K_quoteleft" +#define IUP_K_a "K_a" +#define IUP_K_b "K_b" +#define IUP_K_c "K_c" +#define IUP_K_d "K_d" +#define IUP_K_e "K_e" +#define IUP_K_f "K_f" +#define IUP_K_g "K_g" +#define IUP_K_h "K_h" +#define IUP_K_i "K_i" +#define IUP_K_j "K_j" +#define IUP_K_k "K_k" +#define IUP_K_l "K_l" +#define IUP_K_m "K_m" +#define IUP_K_n "K_n" +#define IUP_K_o "K_o" +#define IUP_K_p "K_p" +#define IUP_K_q "K_q" +#define IUP_K_r "K_r" +#define IUP_K_s "K_s" +#define IUP_K_t "K_t" +#define IUP_K_u "K_u" +#define IUP_K_v "K_v" +#define IUP_K_w "K_w" +#define IUP_K_x "K_x" +#define IUP_K_y "K_y" +#define IUP_K_z "K_z" +#define IUP_K_braceleft "K_braceleft" +#define IUP_K_bar "K_bar" +#define IUP_K_braceright "K_braceright" +#define IUP_K_tilde "K_tilde" + +#define IUP_K_cA "K_cA" +#define IUP_K_cB "K_cB" +#define IUP_K_cC "K_cC" +#define IUP_K_cD "K_cD" +#define IUP_K_cE "K_cE" +#define IUP_K_cF "K_cF" +#define IUP_K_cG "K_cG" +#define IUP_K_cJ "K_cJ" +#define IUP_K_cK "K_cK" +#define IUP_K_cL "K_cL" +#define IUP_K_cN "K_cN" +#define IUP_K_cO "K_cO" +#define IUP_K_cP "K_cP" +#define IUP_K_cQ "K_cQ" +#define IUP_K_cR "K_cR" +#define IUP_K_cS "K_cS" +#define IUP_K_cT "K_cT" +#define IUP_K_cU "K_cU" +#define IUP_K_cV "K_cV" +#define IUP_K_cW "K_cW" +#define IUP_K_cX "K_cX" +#define IUP_K_cY "K_cY" +#define IUP_K_cZ "K_cZ" +#define IUP_K_mA "K_mA" +#define IUP_K_mB "K_mB" +#define IUP_K_mC "K_mC" +#define IUP_K_mD "K_mD" +#define IUP_K_mE "K_mE" +#define IUP_K_mF "K_mF" +#define IUP_K_mG "K_mG" +#define IUP_K_mH "K_mH" +#define IUP_K_mI "K_mI" +#define IUP_K_mJ "K_mJ" +#define IUP_K_mK "K_mK" +#define IUP_K_mL "K_mL" +#define IUP_K_mM "K_mM" +#define IUP_K_mN "K_mN" +#define IUP_K_mO "K_mO" +#define IUP_K_mP "K_mP" +#define IUP_K_mQ "K_mQ" +#define IUP_K_mR "K_mR" +#define IUP_K_mS "K_mS" +#define IUP_K_mT "K_mT" +#define IUP_K_mU "K_mU" +#define IUP_K_mV "K_mV" +#define IUP_K_mW "K_mW" +#define IUP_K_mX "K_mX" +#define IUP_K_mY "K_mY" +#define IUP_K_mZ "K_mZ" +#define IUP_K_BS "K_BS" +#define IUP_K_TAB "K_TAB" +#define IUP_K_CR "K_CR" +#define IUP_K_SP "K_SP" +#define IUP_K_ESC "K_ESC" +#define IUP_K_sCR "K_sCR" +#define IUP_K_sTAB "K_sTAB" +#define IUP_K_cTAB "K_cTAB" +#define IUP_K_mTAB "K_mTAB" +#define IUP_K_HOME "K_HOME" +#define IUP_K_UP "K_UP" +#define IUP_K_PGUP "K_PGUP" +#define IUP_K_LEFT "K_LEFT" +#define IUP_K_RIGHT "K_RIGHT" +#define IUP_K_END "K_END" +#define IUP_K_DOWN "K_DOWN" +#define IUP_K_PGDN "K_PGDN" +#define IUP_K_MIDDLE "K_MIDDLE" +#define IUP_K_INS "K_INS" +#define IUP_K_DEL "K_DEL" +#define IUP_K_sHOME "K_sHOME" +#define IUP_K_sUP "K_sUP" +#define IUP_K_sPGUP "K_sPGUP" +#define IUP_K_sLEFT "K_sLEFT" +#define IUP_K_sRIGHT "K_sRIGHT" +#define IUP_K_sEND "K_sEND" +#define IUP_K_sDOWN "K_sDOWN" +#define IUP_K_sPGDN "K_sPGDN" +#define IUP_K_cHOME "K_cHOME" +#define IUP_K_cPGUP "K_cPGUP" +#define IUP_K_cLEFT "K_cLEFT" +#define IUP_K_cRIGHT "K_cRIGHT" +#define IUP_K_cEND "K_cEND" +#define IUP_K_cPGDN "K_cPGDN" +#define IUP_K_cUP "K_cUP" +#define IUP_K_cDOWN "K_cDOWN" +#define IUP_K_cMIDDLE "K_cMIDDLE" +#define IUP_K_cINS "K_cINS" +#define IUP_K_cDEL "K_cDEL" +#define IUP_K_mHOME "K_mHOME" +#define IUP_K_mPGUP "K_mPGUP" +#define IUP_K_mLEFT "K_mLEFT" +#define IUP_K_mRIGHT "K_mRIGHT" +#define IUP_K_mEND "K_mEND" +#define IUP_K_mPGDN "K_mPGDN" +#define IUP_K_mUP "K_mUP" +#define IUP_K_mDOWN "K_mDOWN" +#define IUP_K_mINS "K_mINS" +#define IUP_K_mDEL "K_mDEL" +#define IUP_K_F1 "K_F1" +#define IUP_K_F2 "K_F2" +#define IUP_K_F3 "K_F3" +#define IUP_K_F4 "K_F4" +#define IUP_K_F5 "K_F5" +#define IUP_K_F6 "K_F6" +#define IUP_K_F7 "K_F7" +#define IUP_K_F8 "K_F8" +#define IUP_K_F9 "K_F9" +#define IUP_K_F10 "K_F10" +#define IUP_K_F11 "K_F11" +#define IUP_K_F12 "K_F12" +#define IUP_K_sF1 "K_sF1" +#define IUP_K_sF2 "K_sF2" +#define IUP_K_sF3 "K_sF3" +#define IUP_K_sF4 "K_sF4" +#define IUP_K_sF5 "K_sF5" +#define IUP_K_sF6 "K_sF6" +#define IUP_K_sF7 "K_sF7" +#define IUP_K_sF8 "K_sF8" +#define IUP_K_sF9 "K_sF9" +#define IUP_K_sF10 "K_sF10" +#define IUP_K_sF11 "K_sF11" +#define IUP_K_sF12 "K_sF12" +#define IUP_K_cF1 "K_cF1" +#define IUP_K_cF2 "K_cF2" +#define IUP_K_cF3 "K_cF3" +#define IUP_K_cF4 "K_cF4" +#define IUP_K_cF5 "K_cF5" +#define IUP_K_cF6 "K_cF6" +#define IUP_K_cF7 "K_cF7" +#define IUP_K_cF8 "K_cF8" +#define IUP_K_cF9 "K_cF9" +#define IUP_K_cF10 "K_cF10" +#define IUP_K_cF11 "K_cF11" +#define IUP_K_cF12 "K_cF12" +#define IUP_K_mF1 "K_mF1" +#define IUP_K_mF2 "K_mF2" +#define IUP_K_mF3 "K_mF3" +#define IUP_K_mF4 "K_mF4" +#define IUP_K_mF5 "K_mF5" +#define IUP_K_mF6 "K_mF6" +#define IUP_K_mF7 "K_mF7" +#define IUP_K_mF8 "K_mF8" +#define IUP_K_mF9 "K_mF9" +#define IUP_K_mF10 "K_mF10" +#define IUP_K_m1 "K_m1" +#define IUP_K_m2 "K_m2" +#define IUP_K_m3 "K_m3" +#define IUP_K_m4 "K_m4" +#define IUP_K_m5 "K_m5" +#define IUP_K_m6 "K_m6" +#define IUP_K_m7 "K_m7" +#define IUP_K_m8 "K_m8" +#define IUP_K_m9 "K_m9" +#define IUP_K_m0 "K_m0" + +/************/ +/* Colorbar */ +/************/ + +#define IUP_NUM_PARTS "NUM_PARTS" +#define IUP_NUM_CELLS "NUM_CELLS" +#define IUP_CELL "CELL" +#define IUP_PREVIEW_SIZE "PREVIEW_SIZE" +#define IUP_SHOW_PREVIEW "SHOW_PREVIEW" +#define IUP_SHOW_SECONDARY "SHOW_SECONDARY" +#define IUP_PRIMARY_CELL "PRIMARY_CELL" +#define IUP_SECONDARY_CELL "SECONDARY_CELL" +#define IUP_ORIENTATION "ORIENTATION" +#define IUP_SQUARED "SQUARED" +#define IUP_SHADOWED "SHADOWED" +#define IUP_BUFFERIZE "BUFFERIZE" +#define IUP_TRANSPARENCY "TRANSPARENCY" +#define IUP_CELL_CB "CELL_CB" +#define IUP_EXTENDED_CB "EXTENDED_CB" +#define IUP_SELECT_CB "SELECT_CB" +#define IUP_SWITCH_CB "SWITCH_CB" +#define IUP_VERTICAL "VERTICAL" +#define IUP_HORIZONTAL "HORIZONTAL" + +/************/ +/* Cells */ +/************/ + +#define IUP_ALL "ALL" +#define IUP_BOXED "BOXED" +#define IUP_CLIPPED "CLIPPED" +#define IUP_TRANSPARENT "TRANSPARENT" +#define IUP_NON_SCROLLABLE_LINES "NON_SCROLLABLE_LINES" +#define IUP_NON_SCROLLABLE_COLS "NON_SCROLLABLE_COLS" +#define IUP_ORIGIN "ORIGIN" +#define IUP_NO_COLOR "NO_COLOR" +#define IUP_FIRST_LINE "FIRST_LINE" +#define IUP_FIRST_COL "FIRST_COL" +#define IUP_DOUBLE_BUFFER "DOUBLE_BUFFER" +#define IUP_LIMITS "LIMITS" +#define IUP_CANVAS "CANVAS" +#define IUP_IMAGE_CANVAS "IMAGE_CANVAS" +#define IUP_FULL_VISIBLE "FULL_VISIBLE" +#define IUP_MOUSECLICK_CB "MOUSECLICK_CB" +#define IUP_MOUSEMOTION_CB "MOUSEMOTION_CB" +#define IUP_DRAW_CB "DRAW_CB" +#define IUP_WIDTH_CB "WIDTH_CB" +#define IUP_HEIGHT_CB "HEIGHT_CB" +#define IUP_NLINES_CB "NLINES_CB" +#define IUP_NCOLS_CB "NCOLS_CB" +#define IUP_HSPAN_CB "HSPAN_CB" +#define IUP_VSPAN_CB "VSPAN_CB" +#define IUP_SCROLLING_CB "SCROLLING_CB" + +/*****************/ +/* ColorBrowser */ +/*****************/ + +#define IUP_RGB "RGB" +#define IUP_CHANGE_CB "CHANGE_CB" +#define IUP_DRAG_CB "DRAG_CB" + +/*****************/ +/* Val */ +/*****************/ + +#define ICTL_MOUSEMOVE_CB "MOUSEMOVE_CB" +#define ICTL_BUTTON_PRESS_CB "BUTTON_PRESS_CB" +#define ICTL_BUTTON_RELEASE_CB "BUTTON_RELEASE_CB" +#define ICTL_HORIZONTAL "HORIZONTAL" +#define ICTL_VERTICAL "VERTICAL" +#define ICTL_SHOWTICKS "SHOWTICKS" + +/*****************/ +/* Tabs */ +/*****************/ + +#define ICTL_TOP "TOP" +#define ICTL_BOTTOM "BOTTOM" +#define ICTL_LEFT "LEFT" +#define ICTL_RIGHT "RIGHT" +#define ICTL_TABTYPE "TABTYPE" +#define ICTL_TABTITLE "TABTITLE" +#define ICTL_TABSIZE "TABSIZE" +#define ICTL_TABCHANGE_CB "TABCHANGE_CB" +#define ICTL_FONT "FONT" +#define ICTL_FONT_ACTIVE "FONT_ACTIVE" +#define ICTL_FONT_INACTIVE "FONT_INACTIVE" + +/*****************/ +/* Gauge */ +/*****************/ + +#define ICTL_SHOW_TEXT "SHOW_TEXT" +#define ICTL_DASHED "DASHED" +#define ICTL_MARGIN "MARGIN" +#define ICTL_TEXT "TEXT" + +/*****************/ +/* Dial */ +/*****************/ + +#define ICTL_DENSITY "DENSITY" +#define ICTL_HORIZONTAL "HORIZONTAL" +#define ICTL_VERTICAL "VERTICAL" +#define ICTL_CIRCULAR "CIRCULAR" +#define ICTL_UNIT "UNIT" + +/*****************/ +/* Matrix */ +/*****************/ + +#define IUP_ENTERITEM_CB "ENTERITEM_CB" +#define IUP_LEAVEITEM_CB "LEAVEITEM_CB" +#define IUP_EDITION_CB "EDITION_CB" +#define IUP_CLICK_CB "CLICK_CB" +#define IUP_DROP_CB "DROP_CB" +#define IUP_DROPSELECT_CB "DROPSELECT_CB" +#define IUP_DROPCHECK_CB "DROPCHECK_CB" +#define IUP_SCROLL_CB "SCROLL_CB" +#define IUP_VALUE_CB "VALUE_CB" +#define IUP_VALUE_EDIT_CB "VALUE_EDIT_CB" +#define IUP_FIELD_CB "FIELD_CB" +#define IUP_RESIZEMATRIX "RESIZEMATRIX" +#define IUP_ADDLIN "ADDLIN" +#define IUP_ADDCOL "ADDCOL" +#define IUP_DELLIN "DELLIN" +#define IUP_DELCOL "DELCOL" +#define IUP_NUMLIN "NUMLIN" +#define IUP_NUMCOL "NUMCOL" +#define IUP_NUMLIN_VISIBLE "NUMLIN_VISIBLE" +#define IUP_NUMCOL_VISIBLE "NUMCOL_VISIBLE" +#define IUP_MARKED "MARKED" +#define IUP_WIDTHDEF "WIDTHDEF" +#define IUP_HEIGHTDEF "HEIGHTDEF" +#define IUP_AREA "AREA" +#define IUP_MARK_MODE "MARK_MODE" +#define IUP_LIN "LIN" +#define IUP_COL "COL" +#define IUP_LINCOL "LINCOL" +#define IUP_CELL "CELL" +#define IUP_EDIT_MODE "EDIT_MODE" +#define IUP_FOCUS_CELL "FOCUS_CELL" +#define IUP_ORIGIN "ORIGIN" +#define IUP_REDRAW "REDRAW" +#define IUP_PREVIOUSVALUE "PREVIOUSVALUE" +#define IUP_MOUSEMOVE_CB "MOUSEMOVE_CB" + +/*****************/ +/* Tree */ +/*****************/ + +#define IUP_ADDLEAF "ADDLEAF" +#define IUP_ADDBRANCH "ADDBRANCH" +#define IUP_DELNODE "DELNODE" +#define IUP_IMAGELEAF "IMAGELEAF" +#define IUP_IMAGEBRANCHCOLLAPSED "IMAGEBRANCHCOLLAPSED" +#define IUP_IMAGEBRANCHEXPANDED "IMAGEBRANCHEXPANDED" +#define IUP_IMAGEEXPANDED "IMAGEEXPANDED" +#define IUP_KIND "KIND" +#define IUP_PARENT "PARENT" +#define IUP_DEPTH "DEPTH" +#define IUP_MARKED "MARKED" +#define IUP_ADDEXPANDED "ADDEXPANDED" +#define IUP_CTRL "CTRL" +#define IUP_SHIFT "SHIFT" +#define IUP_STATE "STATE" +#define IUP_STARTING "STARTING" +#define IUP_LEAF "LEAF" +#define IUP_BRANCH "BRANCH" +#define IUP_SELECTED "SELECTED" +#define IUP_CHILDREN "CHILDREN" +#define IUP_MARKED "MARKED" +#define IUP_ROOT "ROOT" +#define IUP_LAST "LAST" +#define IUP_PGUP "PGUP" +#define IUP_PGDN "PGDN" +#define IUP_NEXT "NEXT" +#define IUP_PREVIOUS "PREVIOUS" +#define IUP_INVERT "INVERT" +#define IUP_BLOCK "BLOCK" +#define IUP_CLEARALL "CLEARALL" +#define IUP_MARKALL "MARKALL" +#define IUP_INVERTALL "INVERTALL" +#define IUP_REDRAW "REDRAW" +#define IUP_COLLAPSED "COLLAPSED" +#define IUP_EXPANDED "EXPANDED" +#define IUP_SELECTION_CB "SELECTION_CB" +#define IUP_BRANCHOPEN_CB "BRANCHOPEN_CB" +#define IUP_BRANCHCLOSE_CB "BRANCHCLOSE_CB" +#define IUP_RIGHTCLICK_CB "RIGHTCLICK_CB" +#define IUP_EXECUTELEAF_CB "EXECUTELEAF_CB" +#define IUP_RENAMENODE_CB "RENAMENODE_CB" +#define IUP_IMGLEAF "IMGLEAF" +#define IUP_IMGCOLLAPSED "IMGCOLLAPSED" +#define IUP_IMGEXPANDED "IMGEXPANDED" +#define IUP_IMGBLANK "IMGBLANK" +#define IUP_IMGPAPER "IMGPAPER" + +#endif + diff --git a/komodoeditor/libs/iup/windows/include/iupdraw.h b/komodoeditor/libs/iup/windows/include/iupdraw.h new file mode 100644 index 0000000..5e9c079 --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iupdraw.h @@ -0,0 +1,47 @@ +/** \file + * \brief Canvas Draw API + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPDRAW_H +#define __IUPDRAW_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* all functions can be used only in IUP canvas and inside the ACTION callback */ + +IUP_API void IupDrawBegin(Ihandle* ih); +IUP_API void IupDrawEnd(Ihandle* ih); + +/* all functions can be called only between calls to Begin and End */ + +IUP_API void IupDrawSetClipRect(Ihandle* ih, int x1, int y1, int x2, int y2); +IUP_API void IupDrawGetClipRect(Ihandle* ih, int *x1, int *y1, int *x2, int *y2); +IUP_API void IupDrawResetClip(Ihandle* ih); + +/* color controlled by the attribute DRAWCOLOR */ +/* line style or fill controlled by the attribute DRAWSTYLE */ + +IUP_API void IupDrawParentBackground(Ihandle* ih); +IUP_API void IupDrawLine(Ihandle* ih, int x1, int y1, int x2, int y2); +IUP_API void IupDrawRectangle(Ihandle* ih, int x1, int y1, int x2, int y2); +IUP_API void IupDrawArc(Ihandle* ih, int x1, int y1, int x2, int y2, double a1, double a2); +IUP_API void IupDrawPolygon(Ihandle* ih, int* points, int count); +IUP_API void IupDrawText(Ihandle* ih, const char* text, int len, int x, int y, int w, int h); +IUP_API void IupDrawImage(Ihandle* ih, const char* name, int x, int y, int w, int h); +IUP_API void IupDrawSelectRect(Ihandle* ih, int x1, int y1, int x2, int y2); +IUP_API void IupDrawFocusRect(Ihandle* ih, int x1, int y1, int x2, int y2); + +IUP_API void IupDrawGetSize(Ihandle* ih, int *w, int *h); +IUP_API void IupDrawGetTextSize(Ihandle* ih, const char* text, int len, int *w, int *h); +IUP_API void IupDrawGetImageInfo(const char* name, int *w, int *h, int *bpp); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/windows/include/iupdraw_cd.h b/komodoeditor/libs/iup/windows/include/iupdraw_cd.h new file mode 100644 index 0000000..554fe69 --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iupdraw_cd.h @@ -0,0 +1,21 @@ +/** \file + * \brief IupDraw CD driver + * + * See Copyright Notice in iup.h + */ + +#ifndef __CD_IUPDRAW_H +#define __CD_IUPDRAW_H + +#ifdef __cplusplus +extern "C" { +#endif + +cdContext* cdContextIupDraw(void); +#define CD_IUPDRAW cdContextIupDraw() + +#ifdef __cplusplus +} +#endif + +#endif /* ifndef __CD_IUPDRAW_ */ diff --git a/komodoeditor/libs/iup/windows/include/iupfiledlg.h b/komodoeditor/libs/iup/windows/include/iupfiledlg.h new file mode 100644 index 0000000..48a37b9 --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iupfiledlg.h @@ -0,0 +1,24 @@ +/** \file + * \brief New FileDlg (Windows Only). + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPFILEDLG_H +#define __IUPFILEDLG_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* the only exported function, + once called it will replace regular IupFileDlg */ + +int IupNewFileDlgOpen(void); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/windows/include/iupgl.h b/komodoeditor/libs/iup/windows/include/iupgl.h new file mode 100644 index 0000000..fa0f869 --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iupgl.h @@ -0,0 +1,97 @@ +/** \file + * \brief OpenGL canvas for Iup. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPGL_H +#define __IUPGL_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Attributes +** To set the appropriate visual (pixel format) the following +** attributes may be specified. Their values should be set +** before the canvas is mapped to the scrren. +** After mapping, changing their values has no effect. +*/ +#ifndef IUP_BUFFER /* IUP_SINGLE (defaut) or IUP_DOUBLE */ +#define IUP_BUFFER "BUFFER" +#endif +#ifndef IUP_STEREO /* IUP_NO (defaut) or IUP_YES */ +#define IUP_STEREO "STEREO" +#endif +#ifndef IUP_BUFFER_SIZE /* Number of bits if index mode */ +#define IUP_BUFFER_SIZE "BUFFER_SIZE" +#endif +#ifndef IUP_RED_SIZE /* Number of red bits */ +#define IUP_RED_SIZE "RED_SIZE" +#endif +#ifndef IUP_GREEN_SIZE /* Number of green bits */ +#define IUP_GREEN_SIZE "GREEN_SIZE" +#endif +#ifndef IUP_BLUE_SIZE /* Number of blue bits */ +#define IUP_BLUE_SIZE "BLUE_SIZE" +#endif +#ifndef IUP_ALPHA_SIZE /* Number of alpha bits */ +#define IUP_ALPHA_SIZE "ALPHA_SIZE" +#endif +#ifndef IUP_DEPTH_SIZE /* Number of bits in depth buffer */ +#define IUP_DEPTH_SIZE "DEPTH_SIZE" +#endif +#ifndef IUP_STENCIL_SIZE /* Number of bits in stencil buffer */ +#define IUP_STENCIL_SIZE "STENCIL_SIZE" +#endif +#ifndef IUP_ACCUM_RED_SIZE /* Number of red bits in accum. buffer */ +#define IUP_ACCUM_RED_SIZE "ACCUM_RED_SIZE" +#endif +#ifndef IUP_ACCUM_GREEN_SIZE /* Number of green bits in accum. buffer */ +#define IUP_ACCUM_GREEN_SIZE "ACCUM_GREEN_SIZE" +#endif +#ifndef IUP_ACCUM_BLUE_SIZE /* Number of blue bits in accum. buffer */ +#define IUP_ACCUM_BLUE_SIZE "ACCUM_BLUE_SIZE" +#endif +#ifndef IUP_ACCUM_ALPHA_SIZE /* Number of alpha bits in accum. buffer */ +#define IUP_ACCUM_ALPHA_SIZE "ACCUM_ALPHA_SIZE" +#endif + + +/* Attribute values */ +#ifndef IUP_DOUBLE +#define IUP_DOUBLE "DOUBLE" +#endif +#ifndef IUP_SINGLE +#define IUP_SINGLE "SINGLE" +#endif +#ifndef IUP_INDEX +#define IUP_INDEX "INDEX" +#endif +#ifndef IUP_RGBA +#define IUP_RGBA "RGBA" +#endif +#ifndef IUP_YES +#define IUP_YES "YES" +#endif +#ifndef IUP_NO +#define IUP_NO "NO" +#endif + +void IupGLCanvasOpen(void); + +Ihandle *IupGLCanvas(const char *action); +Ihandle* IupGLBackgroundBox(Ihandle* child); + +void IupGLMakeCurrent(Ihandle* ih); +int IupGLIsCurrent(Ihandle* ih); +void IupGLSwapBuffers(Ihandle* ih); +void IupGLPalette(Ihandle* ih, int index, float r, float g, float b); +void IupGLUseFont(Ihandle* ih, int first, int count, int list_base); +void IupGLWait(int gl); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/windows/include/iupglcontrols.h b/komodoeditor/libs/iup/windows/include/iupglcontrols.h new file mode 100644 index 0000000..0132608 --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iupglcontrols.h @@ -0,0 +1,47 @@ +/** \file + * \brief GL Controls. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPGLCONTROLS_H +#define __IUPGLCONTROLS_H + +#ifdef __cplusplus +extern "C" { +#endif + + +int IupGLControlsOpen(void); + +Ihandle* IupGLCanvasBoxv(Ihandle** children); +Ihandle* IupGLCanvasBox(Ihandle* child, ...); + +Ihandle* IupGLSubCanvas(void); + +Ihandle* IupGLLabel(const char* title); +Ihandle* IupGLSeparator(void); +Ihandle* IupGLButton(const char* title); +Ihandle* IupGLToggle(const char* title); +Ihandle* IupGLLink(const char *url, const char * title); +Ihandle* IupGLProgressBar(void); +Ihandle* IupGLVal(void); +Ihandle* IupGLFrame(Ihandle* child); +Ihandle* IupGLExpander(Ihandle* child); +Ihandle* IupGLScrollBox(Ihandle* child); +Ihandle* IupGLSizeBox(Ihandle* child); +Ihandle* IupGLText(void); + + +/* Utilities */ +void IupGLDrawImage(Ihandle* ih, const char* name, int x, int y, int active); +void IupGLDrawText(Ihandle* ih, const char* str, int len, int x, int y); +void IupGLDrawGetTextSize(Ihandle* ih, const char* str, int *w, int *h); +void IupGLDrawGetImageInfo(const char* name, int *w, int *h, int *bpp); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/windows/include/iupim.h b/komodoeditor/libs/iup/windows/include/iupim.h new file mode 100644 index 0000000..185660a --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iupim.h @@ -0,0 +1,36 @@ +/** \file + * \brief Utilities using IM + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPIM_H +#define __IUPIM_H + +#if defined(__cplusplus) +extern "C" { +#endif + + +void IupImOpen(void); /* optional */ + +Ihandle* IupLoadImage(const char* filename); +int IupSaveImage(Ihandle* ih, const char* filename, const char* format); + +Ihandle* IupLoadAnimation(const char* filename); +Ihandle* IupLoadAnimationFrames(const char** filename_list, int file_count); + +#ifdef __IM_IMAGE_H +imImage* IupGetNativeHandleImage(void* handle); +void* IupGetImageNativeHandle(const imImage* image); + +Ihandle* IupImageFromImImage(const imImage* image); +imImage* IupImageToImImage(Ihandle* iup_image); +#endif + + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/windows/include/iupkey.h b/komodoeditor/libs/iup/windows/include/iupkey.h new file mode 100644 index 0000000..42d8f17 --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iupkey.h @@ -0,0 +1,533 @@ +/** \file + * \brief Keyboard Keys definitions. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPKEY_H +#define __IUPKEY_H + +/* from 32 to 126, all character sets are equal, + the key code is the same as the ASCii character code. */ + +#define K_SP ' ' /* 32 (0x20) */ +#define K_exclam '!' /* 33 */ +#define K_quotedbl '\"' /* 34 */ +#define K_numbersign '#' /* 35 */ +#define K_dollar '$' /* 36 */ +#define K_percent '%' /* 37 */ +#define K_ampersand '&' /* 38 */ +#define K_apostrophe '\'' /* 39 */ +#define K_parentleft '(' /* 40 */ +#define K_parentright ')' /* 41 */ +#define K_asterisk '*' /* 42 */ +#define K_plus '+' /* 43 */ +#define K_comma ',' /* 44 */ +#define K_minus '-' /* 45 */ +#define K_period '.' /* 46 */ +#define K_slash '/' /* 47 */ +#define K_0 '0' /* 48 (0x30) */ +#define K_1 '1' /* 49 */ +#define K_2 '2' /* 50 */ +#define K_3 '3' /* 51 */ +#define K_4 '4' /* 52 */ +#define K_5 '5' /* 53 */ +#define K_6 '6' /* 54 */ +#define K_7 '7' /* 55 */ +#define K_8 '8' /* 56 */ +#define K_9 '9' /* 57 */ +#define K_colon ':' /* 58 */ +#define K_semicolon ';' /* 59 */ +#define K_less '<' /* 60 */ +#define K_equal '=' /* 61 */ +#define K_greater '>' /* 62 */ +#define K_question '?' /* 63 */ +#define K_at '@' /* 64 */ +#define K_A 'A' /* 65 (0x41) */ +#define K_B 'B' /* 66 */ +#define K_C 'C' /* 67 */ +#define K_D 'D' /* 68 */ +#define K_E 'E' /* 69 */ +#define K_F 'F' /* 70 */ +#define K_G 'G' /* 71 */ +#define K_H 'H' /* 72 */ +#define K_I 'I' /* 73 */ +#define K_J 'J' /* 74 */ +#define K_K 'K' /* 75 */ +#define K_L 'L' /* 76 */ +#define K_M 'M' /* 77 */ +#define K_N 'N' /* 78 */ +#define K_O 'O' /* 79 */ +#define K_P 'P' /* 80 */ +#define K_Q 'Q' /* 81 */ +#define K_R 'R' /* 82 */ +#define K_S 'S' /* 83 */ +#define K_T 'T' /* 84 */ +#define K_U 'U' /* 85 */ +#define K_V 'V' /* 86 */ +#define K_W 'W' /* 87 */ +#define K_X 'X' /* 88 */ +#define K_Y 'Y' /* 89 */ +#define K_Z 'Z' /* 90 */ +#define K_bracketleft '[' /* 91 */ +#define K_backslash '\\' /* 92 */ +#define K_bracketright ']' /* 93 */ +#define K_circum '^' /* 94 */ +#define K_underscore '_' /* 95 */ +#define K_grave '`' /* 96 */ +#define K_a 'a' /* 97 (0x61) */ +#define K_b 'b' /* 98 */ +#define K_c 'c' /* 99 */ +#define K_d 'd' /* 100 */ +#define K_e 'e' /* 101 */ +#define K_f 'f' /* 102 */ +#define K_g 'g' /* 103 */ +#define K_h 'h' /* 104 */ +#define K_i 'i' /* 105 */ +#define K_j 'j' /* 106 */ +#define K_k 'k' /* 107 */ +#define K_l 'l' /* 108 */ +#define K_m 'm' /* 109 */ +#define K_n 'n' /* 110 */ +#define K_o 'o' /* 111 */ +#define K_p 'p' /* 112 */ +#define K_q 'q' /* 113 */ +#define K_r 'r' /* 114 */ +#define K_s 's' /* 115 */ +#define K_t 't' /* 116 */ +#define K_u 'u' /* 117 */ +#define K_v 'v' /* 118 */ +#define K_w 'w' /* 119 */ +#define K_x 'x' /* 120 */ +#define K_y 'y' /* 121 */ +#define K_z 'z' /* 122 */ +#define K_braceleft '{' /* 123 */ +#define K_bar '|' /* 124 */ +#define K_braceright '}' /* 125 */ +#define K_tilde '~' /* 126 (0x7E) */ + +/* Printable ASCii keys */ + +#define iup_isprint(_c) ((_c) > 31 && (_c) < 127) + +/* also define the escape sequences that have keys associated */ + +#define K_BS '\b' /* 8 */ +#define K_TAB '\t' /* 9 */ +#define K_LF '\n' /* 10 (0x0A) not a real key, is a combination of CR with a modifier, just to document */ +#define K_CR '\r' /* 13 (0x0D) */ + +/* backward compatible definitions */ + +#define K_quoteleft K_grave +#define K_quoteright K_apostrophe +#define isxkey iup_isXkey + +/* IUP Extended Key Codes, range start at 128 */ + +#define iup_isXkey(_c) ((_c) >= 128) + +/* These use the same definition as X11 and GDK. + This also means that any X11 or GDK definition can also be used. */ + +#define K_PAUSE 0xFF13 +#define K_ESC 0xFF1B +#define K_HOME 0xFF50 +#define K_LEFT 0xFF51 +#define K_UP 0xFF52 +#define K_RIGHT 0xFF53 +#define K_DOWN 0xFF54 +#define K_PGUP 0xFF55 +#define K_PGDN 0xFF56 +#define K_END 0xFF57 +#define K_MIDDLE 0xFF0B +#define K_Print 0xFF61 +#define K_INS 0xFF63 +#define K_Menu 0xFF67 +#define K_DEL 0xFFFF +#define K_F1 0xFFBE +#define K_F2 0xFFBF +#define K_F3 0xFFC0 +#define K_F4 0xFFC1 +#define K_F5 0xFFC2 +#define K_F6 0xFFC3 +#define K_F7 0xFFC4 +#define K_F8 0xFFC5 +#define K_F9 0xFFC6 +#define K_F10 0xFFC7 +#define K_F11 0xFFC8 +#define K_F12 0xFFC9 +#define K_F13 0xFFCA +#define K_F14 0xFFCB +#define K_F15 0xFFCC +#define K_F16 0xFFCD +#define K_F17 0xFFCE +#define K_F18 0xFFCF +#define K_F19 0xFFD0 +#define K_F20 0xFFD1 + +/* no Shift/Ctrl/Alt */ +#define K_LSHIFT 0xFFE1 +#define K_RSHIFT 0xFFE2 +#define K_LCTRL 0xFFE3 +#define K_RCTRL 0xFFE4 +#define K_LALT 0xFFE9 +#define K_RALT 0xFFEA + +#define K_NUM 0xFF7F +#define K_SCROLL 0xFF14 +#define K_CAPS 0xFFE5 + +/* Mac clear button. Value randomly picked trying to avoid clashing with an existing value. */ +#define K_CLEAR 0xFFD2 +/* Help button if anybody has it. Value randomly picked trying to avoid clashing with an existing value. */ +#define K_HELP 0xFFD3 + +/* Also, these are the same as the Latin-1 definition */ + +#define K_ccedilla 0x00E7 +#define K_Ccedilla 0x00C7 +#define K_acute 0x00B4 /* no Shift/Ctrl/Alt */ +#define K_diaeresis 0x00A8 + +/******************************************************/ +/* Modifiers use last 4 bits. Since IUP 3.9 */ +/* These modifiers definitions are specific to IUP */ +/******************************************************/ + +#define iup_isShiftXkey(_c) (((_c) & 0x10000000) != 0) +#define iup_isCtrlXkey(_c) (((_c) & 0x20000000) != 0) +#define iup_isAltXkey(_c) (((_c) & 0x40000000) != 0) +#define iup_isSysXkey(_c) (((_c) & 0x80000000) != 0) + +#define iup_XkeyBase(_c) ((_c) & 0x0FFFFFFF) +#define iup_XkeyShift(_c) ((_c) | 0x10000000) /* Shift */ +#define iup_XkeyCtrl(_c) ((_c) | 0x20000000) /* Ctrl */ +#define iup_XkeyAlt(_c) ((_c) | 0x40000000) /* Alt */ +#define iup_XkeySys(_c) ((_c) | 0x80000000) /* Sys (Win or Apple) - notice that using "int" will display a negative value */ + +/* These definitions are here for backward compatibility + and to simplify some key combination usage. + But since IUP 3.9, modifiers can be combined with any key + and they can be mixed together. */ + +#define K_sHOME iup_XkeyShift(K_HOME ) +#define K_sUP iup_XkeyShift(K_UP ) +#define K_sPGUP iup_XkeyShift(K_PGUP ) +#define K_sLEFT iup_XkeyShift(K_LEFT ) +#define K_sMIDDLE iup_XkeyShift(K_MIDDLE ) +#define K_sRIGHT iup_XkeyShift(K_RIGHT ) +#define K_sEND iup_XkeyShift(K_END ) +#define K_sDOWN iup_XkeyShift(K_DOWN ) +#define K_sPGDN iup_XkeyShift(K_PGDN ) +#define K_sINS iup_XkeyShift(K_INS ) +#define K_sDEL iup_XkeyShift(K_DEL ) +#define K_sSP iup_XkeyShift(K_SP ) +#define K_sTAB iup_XkeyShift(K_TAB ) +#define K_sCR iup_XkeyShift(K_CR ) +#define K_sBS iup_XkeyShift(K_BS ) +#define K_sPAUSE iup_XkeyShift(K_PAUSE ) +#define K_sESC iup_XkeyShift(K_ESC ) +#define K_sCLEAR iup_XkeyShift(K_CLEAR ) +#define K_sF1 iup_XkeyShift(K_F1 ) +#define K_sF2 iup_XkeyShift(K_F2 ) +#define K_sF3 iup_XkeyShift(K_F3 ) +#define K_sF4 iup_XkeyShift(K_F4 ) +#define K_sF5 iup_XkeyShift(K_F5 ) +#define K_sF6 iup_XkeyShift(K_F6 ) +#define K_sF7 iup_XkeyShift(K_F7 ) +#define K_sF8 iup_XkeyShift(K_F8 ) +#define K_sF9 iup_XkeyShift(K_F9 ) +#define K_sF10 iup_XkeyShift(K_F10 ) +#define K_sF11 iup_XkeyShift(K_F11 ) +#define K_sF12 iup_XkeyShift(K_F12 ) +#define K_sF13 iup_XkeyShift(K_F13 ) +#define K_sF14 iup_XkeyShift(K_F14 ) +#define K_sF15 iup_XkeyShift(K_F15 ) +#define K_sF16 iup_XkeyShift(K_F16 ) +#define K_sF17 iup_XkeyShift(K_F17 ) +#define K_sF18 iup_XkeyShift(K_F18 ) +#define K_sF19 iup_XkeyShift(K_F19 ) +#define K_sF20 iup_XkeyShift(K_F20 ) +#define K_sPrint iup_XkeyShift(K_Print ) +#define K_sMenu iup_XkeyShift(K_Menu ) + +#define K_cHOME iup_XkeyCtrl(K_HOME ) +#define K_cUP iup_XkeyCtrl(K_UP ) +#define K_cPGUP iup_XkeyCtrl(K_PGUP ) +#define K_cLEFT iup_XkeyCtrl(K_LEFT ) +#define K_cMIDDLE iup_XkeyCtrl(K_MIDDLE ) +#define K_cRIGHT iup_XkeyCtrl(K_RIGHT ) +#define K_cEND iup_XkeyCtrl(K_END ) +#define K_cDOWN iup_XkeyCtrl(K_DOWN ) +#define K_cPGDN iup_XkeyCtrl(K_PGDN ) +#define K_cINS iup_XkeyCtrl(K_INS ) +#define K_cDEL iup_XkeyCtrl(K_DEL ) +#define K_cSP iup_XkeyCtrl(K_SP ) +#define K_cTAB iup_XkeyCtrl(K_TAB ) +#define K_cCR iup_XkeyCtrl(K_CR ) +#define K_cBS iup_XkeyCtrl(K_BS ) +#define K_cPAUSE iup_XkeyCtrl(K_PAUSE ) +#define K_cESC iup_XkeyCtrl(K_ESC ) +#define K_cCLEAR iup_XkeyCtrl(K_CLEAR ) +#define K_cCcedilla iup_XkeyCtrl(K_Ccedilla) +#define K_cF1 iup_XkeyCtrl(K_F1 ) +#define K_cF2 iup_XkeyCtrl(K_F2 ) +#define K_cF3 iup_XkeyCtrl(K_F3 ) +#define K_cF4 iup_XkeyCtrl(K_F4 ) +#define K_cF5 iup_XkeyCtrl(K_F5 ) +#define K_cF6 iup_XkeyCtrl(K_F6 ) +#define K_cF7 iup_XkeyCtrl(K_F7 ) +#define K_cF8 iup_XkeyCtrl(K_F8 ) +#define K_cF9 iup_XkeyCtrl(K_F9 ) +#define K_cF10 iup_XkeyCtrl(K_F10 ) +#define K_cF11 iup_XkeyCtrl(K_F11 ) +#define K_cF12 iup_XkeyCtrl(K_F12 ) +#define K_cF13 iup_XkeyCtrl(K_F13 ) +#define K_cF14 iup_XkeyCtrl(K_F14 ) +#define K_cF15 iup_XkeyCtrl(K_F15 ) +#define K_cF16 iup_XkeyCtrl(K_F16 ) +#define K_cF17 iup_XkeyCtrl(K_F17 ) +#define K_cF18 iup_XkeyCtrl(K_F18 ) +#define K_cF19 iup_XkeyCtrl(K_F19 ) +#define K_cF20 iup_XkeyCtrl(K_F20 ) +#define K_cPrint iup_XkeyCtrl(K_Print ) +#define K_cMenu iup_XkeyCtrl(K_Menu ) + +#define K_mHOME iup_XkeyAlt(K_HOME ) +#define K_mUP iup_XkeyAlt(K_UP ) +#define K_mPGUP iup_XkeyAlt(K_PGUP ) +#define K_mLEFT iup_XkeyAlt(K_LEFT ) +#define K_mMIDDLE iup_XkeyAlt(K_MIDDLE ) +#define K_mRIGHT iup_XkeyAlt(K_RIGHT ) +#define K_mEND iup_XkeyAlt(K_END ) +#define K_mDOWN iup_XkeyAlt(K_DOWN ) +#define K_mPGDN iup_XkeyAlt(K_PGDN ) +#define K_mINS iup_XkeyAlt(K_INS ) +#define K_mDEL iup_XkeyAlt(K_DEL ) +#define K_mSP iup_XkeyAlt(K_SP ) +#define K_mTAB iup_XkeyAlt(K_TAB ) +#define K_mCR iup_XkeyAlt(K_CR ) +#define K_mBS iup_XkeyAlt(K_BS ) +#define K_mPAUSE iup_XkeyAlt(K_PAUSE ) +#define K_mESC iup_XkeyAlt(K_ESC ) +#define K_mCLEAR iup_XkeyAlt(K_CLEAR ) +#define K_mCcedilla iup_XkeyAlt(K_Ccedilla) +#define K_mF1 iup_XkeyAlt(K_F1 ) +#define K_mF2 iup_XkeyAlt(K_F2 ) +#define K_mF3 iup_XkeyAlt(K_F3 ) +#define K_mF4 iup_XkeyAlt(K_F4 ) +#define K_mF5 iup_XkeyAlt(K_F5 ) +#define K_mF6 iup_XkeyAlt(K_F6 ) +#define K_mF7 iup_XkeyAlt(K_F7 ) +#define K_mF8 iup_XkeyAlt(K_F8 ) +#define K_mF9 iup_XkeyAlt(K_F9 ) +#define K_mF10 iup_XkeyAlt(K_F10 ) +#define K_mF11 iup_XkeyAlt(K_F11 ) +#define K_mF12 iup_XkeyAlt(K_F12 ) +#define K_mF13 iup_XkeyAlt(K_F13 ) +#define K_mF14 iup_XkeyAlt(K_F14 ) +#define K_mF15 iup_XkeyAlt(K_F15 ) +#define K_mF16 iup_XkeyAlt(K_F16 ) +#define K_mF17 iup_XkeyAlt(K_F17 ) +#define K_mF18 iup_XkeyAlt(K_F18 ) +#define K_mF19 iup_XkeyAlt(K_F19 ) +#define K_mF20 iup_XkeyAlt(K_F20 ) +#define K_mPrint iup_XkeyAlt(K_Print ) +#define K_mMenu iup_XkeyAlt(K_Menu ) + +#define K_yHOME iup_XkeySys(K_HOME ) +#define K_yUP iup_XkeySys(K_UP ) +#define K_yPGUP iup_XkeySys(K_PGUP ) +#define K_yLEFT iup_XkeySys(K_LEFT ) +#define K_yMIDDLE iup_XkeySys(K_MIDDLE ) +#define K_yRIGHT iup_XkeySys(K_RIGHT ) +#define K_yEND iup_XkeySys(K_END ) +#define K_yDOWN iup_XkeySys(K_DOWN ) +#define K_yPGDN iup_XkeySys(K_PGDN ) +#define K_yINS iup_XkeySys(K_INS ) +#define K_yDEL iup_XkeySys(K_DEL ) +#define K_ySP iup_XkeySys(K_SP ) +#define K_yTAB iup_XkeySys(K_TAB ) +#define K_yCR iup_XkeySys(K_CR ) +#define K_yBS iup_XkeySys(K_BS ) +#define K_yPAUSE iup_XkeySys(K_PAUSE ) +#define K_yESC iup_XkeySys(K_ESC ) +#define K_yCLEAR iup_XkeySys(K_CLEAR ) +#define K_yCcedilla iup_XkeySys(K_Ccedilla) +#define K_yF1 iup_XkeySys(K_F1 ) +#define K_yF2 iup_XkeySys(K_F2 ) +#define K_yF3 iup_XkeySys(K_F3 ) +#define K_yF4 iup_XkeySys(K_F4 ) +#define K_yF5 iup_XkeySys(K_F5 ) +#define K_yF6 iup_XkeySys(K_F6 ) +#define K_yF7 iup_XkeySys(K_F7 ) +#define K_yF8 iup_XkeySys(K_F8 ) +#define K_yF9 iup_XkeySys(K_F9 ) +#define K_yF10 iup_XkeySys(K_F10 ) +#define K_yF11 iup_XkeySys(K_F11 ) +#define K_yF12 iup_XkeySys(K_F12 ) +#define K_yF13 iup_XkeySys(K_F13 ) +#define K_yF14 iup_XkeySys(K_F14 ) +#define K_yF15 iup_XkeySys(K_F15 ) +#define K_yF16 iup_XkeySys(K_F16 ) +#define K_yF17 iup_XkeySys(K_F17 ) +#define K_yF18 iup_XkeySys(K_F18 ) +#define K_yF19 iup_XkeySys(K_F19 ) +#define K_yF20 iup_XkeySys(K_F20 ) +#define K_yPrint iup_XkeySys(K_Print ) +#define K_yMenu iup_XkeySys(K_Menu ) + +#define K_sPlus iup_XkeyShift(K_plus ) +#define K_sComma iup_XkeyShift(K_comma ) +#define K_sMinus iup_XkeyShift(K_minus ) +#define K_sPeriod iup_XkeyShift(K_period ) +#define K_sSlash iup_XkeyShift(K_slash ) +#define K_sAsterisk iup_XkeyShift(K_asterisk) + +#define K_cA iup_XkeyCtrl(K_A) +#define K_cB iup_XkeyCtrl(K_B) +#define K_cC iup_XkeyCtrl(K_C) +#define K_cD iup_XkeyCtrl(K_D) +#define K_cE iup_XkeyCtrl(K_E) +#define K_cF iup_XkeyCtrl(K_F) +#define K_cG iup_XkeyCtrl(K_G) +#define K_cH iup_XkeyCtrl(K_H) +#define K_cI iup_XkeyCtrl(K_I) +#define K_cJ iup_XkeyCtrl(K_J) +#define K_cK iup_XkeyCtrl(K_K) +#define K_cL iup_XkeyCtrl(K_L) +#define K_cM iup_XkeyCtrl(K_M) +#define K_cN iup_XkeyCtrl(K_N) +#define K_cO iup_XkeyCtrl(K_O) +#define K_cP iup_XkeyCtrl(K_P) +#define K_cQ iup_XkeyCtrl(K_Q) +#define K_cR iup_XkeyCtrl(K_R) +#define K_cS iup_XkeyCtrl(K_S) +#define K_cT iup_XkeyCtrl(K_T) +#define K_cU iup_XkeyCtrl(K_U) +#define K_cV iup_XkeyCtrl(K_V) +#define K_cW iup_XkeyCtrl(K_W) +#define K_cX iup_XkeyCtrl(K_X) +#define K_cY iup_XkeyCtrl(K_Y) +#define K_cZ iup_XkeyCtrl(K_Z) +#define K_c1 iup_XkeyCtrl(K_1) +#define K_c2 iup_XkeyCtrl(K_2) +#define K_c3 iup_XkeyCtrl(K_3) +#define K_c4 iup_XkeyCtrl(K_4) +#define K_c5 iup_XkeyCtrl(K_5) +#define K_c6 iup_XkeyCtrl(K_6) +#define K_c7 iup_XkeyCtrl(K_7) +#define K_c8 iup_XkeyCtrl(K_8) +#define K_c9 iup_XkeyCtrl(K_9) +#define K_c0 iup_XkeyCtrl(K_0) +#define K_cPlus iup_XkeyCtrl(K_plus ) +#define K_cComma iup_XkeyCtrl(K_comma ) +#define K_cMinus iup_XkeyCtrl(K_minus ) +#define K_cPeriod iup_XkeyCtrl(K_period ) +#define K_cSlash iup_XkeyCtrl(K_slash ) +#define K_cSemicolon iup_XkeyCtrl(K_semicolon ) +#define K_cEqual iup_XkeyCtrl(K_equal ) +#define K_cBracketleft iup_XkeyCtrl(K_bracketleft ) +#define K_cBracketright iup_XkeyCtrl(K_bracketright) +#define K_cBackslash iup_XkeyCtrl(K_backslash ) +#define K_cAsterisk iup_XkeyCtrl(K_asterisk ) + +#define K_mA iup_XkeyAlt(K_A) +#define K_mB iup_XkeyAlt(K_B) +#define K_mC iup_XkeyAlt(K_C) +#define K_mD iup_XkeyAlt(K_D) +#define K_mE iup_XkeyAlt(K_E) +#define K_mF iup_XkeyAlt(K_F) +#define K_mG iup_XkeyAlt(K_G) +#define K_mH iup_XkeyAlt(K_H) +#define K_mI iup_XkeyAlt(K_I) +#define K_mJ iup_XkeyAlt(K_J) +#define K_mK iup_XkeyAlt(K_K) +#define K_mL iup_XkeyAlt(K_L) +#define K_mM iup_XkeyAlt(K_M) +#define K_mN iup_XkeyAlt(K_N) +#define K_mO iup_XkeyAlt(K_O) +#define K_mP iup_XkeyAlt(K_P) +#define K_mQ iup_XkeyAlt(K_Q) +#define K_mR iup_XkeyAlt(K_R) +#define K_mS iup_XkeyAlt(K_S) +#define K_mT iup_XkeyAlt(K_T) +#define K_mU iup_XkeyAlt(K_U) +#define K_mV iup_XkeyAlt(K_V) +#define K_mW iup_XkeyAlt(K_W) +#define K_mX iup_XkeyAlt(K_X) +#define K_mY iup_XkeyAlt(K_Y) +#define K_mZ iup_XkeyAlt(K_Z) +#define K_m1 iup_XkeyAlt(K_1) +#define K_m2 iup_XkeyAlt(K_2) +#define K_m3 iup_XkeyAlt(K_3) +#define K_m4 iup_XkeyAlt(K_4) +#define K_m5 iup_XkeyAlt(K_5) +#define K_m6 iup_XkeyAlt(K_6) +#define K_m7 iup_XkeyAlt(K_7) +#define K_m8 iup_XkeyAlt(K_8) +#define K_m9 iup_XkeyAlt(K_9) +#define K_m0 iup_XkeyAlt(K_0) +#define K_mPlus iup_XkeyAlt(K_plus ) +#define K_mComma iup_XkeyAlt(K_comma ) +#define K_mMinus iup_XkeyAlt(K_minus ) +#define K_mPeriod iup_XkeyAlt(K_period ) +#define K_mSlash iup_XkeyAlt(K_slash ) +#define K_mSemicolon iup_XkeyAlt(K_semicolon ) +#define K_mEqual iup_XkeyAlt(K_equal ) +#define K_mBracketleft iup_XkeyAlt(K_bracketleft ) +#define K_mBracketright iup_XkeyAlt(K_bracketright) +#define K_mBackslash iup_XkeyAlt(K_backslash ) +#define K_mAsterisk iup_XkeyAlt(K_asterisk ) + +#define K_yA iup_XkeySys(K_A) +#define K_yB iup_XkeySys(K_B) +#define K_yC iup_XkeySys(K_C) +#define K_yD iup_XkeySys(K_D) +#define K_yE iup_XkeySys(K_E) +#define K_yF iup_XkeySys(K_F) +#define K_yG iup_XkeySys(K_G) +#define K_yH iup_XkeySys(K_H) +#define K_yI iup_XkeySys(K_I) +#define K_yJ iup_XkeySys(K_J) +#define K_yK iup_XkeySys(K_K) +#define K_yL iup_XkeySys(K_L) +#define K_yM iup_XkeySys(K_M) +#define K_yN iup_XkeySys(K_N) +#define K_yO iup_XkeySys(K_O) +#define K_yP iup_XkeySys(K_P) +#define K_yQ iup_XkeySys(K_Q) +#define K_yR iup_XkeySys(K_R) +#define K_yS iup_XkeySys(K_S) +#define K_yT iup_XkeySys(K_T) +#define K_yU iup_XkeySys(K_U) +#define K_yV iup_XkeySys(K_V) +#define K_yW iup_XkeySys(K_W) +#define K_yX iup_XkeySys(K_X) +#define K_yY iup_XkeySys(K_Y) +#define K_yZ iup_XkeySys(K_Z) +#define K_y1 iup_XkeySys(K_1) +#define K_y2 iup_XkeySys(K_2) +#define K_y3 iup_XkeySys(K_3) +#define K_y4 iup_XkeySys(K_4) +#define K_y5 iup_XkeySys(K_5) +#define K_y6 iup_XkeySys(K_6) +#define K_y7 iup_XkeySys(K_7) +#define K_y8 iup_XkeySys(K_8) +#define K_y9 iup_XkeySys(K_9) +#define K_y0 iup_XkeySys(K_0) +#define K_yPlus iup_XkeySys(K_plus ) +#define K_yComma iup_XkeySys(K_comma ) +#define K_yMinus iup_XkeySys(K_minus ) +#define K_yPeriod iup_XkeySys(K_period ) +#define K_ySlash iup_XkeySys(K_slash ) +#define K_ySemicolon iup_XkeySys(K_semicolon ) +#define K_yEqual iup_XkeySys(K_equal ) +#define K_yBracketleft iup_XkeySys(K_bracketleft ) +#define K_yBracketright iup_XkeySys(K_bracketright) +#define K_yBackslash iup_XkeySys(K_backslash ) +#define K_yAsterisk iup_XkeySys(K_asterisk ) + + +#endif diff --git a/komodoeditor/libs/iup/windows/include/iuplua.h b/komodoeditor/libs/iup/windows/include/iuplua.h new file mode 100644 index 0000000..5893d13 --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iuplua.h @@ -0,0 +1,54 @@ +/** \file + * \brief IUP Binding for Lua. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPLUA_H +#define __IUPLUA_H + +#ifdef __cplusplus +extern "C" { +#endif + + +#ifndef DOXYGEN_SHOULD_IGNORE_THIS +/** @cond DOXYGEN_SHOULD_IGNORE_THIS */ +#ifndef IUPLUA_API +#ifdef IUPLUA_BUILD_LIBRARY + #ifdef __EMSCRIPTEN__ + #include + #define IUPLUA_API EMSCRIPTEN_KEEPALIVE + #elif WIN32 + #define IUPLUA_API __declspec(dllexport) + #elif defined(__GNUC__) && __GNUC__ >= 4 + #define IUPLUA_API __attribute__ ((visibility("default"))) + #else + #define IUPLUA_API + #endif +#else + #define IUPLUA_API +#endif /* IUPLUA_BUILD_LIBRARY */ +#endif /* IUPLUA_API */ +/** @endcond DOXYGEN_SHOULD_IGNORE_THIS */ +#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ + + +IUPLUA_API int iuplua_open(lua_State *L); +IUPLUA_API int iupkey_open(lua_State *L); /* does nothing, kept for backward compatibility */ +IUPLUA_API int iuplua_close(lua_State * L); + +/* utilities */ +IUPLUA_API int iuplua_isihandle(lua_State *L, int pos); +IUPLUA_API Ihandle* iuplua_checkihandle(lua_State *L, int pos); +IUPLUA_API void iuplua_pushihandle(lua_State *L, Ihandle *n); +IUPLUA_API int iuplua_dofile(lua_State *L, const char *filename); +IUPLUA_API int iuplua_dostring(lua_State *L, const char *string, const char *chunk_name); +IUPLUA_API int iuplua_dobuffer(lua_State *L, const char *buffer, int len, const char *chunk_name); +IUPLUA_API void iuplua_show_error_message(const char *pname, const char* msg); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/windows/include/iuplua_mglplot.h b/komodoeditor/libs/iup/windows/include/iuplua_mglplot.h new file mode 100644 index 0000000..75355c7 --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iuplua_mglplot.h @@ -0,0 +1,20 @@ +/** \file + * \brief IupMglPlot Binding for Lua. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPLUA_MGLPLOT_H +#define __IUPLUA_MGLPLOT_H + +#ifdef __cplusplus +extern "C" { +#endif + +int iup_mglplotlua_open (lua_State * L); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/windows/include/iuplua_plot.h b/komodoeditor/libs/iup/windows/include/iuplua_plot.h new file mode 100644 index 0000000..1a84c92 --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iuplua_plot.h @@ -0,0 +1,20 @@ +/** \file + * \brief iup_plot Binding for Lua. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPLUA_PLOT_H +#define __IUPLUA_PLOT_H + +#ifdef __cplusplus +extern "C" { +#endif + +int iup_plotlua_open (lua_State * L); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/windows/include/iuplua_scintilla.h b/komodoeditor/libs/iup/windows/include/iuplua_scintilla.h new file mode 100644 index 0000000..86618d6 --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iuplua_scintilla.h @@ -0,0 +1,20 @@ +/** \file + * \brief IupScintilla Binding for Lua. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPLUA_SCINTILLA_H +#define __IUPLUA_SCINTILLA_H + +#ifdef __cplusplus +extern "C" { +#endif + +int iup_scintillalua_open (lua_State * L); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/windows/include/iupluacontrols.h b/komodoeditor/libs/iup/windows/include/iupluacontrols.h new file mode 100644 index 0000000..1244607 --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iupluacontrols.h @@ -0,0 +1,20 @@ +/** \file + * \brief iupcontrols Binding for Lua. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPLUACONTROLS_H +#define __IUPLUACONTROLS_H + +#ifdef __cplusplus +extern "C" { +#endif + +int iupcontrolslua_open (lua_State * L); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/windows/include/iupluafiledlg.h b/komodoeditor/libs/iup/windows/include/iupluafiledlg.h new file mode 100644 index 0000000..465886f --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iupluafiledlg.h @@ -0,0 +1,20 @@ +/** \file + * \brief Binding of new iupfiledlg to Lua. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPLUAFILEDLG_H +#define __IUPLUAFILEDLG_H + +#ifdef __cplusplus +extern "C" { +#endif + +int iupfiledlglua_open (lua_State * L); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/windows/include/iupluagl.h b/komodoeditor/libs/iup/windows/include/iupluagl.h new file mode 100644 index 0000000..db71d26 --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iupluagl.h @@ -0,0 +1,20 @@ +/** \file + * \brief Binding of iupglcanvas to Lua. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPLUAGL_H +#define __IUPLUAGL_H + +#ifdef __cplusplus +extern "C" { +#endif + +int iupgllua_open (lua_State * L); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/windows/include/iupluaglcontrols.h b/komodoeditor/libs/iup/windows/include/iupluaglcontrols.h new file mode 100644 index 0000000..ebec46b --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iupluaglcontrols.h @@ -0,0 +1,20 @@ +/** \file + * \brief iupglcontrols Binding for Lua. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPLUAGLCONTROLS_H +#define __IUPLUAGLCONTROLS_H + +#ifdef __cplusplus +extern "C" { +#endif + +int iupglcontrolslua_open (lua_State * L); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/windows/include/iupluaim.h b/komodoeditor/libs/iup/windows/include/iupluaim.h new file mode 100644 index 0000000..77c7670 --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iupluaim.h @@ -0,0 +1,20 @@ +/** \file + * \brief Bindig of iupim functions to Lua. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPLUAIM_H +#define __IUPLUAIM_H + +#ifdef __cplusplus +extern "C" { +#endif + +int iupimlua_open(lua_State * L); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/windows/include/iupluaole.h b/komodoeditor/libs/iup/windows/include/iupluaole.h new file mode 100644 index 0000000..6c3a23f --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iupluaole.h @@ -0,0 +1,20 @@ +/** \file + * \brief Binding of iupolecontrol to Lua. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPLUAOLE_H +#define __IUPLUAOLE_H + +#ifdef __cplusplus +extern "C" { +#endif + +int iupolelua_open (lua_State * L); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/windows/include/iupluascripterdlg.h b/komodoeditor/libs/iup/windows/include/iupluascripterdlg.h new file mode 100644 index 0000000..695ee29 --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iupluascripterdlg.h @@ -0,0 +1,25 @@ +/** \file + * \brief IupLuaScripterDlg dialog and Lua binding + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPLUASCRIPTERDLG_H +#define __IUPLUASCRIPTERDLG_H + +#ifdef __cplusplus +extern "C" { +#endif + +void IupLuaScripterDlgOpen(lua_State * L); + +Ihandle* IupLuaScripterDlg(void); + +/* Lua binding */ +int iupluascripterdlglua_open(lua_State * L); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/windows/include/iupluatuio.h b/komodoeditor/libs/iup/windows/include/iupluatuio.h new file mode 100644 index 0000000..334de4b --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iupluatuio.h @@ -0,0 +1,20 @@ +/** \file + * \brief Binding of iuptuio to Lua. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPLUATUIO_H +#define __IUPLUATUIO_H + +#ifdef __cplusplus +extern "C" { +#endif + +int iuptuiolua_open (lua_State * L); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/windows/include/iupluaweb.h b/komodoeditor/libs/iup/windows/include/iupluaweb.h new file mode 100644 index 0000000..0556d98 --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iupluaweb.h @@ -0,0 +1,42 @@ +/** \file + * \brief Binding of iupwebbrowser to Lua. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPLUAWEB_H +#define __IUPLUAWEB_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef DOXYGEN_SHOULD_IGNORE_THIS +/** @cond DOXYGEN_SHOULD_IGNORE_THIS */ +#ifndef IUPLUAWEB_API +#ifdef IUPLUAWEB_BUILD_LIBRARY + #ifdef __EMSCRIPTEN__ + #include + #define IUPLUAWEB_API EMSCRIPTEN_KEEPALIVE + #elif WIN32 + #define IUPLUAWEB_API __declspec(dllexport) + #elif defined(__GNUC__) && __GNUC__ >= 4 + #define IUPLUAWEB_API __attribute__ ((visibility("default"))) + #else + #define IUPLUAWEB_API + #endif +#else + #define IUPLUAWEB_API +#endif /* IUPLUAWEB_BUILD_LIBRARY */ +#endif /* IUPLUAWEB_API */ +/** @endcond DOXYGEN_SHOULD_IGNORE_THIS */ +#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ + + +IUPLUAWEB_API int iupweblua_open (lua_State * L); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/windows/include/iupole.h b/komodoeditor/libs/iup/windows/include/iupole.h new file mode 100644 index 0000000..4e7aed3 --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iupole.h @@ -0,0 +1,45 @@ +/** \file + * \brief Ole control. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPOLE_H +#define __IUPOLE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef DOXYGEN_SHOULD_IGNORE_THIS + /** @cond DOXYGEN_SHOULD_IGNORE_THIS */ +#ifndef IUPOLE_API +#ifdef IUPOLE_BUILD_LIBRARY +#ifdef __EMSCRIPTEN__ +#include +#define IUPOLE_API EMSCRIPTEN_KEEPALIVE +#elif WIN32 +#define IUPOLE_API __declspec(dllexport) +#elif defined(__GNUC__) && __GNUC__ >= 4 +#define IUPOLE_API __attribute__ ((visibility("default"))) +#else +#define IUPOLE_API +#endif +#else +#define IUPOLE_API +#endif /* IUP_BUILD_LIBRARY */ +#endif /* IUPOLE_API */ + /** @endcond DOXYGEN_SHOULD_IGNORE_THIS */ +#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ + + +IUPOLE_API Ihandle *IupOleControl(const char* progid); + +IUPOLE_API int IupOleControlOpen(void); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/windows/include/iuptuio.h b/komodoeditor/libs/iup/windows/include/iuptuio.h new file mode 100644 index 0000000..4638181 --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iuptuio.h @@ -0,0 +1,21 @@ +/** \file + * \brief IupTuioClient control + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPTUIO_H +#define __IUPTUIO_H + +#if defined(__cplusplus) +extern "C" { +#endif + +int IupTuioOpen(void); +Ihandle* IupTuioClient(int port); + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/windows/include/iupweb.h b/komodoeditor/libs/iup/windows/include/iupweb.h new file mode 100644 index 0000000..3b72838 --- /dev/null +++ b/komodoeditor/libs/iup/windows/include/iupweb.h @@ -0,0 +1,45 @@ +/** \file + * \brief Web control. + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUPWEB_H +#define __IUPWEB_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef DOXYGEN_SHOULD_IGNORE_THIS +/** @cond DOXYGEN_SHOULD_IGNORE_THIS */ +#ifndef IUPWEB_API +#ifdef IUPWEB_BUILD_LIBRARY + #ifdef __EMSCRIPTEN__ + #include + #define IUPWEB_API EMSCRIPTEN_KEEPALIVE + #elif WIN32 + #define IUPWEB_API __declspec(dllexport) + #elif defined(__GNUC__) && __GNUC__ >= 4 + #define IUPWEB_API __attribute__ ((visibility("default"))) + #else + #define IUPWEB_API + #endif +#else + #define IUPWEB_API +#endif /* IUP_BUILD_LIBRARY */ +#endif /* IUPWEB_API */ +/** @endcond DOXYGEN_SHOULD_IGNORE_THIS */ +#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ + + +IUPWEB_API int IupWebBrowserOpen(void); + +IUPWEB_API Ihandle *IupWebBrowser(void); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/komodoeditor/libs/iup/windows/iup.dll b/komodoeditor/libs/iup/windows/iup.dll new file mode 100644 index 0000000..0f95548 Binary files /dev/null and b/komodoeditor/libs/iup/windows/iup.dll differ diff --git a/komodoeditor/libs/iup/windows/iup.lib b/komodoeditor/libs/iup/windows/iup.lib new file mode 100644 index 0000000..6f391e2 Binary files /dev/null and b/komodoeditor/libs/iup/windows/iup.lib differ diff --git a/komodoeditor/libs/iup/windows/iup_mglplot.dll b/komodoeditor/libs/iup/windows/iup_mglplot.dll new file mode 100644 index 0000000..13eca99 Binary files /dev/null and b/komodoeditor/libs/iup/windows/iup_mglplot.dll differ diff --git a/komodoeditor/libs/iup/windows/iup_mglplot.lib b/komodoeditor/libs/iup/windows/iup_mglplot.lib new file mode 100644 index 0000000..11a4d55 Binary files /dev/null and b/komodoeditor/libs/iup/windows/iup_mglplot.lib differ diff --git a/komodoeditor/libs/iup/windows/iup_plot.dll b/komodoeditor/libs/iup/windows/iup_plot.dll new file mode 100644 index 0000000..596c460 Binary files /dev/null and b/komodoeditor/libs/iup/windows/iup_plot.dll differ diff --git a/komodoeditor/libs/iup/windows/iup_plot.lib b/komodoeditor/libs/iup/windows/iup_plot.lib new file mode 100644 index 0000000..09dd2c4 Binary files /dev/null and b/komodoeditor/libs/iup/windows/iup_plot.lib differ diff --git a/komodoeditor/libs/iup/windows/iup_scintilla.dll b/komodoeditor/libs/iup/windows/iup_scintilla.dll new file mode 100644 index 0000000..b116fe4 Binary files /dev/null and b/komodoeditor/libs/iup/windows/iup_scintilla.dll differ diff --git a/komodoeditor/libs/iup/windows/iup_scintilla.lib b/komodoeditor/libs/iup/windows/iup_scintilla.lib new file mode 100644 index 0000000..5c4e9ae Binary files /dev/null and b/komodoeditor/libs/iup/windows/iup_scintilla.lib differ diff --git a/komodoeditor/libs/iup/windows/iupcd.dll b/komodoeditor/libs/iup/windows/iupcd.dll new file mode 100644 index 0000000..900053f Binary files /dev/null and b/komodoeditor/libs/iup/windows/iupcd.dll differ diff --git a/komodoeditor/libs/iup/windows/iupcd.lib b/komodoeditor/libs/iup/windows/iupcd.lib new file mode 100644 index 0000000..14da67c Binary files /dev/null and b/komodoeditor/libs/iup/windows/iupcd.lib differ diff --git a/komodoeditor/libs/iup/windows/iupcontrols.dll b/komodoeditor/libs/iup/windows/iupcontrols.dll new file mode 100644 index 0000000..62c68a2 Binary files /dev/null and b/komodoeditor/libs/iup/windows/iupcontrols.dll differ diff --git a/komodoeditor/libs/iup/windows/iupcontrols.lib b/komodoeditor/libs/iup/windows/iupcontrols.lib new file mode 100644 index 0000000..a7aad22 Binary files /dev/null and b/komodoeditor/libs/iup/windows/iupcontrols.lib differ diff --git a/komodoeditor/libs/iup/windows/iupfiledlg.dll b/komodoeditor/libs/iup/windows/iupfiledlg.dll new file mode 100644 index 0000000..b3e542e Binary files /dev/null and b/komodoeditor/libs/iup/windows/iupfiledlg.dll differ diff --git a/komodoeditor/libs/iup/windows/iupfiledlg.lib b/komodoeditor/libs/iup/windows/iupfiledlg.lib new file mode 100644 index 0000000..2475ce1 Binary files /dev/null and b/komodoeditor/libs/iup/windows/iupfiledlg.lib differ diff --git a/komodoeditor/libs/iup/windows/iupgl.dll b/komodoeditor/libs/iup/windows/iupgl.dll new file mode 100644 index 0000000..69e106b Binary files /dev/null and b/komodoeditor/libs/iup/windows/iupgl.dll differ diff --git a/komodoeditor/libs/iup/windows/iupgl.lib b/komodoeditor/libs/iup/windows/iupgl.lib new file mode 100644 index 0000000..f8d5a71 Binary files /dev/null and b/komodoeditor/libs/iup/windows/iupgl.lib differ diff --git a/komodoeditor/libs/iup/windows/iupglcontrols.dll b/komodoeditor/libs/iup/windows/iupglcontrols.dll new file mode 100644 index 0000000..cc82ed4 Binary files /dev/null and b/komodoeditor/libs/iup/windows/iupglcontrols.dll differ diff --git a/komodoeditor/libs/iup/windows/iupglcontrols.lib b/komodoeditor/libs/iup/windows/iupglcontrols.lib new file mode 100644 index 0000000..ab1f9df Binary files /dev/null and b/komodoeditor/libs/iup/windows/iupglcontrols.lib differ diff --git a/komodoeditor/libs/iup/windows/iupim.dll b/komodoeditor/libs/iup/windows/iupim.dll new file mode 100644 index 0000000..7775746 Binary files /dev/null and b/komodoeditor/libs/iup/windows/iupim.dll differ diff --git a/komodoeditor/libs/iup/windows/iupim.lib b/komodoeditor/libs/iup/windows/iupim.lib new file mode 100644 index 0000000..dd8a0fd Binary files /dev/null and b/komodoeditor/libs/iup/windows/iupim.lib differ diff --git a/komodoeditor/libs/iup/windows/iupimglib.dll b/komodoeditor/libs/iup/windows/iupimglib.dll new file mode 100644 index 0000000..eb5d211 Binary files /dev/null and b/komodoeditor/libs/iup/windows/iupimglib.dll differ diff --git a/komodoeditor/libs/iup/windows/iupimglib.lib b/komodoeditor/libs/iup/windows/iupimglib.lib new file mode 100644 index 0000000..faec11b Binary files /dev/null and b/komodoeditor/libs/iup/windows/iupimglib.lib differ diff --git a/komodoeditor/libs/iup/windows/iupole.dll b/komodoeditor/libs/iup/windows/iupole.dll new file mode 100644 index 0000000..2864af1 Binary files /dev/null and b/komodoeditor/libs/iup/windows/iupole.dll differ diff --git a/komodoeditor/libs/iup/windows/iupole.lib b/komodoeditor/libs/iup/windows/iupole.lib new file mode 100644 index 0000000..9d28d3e Binary files /dev/null and b/komodoeditor/libs/iup/windows/iupole.lib differ diff --git a/komodoeditor/libs/iup/windows/iuptuio.dll b/komodoeditor/libs/iup/windows/iuptuio.dll new file mode 100644 index 0000000..1e8d0bc Binary files /dev/null and b/komodoeditor/libs/iup/windows/iuptuio.dll differ diff --git a/komodoeditor/libs/iup/windows/iuptuio.lib b/komodoeditor/libs/iup/windows/iuptuio.lib new file mode 100644 index 0000000..0482803 Binary files /dev/null and b/komodoeditor/libs/iup/windows/iuptuio.lib differ diff --git a/komodoeditor/libs/iup/windows/iupweb.dll b/komodoeditor/libs/iup/windows/iupweb.dll new file mode 100644 index 0000000..661f67b Binary files /dev/null and b/komodoeditor/libs/iup/windows/iupweb.dll differ diff --git a/komodoeditor/libs/iup/windows/iupweb.lib b/komodoeditor/libs/iup/windows/iupweb.lib new file mode 100644 index 0000000..f8ac407 Binary files /dev/null and b/komodoeditor/libs/iup/windows/iupweb.lib differ diff --git a/komodoeditor/libs/iup/windows/zlib1.dll b/komodoeditor/libs/iup/windows/zlib1.dll new file mode 100644 index 0000000..83f036b Binary files /dev/null and b/komodoeditor/libs/iup/windows/zlib1.dll differ diff --git a/komodoeditor/libs/iup/windows/zlib1.lib b/komodoeditor/libs/iup/windows/zlib1.lib new file mode 100644 index 0000000..3b14f3f Binary files /dev/null and b/komodoeditor/libs/iup/windows/zlib1.lib differ diff --git a/komodoeditor/src/game_window.nim b/komodoeditor/src/game_window.nim new file mode 100644 index 0000000..3a6c74b --- /dev/null +++ b/komodoeditor/src/game_window.nim @@ -0,0 +1,46 @@ +include komodo/prelude + +import komodo/ecs/components +import komodo/ecs/systems + +proc addCube(game: Game) = + let parent = newEntity() + assert game.registerEntity(parent) + let render_model_system = newRenderModelSystem() + assert game.registerSystem(render_model_system) + let model = newModelComponent( + parent, + "models/cube.obj", + ) + model.color = Yellow + model.hasWireframe = true + assert game.registerComponent(model) + + let transform = newTransformComponent( + parent, + position = Vector3( + x: -4, + y: 1, + z: 0, + ), + rotation = Vector3( + x: 0, + y: 0, + z: 0, + ), + scale = Vector3( + x: 0.5, + y: 1, + z: 1, + ), + ) + assert game.registerComponent(transform) + +proc start*(channel: ptr Channel[CommandKind]) = + var game = newGame() + game.title = "Komodo Editor Game Window" + game.clearColor = Blue + + # game.addCube() + + game.run(channel) diff --git a/komodoeditor/src/komodoeditor.nim b/komodoeditor/src/komodoeditor.nim new file mode 100644 index 0000000..a23c557 --- /dev/null +++ b/komodoeditor/src/komodoeditor.nim @@ -0,0 +1,78 @@ +import os + +import komodo/game +import ./game_window +import ./ui + +from iup import open, close, mainLoop + +var gameThread: Thread[ptr Channel[CommandKind]] +var channel: ptr Channel[CommandKind] +var isRunning: bool + +proc sendCloseCommand(): CallbackCode {.cdecl.} = + if isRunning: + channel[].send(CommandKind.Close) + gameThread.joinThread() + isRunning = false + DefaultCallbackCode + +proc startGame(): CallbackCode {.cdecl.} = + if not isRunning: + isRunning = true + createThread(gameThread, game_window.start, channel) + DefaultCallbackCode + +proc generateSkeleton(channel: ptr Channel[CommandKind]) = + let startCallback = callback: + startGame() + let startButton = newButton( + "Start", + startCallback, + ) + + let closeCallback = callback: + sendCloseCommand() + let closeButton = newButton( + "Close Game", + closeCallback, + ) + let label = newLabel("Welcome to the Komodo Editor") + let vertical_box = newVerticalBox( + label, + startButton, + closeButton, + ) + vertical_box[AlignmentAttribute] = "ACENTER" + vertical_box[GapAttribute] = 10 + vertical_box[MarginAttribute] = createDimensionAttribute(100, 10) + + let dialog = newDialog(vertical_box) + dialog[TitleAttribute] = "Komodo Editor" + + dialog.show() + +proc init(channel: ptr Channel[CommandKind]) = + var argc = create(cint) + argc[] = paramCount().cint + var argv = allocCstringArray(commandLineParams()) + assert iup.open(argc, argv.addr) == 0 # UIP requires calling open() + + channel[].open() + generateSkeleton(channel) + +proc close(channel: ptr Channel[CommandKind]) = + iup.close() + channel[].close() + +proc run() = + iup.mainLoop() + +when isMainModule: + channel = cast[ptr Channel[CommandKind]]( + allocShared0(sizeof(Channel[CommandKind])) + ) + init(channel) + run() + close(channel) + deallocShared(channel) diff --git a/komodoeditor/src/ui.nim b/komodoeditor/src/ui.nim new file mode 100644 index 0000000..16c3636 --- /dev/null +++ b/komodoeditor/src/ui.nim @@ -0,0 +1,15 @@ +import ui/[ + button, + dialog, + element, + label, + ui_macros, + vertical_box, +] + +export button +export dialog +export element +export label +export ui_macros +export vertical_box \ No newline at end of file diff --git a/komodoeditor/src/ui/button.nim b/komodoeditor/src/ui/button.nim new file mode 100644 index 0000000..8a5d8c5 --- /dev/null +++ b/komodoeditor/src/ui/button.nim @@ -0,0 +1,28 @@ +import iup + +import ./element + +type + Button* = ref object of Element + +func `callback=`*(self: Button; callback: Callback) = + self.inner.setCallback( + "ACTION", + callback, + ) + +func newButton*( + text: string; +): Button = + result = Button() + result.inner = iup.button( + text, + nil, + ) + +func newButton*( + text: string; + callback: Callback; +): Button = + result = newButton(text) + result.callback = callback diff --git a/komodoeditor/src/ui/dialog.nim b/komodoeditor/src/ui/dialog.nim new file mode 100644 index 0000000..740e6f5 --- /dev/null +++ b/komodoeditor/src/ui/dialog.nim @@ -0,0 +1,16 @@ +import iup + +import ./element + +type + Dialog* = ref object of Element + +func newDialog*(children: varargs[Element]): Dialog = + result = Dialog() + result.inner = iup.dialog(nil) + + for child in children: + result.addChild(child) + +func show*(self: Dialog; x: int = iup.IUP_CENTER; y: int = iup.IUP_CENTER) = + self.inner.showXY(x.cint, y.cint) diff --git a/komodoeditor/src/ui/element.nim b/komodoeditor/src/ui/element.nim new file mode 100644 index 0000000..c5a6847 --- /dev/null +++ b/komodoeditor/src/ui/element.nim @@ -0,0 +1,48 @@ +import iup +import strformat + +type + InnerElement* = PIhandle + + Element* = ref object of RootObj + inner: InnerElement + + ElementAttribute* = distinct string + + Callback* = proc (arg: InnerElement): CallbackCode {.cdecl.} + + CallbackCode* = cint + +const + AlignmentAttribute*: ElementAttribute = "ALIGNMENT".ElementAttribute + GapAttribute*: ElementAttribute = "GAP".ElementAttribute + MarginAttribute*: ElementAttribute = "MARGIN".ElementAttribute + TitleAttribute*: ElementAttribute = "TITLE".ElementAttribute + +const + CloseCallbackCode*: CallbackCode = IUP_CLOSE.CallbackCode + ContinueCallbackCode*: CallbackCode = IUP_CONTINUE.CallbackCode + DefaultCallbackCode*: CallbackCode = IUP_DEFAULT.CallbackCode + +func `inner=`*(self: Element; value: InnerElement) = self.inner = value +func inner*(self: Element): InnerElement = self.inner + +func addChild*(self: Element; child: Element) = + self.inner.append(child.inner) + +func removeChild*(self: Element; child: Element) = + child.inner.detach() + +func setAttribute*[T: Element](self: T; attribute: ElementAttribute; value: string) = + self.inner.setAttribute(attribute.string, value) + +func setAttribute*[T: Element](self: T; attribute: ElementAttribute; value: int) = + self.inner.setAttribute(attribute.string, $value) + +func `[]=`*(self: Element; attribute: ElementAttribute; value: string) = + self.setAttribute(attribute, value) + +func `[]=`*(self: Element; attribute: ElementAttribute; value: int) = + self.setAttribute(attribute, value) + +func createDimensionAttribute*(width: int; height: int): string = fmt"{width}x{height}" \ No newline at end of file diff --git a/komodoeditor/src/ui/label.nim b/komodoeditor/src/ui/label.nim new file mode 100644 index 0000000..1e66372 --- /dev/null +++ b/komodoeditor/src/ui/label.nim @@ -0,0 +1,10 @@ +import iup + +import ./element + +type + Label* = ref object of Element + +func newLabel*(text: string): Label = + result = Label() + result.inner = iup.label(text) diff --git a/komodoeditor/src/ui/ui_macros.nim b/komodoeditor/src/ui/ui_macros.nim new file mode 100644 index 0000000..d535577 --- /dev/null +++ b/komodoeditor/src/ui/ui_macros.nim @@ -0,0 +1,30 @@ +import macros + +from ./element import Callback + + +macro callback*(statements: untyped): Callback = + expectKind(statements, nnkStmtList) + + result = newTree( + nnkLambda, + newEmptyNode(), + newEmptyNode(), + newEmptyNode(), + newTree( + nnkFormalParams, + ident("CallbackCode"), + newTree( + nnkIdentDefs, + ident("element"), + ident("InnerElement"), + newEmptyNode(), + ) + ), + newTree( + nnkPragma, + ident("cdecl"), + ), + newEmptyNode(), + statements, + ) diff --git a/komodoeditor/src/ui/vertical_box.nim b/komodoeditor/src/ui/vertical_box.nim new file mode 100644 index 0000000..228f8f3 --- /dev/null +++ b/komodoeditor/src/ui/vertical_box.nim @@ -0,0 +1,13 @@ +import iup + +import ./element + +type + VerticalBox* = ref object of Element + +func newVerticalBox*(children: varargs[Element]): VerticalBox = + result = VerticalBox() + result.inner = iup.vbox(nil) + + for child in children: + result.addChild(child) diff --git a/include/raylib.h b/libs/raylib/linux/include/raylib.h similarity index 100% rename from include/raylib.h rename to libs/raylib/linux/include/raylib.h diff --git a/lib/linux/libraylib.so b/libs/raylib/linux/libraylib.so similarity index 100% rename from lib/linux/libraylib.so rename to libs/raylib/linux/libraylib.so diff --git a/libs/raylib/windows/include/raylib.h b/libs/raylib/windows/include/raylib.h new file mode 100644 index 0000000..e1e6310 --- /dev/null +++ b/libs/raylib/windows/include/raylib.h @@ -0,0 +1,1515 @@ +/********************************************************************************************** +* +* raylib - A simple and easy-to-use library to enjoy videogames programming (www.raylib.com) +* +* FEATURES: +* - NO external dependencies, all required libraries included with raylib +* - Multiplatform: Windows, Linux, FreeBSD, OpenBSD, NetBSD, DragonFly, MacOS, UWP, Android, Raspberry Pi, HTML5. +* - Written in plain C code (C99) in PascalCase/camelCase notation +* - Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES2 - choose at compile) +* - Unique OpenGL abstraction layer (usable as standalone module): [rlgl] +* - Multiple Fonts formats supported (TTF, XNA fonts, AngelCode fonts) +* - Outstanding texture formats support, including compressed formats (DXT, ETC, ASTC) +* - Full 3d support for 3d Shapes, Models, Billboards, Heightmaps and more! +* - Flexible Materials system, supporting classic maps and PBR maps +* - Skeletal Animation support (CPU bones-based animation) +* - Shaders support, including Model shaders and Postprocessing shaders +* - Powerful math module for Vector, Matrix and Quaternion operations: [raymath] +* - Audio loading and playing with streaming support (WAV, OGG, MP3, FLAC, XM, MOD) +* - VR stereo rendering with configurable HMD device parameters +* - Bindings to multiple programming languages available! +* +* NOTES: +* One custom font is loaded by default when InitWindow() [core] +* If using OpenGL 3.3 or ES2, one default shader is loaded automatically (internally defined) [rlgl] +* If using OpenGL 3.3 or ES2, several vertex buffers (VAO/VBO) are created to manage lines-triangles-quads +* +* DEPENDENCIES (included): +* [core] rglfw (github.com/glfw/glfw) for window/context management and input (only PLATFORM_DESKTOP) +* [rlgl] glad (github.com/Dav1dde/glad) for OpenGL 3.3 extensions loading (only PLATFORM_DESKTOP) +* [raudio] miniaudio (github.com/dr-soft/miniaudio) for audio device/context management +* +* OPTIONAL DEPENDENCIES (included): +* [core] rgif (Charlie Tangora, Ramon Santamaria) for GIF recording +* [textures] stb_image (Sean Barret) for images loading (BMP, TGA, PNG, JPEG, HDR...) +* [textures] stb_image_write (Sean Barret) for image writting (BMP, TGA, PNG, JPG) +* [textures] stb_image_resize (Sean Barret) for image resizing algorithms +* [textures] stb_perlin (Sean Barret) for Perlin noise image generation +* [text] stb_truetype (Sean Barret) for ttf fonts loading +* [text] stb_rect_pack (Sean Barret) for rectangles packing +* [models] par_shapes (Philip Rideout) for parametric 3d shapes generation +* [models] tinyobj_loader_c (Syoyo Fujita) for models loading (OBJ, MTL) +* [models] cgltf (Johannes Kuhlmann) for models loading (glTF) +* [raudio] stb_vorbis (Sean Barret) for OGG audio loading +* [raudio] dr_flac (David Reid) for FLAC audio file loading +* [raudio] dr_mp3 (David Reid) for MP3 audio file loading +* [raudio] jar_xm (Joshua Reisenauer) for XM audio module loading +* [raudio] jar_mod (Joshua Reisenauer) for MOD audio module loading +* +* +* LICENSE: zlib/libpng +* +* raylib is licensed under an unmodified zlib/libpng license, which is an OSI-certified, +* BSD-like license that allows static linking with closed source software: +* +* Copyright (c) 2013-2020 Ramon Santamaria (@raysan5) +* +* This software is provided "as-is", without any express or implied warranty. In no event +* will the authors be held liable for any damages arising from the use of this software. +* +* Permission is granted to anyone to use this software for any purpose, including commercial +* applications, and to alter it and redistribute it freely, subject to the following restrictions: +* +* 1. The origin of this software must not be misrepresented; you must not claim that you +* wrote the original software. If you use this software in a product, an acknowledgment +* in the product documentation would be appreciated but is not required. +* +* 2. Altered source versions must be plainly marked as such, and must not be misrepresented +* as being the original software. +* +* 3. This notice may not be removed or altered from any source distribution. +* +**********************************************************************************************/ + +#ifndef RAYLIB_H +#define RAYLIB_H + +#include // Required for: va_list - Only used by TraceLogCallback + +#if defined(_WIN32) + // Microsoft attibutes to tell compiler that symbols are imported/exported from a .dll + #if defined(BUILD_LIBTYPE_SHARED) + #define RLAPI __declspec(dllexport) // We are building raylib as a Win32 shared library (.dll) + #elif defined(USE_LIBTYPE_SHARED) + #define RLAPI __declspec(dllimport) // We are using raylib as a Win32 shared library (.dll) + #else + #define RLAPI // We are building or using raylib as a static library + #endif +#else + #define RLAPI // We are building or using raylib as a static library (or Linux shared library) +#endif + +//---------------------------------------------------------------------------------- +// Some basic Defines +//---------------------------------------------------------------------------------- +#ifndef PI + #define PI 3.14159265358979323846f +#endif + +#define DEG2RAD (PI/180.0f) +#define RAD2DEG (180.0f/PI) + +// Allow custom memory allocators +#ifndef RL_MALLOC + #define RL_MALLOC(sz) malloc(sz) +#endif +#ifndef RL_CALLOC + #define RL_CALLOC(n,sz) calloc(n,sz) +#endif +#ifndef RL_REALLOC + #define RL_REALLOC(ptr,sz) realloc(ptr,sz) +#endif +#ifndef RL_FREE + #define RL_FREE(ptr) free(ptr) +#endif + +// NOTE: MSC C++ compiler does not support compound literals (C99 feature) +// Plain structures in C++ (without constructors) can be initialized from { } initializers. +#if defined(__cplusplus) + #define CLITERAL(type) type +#else + #define CLITERAL(type) (type) +#endif + +// Some Basic Colors +// NOTE: Custom raylib color palette for amazing visuals on WHITE background +#define LIGHTGRAY CLITERAL(Color){ 200, 200, 200, 255 } // Light Gray +#define GRAY CLITERAL(Color){ 130, 130, 130, 255 } // Gray +#define DARKGRAY CLITERAL(Color){ 80, 80, 80, 255 } // Dark Gray +#define YELLOW CLITERAL(Color){ 253, 249, 0, 255 } // Yellow +#define GOLD CLITERAL(Color){ 255, 203, 0, 255 } // Gold +#define ORANGE CLITERAL(Color){ 255, 161, 0, 255 } // Orange +#define PINK CLITERAL(Color){ 255, 109, 194, 255 } // Pink +#define RED CLITERAL(Color){ 230, 41, 55, 255 } // Red +#define MAROON CLITERAL(Color){ 190, 33, 55, 255 } // Maroon +#define GREEN CLITERAL(Color){ 0, 228, 48, 255 } // Green +#define LIME CLITERAL(Color){ 0, 158, 47, 255 } // Lime +#define DARKGREEN CLITERAL(Color){ 0, 117, 44, 255 } // Dark Green +#define SKYBLUE CLITERAL(Color){ 102, 191, 255, 255 } // Sky Blue +#define BLUE CLITERAL(Color){ 0, 121, 241, 255 } // Blue +#define DARKBLUE CLITERAL(Color){ 0, 82, 172, 255 } // Dark Blue +#define PURPLE CLITERAL(Color){ 200, 122, 255, 255 } // Purple +#define VIOLET CLITERAL(Color){ 135, 60, 190, 255 } // Violet +#define DARKPURPLE CLITERAL(Color){ 112, 31, 126, 255 } // Dark Purple +#define BEIGE CLITERAL(Color){ 211, 176, 131, 255 } // Beige +#define BROWN CLITERAL(Color){ 127, 106, 79, 255 } // Brown +#define DARKBROWN CLITERAL(Color){ 76, 63, 47, 255 } // Dark Brown + +#define WHITE CLITERAL(Color){ 255, 255, 255, 255 } // White +#define BLACK CLITERAL(Color){ 0, 0, 0, 255 } // Black +#define BLANK CLITERAL(Color){ 0, 0, 0, 0 } // Blank (Transparent) +#define MAGENTA CLITERAL(Color){ 255, 0, 255, 255 } // Magenta +#define RAYWHITE CLITERAL(Color){ 245, 245, 245, 255 } // My own White (raylib logo) + +// Temporal hack to avoid breaking old codebases using +// deprecated raylib implementation of these functions +#define FormatText TextFormat +#define LoadText LoadFileText +#define GetExtension GetFileExtension +#define GetImageData LoadImageColors +//#define Fade(c, a) ColorAlpha(c, a) + +//---------------------------------------------------------------------------------- +// Structures Definition +//---------------------------------------------------------------------------------- +// Boolean type +#if defined(__STDC__) && __STDC_VERSION__ >= 199901L + #include +#elif !defined(__cplusplus) && !defined(bool) + typedef enum { false, true } bool; +#endif + +// Vector2 type +typedef struct Vector2 { + float x; + float y; +} Vector2; + +// Vector3 type +typedef struct Vector3 { + float x; + float y; + float z; +} Vector3; + +// Vector4 type +typedef struct Vector4 { + float x; + float y; + float z; + float w; +} Vector4; + +// Quaternion type, same as Vector4 +typedef Vector4 Quaternion; + +// Matrix type (OpenGL style 4x4 - right handed, column major) +typedef struct Matrix { + float m0, m4, m8, m12; + float m1, m5, m9, m13; + float m2, m6, m10, m14; + float m3, m7, m11, m15; +} Matrix; + +// Color type, RGBA (32bit) +typedef struct Color { + unsigned char r; + unsigned char g; + unsigned char b; + unsigned char a; +} Color; + +// Rectangle type +typedef struct Rectangle { + float x; + float y; + float width; + float height; +} Rectangle; + +// Image type, bpp always RGBA (32bit) +// NOTE: Data stored in CPU memory (RAM) +typedef struct Image { + void *data; // Image raw data + int width; // Image base width + int height; // Image base height + int mipmaps; // Mipmap levels, 1 by default + int format; // Data format (PixelFormat type) +} Image; + +// Texture type +// NOTE: Data stored in GPU memory +typedef struct Texture { + unsigned int id; // OpenGL texture id + int width; // Texture base width + int height; // Texture base height + int mipmaps; // Mipmap levels, 1 by default + int format; // Data format (PixelFormat type) +} Texture; + +// Texture2D type, same as Texture +typedef Texture Texture2D; + +// TextureCubemap type, actually, same as Texture +typedef Texture TextureCubemap; + +// RenderTexture type, for texture rendering +typedef struct RenderTexture { + unsigned int id; // OpenGL Framebuffer Object (FBO) id + Texture texture; // Color buffer attachment texture + Texture depth; // Depth buffer attachment texture +} RenderTexture; + +// RenderTexture2D type, same as RenderTexture +typedef RenderTexture RenderTexture2D; + +// N-Patch layout info +typedef struct NPatchInfo { + Rectangle source; // Region in the texture + int left; // left border offset + int top; // top border offset + int right; // right border offset + int bottom; // bottom border offset + int type; // layout of the n-patch: 3x3, 1x3 or 3x1 +} NPatchInfo; + +// Font character info +typedef struct CharInfo { + int value; // Character value (Unicode) + int offsetX; // Character offset X when drawing + int offsetY; // Character offset Y when drawing + int advanceX; // Character advance position X + Image image; // Character image data +} CharInfo; + +// Font type, includes texture and charSet array data +typedef struct Font { + int baseSize; // Base size (default chars height) + int charsCount; // Number of characters + int charsPadding; // Padding around the chars + Texture2D texture; // Characters texture atlas + Rectangle *recs; // Characters rectangles in texture + CharInfo *chars; // Characters info data +} Font; + +#define SpriteFont Font // SpriteFont type fallback, defaults to Font + +// Camera type, defines a camera position/orientation in 3d space +typedef struct Camera3D { + Vector3 position; // Camera position + Vector3 target; // Camera target it looks-at + Vector3 up; // Camera up vector (rotation over its axis) + float fovy; // Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic + int type; // Camera type, defines projection type: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC +} Camera3D; + +typedef Camera3D Camera; // Camera type fallback, defaults to Camera3D + +// Camera2D type, defines a 2d camera +typedef struct Camera2D { + Vector2 offset; // Camera offset (displacement from target) + Vector2 target; // Camera target (rotation and zoom origin) + float rotation; // Camera rotation in degrees + float zoom; // Camera zoom (scaling), should be 1.0f by default +} Camera2D; + +// Vertex data definning a mesh +// NOTE: Data stored in CPU memory (and GPU) +typedef struct Mesh { + int vertexCount; // Number of vertices stored in arrays + int triangleCount; // Number of triangles stored (indexed or not) + + // Default vertex data + float *vertices; // Vertex position (XYZ - 3 components per vertex) (shader-location = 0) + float *texcoords; // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) + float *texcoords2; // Vertex second texture coordinates (useful for lightmaps) (shader-location = 5) + float *normals; // Vertex normals (XYZ - 3 components per vertex) (shader-location = 2) + float *tangents; // Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4) + unsigned char *colors; // Vertex colors (RGBA - 4 components per vertex) (shader-location = 3) + unsigned short *indices;// Vertex indices (in case vertex data comes indexed) + + // Animation vertex data + float *animVertices; // Animated vertex positions (after bones transformations) + float *animNormals; // Animated normals (after bones transformations) + int *boneIds; // Vertex bone ids, up to 4 bones influence by vertex (skinning) + float *boneWeights; // Vertex bone weight, up to 4 bones influence by vertex (skinning) + + // OpenGL identifiers + unsigned int vaoId; // OpenGL Vertex Array Object id + unsigned int *vboId; // OpenGL Vertex Buffer Objects id (default vertex data) +} Mesh; + +// Shader type (generic) +typedef struct Shader { + unsigned int id; // Shader program id + int *locs; // Shader locations array (MAX_SHADER_LOCATIONS) +} Shader; + +// Material texture map +typedef struct MaterialMap { + Texture2D texture; // Material map texture + Color color; // Material map color + float value; // Material map value +} MaterialMap; + +// Material type (generic) +typedef struct Material { + Shader shader; // Material shader + MaterialMap *maps; // Material maps array (MAX_MATERIAL_MAPS) + float *params; // Material generic parameters (if required) +} Material; + +// Transformation properties +typedef struct Transform { + Vector3 translation; // Translation + Quaternion rotation; // Rotation + Vector3 scale; // Scale +} Transform; + +// Bone information +typedef struct BoneInfo { + char name[32]; // Bone name + int parent; // Bone parent +} BoneInfo; + +// Model type +typedef struct Model { + Matrix transform; // Local transform matrix + + int meshCount; // Number of meshes + int materialCount; // Number of materials + Mesh *meshes; // Meshes array + Material *materials; // Materials array + int *meshMaterial; // Mesh material number + + // Animation data + int boneCount; // Number of bones + BoneInfo *bones; // Bones information (skeleton) + Transform *bindPose; // Bones base transformation (pose) +} Model; + +// Model animation +typedef struct ModelAnimation { + int boneCount; // Number of bones + int frameCount; // Number of animation frames + BoneInfo *bones; // Bones information (skeleton) + Transform **framePoses; // Poses array by frame +} ModelAnimation; + +// Ray type (useful for raycast) +typedef struct Ray { + Vector3 position; // Ray position (origin) + Vector3 direction; // Ray direction +} Ray; + +// Raycast hit information +typedef struct RayHitInfo { + bool hit; // Did the ray hit something? + float distance; // Distance to nearest hit + Vector3 position; // Position of nearest hit + Vector3 normal; // Surface normal of hit +} RayHitInfo; + +// Bounding box type +typedef struct BoundingBox { + Vector3 min; // Minimum vertex box-corner + Vector3 max; // Maximum vertex box-corner +} BoundingBox; + +// Wave type, defines audio wave data +typedef struct Wave { + unsigned int sampleCount; // Total number of samples + unsigned int sampleRate; // Frequency (samples per second) + unsigned int sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported) + unsigned int channels; // Number of channels (1-mono, 2-stereo) + void *data; // Buffer data pointer +} Wave; + +typedef struct rAudioBuffer rAudioBuffer; + +// Audio stream type +// NOTE: Useful to create custom audio streams not bound to a specific file +typedef struct AudioStream { + rAudioBuffer *buffer; // Pointer to internal data used by the audio system + + unsigned int sampleRate; // Frequency (samples per second) + unsigned int sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported) + unsigned int channels; // Number of channels (1-mono, 2-stereo) +} AudioStream; + +// Sound source type +typedef struct Sound { + AudioStream stream; // Audio stream + unsigned int sampleCount; // Total number of samples +} Sound; + +// Music stream type (audio file streaming from memory) +// NOTE: Anything longer than ~10 seconds should be streamed +typedef struct Music { + AudioStream stream; // Audio stream + unsigned int sampleCount; // Total number of samples + bool looping; // Music looping enable + + int ctxType; // Type of music context (audio filetype) + void *ctxData; // Audio context data, depends on type +} Music; + +// Head-Mounted-Display device parameters +typedef struct VrDeviceInfo { + int hResolution; // HMD horizontal resolution in pixels + int vResolution; // HMD vertical resolution in pixels + float hScreenSize; // HMD horizontal size in meters + float vScreenSize; // HMD vertical size in meters + float vScreenCenter; // HMD screen center in meters + float eyeToScreenDistance; // HMD distance between eye and display in meters + float lensSeparationDistance; // HMD lens separation distance in meters + float interpupillaryDistance; // HMD IPD (distance between pupils) in meters + float lensDistortionValues[4]; // HMD lens distortion constant parameters + float chromaAbCorrection[4]; // HMD chromatic aberration correction parameters +} VrDeviceInfo; + +//---------------------------------------------------------------------------------- +// Enumerators Definition +//---------------------------------------------------------------------------------- +// System/Window config flags +// NOTE: Every bit registers one state (use it with bit masks) +// By default all flags are set to 0 +typedef enum { + FLAG_VSYNC_HINT = 0x00000040, // Set to try enabling V-Sync on GPU + FLAG_FULLSCREEN_MODE = 0x00000002, // Set to run program in fullscreen + FLAG_WINDOW_RESIZABLE = 0x00000004, // Set to allow resizable window + FLAG_WINDOW_UNDECORATED = 0x00000008, // Set to disable window decoration (frame and buttons) + FLAG_WINDOW_HIDDEN = 0x00000080, // Set to hide window + FLAG_WINDOW_MINIMIZED = 0x00000200, // Set to minimize window (iconify) + FLAG_WINDOW_MAXIMIZED = 0x00000400, // Set to maximize window (expanded to monitor) + FLAG_WINDOW_UNFOCUSED = 0x00000800, // Set to window non focused + FLAG_WINDOW_TOPMOST = 0x00001000, // Set to window always on top + FLAG_WINDOW_ALWAYS_RUN = 0x00000100, // Set to allow windows running while minimized + FLAG_WINDOW_TRANSPARENT = 0x00000010, // Set to allow transparent framebuffer + FLAG_WINDOW_HIGHDPI = 0x00002000, // Set to support HighDPI + FLAG_MSAA_4X_HINT = 0x00000020, // Set to try enabling MSAA 4X + FLAG_INTERLACED_HINT = 0x00010000 // Set to try enabling interlaced video format (for V3D) +} ConfigFlag; + +// Trace log type +typedef enum { + LOG_ALL = 0, // Display all logs + LOG_TRACE, + LOG_DEBUG, + LOG_INFO, + LOG_WARNING, + LOG_ERROR, + LOG_FATAL, + LOG_NONE // Disable logging +} TraceLogType; + +// Keyboard keys (US keyboard layout) +// NOTE: Use GetKeyPressed() to allow redefining +// required keys for alternative layouts +typedef enum { + // Alphanumeric keys + KEY_APOSTROPHE = 39, + KEY_COMMA = 44, + KEY_MINUS = 45, + KEY_PERIOD = 46, + KEY_SLASH = 47, + KEY_ZERO = 48, + KEY_ONE = 49, + KEY_TWO = 50, + KEY_THREE = 51, + KEY_FOUR = 52, + KEY_FIVE = 53, + KEY_SIX = 54, + KEY_SEVEN = 55, + KEY_EIGHT = 56, + KEY_NINE = 57, + KEY_SEMICOLON = 59, + KEY_EQUAL = 61, + KEY_A = 65, + KEY_B = 66, + KEY_C = 67, + KEY_D = 68, + KEY_E = 69, + KEY_F = 70, + KEY_G = 71, + KEY_H = 72, + KEY_I = 73, + KEY_J = 74, + KEY_K = 75, + KEY_L = 76, + KEY_M = 77, + KEY_N = 78, + KEY_O = 79, + KEY_P = 80, + KEY_Q = 81, + KEY_R = 82, + KEY_S = 83, + KEY_T = 84, + KEY_U = 85, + KEY_V = 86, + KEY_W = 87, + KEY_X = 88, + KEY_Y = 89, + KEY_Z = 90, + + // Function keys + KEY_SPACE = 32, + KEY_ESCAPE = 256, + KEY_ENTER = 257, + KEY_TAB = 258, + KEY_BACKSPACE = 259, + KEY_INSERT = 260, + KEY_DELETE = 261, + KEY_RIGHT = 262, + KEY_LEFT = 263, + KEY_DOWN = 264, + KEY_UP = 265, + KEY_PAGE_UP = 266, + KEY_PAGE_DOWN = 267, + KEY_HOME = 268, + KEY_END = 269, + KEY_CAPS_LOCK = 280, + KEY_SCROLL_LOCK = 281, + KEY_NUM_LOCK = 282, + KEY_PRINT_SCREEN = 283, + KEY_PAUSE = 284, + KEY_F1 = 290, + KEY_F2 = 291, + KEY_F3 = 292, + KEY_F4 = 293, + KEY_F5 = 294, + KEY_F6 = 295, + KEY_F7 = 296, + KEY_F8 = 297, + KEY_F9 = 298, + KEY_F10 = 299, + KEY_F11 = 300, + KEY_F12 = 301, + KEY_LEFT_SHIFT = 340, + KEY_LEFT_CONTROL = 341, + KEY_LEFT_ALT = 342, + KEY_LEFT_SUPER = 343, + KEY_RIGHT_SHIFT = 344, + KEY_RIGHT_CONTROL = 345, + KEY_RIGHT_ALT = 346, + KEY_RIGHT_SUPER = 347, + KEY_KB_MENU = 348, + KEY_LEFT_BRACKET = 91, + KEY_BACKSLASH = 92, + KEY_RIGHT_BRACKET = 93, + KEY_GRAVE = 96, + + // Keypad keys + KEY_KP_0 = 320, + KEY_KP_1 = 321, + KEY_KP_2 = 322, + KEY_KP_3 = 323, + KEY_KP_4 = 324, + KEY_KP_5 = 325, + KEY_KP_6 = 326, + KEY_KP_7 = 327, + KEY_KP_8 = 328, + KEY_KP_9 = 329, + KEY_KP_DECIMAL = 330, + KEY_KP_DIVIDE = 331, + KEY_KP_MULTIPLY = 332, + KEY_KP_SUBTRACT = 333, + KEY_KP_ADD = 334, + KEY_KP_ENTER = 335, + KEY_KP_EQUAL = 336 +} KeyboardKey; + +// Android buttons +typedef enum { + KEY_BACK = 4, + KEY_MENU = 82, + KEY_VOLUME_UP = 24, + KEY_VOLUME_DOWN = 25 +} AndroidButton; + +// Mouse buttons +typedef enum { + MOUSE_LEFT_BUTTON = 0, + MOUSE_RIGHT_BUTTON = 1, + MOUSE_MIDDLE_BUTTON = 2 +} MouseButton; + +// Mouse cursor types +typedef enum { + MOUSE_CURSOR_DEFAULT = 0, + MOUSE_CURSOR_ARROW = 1, + MOUSE_CURSOR_IBEAM = 2, + MOUSE_CURSOR_CROSSHAIR = 3, + MOUSE_CURSOR_POINTING_HAND = 4, + MOUSE_CURSOR_RESIZE_EW = 5, // The horizontal resize/move arrow shape + MOUSE_CURSOR_RESIZE_NS = 6, // The vertical resize/move arrow shape + MOUSE_CURSOR_RESIZE_NWSE = 7, // The top-left to bottom-right diagonal resize/move arrow shape + MOUSE_CURSOR_RESIZE_NESW = 8, // The top-right to bottom-left diagonal resize/move arrow shape + MOUSE_CURSOR_RESIZE_ALL = 9, // The omni-directional resize/move cursor shape + MOUSE_CURSOR_NOT_ALLOWED = 10 // The operation-not-allowed shape +} MouseCursor; + +// Gamepad number +typedef enum { + GAMEPAD_PLAYER1 = 0, + GAMEPAD_PLAYER2 = 1, + GAMEPAD_PLAYER3 = 2, + GAMEPAD_PLAYER4 = 3 +} GamepadNumber; + +// Gamepad buttons +typedef enum { + // This is here just for error checking + GAMEPAD_BUTTON_UNKNOWN = 0, + + // This is normally a DPAD + GAMEPAD_BUTTON_LEFT_FACE_UP, + GAMEPAD_BUTTON_LEFT_FACE_RIGHT, + GAMEPAD_BUTTON_LEFT_FACE_DOWN, + GAMEPAD_BUTTON_LEFT_FACE_LEFT, + + // This normally corresponds with PlayStation and Xbox controllers + // XBOX: [Y,X,A,B] + // PS3: [Triangle,Square,Cross,Circle] + // No support for 6 button controllers though.. + GAMEPAD_BUTTON_RIGHT_FACE_UP, + GAMEPAD_BUTTON_RIGHT_FACE_RIGHT, + GAMEPAD_BUTTON_RIGHT_FACE_DOWN, + GAMEPAD_BUTTON_RIGHT_FACE_LEFT, + + // Triggers + GAMEPAD_BUTTON_LEFT_TRIGGER_1, + GAMEPAD_BUTTON_LEFT_TRIGGER_2, + GAMEPAD_BUTTON_RIGHT_TRIGGER_1, + GAMEPAD_BUTTON_RIGHT_TRIGGER_2, + + // These are buttons in the center of the gamepad + GAMEPAD_BUTTON_MIDDLE_LEFT, //PS3 Select + GAMEPAD_BUTTON_MIDDLE, //PS Button/XBOX Button + GAMEPAD_BUTTON_MIDDLE_RIGHT, //PS3 Start + + // These are the joystick press in buttons + GAMEPAD_BUTTON_LEFT_THUMB, + GAMEPAD_BUTTON_RIGHT_THUMB +} GamepadButton; + +// Gamepad axis +typedef enum { + // Left stick + GAMEPAD_AXIS_LEFT_X = 0, + GAMEPAD_AXIS_LEFT_Y = 1, + + // Right stick + GAMEPAD_AXIS_RIGHT_X = 2, + GAMEPAD_AXIS_RIGHT_Y = 3, + + // Pressure levels for the back triggers + GAMEPAD_AXIS_LEFT_TRIGGER = 4, // [1..-1] (pressure-level) + GAMEPAD_AXIS_RIGHT_TRIGGER = 5 // [1..-1] (pressure-level) +} GamepadAxis; + +// Shader location points +typedef enum { + LOC_VERTEX_POSITION = 0, + LOC_VERTEX_TEXCOORD01, + LOC_VERTEX_TEXCOORD02, + LOC_VERTEX_NORMAL, + LOC_VERTEX_TANGENT, + LOC_VERTEX_COLOR, + LOC_MATRIX_MVP, + LOC_MATRIX_MODEL, + LOC_MATRIX_VIEW, + LOC_MATRIX_PROJECTION, + LOC_VECTOR_VIEW, + LOC_COLOR_DIFFUSE, + LOC_COLOR_SPECULAR, + LOC_COLOR_AMBIENT, + LOC_MAP_ALBEDO, // LOC_MAP_DIFFUSE + LOC_MAP_METALNESS, // LOC_MAP_SPECULAR + LOC_MAP_NORMAL, + LOC_MAP_ROUGHNESS, + LOC_MAP_OCCLUSION, + LOC_MAP_EMISSION, + LOC_MAP_HEIGHT, + LOC_MAP_CUBEMAP, + LOC_MAP_IRRADIANCE, + LOC_MAP_PREFILTER, + LOC_MAP_BRDF +} ShaderLocationIndex; + +#define LOC_MAP_DIFFUSE LOC_MAP_ALBEDO +#define LOC_MAP_SPECULAR LOC_MAP_METALNESS + +// Shader uniform data types +typedef enum { + UNIFORM_FLOAT = 0, + UNIFORM_VEC2, + UNIFORM_VEC3, + UNIFORM_VEC4, + UNIFORM_INT, + UNIFORM_IVEC2, + UNIFORM_IVEC3, + UNIFORM_IVEC4, + UNIFORM_SAMPLER2D +} ShaderUniformDataType; + +// Material maps +typedef enum { + MAP_ALBEDO = 0, // MAP_DIFFUSE + MAP_METALNESS = 1, // MAP_SPECULAR + MAP_NORMAL = 2, + MAP_ROUGHNESS = 3, + MAP_OCCLUSION, + MAP_EMISSION, + MAP_HEIGHT, + MAP_CUBEMAP, // NOTE: Uses GL_TEXTURE_CUBE_MAP + MAP_IRRADIANCE, // NOTE: Uses GL_TEXTURE_CUBE_MAP + MAP_PREFILTER, // NOTE: Uses GL_TEXTURE_CUBE_MAP + MAP_BRDF +} MaterialMapType; + +#define MAP_DIFFUSE MAP_ALBEDO +#define MAP_SPECULAR MAP_METALNESS + +// Pixel formats +// NOTE: Support depends on OpenGL version and platform +typedef enum { + UNCOMPRESSED_GRAYSCALE = 1, // 8 bit per pixel (no alpha) + UNCOMPRESSED_GRAY_ALPHA, // 8*2 bpp (2 channels) + UNCOMPRESSED_R5G6B5, // 16 bpp + UNCOMPRESSED_R8G8B8, // 24 bpp + UNCOMPRESSED_R5G5B5A1, // 16 bpp (1 bit alpha) + UNCOMPRESSED_R4G4B4A4, // 16 bpp (4 bit alpha) + UNCOMPRESSED_R8G8B8A8, // 32 bpp + UNCOMPRESSED_R32, // 32 bpp (1 channel - float) + UNCOMPRESSED_R32G32B32, // 32*3 bpp (3 channels - float) + UNCOMPRESSED_R32G32B32A32, // 32*4 bpp (4 channels - float) + COMPRESSED_DXT1_RGB, // 4 bpp (no alpha) + COMPRESSED_DXT1_RGBA, // 4 bpp (1 bit alpha) + COMPRESSED_DXT3_RGBA, // 8 bpp + COMPRESSED_DXT5_RGBA, // 8 bpp + COMPRESSED_ETC1_RGB, // 4 bpp + COMPRESSED_ETC2_RGB, // 4 bpp + COMPRESSED_ETC2_EAC_RGBA, // 8 bpp + COMPRESSED_PVRT_RGB, // 4 bpp + COMPRESSED_PVRT_RGBA, // 4 bpp + COMPRESSED_ASTC_4x4_RGBA, // 8 bpp + COMPRESSED_ASTC_8x8_RGBA // 2 bpp +} PixelFormat; + +// Texture parameters: filter mode +// NOTE 1: Filtering considers mipmaps if available in the texture +// NOTE 2: Filter is accordingly set for minification and magnification +typedef enum { + FILTER_POINT = 0, // No filter, just pixel aproximation + FILTER_BILINEAR, // Linear filtering + FILTER_TRILINEAR, // Trilinear filtering (linear with mipmaps) + FILTER_ANISOTROPIC_4X, // Anisotropic filtering 4x + FILTER_ANISOTROPIC_8X, // Anisotropic filtering 8x + FILTER_ANISOTROPIC_16X, // Anisotropic filtering 16x +} TextureFilterMode; + +// Texture parameters: wrap mode +typedef enum { + WRAP_REPEAT = 0, // Repeats texture in tiled mode + WRAP_CLAMP, // Clamps texture to edge pixel in tiled mode + WRAP_MIRROR_REPEAT, // Mirrors and repeats the texture in tiled mode + WRAP_MIRROR_CLAMP // Mirrors and clamps to border the texture in tiled mode +} TextureWrapMode; + +// Cubemap layouts +typedef enum { + CUBEMAP_AUTO_DETECT = 0, // Automatically detect layout type + CUBEMAP_LINE_VERTICAL, // Layout is defined by a vertical line with faces + CUBEMAP_LINE_HORIZONTAL, // Layout is defined by an horizontal line with faces + CUBEMAP_CROSS_THREE_BY_FOUR, // Layout is defined by a 3x4 cross with cubemap faces + CUBEMAP_CROSS_FOUR_BY_THREE, // Layout is defined by a 4x3 cross with cubemap faces + CUBEMAP_PANORAMA // Layout is defined by a panorama image (equirectangular map) +} CubemapLayoutType; + +// Font type, defines generation method +typedef enum { + FONT_DEFAULT = 0, // Default font generation, anti-aliased + FONT_BITMAP, // Bitmap font generation, no anti-aliasing + FONT_SDF // SDF font generation, requires external shader +} FontType; + +// Color blending modes (pre-defined) +typedef enum { + BLEND_ALPHA = 0, // Blend textures considering alpha (default) + BLEND_ADDITIVE, // Blend textures adding colors + BLEND_MULTIPLIED, // Blend textures multiplying colors + BLEND_ADD_COLORS, // Blend textures adding colors (alternative) + BLEND_SUBTRACT_COLORS, // Blend textures subtracting colors (alternative) + BLEND_CUSTOM // Belnd textures using custom src/dst factors (use SetBlendModeCustom()) +} BlendMode; + +// Gestures type +// NOTE: It could be used as flags to enable only some gestures +typedef enum { + GESTURE_NONE = 0, + GESTURE_TAP = 1, + GESTURE_DOUBLETAP = 2, + GESTURE_HOLD = 4, + GESTURE_DRAG = 8, + GESTURE_SWIPE_RIGHT = 16, + GESTURE_SWIPE_LEFT = 32, + GESTURE_SWIPE_UP = 64, + GESTURE_SWIPE_DOWN = 128, + GESTURE_PINCH_IN = 256, + GESTURE_PINCH_OUT = 512 +} GestureType; + +// Camera system modes +typedef enum { + CAMERA_CUSTOM = 0, + CAMERA_FREE, + CAMERA_ORBITAL, + CAMERA_FIRST_PERSON, + CAMERA_THIRD_PERSON +} CameraMode; + +// Camera projection modes +typedef enum { + CAMERA_PERSPECTIVE = 0, + CAMERA_ORTHOGRAPHIC +} CameraType; + +// N-patch types +typedef enum { + NPT_9PATCH = 0, // Npatch defined by 3x3 tiles + NPT_3PATCH_VERTICAL, // Npatch defined by 1x3 tiles + NPT_3PATCH_HORIZONTAL // Npatch defined by 3x1 tiles +} NPatchType; + +// Callbacks to be implemented by users +typedef void (*TraceLogCallback)(int logType, const char *text, va_list args); + +#if defined(__cplusplus) +extern "C" { // Prevents name mangling of functions +#endif + +//------------------------------------------------------------------------------------ +// Global Variables Definition +//------------------------------------------------------------------------------------ +// It's lonely here... + +//------------------------------------------------------------------------------------ +// Window and Graphics Device Functions (Module: core) +//------------------------------------------------------------------------------------ + +// Window-related functions +RLAPI void InitWindow(int width, int height, const char *title); // Initialize window and OpenGL context +RLAPI bool WindowShouldClose(void); // Check if KEY_ESCAPE pressed or Close icon pressed +RLAPI void CloseWindow(void); // Close window and unload OpenGL context +RLAPI bool IsWindowReady(void); // Check if window has been initialized successfully +RLAPI bool IsWindowFullscreen(void); // Check if window is currently fullscreen +RLAPI bool IsWindowHidden(void); // Check if window is currently hidden (only PLATFORM_DESKTOP) +RLAPI bool IsWindowMinimized(void); // Check if window is currently minimized (only PLATFORM_DESKTOP) +RLAPI bool IsWindowMaximized(void); // Check if window is currently maximized (only PLATFORM_DESKTOP) +RLAPI bool IsWindowFocused(void); // Check if window is currently focused (only PLATFORM_DESKTOP) +RLAPI bool IsWindowResized(void); // Check if window has been resized last frame +RLAPI bool IsWindowState(unsigned int flag); // Check if one specific window flag is enabled +RLAPI void SetWindowState(unsigned int flags); // Set window configuration state using flags +RLAPI void ClearWindowState(unsigned int flags); // Clear window configuration state flags +RLAPI void ToggleFullscreen(void); // Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP) +RLAPI void MaximizeWindow(void); // Set window state: maximized, if resizable (only PLATFORM_DESKTOP) +RLAPI void MinimizeWindow(void); // Set window state: minimized, if resizable (only PLATFORM_DESKTOP) +RLAPI void RestoreWindow(void); // Set window state: not minimized/maximized (only PLATFORM_DESKTOP) +RLAPI void SetWindowIcon(Image image); // Set icon for window (only PLATFORM_DESKTOP) +RLAPI void SetWindowTitle(const char *title); // Set title for window (only PLATFORM_DESKTOP) +RLAPI void SetWindowPosition(int x, int y); // Set window position on screen (only PLATFORM_DESKTOP) +RLAPI void SetWindowMonitor(int monitor); // Set monitor for the current window (fullscreen mode) +RLAPI void SetWindowMinSize(int width, int height); // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) +RLAPI void SetWindowSize(int width, int height); // Set window dimensions +RLAPI void *GetWindowHandle(void); // Get native window handle +RLAPI int GetScreenWidth(void); // Get current screen width +RLAPI int GetScreenHeight(void); // Get current screen height +RLAPI int GetMonitorCount(void); // Get number of connected monitors +RLAPI Vector2 GetMonitorPosition(int monitor); // Get specified monitor position +RLAPI int GetMonitorWidth(int monitor); // Get specified monitor width +RLAPI int GetMonitorHeight(int monitor); // Get specified monitor height +RLAPI int GetMonitorPhysicalWidth(int monitor); // Get specified monitor physical width in millimetres +RLAPI int GetMonitorPhysicalHeight(int monitor); // Get specified monitor physical height in millimetres +RLAPI int GetMonitorRefreshRate(int monitor); // Get specified monitor refresh rate +RLAPI Vector2 GetWindowPosition(void); // Get window position XY on monitor +RLAPI Vector2 GetWindowScaleDPI(void); // Get window scale DPI factor +RLAPI const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the primary monitor +RLAPI void SetClipboardText(const char *text); // Set clipboard text content +RLAPI const char *GetClipboardText(void); // Get clipboard text content + +// Cursor-related functions +RLAPI void ShowCursor(void); // Shows cursor +RLAPI void HideCursor(void); // Hides cursor +RLAPI bool IsCursorHidden(void); // Check if cursor is not visible +RLAPI void EnableCursor(void); // Enables cursor (unlock cursor) +RLAPI void DisableCursor(void); // Disables cursor (lock cursor) +RLAPI bool IsCursorOnScreen(void); // Check if cursor is on the current screen. + +// Drawing-related functions +RLAPI void ClearBackground(Color color); // Set background color (framebuffer clear color) +RLAPI void BeginDrawing(void); // Setup canvas (framebuffer) to start drawing +RLAPI void EndDrawing(void); // End canvas drawing and swap buffers (double buffering) +RLAPI void BeginMode2D(Camera2D camera); // Initialize 2D mode with custom camera (2D) +RLAPI void EndMode2D(void); // Ends 2D mode with custom camera +RLAPI void BeginMode3D(Camera3D camera); // Initializes 3D mode with custom camera (3D) +RLAPI void EndMode3D(void); // Ends 3D mode and returns to default 2D orthographic mode +RLAPI void BeginTextureMode(RenderTexture2D target); // Initializes render texture for drawing +RLAPI void EndTextureMode(void); // Ends drawing to render texture +RLAPI void BeginScissorMode(int x, int y, int width, int height); // Begin scissor mode (define screen area for following drawing) +RLAPI void EndScissorMode(void); // End scissor mode + +// Screen-space-related functions +RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Returns a ray trace from mouse position +RLAPI Matrix GetCameraMatrix(Camera camera); // Returns camera transform matrix (view matrix) +RLAPI Matrix GetCameraMatrix2D(Camera2D camera); // Returns camera 2d transform matrix +RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Returns the screen space position for a 3d world space position +RLAPI Vector2 GetWorldToScreenEx(Vector3 position, Camera camera, int width, int height); // Returns size position for a 3d world space position +RLAPI Vector2 GetWorldToScreen2D(Vector2 position, Camera2D camera); // Returns the screen space position for a 2d camera world space position +RLAPI Vector2 GetScreenToWorld2D(Vector2 position, Camera2D camera); // Returns the world space position for a 2d camera screen space position + +// Timing-related functions +RLAPI void SetTargetFPS(int fps); // Set target FPS (maximum) +RLAPI int GetFPS(void); // Returns current FPS +RLAPI float GetFrameTime(void); // Returns time in seconds for last frame drawn +RLAPI double GetTime(void); // Returns elapsed time in seconds since InitWindow() + +// Misc. functions +RLAPI void SetConfigFlags(unsigned int flags); // Setup init configuration flags (view FLAGS) + +RLAPI void SetTraceLogLevel(int logType); // Set the current threshold (minimum) log level +RLAPI void SetTraceLogExit(int logType); // Set the exit threshold (minimum) log level +RLAPI void SetTraceLogCallback(TraceLogCallback callback); // Set a trace log callback to enable custom logging +RLAPI void TraceLog(int logType, const char *text, ...); // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR) + +RLAPI void *MemAlloc(int size); // Internal memory allocator +RLAPI void MemFree(void *ptr); // Internal memory free +RLAPI void TakeScreenshot(const char *fileName); // Takes a screenshot of current screen (saved a .png) +RLAPI int GetRandomValue(int min, int max); // Returns a random value between min and max (both included) + +// Files management functions +RLAPI unsigned char *LoadFileData(const char *fileName, unsigned int *bytesRead); // Load file data as byte array (read) +RLAPI void UnloadFileData(unsigned char *data); // Unload file data allocated by LoadFileData() +RLAPI bool SaveFileData(const char *fileName, void *data, unsigned int bytesToWrite); // Save data to file from byte array (write), returns true on success +RLAPI char *LoadFileText(const char *fileName); // Load text data from file (read), returns a '\0' terminated string +RLAPI void UnloadFileText(unsigned char *text); // Unload file text data allocated by LoadFileText() +RLAPI bool SaveFileText(const char *fileName, char *text); // Save text data to file (write), string must be '\0' terminated, returns true on success +RLAPI bool FileExists(const char *fileName); // Check if file exists +RLAPI bool DirectoryExists(const char *dirPath); // Check if a directory path exists +RLAPI bool IsFileExtension(const char *fileName, const char *ext);// Check file extension (including point: .png, .wav) +RLAPI const char *GetFileExtension(const char *fileName); // Get pointer to extension for a filename string (including point: ".png") +RLAPI const char *GetFileName(const char *filePath); // Get pointer to filename for a path string +RLAPI const char *GetFileNameWithoutExt(const char *filePath); // Get filename string without extension (uses static string) +RLAPI const char *GetDirectoryPath(const char *filePath); // Get full path for a given fileName with path (uses static string) +RLAPI const char *GetPrevDirectoryPath(const char *dirPath); // Get previous directory path for a given path (uses static string) +RLAPI const char *GetWorkingDirectory(void); // Get current working directory (uses static string) +RLAPI char **GetDirectoryFiles(const char *dirPath, int *count); // Get filenames in a directory path (memory should be freed) +RLAPI void ClearDirectoryFiles(void); // Clear directory files paths buffers (free memory) +RLAPI bool ChangeDirectory(const char *dir); // Change working directory, return true on success +RLAPI bool IsFileDropped(void); // Check if a file has been dropped into window +RLAPI char **GetDroppedFiles(int *count); // Get dropped files names (memory should be freed) +RLAPI void ClearDroppedFiles(void); // Clear dropped files paths buffer (free memory) +RLAPI long GetFileModTime(const char *fileName); // Get file modification time (last write time) + +RLAPI unsigned char *CompressData(unsigned char *data, int dataLength, int *compDataLength); // Compress data (DEFLATE algorithm) +RLAPI unsigned char *DecompressData(unsigned char *compData, int compDataLength, int *dataLength); // Decompress data (DEFLATE algorithm) + +// Persistent storage management +RLAPI bool SaveStorageValue(unsigned int position, int value); // Save integer value to storage file (to defined position), returns true on success +RLAPI int LoadStorageValue(unsigned int position); // Load integer value from storage file (from defined position) + +RLAPI void OpenURL(const char *url); // Open URL with default system browser (if available) + +//------------------------------------------------------------------------------------ +// Input Handling Functions (Module: core) +//------------------------------------------------------------------------------------ + +// Input-related functions: keyboard +RLAPI bool IsKeyPressed(int key); // Detect if a key has been pressed once +RLAPI bool IsKeyDown(int key); // Detect if a key is being pressed +RLAPI bool IsKeyReleased(int key); // Detect if a key has been released once +RLAPI bool IsKeyUp(int key); // Detect if a key is NOT being pressed +RLAPI void SetExitKey(int key); // Set a custom key to exit program (default is ESC) +RLAPI int GetKeyPressed(void); // Get key pressed (keycode), call it multiple times for keys queued +RLAPI int GetCharPressed(void); // Get char pressed (unicode), call it multiple times for chars queued + +// Input-related functions: gamepads +RLAPI bool IsGamepadAvailable(int gamepad); // Detect if a gamepad is available +RLAPI bool IsGamepadName(int gamepad, const char *name); // Check gamepad name (if available) +RLAPI const char *GetGamepadName(int gamepad); // Return gamepad internal name id +RLAPI bool IsGamepadButtonPressed(int gamepad, int button); // Detect if a gamepad button has been pressed once +RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Detect if a gamepad button is being pressed +RLAPI bool IsGamepadButtonReleased(int gamepad, int button); // Detect if a gamepad button has been released once +RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Detect if a gamepad button is NOT being pressed +RLAPI int GetGamepadButtonPressed(void); // Get the last gamepad button pressed +RLAPI int GetGamepadAxisCount(int gamepad); // Return gamepad axis count for a gamepad +RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Return axis movement value for a gamepad axis + +// Input-related functions: mouse +RLAPI bool IsMouseButtonPressed(int button); // Detect if a mouse button has been pressed once +RLAPI bool IsMouseButtonDown(int button); // Detect if a mouse button is being pressed +RLAPI bool IsMouseButtonReleased(int button); // Detect if a mouse button has been released once +RLAPI bool IsMouseButtonUp(int button); // Detect if a mouse button is NOT being pressed +RLAPI int GetMouseX(void); // Returns mouse position X +RLAPI int GetMouseY(void); // Returns mouse position Y +RLAPI Vector2 GetMousePosition(void); // Returns mouse position XY +RLAPI void SetMousePosition(int x, int y); // Set mouse position XY +RLAPI void SetMouseOffset(int offsetX, int offsetY); // Set mouse offset +RLAPI void SetMouseScale(float scaleX, float scaleY); // Set mouse scaling +RLAPI float GetMouseWheelMove(void); // Returns mouse wheel movement Y +RLAPI int GetMouseCursor(void); // Returns mouse cursor if (MouseCursor enum) +RLAPI void SetMouseCursor(int cursor); // Set mouse cursor + +// Input-related functions: touch +RLAPI int GetTouchX(void); // Returns touch position X for touch point 0 (relative to screen size) +RLAPI int GetTouchY(void); // Returns touch position Y for touch point 0 (relative to screen size) +RLAPI Vector2 GetTouchPosition(int index); // Returns touch position XY for a touch point index (relative to screen size) + +//------------------------------------------------------------------------------------ +// Gestures and Touch Handling Functions (Module: gestures) +//------------------------------------------------------------------------------------ +RLAPI void SetGesturesEnabled(unsigned int gestureFlags); // Enable a set of gestures using flags +RLAPI bool IsGestureDetected(int gesture); // Check if a gesture have been detected +RLAPI int GetGestureDetected(void); // Get latest detected gesture +RLAPI int GetTouchPointsCount(void); // Get touch points count +RLAPI float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds +RLAPI Vector2 GetGestureDragVector(void); // Get gesture drag vector +RLAPI float GetGestureDragAngle(void); // Get gesture drag angle +RLAPI Vector2 GetGesturePinchVector(void); // Get gesture pinch delta +RLAPI float GetGesturePinchAngle(void); // Get gesture pinch angle + +//------------------------------------------------------------------------------------ +// Camera System Functions (Module: camera) +//------------------------------------------------------------------------------------ +RLAPI void SetCameraMode(Camera camera, int mode); // Set camera mode (multiple camera modes available) +RLAPI void UpdateCamera(Camera *camera); // Update camera position for selected mode + +RLAPI void SetCameraPanControl(int keyPan); // Set camera pan key to combine with mouse movement (free camera) +RLAPI void SetCameraAltControl(int keyAlt); // Set camera alt key to combine with mouse movement (free camera) +RLAPI void SetCameraSmoothZoomControl(int keySmoothZoom); // Set camera smooth zoom key to combine with mouse (free camera) +RLAPI void SetCameraMoveControls(int keyFront, int keyBack, int keyRight, int keyLeft, int keyUp, int keyDown); // Set camera move controls (1st person and 3rd person cameras) + +//------------------------------------------------------------------------------------ +// Basic Shapes Drawing Functions (Module: shapes) +//------------------------------------------------------------------------------------ + +// Basic shapes drawing functions +RLAPI void DrawPixel(int posX, int posY, Color color); // Draw a pixel +RLAPI void DrawPixelV(Vector2 position, Color color); // Draw a pixel (Vector version) +RLAPI void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw a line +RLAPI void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); // Draw a line (Vector version) +RLAPI void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line defining thickness +RLAPI void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line using cubic-bezier curves in-out +RLAPI void DrawLineStrip(Vector2 *points, int pointsCount, Color color); // Draw lines sequence +RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color); // Draw a color-filled circle +RLAPI void DrawCircleSector(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color); // Draw a piece of a circle +RLAPI void DrawCircleSectorLines(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color); // Draw circle sector outline +RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2); // Draw a gradient-filled circle +RLAPI void DrawCircleV(Vector2 center, float radius, Color color); // Draw a color-filled circle (Vector version) +RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline +RLAPI void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse +RLAPI void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color); // Draw ellipse outline +RLAPI void DrawRing(Vector2 center, float innerRadius, float outerRadius, int startAngle, int endAngle, int segments, Color color); // Draw ring +RLAPI void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, int startAngle, int endAngle, int segments, Color color); // Draw ring outline +RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle +RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version) +RLAPI void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle +RLAPI void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters +RLAPI void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a vertical-gradient-filled rectangle +RLAPI void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a horizontal-gradient-filled rectangle +RLAPI void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); // Draw a gradient-filled rectangle with custom vertex colors +RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline +RLAPI void DrawRectangleLinesEx(Rectangle rec, int lineThick, Color color); // Draw rectangle outline with extended parameters +RLAPI void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges +RLAPI void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, int lineThick, Color color); // Draw rectangle with rounded edges outline +RLAPI void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!) +RLAPI void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline (vertex in counter-clockwise order!) +RLAPI void DrawTriangleFan(Vector2 *points, int pointsCount, Color color); // Draw a triangle fan defined by points (first vertex is the center) +RLAPI void DrawTriangleStrip(Vector2 *points, int pointsCount, Color color); // Draw a triangle strip defined by points +RLAPI void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a regular polygon (Vector version) +RLAPI void DrawPolyLines(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a polygon outline of n sides + +// Basic shapes collision detection functions +RLAPI bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); // Check collision between two rectangles +RLAPI bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2); // Check collision between two circles +RLAPI bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec); // Check collision between circle and rectangle +RLAPI bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle +RLAPI bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius); // Check if point is inside circle +RLAPI bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3); // Check if point is inside a triangle +RLAPI bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, Vector2 *collisionPoint); // Check the collision between two lines defined by two points each, returns collision point by reference +RLAPI Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // Get collision rectangle for two rectangles collision + +//------------------------------------------------------------------------------------ +// Texture Loading and Drawing Functions (Module: textures) +//------------------------------------------------------------------------------------ + +// Image loading functions +// NOTE: This functions do not require GPU access +RLAPI Image LoadImage(const char *fileName); // Load image from file into CPU memory (RAM) +RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image from RAW file data +RLAPI Image LoadImageAnim(const char *fileName, int *frames); // Load image sequence from file (frames appended to image.data) +RLAPI Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load image from memory buffer, fileType refers to extension: i.e. "png" +RLAPI void UnloadImage(Image image); // Unload image from CPU memory (RAM) +RLAPI bool ExportImage(Image image, const char *fileName); // Export image data to file, returns true on success +RLAPI bool ExportImageAsCode(Image image, const char *fileName); // Export image as code file defining an array of bytes, returns true on success + +// Image generation functions +RLAPI Image GenImageColor(int width, int height, Color color); // Generate image: plain color +RLAPI Image GenImageGradientV(int width, int height, Color top, Color bottom); // Generate image: vertical gradient +RLAPI Image GenImageGradientH(int width, int height, Color left, Color right); // Generate image: horizontal gradient +RLAPI Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer); // Generate image: radial gradient +RLAPI Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2); // Generate image: checked +RLAPI Image GenImageWhiteNoise(int width, int height, float factor); // Generate image: white noise +RLAPI Image GenImagePerlinNoise(int width, int height, int offsetX, int offsetY, float scale); // Generate image: perlin noise +RLAPI Image GenImageCellular(int width, int height, int tileSize); // Generate image: cellular algorithm. Bigger tileSize means bigger cells + +// Image manipulation functions +RLAPI Image ImageCopy(Image image); // Create an image duplicate (useful for transformations) +RLAPI Image ImageFromImage(Image image, Rectangle rec); // Create an image from another image piece +RLAPI Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font) +RLAPI Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Color tint); // Create an image from text (custom sprite font) +RLAPI void ImageFormat(Image *image, int newFormat); // Convert image data to desired format +RLAPI void ImageToPOT(Image *image, Color fill); // Convert image to POT (power-of-two) +RLAPI void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle +RLAPI void ImageAlphaCrop(Image *image, float threshold); // Crop image depending on alpha value +RLAPI void ImageAlphaClear(Image *image, Color color, float threshold); // Clear alpha channel to desired color +RLAPI void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image +RLAPI void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel +RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (Bicubic scaling algorithm) +RLAPI void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm) +RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill); // Resize canvas and fill with color +RLAPI void ImageMipmaps(Image *image); // Generate all mipmap levels for a provided image +RLAPI void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering) +RLAPI void ImageFlipVertical(Image *image); // Flip image vertically +RLAPI void ImageFlipHorizontal(Image *image); // Flip image horizontally +RLAPI void ImageRotateCW(Image *image); // Rotate image clockwise 90deg +RLAPI void ImageRotateCCW(Image *image); // Rotate image counter-clockwise 90deg +RLAPI void ImageColorTint(Image *image, Color color); // Modify image color: tint +RLAPI void ImageColorInvert(Image *image); // Modify image color: invert +RLAPI void ImageColorGrayscale(Image *image); // Modify image color: grayscale +RLAPI void ImageColorContrast(Image *image, float contrast); // Modify image color: contrast (-100 to 100) +RLAPI void ImageColorBrightness(Image *image, int brightness); // Modify image color: brightness (-255 to 255) +RLAPI void ImageColorReplace(Image *image, Color color, Color replace); // Modify image color: replace color +RLAPI Color *LoadImageColors(Image image); // Load color data from image as a Color array (RGBA - 32bit) +RLAPI Color *LoadImagePalette(Image image, int maxPaletteSize, int *colorsCount); // Load colors palette from image as a Color array (RGBA - 32bit) +RLAPI void UnloadImageColors(Color *colors); // Unload color data loaded with LoadImageColors() +RLAPI void UnloadImagePalette(Color *colors); // Unload colors palette loaded with LoadImagePalette() +RLAPI Rectangle GetImageAlphaBorder(Image image, float threshold); // Get image alpha border rectangle + +// Image drawing functions +// NOTE: Image software-rendering functions (CPU) +RLAPI void ImageClearBackground(Image *dst, Color color); // Clear image background with given color +RLAPI void ImageDrawPixel(Image *dst, int posX, int posY, Color color); // Draw pixel within an image +RLAPI void ImageDrawPixelV(Image *dst, Vector2 position, Color color); // Draw pixel within an image (Vector version) +RLAPI void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw line within an image +RLAPI void ImageDrawLineV(Image *dst, Vector2 start, Vector2 end, Color color); // Draw line within an image (Vector version) +RLAPI void ImageDrawCircle(Image *dst, int centerX, int centerY, int radius, Color color); // Draw circle within an image +RLAPI void ImageDrawCircleV(Image *dst, Vector2 center, int radius, Color color); // Draw circle within an image (Vector version) +RLAPI void ImageDrawRectangle(Image *dst, int posX, int posY, int width, int height, Color color); // Draw rectangle within an image +RLAPI void ImageDrawRectangleV(Image *dst, Vector2 position, Vector2 size, Color color); // Draw rectangle within an image (Vector version) +RLAPI void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color); // Draw rectangle within an image +RLAPI void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color); // Draw rectangle lines within an image +RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint); // Draw a source image within a destination image (tint applied to source) +RLAPI void ImageDrawText(Image *dst, const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) within an image (destination) +RLAPI void ImageDrawTextEx(Image *dst, Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text (custom sprite font) within an image (destination) + +// Texture loading functions +// NOTE: These functions require GPU access +RLAPI Texture2D LoadTexture(const char *fileName); // Load texture from file into GPU memory (VRAM) +RLAPI Texture2D LoadTextureFromImage(Image image); // Load texture from image data +RLAPI TextureCubemap LoadTextureCubemap(Image image, int layoutType); // Load cubemap from image, multiple image cubemap layouts supported +RLAPI RenderTexture2D LoadRenderTexture(int width, int height); // Load texture for rendering (framebuffer) +RLAPI void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM) +RLAPI void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory (VRAM) +RLAPI void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data +RLAPI void UpdateTextureRec(Texture2D texture, Rectangle rec, const void *pixels); // Update GPU texture rectangle with new data +RLAPI Image GetTextureData(Texture2D texture); // Get pixel data from GPU texture and return an Image +RLAPI Image GetScreenData(void); // Get pixel data from screen buffer and return an Image (screenshot) + +// Texture configuration functions +RLAPI void GenTextureMipmaps(Texture2D *texture); // Generate GPU mipmaps for a texture +RLAPI void SetTextureFilter(Texture2D texture, int filterMode); // Set texture scaling filter mode +RLAPI void SetTextureWrap(Texture2D texture, int wrapMode); // Set texture wrapping mode + +// Texture drawing functions +RLAPI void DrawTexture(Texture2D texture, int posX, int posY, Color tint); // Draw a Texture2D +RLAPI void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2 +RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters +RLAPI void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle +RLAPI void DrawTextureQuad(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangle quad, Color tint); // Draw texture quad with tiling and offset parameters +RLAPI void DrawTextureTiled(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, float scale, Color tint); // Draw part of a texture (defined by a rectangle) with rotation and scale tiled into dest. +RLAPI void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters +RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint); // Draws a texture (or part of it) that stretches or shrinks nicely + +// Color/pixel related functions +RLAPI Color Fade(Color color, float alpha); // Returns color with alpha applied, alpha goes from 0.0f to 1.0f +RLAPI int ColorToInt(Color color); // Returns hexadecimal value for a Color +RLAPI Vector4 ColorNormalize(Color color); // Returns Color normalized as float [0..1] +RLAPI Color ColorFromNormalized(Vector4 normalized); // Returns Color from normalized values [0..1] +RLAPI Vector3 ColorToHSV(Color color); // Returns HSV values for a Color +RLAPI Color ColorFromHSV(float hue, float saturation, float value); // Returns a Color from HSV values +RLAPI Color ColorAlpha(Color color, float alpha); // Returns color with alpha applied, alpha goes from 0.0f to 1.0f +RLAPI Color ColorAlphaBlend(Color dst, Color src, Color tint); // Returns src alpha-blended into dst color with tint +RLAPI Color GetColor(int hexValue); // Get Color structure from hexadecimal value +RLAPI Color GetPixelColor(void *srcPtr, int format); // Get Color from a source pixel pointer of certain format +RLAPI void SetPixelColor(void *dstPtr, Color color, int format); // Set color formatted into destination pixel pointer +RLAPI int GetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes for certain format + +//------------------------------------------------------------------------------------ +// Font Loading and Text Drawing Functions (Module: text) +//------------------------------------------------------------------------------------ + +// Font loading/unloading functions +RLAPI Font GetFontDefault(void); // Get the default Font +RLAPI Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM) +RLAPI Font LoadFontEx(const char *fileName, int fontSize, int *fontChars, int charsCount); // Load font from file with extended parameters +RLAPI Font LoadFontFromImage(Image image, Color key, int firstChar); // Load font from Image (XNA style) +RLAPI Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int charsCount); // Load font from memory buffer, fileType refers to extension: i.e. "ttf" +RLAPI CharInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int charsCount, int type); // Load font data for further use +RLAPI Image GenImageFontAtlas(const CharInfo *chars, Rectangle **recs, int charsCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info +RLAPI void UnloadFontData(CharInfo *chars, int charsCount); // Unload font chars info data (RAM) +RLAPI void UnloadFont(Font font); // Unload Font from GPU memory (VRAM) + +// Text drawing functions +RLAPI void DrawFPS(int posX, int posY); // Shows current FPS +RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) +RLAPI void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters +RLAPI void DrawTextRec(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint); // Draw text using font inside rectangle limits +RLAPI void DrawTextRecEx(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint, + int selectStart, int selectLength, Color selectTint, Color selectBackTint); // Draw text using font inside rectangle limits with support for text selection +RLAPI void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSize, Color tint); // Draw one character (codepoint) + +// Text misc. functions +RLAPI int MeasureText(const char *text, int fontSize); // Measure string width for default font +RLAPI Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font +RLAPI int GetGlyphIndex(Font font, int codepoint); // Get index position for a unicode character on font + +// Text strings management functions (no utf8 strings, only byte chars) +// NOTE: Some strings allocate memory internally for returned strings, just be careful! +RLAPI int TextCopy(char *dst, const char *src); // Copy one string to another, returns bytes copied +RLAPI bool TextIsEqual(const char *text1, const char *text2); // Check if two text string are equal +RLAPI unsigned int TextLength(const char *text); // Get text length, checks for '\0' ending +RLAPI const char *TextFormat(const char *text, ...); // Text formatting with variables (sprintf style) +RLAPI const char *TextSubtext(const char *text, int position, int length); // Get a piece of a text string +RLAPI char *TextReplace(char *text, const char *replace, const char *by); // Replace text string (memory must be freed!) +RLAPI char *TextInsert(const char *text, const char *insert, int position); // Insert text in a position (memory must be freed!) +RLAPI const char *TextJoin(const char **textList, int count, const char *delimiter); // Join text strings with delimiter +RLAPI const char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings +RLAPI void TextAppend(char *text, const char *append, int *position); // Append text at specific position and move cursor! +RLAPI int TextFindIndex(const char *text, const char *find); // Find first text occurrence within a string +RLAPI const char *TextToUpper(const char *text); // Get upper case version of provided string +RLAPI const char *TextToLower(const char *text); // Get lower case version of provided string +RLAPI const char *TextToPascal(const char *text); // Get Pascal case notation version of provided string +RLAPI int TextToInteger(const char *text); // Get integer value from text (negative values not supported) +RLAPI char *TextToUtf8(int *codepoints, int length); // Encode text codepoint into utf8 text (memory must be freed!) + +// UTF8 text strings management functions +RLAPI int *GetCodepoints(const char *text, int *count); // Get all codepoints in a string, codepoints count returned by parameters +RLAPI int GetCodepointsCount(const char *text); // Get total number of characters (codepoints) in a UTF8 encoded string +RLAPI int GetNextCodepoint(const char *text, int *bytesProcessed); // Returns next codepoint in a UTF8 encoded string; 0x3f('?') is returned on failure +RLAPI const char *CodepointToUtf8(int codepoint, int *byteLength); // Encode codepoint into utf8 text (char array length returned as parameter) + +//------------------------------------------------------------------------------------ +// Basic 3d Shapes Drawing Functions (Module: models) +//------------------------------------------------------------------------------------ + +// Basic geometric 3D shapes drawing functions +RLAPI void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space +RLAPI void DrawPoint3D(Vector3 position, Color color); // Draw a point in 3D space, actually a small line +RLAPI void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color); // Draw a circle in 3D world space +RLAPI void DrawTriangle3D(Vector3 v1, Vector3 v2, Vector3 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!) +RLAPI void DrawTriangleStrip3D(Vector3 *points, int pointsCount, Color color); // Draw a triangle strip defined by points +RLAPI void DrawCube(Vector3 position, float width, float height, float length, Color color); // Draw cube +RLAPI void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version) +RLAPI void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); // Draw cube wires +RLAPI void DrawCubeWiresV(Vector3 position, Vector3 size, Color color); // Draw cube wires (Vector version) +RLAPI void DrawCubeTexture(Texture2D texture, Vector3 position, float width, float height, float length, Color color); // Draw cube textured +RLAPI void DrawSphere(Vector3 centerPos, float radius, Color color); // Draw sphere +RLAPI void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere with extended parameters +RLAPI void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere wires +RLAPI void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone +RLAPI void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone wires +RLAPI void DrawPlane(Vector3 centerPos, Vector2 size, Color color); // Draw a plane XZ +RLAPI void DrawRay(Ray ray, Color color); // Draw a ray line +RLAPI void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0)) +RLAPI void DrawGizmo(Vector3 position); // Draw simple gizmo + +//------------------------------------------------------------------------------------ +// Model 3d Loading and Drawing Functions (Module: models) +//------------------------------------------------------------------------------------ + +// Model loading/unloading functions +RLAPI Model LoadModel(const char *fileName); // Load model from files (meshes and materials) +RLAPI Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh (default material) +RLAPI void UnloadModel(Model model); // Unload model (including meshes) from memory (RAM and/or VRAM) +RLAPI void UnloadModelKeepMeshes(Model model); // Unload model (but not meshes) from memory (RAM and/or VRAM) + +// Mesh loading/unloading functions +RLAPI Mesh *LoadMeshes(const char *fileName, int *meshCount); // Load meshes from model file +RLAPI void UnloadMesh(Mesh mesh); // Unload mesh from memory (RAM and/or VRAM) +RLAPI bool ExportMesh(Mesh mesh, const char *fileName); // Export mesh data to file, returns true on success + +// Material loading/unloading functions +RLAPI Material *LoadMaterials(const char *fileName, int *materialCount); // Load materials from model file +RLAPI Material LoadMaterialDefault(void); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) +RLAPI void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM) +RLAPI void SetMaterialTexture(Material *material, int mapType, Texture2D texture); // Set texture for a material map type (MAP_DIFFUSE, MAP_SPECULAR...) +RLAPI void SetModelMeshMaterial(Model *model, int meshId, int materialId); // Set material for a mesh + +// Model animations loading/unloading functions +RLAPI ModelAnimation *LoadModelAnimations(const char *fileName, int *animsCount); // Load model animations from file +RLAPI void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose +RLAPI void UnloadModelAnimation(ModelAnimation anim); // Unload animation data +RLAPI bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match + +// Mesh generation functions +RLAPI Mesh GenMeshPoly(int sides, float radius); // Generate polygonal mesh +RLAPI Mesh GenMeshPlane(float width, float length, int resX, int resZ); // Generate plane mesh (with subdivisions) +RLAPI Mesh GenMeshCube(float width, float height, float length); // Generate cuboid mesh +RLAPI Mesh GenMeshSphere(float radius, int rings, int slices); // Generate sphere mesh (standard sphere) +RLAPI Mesh GenMeshHemiSphere(float radius, int rings, int slices); // Generate half-sphere mesh (no bottom cap) +RLAPI Mesh GenMeshCylinder(float radius, float height, int slices); // Generate cylinder mesh +RLAPI Mesh GenMeshTorus(float radius, float size, int radSeg, int sides); // Generate torus mesh +RLAPI Mesh GenMeshKnot(float radius, float size, int radSeg, int sides); // Generate trefoil knot mesh +RLAPI Mesh GenMeshHeightmap(Image heightmap, Vector3 size); // Generate heightmap mesh from image data +RLAPI Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); // Generate cubes-based map mesh from image data + +// Mesh manipulation functions +RLAPI BoundingBox MeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits +RLAPI void MeshTangents(Mesh *mesh); // Compute mesh tangents +RLAPI void MeshBinormals(Mesh *mesh); // Compute mesh binormals +RLAPI void MeshNormalsSmooth(Mesh *mesh); // Smooth (average) vertex normals + +// Model drawing functions +RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set) +RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters +RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set) +RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters +RLAPI void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires) +RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint); // Draw a billboard texture +RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 center, float size, Color tint); // Draw a billboard texture defined by source + +// Collision detection functions +RLAPI bool CheckCollisionSpheres(Vector3 center1, float radius1, Vector3 center2, float radius2); // Detect collision between two spheres +RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); // Detect collision between two bounding boxes +RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius); // Detect collision between box and sphere +RLAPI bool CheckCollisionRaySphere(Ray ray, Vector3 center, float radius); // Detect collision between ray and sphere +RLAPI bool CheckCollisionRaySphereEx(Ray ray, Vector3 center, float radius, Vector3 *collisionPoint); // Detect collision between ray and sphere, returns collision point +RLAPI bool CheckCollisionRayBox(Ray ray, BoundingBox box); // Detect collision between ray and box +RLAPI RayHitInfo GetCollisionRayMesh(Ray ray, Mesh mesh, Matrix transform); // Get collision info between ray and mesh +RLAPI RayHitInfo GetCollisionRayModel(Ray ray, Model model); // Get collision info between ray and model +RLAPI RayHitInfo GetCollisionRayTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); // Get collision info between ray and triangle +RLAPI RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight); // Get collision info between ray and ground plane (Y-normal plane) + +//------------------------------------------------------------------------------------ +// Shaders System Functions (Module: rlgl) +// NOTE: This functions are useless when using OpenGL 1.1 +//------------------------------------------------------------------------------------ + +// Shader loading/unloading functions +RLAPI Shader LoadShader(const char *vsFileName, const char *fsFileName); // Load shader from files and bind default locations +RLAPI Shader LoadShaderCode(const char *vsCode, const char *fsCode); // Load shader from code strings and bind default locations +RLAPI void UnloadShader(Shader shader); // Unload shader from GPU memory (VRAM) + +RLAPI Shader GetShaderDefault(void); // Get default shader +RLAPI Texture2D GetTextureDefault(void); // Get default texture +RLAPI Texture2D GetShapesTexture(void); // Get texture to draw shapes +RLAPI Rectangle GetShapesTextureRec(void); // Get texture rectangle to draw shapes +RLAPI void SetShapesTexture(Texture2D texture, Rectangle source); // Define default texture used to draw shapes + +// Shader configuration functions +RLAPI int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location +RLAPI int GetShaderLocationAttrib(Shader shader, const char *attribName); // Get shader attribute location +RLAPI void SetShaderValue(Shader shader, int uniformLoc, const void *value, int uniformType); // Set shader uniform value +RLAPI void SetShaderValueV(Shader shader, int uniformLoc, const void *value, int uniformType, int count); // Set shader uniform value vector +RLAPI void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // Set shader uniform value (matrix 4x4) +RLAPI void SetShaderValueTexture(Shader shader, int uniformLoc, Texture2D texture); // Set shader uniform value for texture +RLAPI void SetMatrixProjection(Matrix proj); // Set a custom projection matrix (replaces internal projection matrix) +RLAPI void SetMatrixModelview(Matrix view); // Set a custom modelview matrix (replaces internal modelview matrix) +RLAPI Matrix GetMatrixModelview(void); // Get internal modelview matrix +RLAPI Matrix GetMatrixProjection(void); // Get internal projection matrix + +// Texture maps generation (PBR) +// NOTE: Required shaders should be provided +RLAPI TextureCubemap GenTextureCubemap(Shader shader, Texture2D panorama, int size, int format); // Generate cubemap texture from 2D panorama texture +RLAPI TextureCubemap GenTextureIrradiance(Shader shader, TextureCubemap cubemap, int size); // Generate irradiance texture using cubemap data +RLAPI TextureCubemap GenTexturePrefilter(Shader shader, TextureCubemap cubemap, int size); // Generate prefilter texture using cubemap data +RLAPI Texture2D GenTextureBRDF(Shader shader, int size); // Generate BRDF texture + +// Shading begin/end functions +RLAPI void BeginShaderMode(Shader shader); // Begin custom shader drawing +RLAPI void EndShaderMode(void); // End custom shader drawing (use default shader) +RLAPI void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied) +RLAPI void EndBlendMode(void); // End blending mode (reset to default: alpha blending) + +// VR control functions +RLAPI void InitVrSimulator(void); // Init VR simulator for selected device parameters +RLAPI void CloseVrSimulator(void); // Close VR simulator for current device +RLAPI void UpdateVrTracking(Camera *camera); // Update VR tracking (position and orientation) and camera +RLAPI void SetVrConfiguration(VrDeviceInfo info, Shader distortion); // Set stereo rendering configuration parameters +RLAPI bool IsVrSimulatorReady(void); // Detect if VR simulator is ready +RLAPI void ToggleVrMode(void); // Enable/Disable VR experience +RLAPI void BeginVrDrawing(void); // Begin VR simulator stereo rendering +RLAPI void EndVrDrawing(void); // End VR simulator stereo rendering + +//------------------------------------------------------------------------------------ +// Audio Loading and Playing Functions (Module: audio) +//------------------------------------------------------------------------------------ + +// Audio device management functions +RLAPI void InitAudioDevice(void); // Initialize audio device and context +RLAPI void CloseAudioDevice(void); // Close the audio device and context +RLAPI bool IsAudioDeviceReady(void); // Check if audio device has been initialized successfully +RLAPI void SetMasterVolume(float volume); // Set master volume (listener) + +// Wave/Sound loading/unloading functions +RLAPI Wave LoadWave(const char *fileName); // Load wave data from file +RLAPI Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load wave from memory buffer, fileType refers to extension: i.e. "wav" +RLAPI Sound LoadSound(const char *fileName); // Load sound from file +RLAPI Sound LoadSoundFromWave(Wave wave); // Load sound from wave data +RLAPI void UpdateSound(Sound sound, const void *data, int samplesCount);// Update sound buffer with new data +RLAPI void UnloadWave(Wave wave); // Unload wave data +RLAPI void UnloadSound(Sound sound); // Unload sound +RLAPI bool ExportWave(Wave wave, const char *fileName); // Export wave data to file, returns true on success +RLAPI bool ExportWaveAsCode(Wave wave, const char *fileName); // Export wave sample data to code (.h), returns true on success + +// Wave/Sound management functions +RLAPI void PlaySound(Sound sound); // Play a sound +RLAPI void StopSound(Sound sound); // Stop playing a sound +RLAPI void PauseSound(Sound sound); // Pause a sound +RLAPI void ResumeSound(Sound sound); // Resume a paused sound +RLAPI void PlaySoundMulti(Sound sound); // Play a sound (using multichannel buffer pool) +RLAPI void StopSoundMulti(void); // Stop any sound playing (using multichannel buffer pool) +RLAPI int GetSoundsPlaying(void); // Get number of sounds playing in the multichannel +RLAPI bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing +RLAPI void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level) +RLAPI void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) +RLAPI void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels); // Convert wave data to desired format +RLAPI Wave WaveCopy(Wave wave); // Copy a wave to a new wave +RLAPI void WaveCrop(Wave *wave, int initSample, int finalSample); // Crop a wave to defined samples range +RLAPI float *LoadWaveSamples(Wave wave); // Load samples data from wave as a floats array +RLAPI void UnloadWaveSamples(float *samples); // Unload samples data loaded with LoadWaveSamples() + +// Music management functions +RLAPI Music LoadMusicStream(const char *fileName); // Load music stream from file +RLAPI void UnloadMusicStream(Music music); // Unload music stream +RLAPI void PlayMusicStream(Music music); // Start music playing +RLAPI void UpdateMusicStream(Music music); // Updates buffers for music streaming +RLAPI void StopMusicStream(Music music); // Stop music playing +RLAPI void PauseMusicStream(Music music); // Pause music playing +RLAPI void ResumeMusicStream(Music music); // Resume playing paused music +RLAPI bool IsMusicPlaying(Music music); // Check if music is playing +RLAPI void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level) +RLAPI void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level) +RLAPI float GetMusicTimeLength(Music music); // Get music time length (in seconds) +RLAPI float GetMusicTimePlayed(Music music); // Get current music time played (in seconds) + +// AudioStream management functions +RLAPI AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); // Init audio stream (to stream raw audio pcm data) +RLAPI void UpdateAudioStream(AudioStream stream, const void *data, int samplesCount); // Update audio stream buffers with data +RLAPI void CloseAudioStream(AudioStream stream); // Close audio stream and free memory +RLAPI bool IsAudioStreamProcessed(AudioStream stream); // Check if any audio stream buffers requires refill +RLAPI void PlayAudioStream(AudioStream stream); // Play audio stream +RLAPI void PauseAudioStream(AudioStream stream); // Pause audio stream +RLAPI void ResumeAudioStream(AudioStream stream); // Resume audio stream +RLAPI bool IsAudioStreamPlaying(AudioStream stream); // Check if audio stream is playing +RLAPI void StopAudioStream(AudioStream stream); // Stop audio stream +RLAPI void SetAudioStreamVolume(AudioStream stream, float volume); // Set volume for audio stream (1.0 is max level) +RLAPI void SetAudioStreamPitch(AudioStream stream, float pitch); // Set pitch for audio stream (1.0 is base level) +RLAPI void SetAudioStreamBufferSizeDefault(int size); // Default size for new audio streams + +#if defined(__cplusplus) +} +#endif + +#endif // RAYLIB_H diff --git a/lib/windows/libraylib.dll b/libs/raylib/windows/libraylib.dll similarity index 100% rename from lib/windows/libraylib.dll rename to libs/raylib/windows/libraylib.dll diff --git a/lib/windows/libraylib.lib b/libs/raylib/windows/libraylib.lib similarity index 100% rename from lib/windows/libraylib.lib rename to libs/raylib/windows/libraylib.lib diff --git a/lib/windows/libraylibdll.lib b/libs/raylib/windows/libraylibdll.lib similarity index 100% rename from lib/windows/libraylibdll.lib rename to libs/raylib/windows/libraylibdll.lib diff --git a/src/komodo/ecs/components/behavior_macros.nim b/src/komodo/ecs/components/behavior_macros.nim index 9892cb7..9ddba30 100644 --- a/src/komodo/ecs/components/behavior_macros.nim +++ b/src/komodo/ecs/components/behavior_macros.nim @@ -69,19 +69,19 @@ proc generateUpdate(typeName: NimNode; updateDefinition: NimNode): NimNode = newEmptyNode(), newEmptyNode(), newTree( - nnkFormalParams, + nnkFormalParams, + newEmptyNode(), + newTree( + nnkIdentDefs, + ident("self"), + ident($typeName), newEmptyNode(), - newTree( - nnkIdentDefs, - ident("self"), - ident($typeName), - newEmptyNode(), ), newTree( - nnkIdentDefs, - ident("delta"), - ident("float32"), - newEmptyNode(), + nnkIdentDefs, + ident("delta"), + ident("float32"), + newEmptyNode(), ), ), newEmptyNode(), diff --git a/src/komodo/game.nim b/src/komodo/game.nim index f467e6d..d0db281 100644 --- a/src/komodo/game.nim +++ b/src/komodo/game.nim @@ -39,7 +39,7 @@ type Game* = ref object systems: seq[System] title: string -var instance* {.global.} = none[Game]() +# var instance* {.global.} = none[Game]() func camera*(self: Game): auto {.inline.} = if self.camera.isNone(): @@ -75,7 +75,7 @@ proc newGame*(): Game = screenSize(result), result.title, ) - instance = some(result) + # instance = some(result) func draw(self: Game) = beginDraw() @@ -167,6 +167,15 @@ func update(self: Game) = for system in self.systems: system.update(delta) +func setClearColor*(self: Game; clearColor: Color) = + self.clearColor = some(clearColor) + +proc quit*(self: Game) = + if self.isRunning: + self.isRunning = false + # instance = none[Game]() + close() + proc run*(self: Game) = if not self.isRunning: logInfo("Starting...") @@ -177,10 +186,31 @@ proc run*(self: Game) = self.update() self.draw() -func setClearColor*(self: Game; clearColor: Color) = - self.clearColor = some(clearColor) +type CommandKind* {.pure.} = enum + Default + Close -func quit*(self: Game) = - if self.isRunning: - self.isRunning = false - close() +proc handleCommands(self: Game; commandChannel: ptr Channel[CommandKind]): CommandKind = + let (isDataAvailable, message) = commandChannel[].tryRecv() + case message + of CommandKind.Close: + self.quit() + else: + discard + message + +proc run*(self: Game; commandChannel: ptr Channel[CommandKind]) = + if not self.isRunning: + logInfo("Starting...") + setFps(60) + + while not isClosing(): + case self.handleCommands(commandChannel) + of CommandKind.Close: + # Necessary to break, as GLFW will throw an error forever otherwise + break + else: + discard + self.initialize() + self.update() + self.draw() diff --git a/src/komodo/prelude.nim b/src/komodo/prelude.nim index f01c438..66f73a3 100644 --- a/src/komodo/prelude.nim +++ b/src/komodo/prelude.nim @@ -1,5 +1,6 @@ import options +import ./game import ./ecs/components/[ behavior_macros, component, @@ -8,5 +9,6 @@ import ./ecs/components/[ import ./ecs/entity import ./ecs/systems/system import ./input +import ./lib/graphics import ./lib/math import ./logging diff --git a/src/komodo/private/macro_helpers.nim b/src/komodo/private/macro_helpers.nim index 8ed0a8d..4d18258 100644 --- a/src/komodo/private/macro_helpers.nim +++ b/src/komodo/private/macro_helpers.nim @@ -175,14 +175,7 @@ proc generateInit*( newEmptyNode(), ), ), - newTree( - nnkPragma, - newTree( - nnkExprColonExpr, - ident("locks"), - lockLevel, - ) - ), + newEmptyNode(), newEmptyNode(), quote do: `defaultStatements`