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-2018 Tecgraf/PUC-Rio";
27 enum IUP_VERSION = "3.24";         /* bug fixes are reported only by IupVersion functions */
28 enum IUP_VERSION_NUMBER = 324000;
29 enum IUP_VERSION_DATE = "2018/01/22";  /* 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 Ihandle*  IupSetAtt(const(char)* handle_name, Ihandle* ih, const(char)* name, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetatt.html
107 Ihandle*  IupSetAttributes (Ihandle* ih, const(char)* str); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattributes.html
108 char*     IupGetAttributes (Ihandle* ih); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattributes.html
109 
110 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
111 void      IupSetStrAttribute(Ihandle* ih, const(char)* name, const(char)* value); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattribute.html
112 void      IupSetStrf        (Ihandle* ih, const(char)* name, const(char)* format, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattribute.html
113 void      IupSetInt         (Ihandle* ih, const(char)* name, int value); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattribute.html
114 void      IupSetFloat       (Ihandle* ih, const(char)* name, float value); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattribute.html
115 void      IupSetDouble      (Ihandle* ih, const(char)* name, double value); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattribute.html
116 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
117 
118 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
119 int       IupGetInt      (Ihandle* ih, const(char)* name); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html
120 int       IupGetInt2     (Ihandle* ih, const(char)* name); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html
121 int       IupGetIntInt   (Ihandle* ih, const(char)* name, int* i1, int* i2); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html
122 float     IupGetFloat    (Ihandle* ih, const(char)* name); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html
123 double    IupGetDouble   (Ihandle* ih, const(char)* name); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html
124 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
125 
126 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
127 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
128 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
129 void  IupSetIntId(Ihandle* ih, const(char)* name, int id, int value); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattribute.html
130 void  IupSetFloatId(Ihandle* ih, const(char)* name, int id, float value); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattribute.html
131 void  IupSetDoubleId(Ihandle* ih, const(char)* name, int id, double value); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattribute.html
132 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
133 
134 char*  IupGetAttributeId(Ihandle* ih, const(char)* name, int id); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html
135 int    IupGetIntId(Ihandle* ih, const(char)* name, int id); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html
136 float  IupGetFloatId(Ihandle* ih, const(char)* name, int id); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html
137 double IupGetDoubleId(Ihandle* ih, const(char)* name, int id); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html
138 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
139 
140 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
141 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
142 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
143 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
144 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
145 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
146 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
147 
148 char*  IupGetAttributeId2(Ihandle* ih, const(char)* name, int lin, int col); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html
149 int    IupGetIntId2(Ihandle* ih, const(char)* name, int lin, int col); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html
150 float  IupGetFloatId2(Ihandle* ih, const(char)* name, int lin, int col); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html
151 double IupGetDoubleId2(Ihandle* ih, const(char)* name, int lin, int col); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html
152 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
153 
154 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
155 void      IupSetStrGlobal(const(char)* name, const(char)* value); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetglobal.html
156 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
157 
158 Ihandle*  IupSetFocus     (Ihandle* ih); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetfocus.html
159 Ihandle*  IupGetFocus     ();            /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetfocus.html
160 Ihandle*  IupPreviousField(Ihandle* ih); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuppreviousfield.html
161 Ihandle*  IupNextField    (Ihandle* ih); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupnextfield.html
162 
163 Icallback IupGetCallback (Ihandle* ih, const(char)* name); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetcallback.html
164 Icallback IupSetCallback (Ihandle* ih, const(char)* name, Icallback func); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetcallback.html
165 Ihandle*  IupSetCallbacks(Ihandle* ih, const(char)* name, Icallback func, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetcallbacks.html
166 
167 Icallback IupGetFunction(const(char)* name); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetfunction.html
168 Icallback IupSetFunction(const(char)* name, Icallback func); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetfunction.html
169 
170 Ihandle*  IupGetHandle    (const(char)* name);              /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgethandle.html
171 Ihandle*  IupSetHandle    (const(char)* name, Ihandle* ih); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsethandle.html
172 int       IupGetAllNames  (char** names, int n); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetallnames.html
173 int       IupGetAllDialogs(char** names, int n); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetalldialogs.html
174 char*     IupGetName      (Ihandle* ih); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetname.html
175 
176 void      IupSetAttributeHandle(Ihandle* ih, const(char)* name, Ihandle* ih_named); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetattributehandle.html
177 Ihandle*  IupGetAttributeHandle(Ihandle* ih, const(char)* name); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattributehandle.html
178 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
179 Ihandle*  IupGetAttributeHandleId(Ihandle* ih, const(char)* name, int id); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattributehandle.html
180 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
181 Ihandle*  IupGetAttributeHandleId2(Ihandle* ih, const(char)* name, int lin, int col); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetattributehandle.html
182 
183 char*     IupGetClassName(Ihandle* ih); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetclassname.html
184 char*     IupGetClassType(Ihandle* ih); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetclasstype.html
185 int       IupGetAllClasses(char** names, int n);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetallclasses.html
186 int       IupGetClassAttributes(const(char)* classname, char** names, int n); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetclassattributes.html
187 int       IupGetClassCallbacks(const(char)* classname, char** names, int n);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetclasscallbacks.html
188 void      IupSaveClassAttributes(Ihandle* ih); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsaveclassattributes.html
189 void      IupCopyClassAttributes(Ihandle* src_ih, Ihandle* dst_ih); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupcopyclassattributes.html
190 void      IupSetClassDefaultAttribute(const(char)* classname, const(char)* name, const(char)* value); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupsetclassdefaultattribute.html
191 int       IupClassMatch(Ihandle* ih, const(char)* classname); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupclassmatch.html
192 
193 Ihandle*  IupCreate (const(char)* classname); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupcreate.html
194 Ihandle*  IupCreatev(const(char)* classname, void** params);    /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupcreate.html
195 Ihandle*  IupCreatep(const(char)* classname, void* first, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupcreate.html
196 
197 /************************************************************************/
198 /*                        Elements                                      */
199 /************************************************************************/
200 
201 Ihandle*  IupFill       ();                    /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupfill.html
202 Ihandle*  IupRadio      (Ihandle* child);      /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupradio.html
203 Ihandle*  IupVbox       (Ihandle* child, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupvbox.html
204 Ihandle*  IupVboxv      (Ihandle** children);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupvbox.html
205 Ihandle*  IupZbox       (Ihandle* child, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupzbox.html
206 Ihandle*  IupZboxv      (Ihandle** children);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupzbox.html
207 Ihandle*  IupHbox       (Ihandle* child, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuphbox.html
208 Ihandle*  IupHboxv      (Ihandle** children);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuphbox.html
209 
210 Ihandle*  IupNormalizer (Ihandle* ih_first, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupnormalizer.html
211 Ihandle*  IupNormalizerv(Ihandle** ih_list);      /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupnormalizer.html
212 
213 Ihandle*  IupCbox       (Ihandle* child, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupcbox.html
214 Ihandle*  IupCboxv      (Ihandle** children);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupcbox.html
215 Ihandle*  IupSbox       (Ihandle* child);      /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupsbox.html
216 Ihandle*  IupSplit      (Ihandle* child1, Ihandle* child2); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupsplit.html
217 Ihandle*  IupScrollBox  (Ihandle* child);      /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupscrollbox.html
218 Ihandle*  IupFlatScrollBox(Ihandle* child);    /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupflatscrollbox.html
219 Ihandle*  IupGridBox    (Ihandle* child, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupgridbox.html
220 Ihandle*  IupGridBoxv   (Ihandle** children);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupgridbox.html
221 Ihandle*  IupExpander   (Ihandle* child);      /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupexpander.html
222 Ihandle*  IupDetachBox  (Ihandle* child);      /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupdetachbox.html
223 Ihandle*  IupBackgroundBox(Ihandle* child);    /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupbackgroundbox.html
224 
225 Ihandle*  IupFrame      (Ihandle* child); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupframe.html
226 Ihandle*  IupFlatFrame  (Ihandle* child); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupflatframe.html
227 
228 Ihandle*  IupImage      (int width, int height, const(ubyte)* pixmap); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupimage.html
229 Ihandle*  IupImageRGB   (int width, int height, const(ubyte)* pixmap); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupimage.html
230 Ihandle*  IupImageRGBA  (int width, int height, const(ubyte)* pixmap); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupimage.html
231 
232 Ihandle*  IupItem       (const(char)* title, const(char)* action); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupitem.html
233 Ihandle*  IupSubmenu    (const(char)* title, Ihandle* child); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupsubmenu.html
234 Ihandle*  IupSeparator  ();                    /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupseparator.html
235 Ihandle*  IupMenu       (Ihandle* child, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupmenu.html
236 Ihandle*  IupMenuv      (Ihandle** children);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupmenu.html
237 
238 Ihandle*  IupButton     (const(char)* title, const(char)* action); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupbutton.html
239 Ihandle*  IupFlatButton (const(char)* title);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupflatbutton.html
240 Ihandle*  IupCanvas     (const(char)* action); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupcanvas.html
241 Ihandle*  IupDialog     (Ihandle* child);      /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupdialog.html
242 Ihandle*  IupUser       ();                    /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupuser.html
243 Ihandle*  IupLabel      (const(char)* title);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuplabel.html
244 Ihandle*  IupList       (const(char)* action); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuplist.html
245 Ihandle*  IupText       (const(char)* action); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptext.html
246 Ihandle*  IupMultiLine  (const(char)* action); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupmultiline.html
247 Ihandle*  IupToggle     (const(char)* title, const(char)* action); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptoggle.html
248 Ihandle*  IupTimer      (); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptimer.html
249 Ihandle*  IupClipboard  (); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupclipboard.html
250 Ihandle*  IupProgressBar(); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/.../iupprogressbar.html
251 Ihandle*  IupVal        (const(char)* type);   /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupval.html
252 Ihandle*  IupTabs       (Ihandle* child, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptabs.html
253 Ihandle*  IupTabsv      (Ihandle** children);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptabs.html
254 Ihandle*  IupFlatTabs   (Ihandle* first, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupflattabs.html
255 Ihandle*  IupFlatTabsv  (Ihandle** children);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupflattabs.html
256 Ihandle*  IupTree       (); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptree.html
257 Ihandle*  IupLink       (const(char)* url, const(char)* title); /// See_Also: webserver2.tecgraf.puc-rio.br/iup/en/elem/iuplink.html
258 Ihandle*  IupAnimatedLabel(Ihandle* animation); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/.../iupanimatedlabel.html
259 Ihandle*  IupDatePick   (); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupdatepick.html
260 Ihandle*  IupCalendar   (); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupcalendar.html
261 Ihandle*  IupColorbar   (); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupcolorbar.html
262 Ihandle*  IupGauge      (); //  See_Also: undocumented
263 Ihandle*  IupDial       (const(char)* type); /// See_Also: http://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupdial.html
264 Ihandle*  IupColorBrowser(); /// See_Also: http://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupcolorbrowser.html
265 
266 /* Old controls, use SPIN attribute of IupText */
267 Ihandle*  IupSpin       ();               /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupspin.html
268 Ihandle*  IupSpinbox    (Ihandle* child); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupspin.html
269 
270 
271 /************************************************************************/
272 /*                      Utilities                                       */
273 /************************************************************************/
274 
275 /* String compare utility */
276 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
277 
278 /* IupImage utility */
279 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
280 
281 /* IupText and IupScintilla utilities */
282 void IupTextConvertLinColToPos(Ihandle* ih, int lin, int col, int* pos);  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptext.html
283 void IupTextConvertPosToLinCol(Ihandle* ih, int pos, int* lin, int* col); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptext.html
284 
285 /* IupText, IupList, IupTree, IupMatrix and IupScintilla utility */
286 int  IupConvertXYToPos(Ihandle* ih, int x, int y); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupconvertxytopos.html
287 
288 /* OLD names, kept for backward compatibility, will never be removed. */
289 void IupStoreGlobal(const(char)* name, const(char)* value);
290 void IupStoreAttribute(Ihandle* ih, const(char)* name, const(char)* value);
291 void IupSetfAttribute(Ihandle* ih, const(char)* name, const(char)* format, ...);
292 void IupStoreAttributeId(Ihandle* ih, const(char)* name, int id, const(char)* value);
293 void IupSetfAttributeId(Ihandle* ih, const(char)* name, int id, const(char)* f, ...);
294 void IupStoreAttributeId2(Ihandle* ih, const(char)* name, int lin, int col, const(char)* value);
295 void IupSetfAttributeId2(Ihandle* ih, const(char)* name, int lin, int col, const(char)* format, ...);
296 
297 /* IupTree utilities */
298 int   IupTreeSetUserId(Ihandle* ih, int id, void* userid); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptree.html
299 void* IupTreeGetUserId(Ihandle* ih, int id);               /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptree.html
300 int   IupTreeGetId(Ihandle* ih, void* userid);             /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iuptree.html
301 deprecated("use IupSetAttributeHandleId")
302 void  IupTreeSetAttributeHandle(Ihandle* ih, const(char)* name, int id, Ihandle* ih_named);
303 
304 
305 /************************************************************************/
306 /*                      Pre-definided dialogs                           */
307 /************************************************************************/
308 
309 Ihandle* IupFileDlg();     /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupfiledlg.html
310 Ihandle* IupMessageDlg();  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupmessagedlg.html
311 Ihandle* IupColorDlg();    /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupcolordlg.html
312 Ihandle* IupFontDlg();     /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupfontdlg.html
313 Ihandle* IupProgressDlg(); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupprogressdlg.html
314 
315 int  IupGetFile(char* arq); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupgetfile.html
316 void IupMessage(const(char)* title, const(char)* msg);          /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupmessage.html
317 void IupMessagef(const(char)* title, const(char)* format, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupmessage.html
318 void IupMessageError(Ihandle* parent, const(char)* message); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupmessageerror.html
319 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
320 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
321 int  IupScanf(const(char)* format, ...); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupscanf.html
322 int  IupListDialog(int type, const(char)* title, int size, const(char)** list,
323                    int op, int max_col, int max_lin, int* marks); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iuplistdialog.html
324 int  IupGetText(const(char)* title, char* text, int maxsize); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupgettext.html
325 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
326 
327 //alias Iparamcb = int function(Ihandle* dialog, int param_index, void* user_data) nothrow;
328 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
329 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
330 Ihandle* IupParam(const(char)* format);        /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparam.html
331 Ihandle*  IupParamBox(Ihandle* param, ...);    /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
332 Ihandle*  IupParamBoxv(Ihandle** param_array); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
333 
334 Ihandle* IupLayoutDialog(Ihandle* dialog);          /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/.../iuplayoutdialog.html
335 Ihandle* IupElementPropertiesDialog(Ihandle* elem); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/dlg/iupelementpropdialog.html
336 
337 } // @nogc nothrow
338 } // extern(C)
339 
340 /************************************************************************/
341 /*                   Common Flags and Return Values                     */
342 /************************************************************************/
343 enum {
344 	IUP_ERROR      =   1,
345 	IUP_NOERROR    =   0,
346 	IUP_OPENED     =  -1, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iupopen.html
347 	IUP_INVALID    =  -1,
348 	IUP_INVALID_ID = -10,
349 }
350 
351 /************************************************************************/
352 /*                   Callback Return Values                             */
353 /************************************************************************/
354 enum {
355 	IUP_IGNORE    = -1, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call_guide.html
356 	IUP_DEFAULT   = -2, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call_guide.html
357 	IUP_CLOSE     = -3, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call_guide.html
358 	IUP_CONTINUE  = -4, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call_guide.html
359 }
360 
361 /************************************************************************/
362 /*           IupPopup and IupShowXY Parameter Values                    */
363 /************************************************************************/
364 enum {
365 	IUP_CENTER        = 0xFFFF,  /* 65535 */ /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuppopup.html
366 	IUP_LEFT          = 0xFFFE,  /* 65534 */ /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuppopup.html
367 	IUP_RIGHT         = 0xFFFD,  /* 65533 */ /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuppopup.html
368 	IUP_MOUSEPOS      = 0xFFFC,  /* 65532 */ /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuppopup.html
369 	IUP_CURRENT       = 0xFFFB,  /* 65531 */ /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuppopup.html
370 	IUP_CENTERPARENT  = 0xFFFA,  /* 65530 */ /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuppopup.html
371 	IUP_TOP       = IUP_LEFT,                /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuppopup.html
372 	IUP_BOTTOM    = IUP_RIGHT,               /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuppopup.html
373 }
374 
375 /************************************************************************/
376 /*               SHOW_CB Callback Values                                */
377 /************************************************************************/
378 enum {
379     IUP_SHOW,     /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call/iup_show_cb.html
380     IUP_RESTORE,  /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call/iup_show_cb.html
381     IUP_MINIMIZE, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call/iup_show_cb.html
382     IUP_MAXIMIZE, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call/iup_show_cb.html
383     IUP_HIDE      /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call/iup_show_cb.html
384 }
385 
386 /************************************************************************/
387 /*               SCROLL_CB Callback Values                              */
388 /************************************************************************/
389 enum {IUP_SBUP,   IUP_SBDN,    IUP_SBPGUP,   IUP_SBPGDN,    IUP_SBPOSV, IUP_SBDRAGV,
390       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
391 
392 /************************************************************************/
393 /*               Mouse Button Values and Macros                         */
394 /************************************************************************/
395 enum : char {
396 	IUP_BUTTON1   = '1', /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call/iup_button_cb.html
397 	IUP_BUTTON2   = '2', /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call/iup_button_cb.html
398 	IUP_BUTTON3   = '3', /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call/iup_button_cb.html
399 	IUP_BUTTON4   = '4', /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call/iup_button_cb.html
400 	IUP_BUTTON5   = '5', /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/call/iup_button_cb.html
401 }
402 
403 //#define iup_isshift(_s)    (_s[0]=='S')
404 bool iup_isshift()(string _s) {
405 	if (_s.length > 0)
406 		return _s[0] == 'S';
407 	return false;
408 }
409 
410 //#define iup_iscontrol(_s)  (_s[1]=='C')
411 bool iup_iscontrol()(string _s){
412 	if (_s.length > 1)
413 		return _s[1]=='C';
414 	return false;
415 }
416 
417 //#define iup_isbutton1(_s)  (_s[2]=='1')
418 bool iup_isbutton1(T)(T _s) nothrow
419   if (is (T : string) || is (T : char*))
420 {
421 	static if (is (T : string)) {
422 		if (_s.length > 2)
423 			return _s[2]=='1';
424 		return false;
425 	}
426 	else {
427 		return _s[2]=='1';
428 	}
429 }
430 
431 //bool iup_isbutton1(char* _s) nothrow {
432 //	return _s[2]=='1';
433 //}
434 
435 //#define iup_isbutton2(_s)  (_s[3]=='2')
436 bool iup_isbutton2(T)(T _s) nothrow
437   if (is (T : string) || is (T : char*))
438 {
439 	static if (is (T : string)) {
440 		if (_s.length > 3)
441 			return _s[3]=='2';
442 		return false;
443 	}
444 	else {
445 		return _s[3]=='2';
446 	}
447 }
448 
449 //bool iup_isbutton2(char* _s) nothrow {
450 //	return _s[3]=='2';
451 //}
452 
453 //#define iup_isbutton3(_s)  (_s[4]=='3')
454 bool iup_isbutton3(T)(T _s) nothrow
455   if (is (T : string) || is (T : char*))
456 {
457 	static if (is (T : string)) {
458 		if (_s.length > 4)
459 			return _s[4]=='3';
460 		return false;
461 	}
462 	else {
463 		return _s[4]=='3';
464 	}
465 }
466 
467 //bool iup_isbutton3(char* _s) nothrow {
468 //	return _s[4]=='3';
469 //}
470 
471 //#define iup_isdouble(_s)   (_s[5]=='D')
472 bool iup_isdouble()(string _s) {
473 	if (_s.length > 5)
474 		return _s[5]=='D';
475 	return false;
476 }
477 
478 //#define iup_isalt(_s)      (_s[6]=='A')
479 bool iup_isalt()(string _s) {
480 	if (_s.length > 6)
481 		return _s[6]=='A';
482 	return false;
483 }
484 
485 //#define iup_issys(_s)      (_s[7]=='Y')
486 bool iup_issys()(string _s) {
487 	if (_s.length > 7)
488 		return _s[7]=='Y';
489 	return false;
490 }
491 
492 //#define iup_isbutton4(_s)  (_s[8]=='4')
493 bool iup_isbutton4()(string _s) {
494 	if (_s.length > 8)
495 		return _s[8]=='4';
496 	return false;
497 }
498 
499 //#define iup_isbutton5(_s)  (_s[9]=='5')
500 bool iup_isbutton5()(string _s) {
501 	if (_s.length > 9)
502 		return _s[9]=='5';
503 	return false;
504 }
505 
506 /* Old definitions for backward compatibility */
507 alias isshift     = iup_isshift;
508 alias iscontrol   = iup_iscontrol;
509 alias isbutton1   = iup_isbutton1;
510 alias isbutton2   = iup_isbutton2;
511 alias isbutton3   = iup_isbutton3;
512 alias isdouble    = iup_isdouble;
513 alias isalt       = iup_isalt;
514 alias issys       = iup_issys;
515 alias isbutton4   = iup_isbutton4;
516 alias isbutton5   = iup_isbutton5;
517 
518 
519 /************************************************************************/
520 /*                      Pre-Defined Masks                               */
521 /************************************************************************/
522 enum /* const(char)* */ IUP_MASK_FLOAT       = "[+/-]?(/d+/.?/d*|/./d+)"; /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/attrib/iup_mask.html
523 enum /* const(char)* */ IUP_MASK_UFLOAT            = "(/d+/.?/d*|/./d+)"; /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/attrib/iup_mask.html
524 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
525 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
526 enum /* const(char)* */ IUP_MASK_FLOATCOMMA  = "[+/-]?(/d+/,?/d*|/,/d+)"; /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/attrib/iup_mask.html
527 enum /* const(char)* */ IUP_MASK_UFLOATCOMMA =       "(/d+/,?/d*|/,/d+)"; /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/attrib/iup_mask.html
528 enum /* const(char)* */ IUP_MASK_INT         =  "[+/-]?/d+"; /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/attrib/iup_mask.html
529 enum /* const(char)* */ IUP_MASK_UINT        =        "/d+"; /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/attrib/iup_mask.html
530 
531 /* Old definitions for backward compatibility */
532 alias IUPMASK_FLOAT     = IUP_MASK_FLOAT;
533 alias IUPMASK_UFLOAT    = IUP_MASK_UFLOAT;
534 alias IUPMASK_EFLOAT    = IUP_MASK_EFLOAT;
535 alias IUPMASK_INT       = IUP_MASK_INT;
536 alias IUPMASK_UINT      = IUP_MASK_UINT;
537 
538 
539 /************************************************************************/
540 /*                   IupGetParam Callback situations                    */
541 /************************************************************************/
542 enum {
543 	IUP_GETPARAM_BUTTON1 = -1, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
544 	IUP_GETPARAM_INIT    = -2, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
545 	IUP_GETPARAM_BUTTON2 = -3, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
546 	IUP_GETPARAM_BUTTON3 = -4, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
547 	IUP_GETPARAM_CLOSE   = -5, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
548 	IUP_GETPARAM_MAP     = -6, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
549 	IUP_GETPARAM_OK     = IUP_GETPARAM_BUTTON1, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
550 	IUP_GETPARAM_CANCEL = IUP_GETPARAM_BUTTON2, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
551 	IUP_GETPARAM_HELP   = IUP_GETPARAM_BUTTON3, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupparambox.html
552 }
553 
554 /************************************************************************/
555 /*                   Used by IupColorbar                                */
556 /************************************************************************/
557 enum IUP_PRIMARY   = -1; /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupcolorbar.html
558 enum IUP_SECONDARY = -2; /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupcolorbar.html
559 
560 /************************************************************************/
561 /*                   Record Input Modes                                 */
562 /************************************************************************/
563 enum {
564     IUP_RECBINARY, /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuprecordinput.html
565     IUP_RECTEXT    /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/func/iuprecordinput.html
566 }
567 
568 
569 /******************************************************************************
570 * Copyright (C) 1994-2018 Tecgraf, PUC-Rio.
571 *
572 * Permission is hereby granted, free of charge, to any person obtaining
573 * a copy of this software and associated documentation files (the
574 * "Software"), to deal in the Software without restriction, including
575 * without limitation the rights to use, copy, modify, merge, publish,
576 * distribute, sublicense, and/or sell copies of the Software, and to
577 * permit persons to whom the Software is furnished to do so, subject to
578 * the following conditions:
579 *
580 * The above copyright notice and this permission notice shall be
581 * included in all copies or substantial portions of the Software.
582 *
583 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
584 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
585 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
586 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
587 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
588 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
589 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
590 ******************************************************************************/