1 /** \file
2  * \brief User API
3  * IUP - A Portable User Interface Toolkit
4  * Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil
5  * http://www.tecgraf.puc-rio.br/iup  mailto:iup@tecgraf.puc-rio.br
6  *
7  * See Copyright Notice at the end of this file
8  *
9  * Macros:
10  * ROOT = https://webserver2.tecgraf.puc-rio.br/iup/en
11  */
12 // dmd -o- -D iup/iup.d  https://webserver2.tecgraf.puc-rio.br/iup/en/func/?C=S;O=D
13 
14 module iup.iup;
15 
16 public import iup.iupkey;
17 public import iup.iupdef;
18 
19 version(DigitalMars) version(Windows) { pragma(lib, "iup.lib"); }
20 //version(DigitalMars) version(Windows) { pragma(lib, "iupimglib"); } // required only if function IupImageLibOpen() is called
21 
22 extern(C) {
23 
24 enum IUP_NAME = "IUP - Portable User Interface";
25 enum IUP_DESCRIPTION	= "Multi-platform Toolkit for Building Graphical User Interfaces";
26 enum IUP_COPYRIGHT = "Copyright (C) 1994-2019 Tecgraf/PUC-Rio";
27 enum IUP_VERSION = "3.27";         /* bug fixes are reported only by IupVersion functions */
28 enum IUP_VERSION_NUMBER = 327000;
29 enum IUP_VERSION_DATE = "2019/04/30";  /* does not include bug fix releases */
30 
31 //struct Ihandle_;
32 //alias Ihandle = Ihandle_;
33 struct Ihandle;
34 
35 alias Icallback = int function(Ihandle*) nothrow;
36 alias Iparamcb  = int function(Ihandle* dialog, int param_index, void* user_data) nothrow;
37 
38 @nogc nothrow {
39 
40 /************************************************************************/
41 /*                        Main API                                      */
42 /************************************************************************/
43 
44 int       IupOpen          (int* argc, char*** argv); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/sys_guide.html <br> https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupopen.html
45 void      IupClose         ();                        /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/sys_guide.html <br> https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupclose.html
46 void      IupImageLibOpen  ();                        /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/iupimglib.html
47 
48 int       IupMainLoop      (); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupmainloop.html
49 int       IupLoopStep      (); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuploopstep.html
50 int       IupLoopStepWait  (); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuploopstep.html
51 int       IupMainLoopLevel (); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupmainlooplevel.html
52 void      IupFlush         (); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupflush.html
53 void      IupExitLoop      (); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupexitloop.html
54 
55 int       IupRecordInput(const(char)* filename, int mode); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuprecordinput.html
56 int       IupPlayInput(const(char)* filename);             /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupplayinput.html
57 
58 void      IupUpdate        (Ihandle* ih); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupupdate.html
59 void      IupUpdateChildren(Ihandle* ih); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupupdate.html
60 void      IupRedraw        (Ihandle* ih, int children); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupredraw.html
61 void      IupRefresh       (Ihandle* ih);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuprefresh.html
62 void      IupRefreshChildren(Ihandle* ih); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuprefreshchildren.html
63 
64 int       IupExecute       (const(char)* filename, const(char)* parameters); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupexecute.html
65 int       IupExecuteWait   (const(char)* filename, const(char)* parameters); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupexecutewait.html
66 int       IupHelp          (const(char)* url); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuphelp.html
67 void      IupLog(const(char)* type, const(char)* format, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuplog.html
68 
69 char*     IupLoad          (const(char)* filename); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupload.html
70 char*     IupLoadBuffer    (const(char)* buffer);   /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupload.html
71 
72 char*     IupVersion       (); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupversion.html
73 char*     IupVersionDate   (); //  See_Also: undocumented
74 int       IupVersionNumber (); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupversion.html
75 
76 void      IupSetLanguage   (const(char)* lng); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetlanguage.html
77 char*     IupGetLanguage   (); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetlanguage.html
78 void      IupSetLanguageString(const(char)* name, const(char)* str);   /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetlanguagestring.html
79 void      IupStoreLanguageString(const(char)* name, const(char)* str); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetlanguagestring.html
80 char*     IupGetLanguageString(const(char)* name); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetlanguagestring.html
81 void      IupSetLanguagePack(Ihandle* ih); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetlanguagepack.html
82 
83 void      IupDestroy       (Ihandle* ih); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupdestroy.html
84 void      IupDetach        (Ihandle* child); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupdetach.html
85 Ihandle*  IupAppend        (Ihandle* ih, Ihandle* child); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupappend.html
86 Ihandle*  IupInsert        (Ihandle* ih, Ihandle* ref_child, Ihandle* child); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupinsert.html
87 Ihandle*  IupGetChild      (Ihandle* ih, int pos); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetchild.html
88 int       IupGetChildPos   (Ihandle* ih, Ihandle* child); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetchildpos.html
89 int       IupGetChildCount (Ihandle* ih); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetchildcount.html
90 Ihandle*  IupGetNextChild  (Ihandle* ih, Ihandle* child); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetnextchild.html
91 Ihandle*  IupGetBrother    (Ihandle* ih); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetbrother.html
92 Ihandle*  IupGetParent     (Ihandle* ih); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetparent.html
93 Ihandle*  IupGetDialog     (Ihandle* ih); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetdialog.html
94 Ihandle*  IupGetDialogChild(Ihandle* ih, const(char)* name); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetdialogchild.html
95 int       IupReparent      (Ihandle* ih, Ihandle* new_parent, Ihandle* ref_child); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupreparent.html
96 
97 int       IupPopup         (Ihandle* ih, int x, int y); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuppopup.html
98 int       IupShow          (Ihandle* ih);               /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupshow.html
99 int       IupShowXY        (Ihandle* ih, int x, int y); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupshowxy.html
100 int       IupHide          (Ihandle* ih); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuphide.html
101 int       IupMap           (Ihandle* ih); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupmap.html
102 void      IupUnmap         (Ihandle* ih); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupunmap.html
103 
104 void      IupResetAttribute(Ihandle* ih, const(char)* name); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupresetattribute.html
105 int       IupGetAllAttributes(Ihandle* ih, char** names, int n); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetallattributes.html
106 void      IupCopyAttributes(Ihandle* src_ih, Ihandle* dst_ih);   /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupcopyattributes.html
107 Ihandle*  IupSetAtt(const(char)* handle_name, Ihandle* ih, const(char)* name, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetatt.html
108 Ihandle*  IupSetAttributes (Ihandle* ih, const(char)* str); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattributes.html
109 char*     IupGetAttributes (Ihandle* ih); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattributes.html
110 
111 void      IupSetAttribute   (Ihandle* ih, const(char)* name, const(char)* value); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/attrib_guide.html <br> https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattribute.html
112 void      IupSetStrAttribute(Ihandle* ih, const(char)* name, const(char)* value); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattribute.html
113 void      IupSetStrf        (Ihandle* ih, const(char)* name, const(char)* format, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattribute.html
114 void      IupSetInt         (Ihandle* ih, const(char)* name, int value); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattribute.html
115 void      IupSetFloat       (Ihandle* ih, const(char)* name, float value); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattribute.html
116 void      IupSetDouble      (Ihandle* ih, const(char)* name, double value); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattribute.html
117 void      IupSetRGB         (Ihandle* ih, const(char)* name, ubyte r, ubyte g, ubyte b); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattribute.html
118 
119 char*     IupGetAttribute(Ihandle* ih, const(char)* name); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/attrib_guide.html <br> https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html
120 int       IupGetInt      (Ihandle* ih, const(char)* name); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html
121 int       IupGetInt2     (Ihandle* ih, const(char)* name); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html
122 int       IupGetIntInt   (Ihandle* ih, const(char)* name, int* i1, int* i2); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html
123 float     IupGetFloat    (Ihandle* ih, const(char)* name); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html
124 double    IupGetDouble   (Ihandle* ih, const(char)* name); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html
125 void      IupGetRGB      (Ihandle* ih, const(char)* name, ubyte* r, ubyte* g, ubyte* b); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html
126 
127 void  IupSetAttributeId(Ihandle* ih, const(char)* name, int id, const(char)* value); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattribute.html
128 void  IupSetStrAttributeId(Ihandle* ih, const(char)* name, int id, const(char)* value); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattribute.html
129 void  IupSetStrfId(Ihandle* ih, const(char)* name, int id, const(char)* format, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattribute.html
130 void  IupSetIntId(Ihandle* ih, const(char)* name, int id, int value); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattribute.html
131 void  IupSetFloatId(Ihandle* ih, const(char)* name, int id, float value); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattribute.html
132 void  IupSetDoubleId(Ihandle* ih, const(char)* name, int id, double value); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattribute.html
133 void  IupSetRGBId(Ihandle* ih, const(char)* name, int id, ubyte r, ubyte g, ubyte b); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattribute.html
134 
135 char*  IupGetAttributeId(Ihandle* ih, const(char)* name, int id); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html
136 int    IupGetIntId(Ihandle* ih, const(char)* name, int id); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html
137 float  IupGetFloatId(Ihandle* ih, const(char)* name, int id); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html
138 double IupGetDoubleId(Ihandle* ih, const(char)* name, int id); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html
139 void   IupGetRGBId(Ihandle* ih, const(char)* name, int id, ubyte* r, ubyte* g, ubyte* b); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html
140 
141 void  IupSetAttributeId2(Ihandle* ih, const(char)* name, int lin, int col, const(char)* value); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattribute.html
142 void  IupSetStrAttributeId2(Ihandle* ih, const(char)* name, int lin, int col, const(char)* value); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattribute.html
143 void  IupSetStrfId2(Ihandle* ih, const(char)* name, int lin, int col, const(char)* format, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattribute.html
144 void  IupSetIntId2(Ihandle* ih, const(char)* name, int lin, int col, int value); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattribute.html
145 void  IupSetFloatId2(Ihandle* ih, const(char)* name, int lin, int col, float value); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattribute.html
146 void  IupSetDoubleId2(Ihandle* ih, const(char)* name, int lin, int col, double value); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattribute.html
147 void  IupSetRGBId2(Ihandle* ih, const(char)* name, int lin, int col, ubyte r, ubyte g, ubyte b); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattribute.html
148 
149 char*  IupGetAttributeId2(Ihandle* ih, const(char)* name, int lin, int col); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html
150 int    IupGetIntId2(Ihandle* ih, const(char)* name, int lin, int col); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html
151 float  IupGetFloatId2(Ihandle* ih, const(char)* name, int lin, int col); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html
152 double IupGetDoubleId2(Ihandle* ih, const(char)* name, int lin, int col); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html
153 void   IupGetRGBId2(Ihandle* ih, const(char)* name, int lin, int col, ubyte* r, ubyte* g, ubyte* b); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html
154 
155 void      IupSetGlobal  (const(char)* name, const(char)* value); /// https://webserver2.tecgraf.puc-rio.br/iup/en/attrib/iup_globals.html <br> See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetglobal.html
156 void      IupSetStrGlobal(const(char)* name, const(char)* value); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetglobal.html
157 char*     IupGetGlobal  (const(char)* name); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/attrib/iup_globals.html <br> https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetglobal.html
158 
159 Ihandle*  IupSetFocus     (Ihandle* ih); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetfocus.html
160 Ihandle*  IupGetFocus     ();            /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetfocus.html
161 Ihandle*  IupPreviousField(Ihandle* ih); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuppreviousfield.html
162 Ihandle*  IupNextField    (Ihandle* ih); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupnextfield.html
163 
164 Icallback IupGetCallback (Ihandle* ih, const(char)* name); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetcallback.html
165 Icallback IupSetCallback (Ihandle* ih, const(char)* name, Icallback func); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetcallback.html
166 Ihandle*  IupSetCallbacks(Ihandle* ih, const(char)* name, Icallback func, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetcallbacks.html
167 
168 Icallback IupGetFunction(const(char)* name); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetfunction.html
169 Icallback IupSetFunction(const(char)* name, Icallback func); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetfunction.html
170 
171 Ihandle*  IupGetHandle    (const(char)* name);              /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgethandle.html
172 Ihandle*  IupSetHandle    (const(char)* name, Ihandle* ih); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsethandle.html
173 int       IupGetAllNames  (char** names, int n); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetallnames.html
174 int       IupGetAllDialogs(char** names, int n); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetalldialogs.html
175 char*     IupGetName      (Ihandle* ih); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetname.html
176 
177 void      IupSetAttributeHandle(Ihandle* ih, const(char)* name, Ihandle* ih_named); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattributehandle.html
178 Ihandle*  IupGetAttributeHandle(Ihandle* ih, const(char)* name); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattributehandle.html
179 void      IupSetAttributeHandleId(Ihandle* ih, const(char)* name, int id, Ihandle* ih_named); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattributehandle.html
180 Ihandle*  IupGetAttributeHandleId(Ihandle* ih, const(char)* name, int id); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattributehandle.html
181 void      IupSetAttributeHandleId2(Ihandle* ih, const(char)* name, int lin, int col, Ihandle* ih_named); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattributehandle.html
182 Ihandle*  IupGetAttributeHandleId2(Ihandle* ih, const(char)* name, int lin, int col); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattributehandle.html
183 
184 char*     IupGetClassName(Ihandle* ih); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetclassname.html
185 char*     IupGetClassType(Ihandle* ih); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetclasstype.html
186 int       IupGetAllClasses(char** names, int n);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetallclasses.html
187 int       IupGetClassAttributes(const(char)* classname, char** names, int n); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetclassattributes.html
188 int       IupGetClassCallbacks(const(char)* classname, char** names, int n);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetclasscallbacks.html
189 void      IupSaveClassAttributes(Ihandle* ih); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsaveclassattributes.html
190 void      IupCopyClassAttributes(Ihandle* src_ih, Ihandle* dst_ih); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupcopyclassattributes.html
191 void      IupSetClassDefaultAttribute(const(char)* classname, const(char)* name, const(char)* value); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetclassdefaultattribute.html
192 int       IupClassMatch(Ihandle* ih, const(char)* classname); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupclassmatch.html
193 
194 Ihandle*  IupCreate (const(char)* classname); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupcreate.html
195 Ihandle*  IupCreatev(const(char)* classname, void** params);    /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupcreate.html
196 Ihandle*  IupCreatep(const(char)* classname, void* first, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupcreate.html
197 
198 /************************************************************************/
199 /*                        Elements                                      */
200 /************************************************************************/
201 
202 Ihandle*  IupFill       ();                    /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupfill.html
203 Ihandle*  IupSpace      ();
204 
205 Ihandle*  IupRadio      (Ihandle* child);      /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupradio.html
206 Ihandle*  IupVbox       (Ihandle* child, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupvbox.html
207 Ihandle*  IupVboxv      (Ihandle** children);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupvbox.html
208 Ihandle*  IupZbox       (Ihandle* child, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupzbox.html
209 Ihandle*  IupZboxv      (Ihandle** children);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupzbox.html
210 Ihandle*  IupHbox       (Ihandle* child, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuphbox.html
211 Ihandle*  IupHboxv      (Ihandle** children);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuphbox.html
212 
213 Ihandle*  IupNormalizer (Ihandle* ih_first, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupnormalizer.html
214 Ihandle*  IupNormalizerv(Ihandle** ih_list);      /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupnormalizer.html
215 
216 Ihandle*  IupCbox       (Ihandle* child, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupcbox.html
217 Ihandle*  IupCboxv      (Ihandle** children);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupcbox.html
218 Ihandle*  IupSbox       (Ihandle* child);      /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupsbox.html
219 Ihandle*  IupSplit      (Ihandle* child1, Ihandle* child2); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupsplit.html
220 Ihandle*  IupScrollBox  (Ihandle* child);      /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupscrollbox.html
221 Ihandle*  IupFlatScrollBox(Ihandle* child);    /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupflatscrollbox.html
222 Ihandle*  IupGridBox    (Ihandle* child, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupgridbox.html
223 Ihandle*  IupGridBoxv   (Ihandle** children);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupgridbox.html
224 Ihandle*  IupMultiBox   (Ihandle* child, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupmultibox.html
225 Ihandle*  IupMultiBoxv  (Ihandle** children);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupmultibox.html
226 Ihandle*  IupExpander   (Ihandle* child);      /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupexpander.html
227 Ihandle*  IupDetachBox  (Ihandle* child);      /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupdetachbox.html
228 Ihandle*  IupBackgroundBox(Ihandle* child);    /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupbackgroundbox.html
229 
230 Ihandle*  IupFrame      (Ihandle* child); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupframe.html
231 Ihandle*  IupFlatFrame  (Ihandle* child); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupflatframe.html
232 
233 Ihandle*  IupImage      (int width, int height, const(ubyte)* pixmap); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupimage.html
234 Ihandle*  IupImageRGB   (int width, int height, const(ubyte)* pixmap); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupimage.html
235 Ihandle*  IupImageRGBA  (int width, int height, const(ubyte)* pixmap); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupimage.html
236 
237 Ihandle*  IupItem       (const(char)* title, const(char)* action); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupitem.html
238 Ihandle*  IupSubmenu    (const(char)* title, Ihandle* child); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupsubmenu.html
239 Ihandle*  IupSeparator  ();                    /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupseparator.html
240 Ihandle*  IupMenu       (Ihandle* child, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupmenu.html
241 Ihandle*  IupMenuv      (Ihandle** children);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupmenu.html
242 
243 Ihandle*  IupButton     (const(char)* title, const(char)* action); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupbutton.html
244 Ihandle*  IupFlatButton (const(char)* title);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupflatbutton.html
245 Ihandle*  IupFlatToggle (const(char)* title);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupflattoggle.html
246 Ihandle*  IupDropButton (Ihandle* dropchild);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupdropbutton.html
247 Ihandle*  IupFlatLabel  (const(char)* title);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupflatlabel.html
248 Ihandle*  IupFlatSeparator();                  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupflatseparator.html
249 Ihandle*  IupCanvas     (const(char)* action); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupcanvas.html
250 Ihandle*  IupDialog     (Ihandle* child);      /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupdialog.html
251 Ihandle*  IupUser       ();                    /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupuser.html
252 Ihandle*  IupLabel      (const(char)* title);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuplabel.html
253 Ihandle*  IupList       (const(char)* action); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuplist.html
254 Ihandle*  IupFlatList   ();                    /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupflatlist.html
255 Ihandle*  IupText       (const(char)* action); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptext.html
256 Ihandle*  IupMultiLine  (const(char)* action); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupmultiline.html
257 Ihandle*  IupToggle     (const(char)* title, const(char)* action); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptoggle.html
258 Ihandle*  IupTimer      (); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptimer.html
259 Ihandle*  IupClipboard  (); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupclipboard.html
260 Ihandle*  IupProgressBar(); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/.../iupprogressbar.html
261 Ihandle*  IupVal        (const(char)* type);   /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupval.html
262 Ihandle*  IupTabs       (Ihandle* child, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptabs.html
263 Ihandle*  IupTabsv      (Ihandle** children);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptabs.html
264 Ihandle*  IupFlatTabs   (Ihandle* first, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupflattabs.html
265 Ihandle*  IupFlatTabsv  (Ihandle** children);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupflattabs.html
266 Ihandle*  IupTree       (); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptree.html
267 Ihandle*  IupLink       (const(char)* url, const(char)* title); /// See_Also: webserver2.tecgraf.puc-rio.br/iup/en/elem/iuplink.html
268 Ihandle*  IupAnimatedLabel(Ihandle* animation); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/.../iupanimatedlabel.html
269 Ihandle*  IupDatePick   (); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupdatepick.html
270 Ihandle*  IupCalendar   (); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupcalendar.html
271 Ihandle*  IupColorbar   (); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupcolorbar.html
272 Ihandle*  IupGauge      (); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupgauge.html
273 Ihandle*  IupDial       (const(char)* type); /// See_Also: http://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupdial.html
274 Ihandle*  IupColorBrowser(); /// See_Also: http://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupcolorbrowser.html
275 
276 /* Old controls, use SPIN attribute of IupText */
277 Ihandle*  IupSpin       ();               /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupspin.html
278 Ihandle*  IupSpinbox    (Ihandle* child); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupspin.html
279 
280 
281 /************************************************************************/
282 /*                      Utilities                                       */
283 /************************************************************************/
284 
285 /* String compare utility */
286 int  IupStringCompare(const(char)* str1, const(char)* str2, int casesensitive, int lexicographic); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupstringcompare.html
287 
288 /* IupImage utility */
289 int  IupSaveImageAsText(Ihandle* ih, const(char)* file_name, const(char)* format, const(char)* name); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsaveimageastext.html
290 
291 /* IupText and IupScintilla utilities */
292 void IupTextConvertLinColToPos(Ihandle* ih, int lin, int col, int* pos);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptext.html
293 void IupTextConvertPosToLinCol(Ihandle* ih, int pos, int* lin, int* col); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptext.html
294 
295 /* IupText, IupList, IupTree, IupMatrix and IupScintilla utility */
296 int  IupConvertXYToPos(Ihandle* ih, int x, int y); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupconvertxytopos.html
297 
298 /* OLD names, kept for backward compatibility, will never be removed. */
299 void IupStoreGlobal(const(char)* name, const(char)* value);
300 void IupStoreAttribute(Ihandle* ih, const(char)* name, const(char)* value);
301 void IupSetfAttribute(Ihandle* ih, const(char)* name, const(char)* format, ...);
302 void IupStoreAttributeId(Ihandle* ih, const(char)* name, int id, const(char)* value);
303 void IupSetfAttributeId(Ihandle* ih, const(char)* name, int id, const(char)* f, ...);
304 void IupStoreAttributeId2(Ihandle* ih, const(char)* name, int lin, int col, const(char)* value);
305 void IupSetfAttributeId2(Ihandle* ih, const(char)* name, int lin, int col, const(char)* format, ...);
306 
307 /* IupTree utilities */
308 int   IupTreeSetUserId(Ihandle* ih, int id, void* userid); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptree.html
309 void* IupTreeGetUserId(Ihandle* ih, int id);               /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptree.html
310 int   IupTreeGetId(Ihandle* ih, void* userid);             /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptree.html
311 deprecated("use IupSetAttributeHandleId")
312 void  IupTreeSetAttributeHandle(Ihandle* ih, const(char)* name, int id, Ihandle* ih_named);
313 
314 
315 /************************************************************************/
316 /*                      Pre-definided dialogs                           */
317 /************************************************************************/
318 
319 Ihandle* IupFileDlg();     /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupfiledlg.html
320 Ihandle* IupMessageDlg();  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupmessagedlg.html
321 Ihandle* IupColorDlg();    /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupcolordlg.html
322 Ihandle* IupFontDlg();     /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupfontdlg.html
323 Ihandle* IupProgressDlg(); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupprogressdlg.html
324 
325 int  IupGetFile(char* arq); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupgetfile.html
326 void IupMessage(const(char)* title, const(char)* msg);          /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupmessage.html
327 void IupMessagef(const(char)* title, const(char)* format, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupmessage.html
328 void IupMessageError(Ihandle* parent, const(char)* message); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupmessageerror.html
329 int  IupMessageAlarm(Ihandle* parent, const(char)* title, const(char)* message, const(char)* buttons); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupmessagealarm.html
330 int  IupAlarm(const(char)* title, const(char)* msg, const(char)* b1, const(char)* b2, const(char)* b3); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupalarm.html
331 int  IupScanf(const(char)* format, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupscanf.html
332 int  IupListDialog(int type, const(char)* title, int size, const(char)** list,
333                    int op, int max_col, int max_lin, int* marks); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iuplistdialog.html
334 int  IupGetText(const(char)* title, char* text, int maxsize); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupgettext.html
335 int  IupGetColor(int x, int y, ubyte* r, ubyte* g, ubyte* b); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupgetcolor.html
336 
337 //alias Iparamcb = int function(Ihandle* dialog, int param_index, void* user_data) nothrow;
338 int  IupGetParam(const(char)* title, Iparamcb action, void* user_data, const(char)* format, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupgetparam.html
339 int  IupGetParamv(const(char)* title, Iparamcb action, void* user_data, const(char)* format, int param_count, int param_extra, void** param_data); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupgetparam.html
340 Ihandle* IupParam(const(char)* format);       /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparam.html
341 Ihandle* IupParamBox(Ihandle* param, ...);    /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
342 Ihandle* IupParamBoxv(Ihandle** param_array); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
343 
344 Ihandle* IupLayoutDialog(Ihandle* dialog);          /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/.../iuplayoutdialog.html
345 Ihandle* IupElementPropertiesDialog(Ihandle* elem); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupelementpropdialog.html
346 Ihandle* IupGlobalsDialog();
347 
348 } // @nogc nothrow
349 } // extern(C)
350 
351 /************************************************************************/
352 /*                   Common Flags and Return Values                     */
353 /************************************************************************/
354 enum {
355 	IUP_ERROR      =   1,
356 	IUP_NOERROR    =   0,
357 	IUP_OPENED     =  -1, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupopen.html
358 	IUP_INVALID    =  -1,
359 	IUP_INVALID_ID = -10,
360 }
361 
362 /************************************************************************/
363 /*                   Callback Return Values                             */
364 /************************************************************************/
365 enum {
366 	IUP_IGNORE    = -1, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call_guide.html
367 	IUP_DEFAULT   = -2, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call_guide.html
368 	IUP_CLOSE     = -3, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call_guide.html
369 	IUP_CONTINUE  = -4, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call_guide.html
370 }
371 
372 /************************************************************************/
373 /*           IupPopup and IupShowXY Parameter Values                    */
374 /************************************************************************/
375 enum {                  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuppopup.html
376 	IUP_CENTER        = 0xFFFF,  /* 65535 */
377 	IUP_LEFT          = 0xFFFE,  /* 65534 */
378 	IUP_RIGHT         = 0xFFFD,  /* 65533 */
379 	IUP_MOUSEPOS      = 0xFFFC,  /* 65532 */
380 	IUP_CURRENT       = 0xFFFB,  /* 65531 */
381 	IUP_CENTERPARENT  = 0xFFFA,  /* 65530 */
382 	IUP_TOP       = IUP_LEFT,
383 	IUP_BOTTOM    = IUP_RIGHT,
384 }
385 
386 /************************************************************************/
387 /*               SHOW_CB Callback Values                                */
388 /************************************************************************/
389 enum {                  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call/iup_show_cb.html
390     IUP_SHOW,
391     IUP_RESTORE,
392     IUP_MINIMIZE,
393     IUP_MAXIMIZE,
394     IUP_HIDE
395 }
396 
397 /************************************************************************/
398 /*               SCROLL_CB Callback Values                              */
399 /************************************************************************/
400 enum {IUP_SBUP,   IUP_SBDN,    IUP_SBPGUP,   IUP_SBPGDN,    IUP_SBPOSV, IUP_SBDRAGV,
401       IUP_SBLEFT, IUP_SBRIGHT, IUP_SBPGLEFT, IUP_SBPGRIGHT, IUP_SBPOSH, IUP_SBDRAGH} /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call/iup_scroll_cb.html
402 
403 /************************************************************************/
404 /*               Mouse Button Values and Macros                         */
405 /************************************************************************/
406 enum : char {
407 	IUP_BUTTON1   = '1', /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call/iup_button_cb.html
408 	IUP_BUTTON2   = '2', /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call/iup_button_cb.html
409 	IUP_BUTTON3   = '3', /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call/iup_button_cb.html
410 	IUP_BUTTON4   = '4', /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call/iup_button_cb.html
411 	IUP_BUTTON5   = '5', /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call/iup_button_cb.html
412 }
413 
414 //#define iup_isshift(_s)    (_s[0]=='S')
415 bool iup_isshift()(string _s) {
416 	if (_s.length > 0)
417 		return _s[0] == 'S';
418 	return false;
419 }
420 
421 //#define iup_iscontrol(_s)  (_s[1]=='C')
422 bool iup_iscontrol()(string _s){
423 	if (_s.length > 1)
424 		return _s[1]=='C';
425 	return false;
426 }
427 
428 //#define iup_isbutton1(_s)  (_s[2]=='1')
429 bool iup_isbutton1(T)(T _s) nothrow
430   if (is (T : string) || is (T : char*))
431 {
432 	static if (is (T : string)) {
433 		if (_s.length > 2)
434 			return _s[2]=='1';
435 		return false;
436 	}
437 	else {
438 		return _s[2]=='1';
439 	}
440 }
441 
442 //bool iup_isbutton1(char* _s) nothrow {
443 //	return _s[2]=='1';
444 //}
445 
446 //#define iup_isbutton2(_s)  (_s[3]=='2')
447 bool iup_isbutton2(T)(T _s) nothrow
448   if (is (T : string) || is (T : char*))
449 {
450 	static if (is (T : string)) {
451 		if (_s.length > 3)
452 			return _s[3]=='2';
453 		return false;
454 	}
455 	else {
456 		return _s[3]=='2';
457 	}
458 }
459 
460 //bool iup_isbutton2(char* _s) nothrow {
461 //	return _s[3]=='2';
462 //}
463 
464 //#define iup_isbutton3(_s)  (_s[4]=='3')
465 bool iup_isbutton3(T)(T _s) nothrow
466   if (is (T : string) || is (T : char*))
467 {
468 	static if (is (T : string)) {
469 		if (_s.length > 4)
470 			return _s[4]=='3';
471 		return false;
472 	}
473 	else {
474 		return _s[4]=='3';
475 	}
476 }
477 
478 //bool iup_isbutton3(char* _s) nothrow {
479 //	return _s[4]=='3';
480 //}
481 
482 //#define iup_isdouble(_s)   (_s[5]=='D')
483 bool iup_isdouble()(string _s) {
484 	if (_s.length > 5)
485 		return _s[5]=='D';
486 	return false;
487 }
488 
489 //#define iup_isalt(_s)      (_s[6]=='A')
490 bool iup_isalt()(string _s) {
491 	if (_s.length > 6)
492 		return _s[6]=='A';
493 	return false;
494 }
495 
496 //#define iup_issys(_s)      (_s[7]=='Y')
497 bool iup_issys()(string _s) {
498 	if (_s.length > 7)
499 		return _s[7]=='Y';
500 	return false;
501 }
502 
503 //#define iup_isbutton4(_s)  (_s[8]=='4')
504 bool iup_isbutton4()(string _s) {
505 	if (_s.length > 8)
506 		return _s[8]=='4';
507 	return false;
508 }
509 
510 //#define iup_isbutton5(_s)  (_s[9]=='5')
511 bool iup_isbutton5()(string _s) {
512 	if (_s.length > 9)
513 		return _s[9]=='5';
514 	return false;
515 }
516 
517 /* Old definitions for backward compatibility */
518 alias isshift     = iup_isshift;
519 alias iscontrol   = iup_iscontrol;
520 alias isbutton1   = iup_isbutton1;
521 alias isbutton2   = iup_isbutton2;
522 alias isbutton3   = iup_isbutton3;
523 alias isdouble    = iup_isdouble;
524 alias isalt       = iup_isalt;
525 alias issys       = iup_issys;
526 alias isbutton4   = iup_isbutton4;
527 alias isbutton5   = iup_isbutton5;
528 
529 
530 /************************************************************************/
531 /*                      Pre-Defined Masks                               */
532 /************************************************************************/
533 enum /* const(char)* */ IUP_MASK_FLOAT       = "[+/-]?(/d+/.?/d*|/./d+)"; /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/attrib/iup_mask.html
534 enum /* const(char)* */ IUP_MASK_UFLOAT            = "(/d+/.?/d*|/./d+)"; /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/attrib/iup_mask.html
535 enum /* const(char)* */ IUP_MASK_EFLOAT      = "[+/-]?(/d+/.?/d*|/./d+)([eE][+/-]?/d+)?"; /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/attrib/iup_mask.html
536 enum /* const(char)* */ IUP_MASK_UEFLOAT     = "(/d+/.?/d*|/./d+)([eE][+/-]?/d+)?"; /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/attrib/iup_mask.html
537 enum /* const(char)* */ IUP_MASK_FLOATCOMMA  = "[+/-]?(/d+/,?/d*|/,/d+)"; /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/attrib/iup_mask.html
538 enum /* const(char)* */ IUP_MASK_UFLOATCOMMA =       "(/d+/,?/d*|/,/d+)"; /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/attrib/iup_mask.html
539 enum /* const(char)* */ IUP_MASK_INT         =  "[+/-]?/d+"; /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/attrib/iup_mask.html
540 enum /* const(char)* */ IUP_MASK_UINT        =        "/d+"; /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/attrib/iup_mask.html
541 
542 /* Old definitions for backward compatibility */
543 alias IUPMASK_FLOAT     = IUP_MASK_FLOAT;
544 alias IUPMASK_UFLOAT    = IUP_MASK_UFLOAT;
545 alias IUPMASK_EFLOAT    = IUP_MASK_EFLOAT;
546 alias IUPMASK_INT       = IUP_MASK_INT;
547 alias IUPMASK_UINT      = IUP_MASK_UINT;
548 
549 
550 /************************************************************************/
551 /*                   IupGetParam Callback situations                    */
552 /************************************************************************/
553 enum {
554 	IUP_GETPARAM_BUTTON1 = -1, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
555 	IUP_GETPARAM_INIT    = -2, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
556 	IUP_GETPARAM_BUTTON2 = -3, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
557 	IUP_GETPARAM_BUTTON3 = -4, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
558 	IUP_GETPARAM_CLOSE   = -5, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
559 	IUP_GETPARAM_MAP     = -6, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
560 	IUP_GETPARAM_OK     = IUP_GETPARAM_BUTTON1, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
561 	IUP_GETPARAM_CANCEL = IUP_GETPARAM_BUTTON2, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
562 	IUP_GETPARAM_HELP   = IUP_GETPARAM_BUTTON3, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
563 }
564 
565 /************************************************************************/
566 /*                   Used by IupColorbar                                */
567 /************************************************************************/
568 enum IUP_PRIMARY   = -1; /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupcolorbar.html
569 enum IUP_SECONDARY = -2; /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupcolorbar.html
570 
571 /************************************************************************/
572 /*                   Record Input Modes                                 */
573 /************************************************************************/
574 enum {
575     IUP_RECBINARY, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuprecordinput.html
576     IUP_RECTEXT    /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuprecordinput.html
577 }
578 
579 
580 /******************************************************************************
581 * Copyright (C) 1994-2019 Tecgraf, PUC-Rio.
582 *
583 * Permission is hereby granted, free of charge, to any person obtaining
584 * a copy of this software and associated documentation files (the
585 * "Software"), to deal in the Software without restriction, including
586 * without limitation the rights to use, copy, modify, merge, publish,
587 * distribute, sublicense, and/or sell copies of the Software, and to
588 * permit persons to whom the Software is furnished to do so, subject to
589 * the following conditions:
590 *
591 * The above copyright notice and this permission notice shall be
592 * included in all copies or substantial portions of the Software.
593 *
594 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
595 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
596 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
597 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
598 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
599 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
600 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
601 ******************************************************************************/