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.26";         /* bug fixes are reported only by IupVersion functions */
28 enum IUP_VERSION_NUMBER = 326000;
29 enum IUP_VERSION_DATE = "2019/01/07";  /* 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);
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);
246 Ihandle*  IupDropButton (Ihandle* dropchild);
247 Ihandle*  IupFlatLabel  (const(char)* title);
248 Ihandle*  IupFlatSeparator();
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*  IupText       (const(char)* action); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptext.html
255 Ihandle*  IupMultiLine  (const(char)* action); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupmultiline.html
256 Ihandle*  IupToggle     (const(char)* title, const(char)* action); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptoggle.html
257 Ihandle*  IupTimer      (); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptimer.html
258 Ihandle*  IupClipboard  (); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupclipboard.html
259 Ihandle*  IupProgressBar(); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/.../iupprogressbar.html
260 Ihandle*  IupVal        (const(char)* type);   /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupval.html
261 Ihandle*  IupTabs       (Ihandle* child, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptabs.html
262 Ihandle*  IupTabsv      (Ihandle** children);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptabs.html
263 Ihandle*  IupFlatTabs   (Ihandle* first, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupflattabs.html
264 Ihandle*  IupFlatTabsv  (Ihandle** children);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupflattabs.html
265 Ihandle*  IupTree       (); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptree.html
266 Ihandle*  IupLink       (const(char)* url, const(char)* title); /// See_Also: webserver2.tecgraf.puc-rio.br/iup/en/elem/iuplink.html
267 Ihandle*  IupAnimatedLabel(Ihandle* animation); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/.../iupanimatedlabel.html
268 Ihandle*  IupDatePick   (); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupdatepick.html
269 Ihandle*  IupCalendar   (); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupcalendar.html
270 Ihandle*  IupColorbar   (); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupcolorbar.html
271 Ihandle*  IupGauge      (); //  See_Also: undocumented
272 Ihandle*  IupDial       (const(char)* type); /// See_Also: http://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupdial.html
273 Ihandle*  IupColorBrowser(); /// See_Also: http://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupcolorbrowser.html
274 
275 /* Old controls, use SPIN attribute of IupText */
276 Ihandle*  IupSpin       ();               /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupspin.html
277 Ihandle*  IupSpinbox    (Ihandle* child); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupspin.html
278 
279 
280 /************************************************************************/
281 /*                      Utilities                                       */
282 /************************************************************************/
283 
284 /* String compare utility */
285 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
286 
287 /* IupImage utility */
288 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
289 
290 /* IupText and IupScintilla utilities */
291 void IupTextConvertLinColToPos(Ihandle* ih, int lin, int col, int* pos);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptext.html
292 void IupTextConvertPosToLinCol(Ihandle* ih, int pos, int* lin, int* col); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptext.html
293 
294 /* IupText, IupList, IupTree, IupMatrix and IupScintilla utility */
295 int  IupConvertXYToPos(Ihandle* ih, int x, int y); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupconvertxytopos.html
296 
297 /* OLD names, kept for backward compatibility, will never be removed. */
298 void IupStoreGlobal(const(char)* name, const(char)* value);
299 void IupStoreAttribute(Ihandle* ih, const(char)* name, const(char)* value);
300 void IupSetfAttribute(Ihandle* ih, const(char)* name, const(char)* format, ...);
301 void IupStoreAttributeId(Ihandle* ih, const(char)* name, int id, const(char)* value);
302 void IupSetfAttributeId(Ihandle* ih, const(char)* name, int id, const(char)* f, ...);
303 void IupStoreAttributeId2(Ihandle* ih, const(char)* name, int lin, int col, const(char)* value);
304 void IupSetfAttributeId2(Ihandle* ih, const(char)* name, int lin, int col, const(char)* format, ...);
305 
306 /* IupTree utilities */
307 int   IupTreeSetUserId(Ihandle* ih, int id, void* userid); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptree.html
308 void* IupTreeGetUserId(Ihandle* ih, int id);               /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptree.html
309 int   IupTreeGetId(Ihandle* ih, void* userid);             /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptree.html
310 deprecated("use IupSetAttributeHandleId")
311 void  IupTreeSetAttributeHandle(Ihandle* ih, const(char)* name, int id, Ihandle* ih_named);
312 
313 
314 /************************************************************************/
315 /*                      Pre-definided dialogs                           */
316 /************************************************************************/
317 
318 Ihandle* IupFileDlg();     /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupfiledlg.html
319 Ihandle* IupMessageDlg();  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupmessagedlg.html
320 Ihandle* IupColorDlg();    /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupcolordlg.html
321 Ihandle* IupFontDlg();     /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupfontdlg.html
322 Ihandle* IupProgressDlg(); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupprogressdlg.html
323 
324 int  IupGetFile(char* arq); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupgetfile.html
325 void IupMessage(const(char)* title, const(char)* msg);          /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupmessage.html
326 void IupMessagef(const(char)* title, const(char)* format, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupmessage.html
327 void IupMessageError(Ihandle* parent, const(char)* message); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupmessageerror.html
328 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
329 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
330 int  IupScanf(const(char)* format, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupscanf.html
331 int  IupListDialog(int type, const(char)* title, int size, const(char)** list,
332                    int op, int max_col, int max_lin, int* marks); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iuplistdialog.html
333 int  IupGetText(const(char)* title, char* text, int maxsize); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupgettext.html
334 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
335 
336 //alias Iparamcb = int function(Ihandle* dialog, int param_index, void* user_data) nothrow;
337 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
338 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
339 Ihandle* IupParam(const(char)* format);       /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparam.html
340 Ihandle* IupParamBox(Ihandle* param, ...);    /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
341 Ihandle* IupParamBoxv(Ihandle** param_array); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
342 
343 Ihandle* IupLayoutDialog(Ihandle* dialog);          /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/.../iuplayoutdialog.html
344 Ihandle* IupElementPropertiesDialog(Ihandle* elem); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupelementpropdialog.html
345 
346 } // @nogc nothrow
347 } // extern(C)
348 
349 /************************************************************************/
350 /*                   Common Flags and Return Values                     */
351 /************************************************************************/
352 enum {
353 	IUP_ERROR      =   1,
354 	IUP_NOERROR    =   0,
355 	IUP_OPENED     =  -1, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupopen.html
356 	IUP_INVALID    =  -1,
357 	IUP_INVALID_ID = -10,
358 }
359 
360 /************************************************************************/
361 /*                   Callback Return Values                             */
362 /************************************************************************/
363 enum {
364 	IUP_IGNORE    = -1, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call_guide.html
365 	IUP_DEFAULT   = -2, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call_guide.html
366 	IUP_CLOSE     = -3, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call_guide.html
367 	IUP_CONTINUE  = -4, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call_guide.html
368 }
369 
370 /************************************************************************/
371 /*           IupPopup and IupShowXY Parameter Values                    */
372 /************************************************************************/
373 enum {
374 	IUP_CENTER        = 0xFFFF,  /* 65535 */ /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuppopup.html
375 	IUP_LEFT          = 0xFFFE,  /* 65534 */ /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuppopup.html
376 	IUP_RIGHT         = 0xFFFD,  /* 65533 */ /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuppopup.html
377 	IUP_MOUSEPOS      = 0xFFFC,  /* 65532 */ /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuppopup.html
378 	IUP_CURRENT       = 0xFFFB,  /* 65531 */ /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuppopup.html
379 	IUP_CENTERPARENT  = 0xFFFA,  /* 65530 */ /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuppopup.html
380 	IUP_TOP       = IUP_LEFT,                /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuppopup.html
381 	IUP_BOTTOM    = IUP_RIGHT,               /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuppopup.html
382 }
383 
384 /************************************************************************/
385 /*               SHOW_CB Callback Values                                */
386 /************************************************************************/
387 enum {
388     IUP_SHOW,     /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call/iup_show_cb.html
389     IUP_RESTORE,  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call/iup_show_cb.html
390     IUP_MINIMIZE, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call/iup_show_cb.html
391     IUP_MAXIMIZE, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call/iup_show_cb.html
392     IUP_HIDE      /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call/iup_show_cb.html
393 }
394 
395 /************************************************************************/
396 /*               SCROLL_CB Callback Values                              */
397 /************************************************************************/
398 enum {IUP_SBUP,   IUP_SBDN,    IUP_SBPGUP,   IUP_SBPGDN,    IUP_SBPOSV, IUP_SBDRAGV,
399       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
400 
401 /************************************************************************/
402 /*               Mouse Button Values and Macros                         */
403 /************************************************************************/
404 enum : char {
405 	IUP_BUTTON1   = '1', /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call/iup_button_cb.html
406 	IUP_BUTTON2   = '2', /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call/iup_button_cb.html
407 	IUP_BUTTON3   = '3', /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call/iup_button_cb.html
408 	IUP_BUTTON4   = '4', /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call/iup_button_cb.html
409 	IUP_BUTTON5   = '5', /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call/iup_button_cb.html
410 }
411 
412 //#define iup_isshift(_s)    (_s[0]=='S')
413 bool iup_isshift()(string _s) {
414 	if (_s.length > 0)
415 		return _s[0] == 'S';
416 	return false;
417 }
418 
419 //#define iup_iscontrol(_s)  (_s[1]=='C')
420 bool iup_iscontrol()(string _s){
421 	if (_s.length > 1)
422 		return _s[1]=='C';
423 	return false;
424 }
425 
426 //#define iup_isbutton1(_s)  (_s[2]=='1')
427 bool iup_isbutton1(T)(T _s) nothrow
428   if (is (T : string) || is (T : char*))
429 {
430 	static if (is (T : string)) {
431 		if (_s.length > 2)
432 			return _s[2]=='1';
433 		return false;
434 	}
435 	else {
436 		return _s[2]=='1';
437 	}
438 }
439 
440 //bool iup_isbutton1(char* _s) nothrow {
441 //	return _s[2]=='1';
442 //}
443 
444 //#define iup_isbutton2(_s)  (_s[3]=='2')
445 bool iup_isbutton2(T)(T _s) nothrow
446   if (is (T : string) || is (T : char*))
447 {
448 	static if (is (T : string)) {
449 		if (_s.length > 3)
450 			return _s[3]=='2';
451 		return false;
452 	}
453 	else {
454 		return _s[3]=='2';
455 	}
456 }
457 
458 //bool iup_isbutton2(char* _s) nothrow {
459 //	return _s[3]=='2';
460 //}
461 
462 //#define iup_isbutton3(_s)  (_s[4]=='3')
463 bool iup_isbutton3(T)(T _s) nothrow
464   if (is (T : string) || is (T : char*))
465 {
466 	static if (is (T : string)) {
467 		if (_s.length > 4)
468 			return _s[4]=='3';
469 		return false;
470 	}
471 	else {
472 		return _s[4]=='3';
473 	}
474 }
475 
476 //bool iup_isbutton3(char* _s) nothrow {
477 //	return _s[4]=='3';
478 //}
479 
480 //#define iup_isdouble(_s)   (_s[5]=='D')
481 bool iup_isdouble()(string _s) {
482 	if (_s.length > 5)
483 		return _s[5]=='D';
484 	return false;
485 }
486 
487 //#define iup_isalt(_s)      (_s[6]=='A')
488 bool iup_isalt()(string _s) {
489 	if (_s.length > 6)
490 		return _s[6]=='A';
491 	return false;
492 }
493 
494 //#define iup_issys(_s)      (_s[7]=='Y')
495 bool iup_issys()(string _s) {
496 	if (_s.length > 7)
497 		return _s[7]=='Y';
498 	return false;
499 }
500 
501 //#define iup_isbutton4(_s)  (_s[8]=='4')
502 bool iup_isbutton4()(string _s) {
503 	if (_s.length > 8)
504 		return _s[8]=='4';
505 	return false;
506 }
507 
508 //#define iup_isbutton5(_s)  (_s[9]=='5')
509 bool iup_isbutton5()(string _s) {
510 	if (_s.length > 9)
511 		return _s[9]=='5';
512 	return false;
513 }
514 
515 /* Old definitions for backward compatibility */
516 alias isshift     = iup_isshift;
517 alias iscontrol   = iup_iscontrol;
518 alias isbutton1   = iup_isbutton1;
519 alias isbutton2   = iup_isbutton2;
520 alias isbutton3   = iup_isbutton3;
521 alias isdouble    = iup_isdouble;
522 alias isalt       = iup_isalt;
523 alias issys       = iup_issys;
524 alias isbutton4   = iup_isbutton4;
525 alias isbutton5   = iup_isbutton5;
526 
527 
528 /************************************************************************/
529 /*                      Pre-Defined Masks                               */
530 /************************************************************************/
531 enum /* const(char)* */ IUP_MASK_FLOAT       = "[+/-]?(/d+/.?/d*|/./d+)"; /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/attrib/iup_mask.html
532 enum /* const(char)* */ IUP_MASK_UFLOAT            = "(/d+/.?/d*|/./d+)"; /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/attrib/iup_mask.html
533 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
534 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
535 enum /* const(char)* */ IUP_MASK_FLOATCOMMA  = "[+/-]?(/d+/,?/d*|/,/d+)"; /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/attrib/iup_mask.html
536 enum /* const(char)* */ IUP_MASK_UFLOATCOMMA =       "(/d+/,?/d*|/,/d+)"; /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/attrib/iup_mask.html
537 enum /* const(char)* */ IUP_MASK_INT         =  "[+/-]?/d+"; /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/attrib/iup_mask.html
538 enum /* const(char)* */ IUP_MASK_UINT        =        "/d+"; /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/attrib/iup_mask.html
539 
540 /* Old definitions for backward compatibility */
541 alias IUPMASK_FLOAT     = IUP_MASK_FLOAT;
542 alias IUPMASK_UFLOAT    = IUP_MASK_UFLOAT;
543 alias IUPMASK_EFLOAT    = IUP_MASK_EFLOAT;
544 alias IUPMASK_INT       = IUP_MASK_INT;
545 alias IUPMASK_UINT      = IUP_MASK_UINT;
546 
547 
548 /************************************************************************/
549 /*                   IupGetParam Callback situations                    */
550 /************************************************************************/
551 enum {
552 	IUP_GETPARAM_BUTTON1 = -1, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
553 	IUP_GETPARAM_INIT    = -2, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
554 	IUP_GETPARAM_BUTTON2 = -3, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
555 	IUP_GETPARAM_BUTTON3 = -4, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
556 	IUP_GETPARAM_CLOSE   = -5, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
557 	IUP_GETPARAM_MAP     = -6, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
558 	IUP_GETPARAM_OK     = IUP_GETPARAM_BUTTON1, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
559 	IUP_GETPARAM_CANCEL = IUP_GETPARAM_BUTTON2, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
560 	IUP_GETPARAM_HELP   = IUP_GETPARAM_BUTTON3, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
561 }
562 
563 /************************************************************************/
564 /*                   Used by IupColorbar                                */
565 /************************************************************************/
566 enum IUP_PRIMARY   = -1; /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupcolorbar.html
567 enum IUP_SECONDARY = -2; /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupcolorbar.html
568 
569 /************************************************************************/
570 /*                   Record Input Modes                                 */
571 /************************************************************************/
572 enum {
573     IUP_RECBINARY, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuprecordinput.html
574     IUP_RECTEXT    /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuprecordinput.html
575 }
576 
577 
578 /******************************************************************************
579 * Copyright (C) 1994-2019 Tecgraf, PUC-Rio.
580 *
581 * Permission is hereby granted, free of charge, to any person obtaining
582 * a copy of this software and associated documentation files (the
583 * "Software"), to deal in the Software without restriction, including
584 * without limitation the rights to use, copy, modify, merge, publish,
585 * distribute, sublicense, and/or sell copies of the Software, and to
586 * permit persons to whom the Software is furnished to do so, subject to
587 * the following conditions:
588 *
589 * The above copyright notice and this permission notice shall be
590 * included in all copies or substantial portions of the Software.
591 *
592 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
593 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
594 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
595 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
596 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
597 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
598 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
599 ******************************************************************************/