Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Importing initial version

  • Loading branch information...
commit e8cb0bb10e4ce6e7a342f65a6b933bbd90c1fb6d 1 parent 2d12206
@kmx authored
Showing with 18,184 additions and 0 deletions.
  1. +15 −0 .gitignore
  2. +42 −0 Build.PL
  3. +5 −0 Changes
  4. +25 −0 MANIFEST.SKIP
  5. +73 −0 README
  6. +88 −0 TODO
  7. 0  _generators/Attribute.csv
  8. 0  _generators/Attribute_pm.tt
  9. +252 −0 _generators/Callback.csv
  10. +68 −0 _generators/Callback_pm.tt
  11. +59 −0 _generators/Callback_xs.tt
  12. +181 −0 _generators/do_callbacks.pl
  13. +309 −0 _generators/do_html2pod.pl
  14. +9 −0 doc/Button.pod
  15. +530 −0 lib/IUP.pm
  16. +16 −0 lib/IUP/Button.pm
  17. +39 −0 lib/IUP/Canvas.pm
  18. +36 −0 lib/IUP/Cbox.pm
  19. +18 −0 lib/IUP/Cells.pm
  20. +14 −0 lib/IUP/Clipboard.pm
  21. +17 −0 lib/IUP/ColorBrowser.pm
  22. +14 −0 lib/IUP/ColorDlg.pm
  23. +15 −0 lib/IUP/Colorbar.pm
  24. +71 −0 lib/IUP/Constants.pm
  25. +16 −0 lib/IUP/Dial.pm
  26. +22 −0 lib/IUP/Dialog.pm
  27. +14 −0 lib/IUP/FileDlg.pm
  28. +14 −0 lib/IUP/Fill.pm
  29. +14 −0 lib/IUP/FontDlg.pm
  30. +25 −0 lib/IUP/Frame.pm
  31. +45 −0 lib/IUP/GLCanvas.pm
  32. +36 −0 lib/IUP/Hbox.pm
  33. +43 −0 lib/IUP/Image.pm
  34. +43 −0 lib/IUP/ImageRGB.pm
  35. +43 −0 lib/IUP/ImageRGBA.pm
  36. +910 −0 lib/IUP/Internal/Attribute.pm
  37. +372 −0 lib/IUP/Internal/Callback.pm
  38. +3,903 −0 lib/IUP/Internal/Callback.xs
  39. +475 −0 lib/IUP/Internal/Element.pm
  40. +18 −0 lib/IUP/Internal/LibraryCD.pm
  41. +25 −0 lib/IUP/Internal/LibraryCD.xs
  42. +18 −0 lib/IUP/Internal/LibraryIUP.pm
  43. +2,081 −0 lib/IUP/Internal/LibraryIUP.xs
  44. +16 −0 lib/IUP/Item.pm
  45. +16 −0 lib/IUP/Label.pm
  46. +14 −0 lib/IUP/List.pm
  47. +60 −0 lib/IUP/Matrix.pm
  48. +37 −0 lib/IUP/Menu.pm
  49. +14 −0 lib/IUP/MessageDlg.pm
  50. +14 −0 lib/IUP/Multiline.pm
  51. +37 −0 lib/IUP/Normalizer.pm
  52. +19 −0 lib/IUP/OleControl.pm
  53. +74 −0 lib/IUP/PPlot.pm
  54. +14 −0 lib/IUP/ProgressBar.pm
  55. +25 −0 lib/IUP/Radio.pm
  56. +23 −0 lib/IUP/Sbox.pm
  57. +14 −0 lib/IUP/Separator.pm
  58. +14 −0 lib/IUP/Spin.pm
  59. +27 −0 lib/IUP/Spinbox.pm
  60. +22 −0 lib/IUP/Split.pm
  61. +22 −0 lib/IUP/Submenu.pm
  62. +37 −0 lib/IUP/Tabs.pm
  63. +22 −0 lib/IUP/Text.pm
  64. +14 −0 lib/IUP/Timer.pm
  65. +16 −0 lib/IUP/Toggle.pm
  66. +14 −0 lib/IUP/Tree.pm
  67. +14 −0 lib/IUP/User.pm
  68. +25 −0 lib/IUP/Val.pm
  69. +36 −0 lib/IUP/Vbox.pm
  70. +36 −0 lib/IUP/Zbox.pm
  71. +7,063 −0 src/ppport.h
  72. +10 −0 t/00-load.t
  73. +51 −0 t/01-load-submodules.t
  74. +53 −0 t/empty-new.t
  75. +75 −0 t/iup-global-funcs.t
  76. +168 −0 t/iup.t
  77. +13 −0 t/manifest.t
  78. +12 −0 t/pod.t
  79. +50 −0 typemap
View
15 .gitignore
@@ -0,0 +1,15 @@
+blib*
+Build
+Build.bat
+_build*
+pm_to_blib*
+tmp*
+*.tar.gz
+*.old
+*.bak
+*.o
+*.c
+_internal
+META.yml
+MYMETA.yml
+MANIFEST
View
42 Build.PL
@@ -0,0 +1,42 @@
+use strict;
+use warnings;
+
+use Module::Build;
+
+eval { require Alien::IUP };
+die "You need to have Alien::IUP installed\n" if $@;
+
+my $builder = Module::Build->new(
+ module_name => 'IUP',
+ license => 'mit',
+ dist_abstract => 'IUP bindings to Perl',
+ dist_author => 'KMX <kmx@cpan.org>',
+ dist_version_from => 'lib/IUP.pm',
+ requires => {
+ 'Carp' => 0,
+ 'constant' => 0,
+ },
+ build_requires => { # need to have for running: ./Build (install|test)
+ 'Module::Build' => 0,
+ 'Alien::IUP' => 0,
+ 'Test::More' => 0,
+ 'Carp' => 0,
+ 'constant' => 0,
+ },
+ configure_requires => { # need to have for running: perl Buil.PL
+ 'Module::Build' => 0,
+ 'Alien::IUP' => 0,
+ },
+ add_to_cleanup => [ 'IUP-*' ],
+ c_source => 'src', # ppport.h
+ extra_compiler_flags => Alien::IUP->config('INC'),
+ extra_linker_flags => Alien::IUP->config('LIBS'),
+ meta_merge => {
+ resources => {
+ bugtracker => 'http://rt.cpan.org/NoAuth/Bugs.html?Dist=IUP',
+ repository => 'http://github.com/kmx/perl-iup',
+ }
+ },
+);
+
+$builder->create_build_script();
View
5 Changes
@@ -0,0 +1,5 @@
+Revision history for IUP
+
+0.01 Date/time
+ First version, released on an unsuspecting world.
+
View
25 MANIFEST.SKIP
@@ -0,0 +1,25 @@
+.git
+_build
+_tmp
+stage
+blib*
+pm_to_blib*
+deps
+^Build$
+^Build.bat$
+^MYMETA.yml$
+^MANIFEST.SKIP$
+^tmp
+^build_
+^download
+^share
+^tmp
+^test
+\.c$
+\.o$
+\.old$
+\.tmp$
+\.bak$
+\.zip$
+\.gz$
+pod2htm*.tmp
View
73 README
@@ -0,0 +1,73 @@
+IUP
+
+The README is used to introduce the module and provide instructions on
+how to install the module, any machine dependencies it may have (for
+example C compilers and installed libraries) and any other information
+that should be provided before the module is installed.
+
+A README file is required for CPAN modules since CPAN extracts the README
+file from a module distribution so that people browsing the archive
+can use it to get an idea of the module's uses. It is usually a good idea
+to provide version information here so that people can decide whether
+fixes for the module are worth downloading.
+
+
+INSTALLATION
+
+To install this module, run the following commands:
+
+ perl Build.PL
+ ./Build
+ ./Build test
+ ./Build install
+
+SUPPORT AND DOCUMENTATION
+
+After installing, you can find documentation for this module with the
+perldoc command.
+
+ perldoc IUP
+
+You can also look for information at:
+
+ RT, CPAN's request tracker
+ http://rt.cpan.org/NoAuth/Bugs.html?Dist=IUP
+
+ AnnoCPAN, Annotated CPAN documentation
+ http://annocpan.org/dist/IUP
+
+ CPAN Ratings
+ http://cpanratings.perl.org/d/IUP
+
+ Search CPAN
+ http://search.cpan.org/dist/IUP/
+
+
+LICENSE AND COPYRIGHT
+
+Copyright (C) 2010 KMX
+
+This program is distributed under the MIT (X11) License:
+L<http://www.opensource.org/licenses/mit-license.php>
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
View
88 TODO
@@ -0,0 +1,88 @@
+GLOBAL
+- _generators
+ + attributes
+ + check against GetAttrNames
+- rewrite all examples from lua to perl
+- consider redesign
+ IUP::Internal::LibraryIUP
+ IUP::Internal::LibraryCD
+ IUP::Internal::LibraryIM
+ IUP::Internal::LibraryIMLIB
+ ...
+- move global ihandle table from IUP::Internal::Callback to IUP::Internal::LibraryIUP
+- put somewhere key related functions (see iupkey.h + iup.h) - ?IUP::Keys?
+ sub isAltXkey
+ sub isCtrlXkey
+ sub isShiftXkey
+ sub isSysXkey
+ sub isXkey
+ sub isalt
+ sub iscontrol
+ sub isdouble
+ sub isprint
+ sub isshift
+ sub issys
+ sub isxkey
+ sub isbutton1
+ sub isbutton2
+ sub isbutton3
+ sub isbutton4
+ sub isbutton5
+- update README + Changes
+
+IUP
+- maybe missing (comparing to LUA)
+ sub SetHandle ... IUP->SetHandle('xx', $d->ihandle);
+- maybe not needed (comparing to LUA)
+ sub Close
+ sub GetFocus (we have in Element)
+ sub GetHandle (we have in Element)
+- consider:
+ sub Open (probably not)
+- tests for all global functions
+
+IUP::Constants
+- K_* (see iupkey.h)
+
+IUP::Internal::Element
+- maybe missing (comparing to LUA)
+ sub GetAttributeData (see LUA implementation)
+ sub SetAttributes vs. sub StoreAttribute
+ sub GetName (we have $self->name)
+- maybe not needed (comparing to LUA)
+ sub GetCallback
+- GetAttributes
+ in scalar context = string, in list? context = hash?
+ or: GetAttributesStr vs. GetAttributesHRef
+- tests for all common functions
+
+IUP::Image*
+- move relevant methods from IUP::Internal::Element > IUP::Image
+- add missing methods
+ iup.LoadImage(file_name: string) -> (elem: ihandle) [in Lua]
+ iup.SaveImage(ih: ihandle, file_name, format: string) -> (ret: boolean) [in Lua]
+ iup.GetNativeHandleImage(handle: userdata) -> (image: imImage) [in Lua]
+ iup.GetImageNativeHandle(image: imImage) -> (handle: userdata) [in Lua]
+- base IUP::Image::* on IUP::Image
+- new( ... colors=>[ ] )
+- new( ... pixels=>pack('C*', @array) );
+- 1=>.. 2=>.. 3=>..
+
+IUP::(dialogs)
+- move relevant methods from IUP::Internal::Element > IUP::Dialog
+ IUP::Dialog->popup([x, y: number]) -> (ret: number) [in Lua]
+ IUP::Dialog->show() -> (ret: number) [in IupLua]
+ IUP::Dialog->showxy([x, y: number]) -> (ret: number) [in Lua]
+ IUP::Dialog->hide() -> (ret: number) [in Lua]
+- base IUP::(File|Message|Color|Font)Dlg on IUP::Dialog
+
+IUP::Canvas
+- implement missing methods
+
+IUP::OleControl
+- missing
+- maybe not neccesarry in the first release
+
+IUP::ImageLib
+- missing
+- check memory consumption
View
0  _generators/Attribute.csv
No changes.
View
0  _generators/Attribute_pm.tt
No changes.
View
252 _generators/Callback.csv
@@ -0,0 +1,252 @@
+#module;#action;#type;#c_retval;#c_params
+IUP::Button;ACTION;;int;Ihandle* ih
+IUP::Button;BUTTON_CB;iiiis;int;Ihandle* ih,int button,int pressed,int x,int y,char* status
+IUP::Button;ENTERWINDOW_CB;;int;Ihandle* ih
+IUP::Button;GETFOCUS_CB;;int;Ihandle* ih
+IUP::Button;HELP_CB;;int;Ihandle* ih
+IUP::Button;KILLFOCUS_CB;;int;Ihandle* ih
+IUP::Button;K_ANY;i;int;Ihandle* ih,int c
+IUP::Button;LEAVEWINDOW_CB;;int;Ihandle* ih
+IUP::Button;MAP_CB;;int;Ihandle* ih
+IUP::Button;UNMAP_CB;;int;Ihandle* ih
+IUP::Canvas;ACTION;ff;int;Ihandle* ih,float posx,float posy
+IUP::Canvas;BUTTON_CB;iiiis;int;Ihandle* ih,int button,int pressed,int x,int y,char* status
+IUP::Canvas;DROPFILES_CB;siii;int;Ihandle* ih,const char* filename,int num,int x,int y
+IUP::Canvas;ENTERWINDOW_CB;;int;Ihandle* ih
+IUP::Canvas;FOCUS_CB;i;int;Ihandle* ih,int focus
+IUP::Canvas;GETFOCUS_CB;;int;Ihandle* ih
+IUP::Canvas;HELP_CB;;int;Ihandle* ih
+IUP::Canvas;KEYPRESS_CB;ii;int;Ihandle* ih,int c,int press
+IUP::Canvas;KILLFOCUS_CB;;int;Ihandle* ih
+IUP::Canvas;K_ANY;i;int;Ihandle* ih,int c
+IUP::Canvas;LEAVEWINDOW_CB;;int;Ihandle* ih
+IUP::Canvas;MAP_CB;;int;Ihandle* ih
+IUP::Canvas;MOTION_CB;iis;int;Ihandle* ih,int x,int y,char* status
+IUP::Canvas;RESIZE_CB;ii;int;Ihandle* ih,int width,int height
+IUP::Canvas;SCROLL_CB;iff;int;Ihandle* ih,int op,float posx,float posy
+IUP::Canvas;UNMAP_CB;;int;Ihandle* ih
+IUP::Canvas;WHEEL_CB;fiis;int;Ihandle* ih,float delta,int x,int y,char* status
+IUP::Canvas;WOM_CB;i;int;Ihandle* ih,int state
+IUP::Cells;DRAW_CB;iiiiiiv;int;Ihandle* ih,int line,int column,int xmin,int xmax,int ymin,int ymax,cdCanvas* canvas
+IUP::Cells;ENTERWINDOW_CB;;int;Ihandle* ih
+IUP::Cells;GETFOCUS_CB;;int;Ihandle* ih
+IUP::Cells;HEIGHT_CB;i;int;Ihandle* ih,int line
+IUP::Cells;HELP_CB;;int;Ihandle* ih
+IUP::Cells;HSPAN_CB;ii;int;Ihandle* ih,int line,int column
+IUP::Cells;KILLFOCUS_CB;;int;Ihandle* ih
+IUP::Cells;K_ANY;i;int;Ihandle* ih,int c
+IUP::Cells;LEAVEWINDOW_CB;;int;Ihandle* ih
+IUP::Cells;MAP_CB;;int;Ihandle* ih
+IUP::Cells;MOUSECLICK_CB;iiiiiis;int;Ihandle* ih,int button,int pressed,int line,int column,int x,int y,char* status
+IUP::Cells;MOUSEMOTION_CB;iiiis;int;Ihandle* ih,int line,int column,int x,int y,char* r
+IUP::Cells;NCOLS_CB;;int;Ihandle* ih
+IUP::Cells;NLINES_CB;;int;Ihandle* ih
+IUP::Cells;SCROLLING_CB;ii;int;Ihandle* ih,int line,int column
+IUP::Cells;UNMAP_CB;;int;Ihandle* ih
+IUP::Cells;VSPAN_CB;ii;int;Ihandle* ih,int line,int column
+IUP::Cells;WIDTH_CB;i;int;Ihandle* ih,int column
+IUP::ColorBrowser;CHANGE_CB;ccc;int;Ihandle* ih,unsigned char r,unsigned char g,unsigned char b
+IUP::ColorBrowser;DRAG_CB;ccc;int;Ihandle* ih,unsigned char r,unsigned char g,unsigned char b
+IUP::ColorBrowser;ENTERWINDOW_CB;;int;Ihandle* ih
+IUP::ColorBrowser;GETFOCUS_CB;;int;Ihandle* ih
+IUP::ColorBrowser;HELP_CB;;int;Ihandle* ih
+IUP::ColorBrowser;KILLFOCUS_CB;;int;Ihandle* ih
+IUP::ColorBrowser;K_ANY;i;int;Ihandle* ih,int c
+IUP::ColorBrowser;LEAVEWINDOW_CB;;int;Ihandle* ih
+IUP::ColorBrowser;MAP_CB;;int;Ihandle* ih
+IUP::ColorBrowser;UNMAP_CB;;int;Ihandle* ih
+IUP::ColorBrowser;VALUECHANGED_CB;;int;Ihandle* ih
+IUP::ColorDlg;HELP_CB;;int;Ihandle* ih
+IUP::Colorbar;CELL_CB;i;char*;Ihandle* ih,int cell
+IUP::Colorbar;ENTERWINDOW_CB;;int;Ihandle* ih
+IUP::Colorbar;EXTENDED_CB;i;int;Ihandle* ih,int cell
+IUP::Colorbar;GETFOCUS_CB;;int;Ihandle* ih
+IUP::Colorbar;HELP_CB;;int;Ihandle* ih
+IUP::Colorbar;KILLFOCUS_CB;;int;Ihandle* ih
+IUP::Colorbar;K_ANY;i;int;Ihandle* ih,int c
+IUP::Colorbar;LEAVEWINDOW_CB;;int;Ihandle* ih
+IUP::Colorbar;MAP_CB;;int;Ihandle* ih
+IUP::Colorbar;SELECT_CB;ii;int;Ihandle* ih,int cell,int type
+IUP::Colorbar;SWITCH_CB;ii;int;Ihandle* ih,int prim_cell,int sec_cell
+IUP::Colorbar;UNMAP_CB;;int;Ihandle* ih
+IUP::Dial;BUTTON_PRESS_CB;d;int;Ihandle* ih,double angle
+IUP::Dial;BUTTON_RELEASE_CB;d;int;Ihandle* ih,double angle
+IUP::Dial;ENTERWINDOW_CB;;int;Ihandle* ih
+IUP::Dial;GETFOCUS_CB;;int;Ihandle* ih
+IUP::Dial;HELP_CB;;int;Ihandle* ih
+IUP::Dial;KILLFOCUS_CB;;int;Ihandle* ih
+IUP::Dial;K_ANY;i;int;Ihandle* ih,int c
+IUP::Dial;LEAVEWINDOW_CB;;int;Ihandle* ih
+IUP::Dial;MAP_CB;;int;Ihandle* ih
+IUP::Dial;MOUSEMOVE_CB;d;int;Ihandle* ih,double angle
+IUP::Dial;UNMAP_CB;;int;Ihandle* ih
+IUP::Dial;VALUECHANGED_CB;;int;Ihandle* ih
+IUP::Dialog;CLOSE_CB;;int;Ihandle* ih
+IUP::Dialog;COPYDATA_CB;si;int;Ihandle* ih,char* cmdLine,int size
+IUP::Dialog;DROPFILES_CB;siii;int;Ihandle* ih,const char* filename,int num,int x,int y
+IUP::Dialog;ENTERWINDOW_CB;;int;Ihandle* ih
+IUP::Dialog;GETFOCUS_CB;;int;Ihandle* ih
+IUP::Dialog;HELP_CB;;int;Ihandle* ih
+IUP::Dialog;KILLFOCUS_CB;;int;Ihandle* ih
+IUP::Dialog;K_ANY;i;int;Ihandle* ih,int c
+IUP::Dialog;LEAVEWINDOW_CB;;int;Ihandle* ih
+IUP::Dialog;MAP_CB;;int;Ihandle* ih
+IUP::Dialog;MDIACTIVATE_CB;;int;Ihandle* ih
+IUP::Dialog;MOVE_CB;ii;int;Ihandle* ih,int x,int y
+IUP::Dialog;RESIZE_CB;ii;int;Ihandle* ih,int width,int height
+IUP::Dialog;SHOW_CB;i;int;Ihandle* ih,int state
+IUP::Dialog;TRAYCLICK_CB;iii;int;Ihandle* ih,int but,int pressed,int dclick
+IUP::Dialog;UNMAP_CB;;int;Ihandle* ih
+IUP::FileDlg;FILE_CB;ss;int;Ihandle* ih,const char* file_name,const char* status
+IUP::FileDlg;HELP_CB;;int;Ihandle* ih
+IUP::FontDlg;HELP_CB;;int;Ihandle* ih
+IUP::Frame;MAP_CB;;int;Ihandle* ih
+IUP::Frame;UNMAP_CB;;int;Ihandle* ih
+IUP::GLCanvas;RESIZE_CB;ii;int;Ihandle* ih,int width,int height
+IUP::Item;ACTION;;int;Ihandle* ih
+IUP::Item;HELP_CB;;int;Ihandle* ih
+IUP::Item;HIGHLIGHT_CB;;int;Ihandle* ih
+IUP::Item;MAP_CB;;int;Ihandle* ih
+IUP::Item;UNMAP_CB;;int;Ihandle* ih
+IUP::Label;MAP_CB;;int;Ihandle* ih
+IUP::Label;UNMAP_CB;;int;Ihandle* ih
+IUP::List;ACTION;sii;int;Ihandle* ih,char* text,int pos,int state
+IUP::List;BUTTON_CB;iiiis;int;Ihandle* ih,int button,int pressed,int x,int y,char* status
+IUP::List;CARET_CB;iii;int;Ihandle* ih,int lin,int col,int pos
+IUP::List;DBLCLICK_CB;is;int;Ihandle* ih,int pos,char* text
+IUP::List;DROPDOWN_CB;i;int;Ihandle* ih,int state
+IUP::List;DROPFILES_CB;siii;int;Ihandle* ih,const char* filename,int num,int x,int y
+IUP::List;EDIT_CB;is;int;Ihandle* ih,int c,char* new_value
+IUP::List;ENTERWINDOW_CB;;int;Ihandle* ih
+IUP::List;GETFOCUS_CB;;int;Ihandle* ih
+IUP::List;HELP_CB;;int;Ihandle* ih
+IUP::List;KILLFOCUS_CB;;int;Ihandle* ih
+IUP::List;K_ANY;i;int;Ihandle* ih,int c
+IUP::List;LEAVEWINDOW_CB;;int;Ihandle* ih
+IUP::List;MAP_CB;;int;Ihandle* ih
+IUP::List;MOTION_CB;iis;int;Ihandle* ih,int x,int y,char* status
+IUP::List;MULTISELECT_CB;s;int;Ihandle* ih,char* value
+IUP::List;UNMAP_CB;;int;Ihandle* ih
+IUP::List;VALUECHANGED_CB;;int;Ihandle* ih
+IUP::Matrix;ACTION_CB;iiiis;int;Ihandle* ih,int c,int lin,int col,int edition,char* after
+IUP::Matrix;BGCOLOR_CB;iiIII;int;Ihandle* ih,int lin,int col,unsigned int* red,unsigned int* green,unsigned int* blue
+IUP::Matrix;CLICK_CB;iis;int;Ihandle* ih,int lin,int col,char* status
+IUP::Matrix;DRAW_CB;iiiiiiv;int;Ihandle* ih,int lin,int col,int x1,int x2,int y1,int y2,cdCanvas* cnv
+IUP::Matrix;DROPCHECK_CB;ii;int;Ihandle* ih,int lin,int col
+IUP::Matrix;DROPSELECT_CB;iinsii;int;Ihandle* ih,int lin,int col,Ihandle* drop,char* t,int i,int v
+IUP::Matrix;DROP_CB;nii;int;Ihandle* ih,Ihandle* drop,int lin,int col
+IUP::Matrix;EDITION_CB;iiii;int;Ihandle* ih,int lin,int col,int mode,int update
+IUP::Matrix;ENTERITEM_CB;ii;int;Ihandle* ih,int lin,int col
+IUP::Matrix;FGCOLOR_CB;iiIII;int;Ihandle* ih,int lin,int col,unsigned int* red,unsigned int* green,unsigned int* blue
+IUP::Matrix;FONT_CB;ii;char*;Ihandle* ih,int lin,int col
+IUP::Matrix;LEAVEITEM_CB;ii;int;Ihandle* ih,int lin,int col
+IUP::Matrix;MARKEDIT_CB;iii;int;Ihandle* ih,int lin,int col,int marked
+IUP::Matrix;MARK_CB;ii;int;Ihandle* ih,int lin,int col
+IUP::Matrix;MOUSEMOVE_CB;ii;int;Ihandle* ih,int lin,int col
+IUP::Matrix;RELEASE_CB;iis;int;Ihandle* ih,int lin,int col,char* status
+IUP::Matrix;SCROLLTOP_CB;ii;int;Ihandle* ih,int lin,int col
+IUP::Matrix;VALUE_CB;ii;char*;Ihandle* ih,int lin,int col
+IUP::Matrix;VALUE_EDIT_CB;iis;int;Ihandle* ih,int lin,int col,char* newval
+IUP::Menu;MAP_CB;;int;Ihandle* ih
+IUP::Menu;MENUCLOSE_CB;;int;Ihandle* ih
+IUP::Menu;OPEN_CB;;int;Ihandle* ih
+IUP::Menu;UNMAP_CB;;int;Ihandle* ih
+IUP::MessageDlg;HELP_CB;;int;Ihandle* ih
+IUP::OleControl;ENTERWINDOW_CB;;int;Ihandle* ih
+IUP::OleControl;GETFOCUS_CB;;int;Ihandle* ih
+IUP::OleControl;KILLFOCUS_CB;;int;Ihandle* ih
+IUP::OleControl;LEAVEWINDOW_CB;;int;Ihandle* ih
+IUP::OleControl;MAP_CB;;int;Ihandle* ih
+IUP::OleControl;UNMAP_CB;;int;Ihandle* ih
+IUP::PPlot;DELETEBEGIN_CB;;int;Ihandle* ih
+IUP::PPlot;DELETEEND_CB;;int;Ihandle* ih
+IUP::PPlot;DELETE_CB;iiff;int;Ihandle* ih,int index,int sample_index,float x,float y
+IUP::PPlot;EDITBEGIN_CB;;int;Ihandle* ih
+IUP::PPlot;EDITEND_CB;;int;Ihandle* ih
+IUP::PPlot;EDIT_CB;iiffFF;int;Ihandle* ih,int index,int sample_index,float x,float y,float* new_x,float* new_y
+IUP::PPlot;ENTERWINDOW_CB;;int;Ihandle* ih
+IUP::PPlot;GETFOCUS_CB;;int;Ihandle* ih
+IUP::PPlot;HELP_CB;;int;Ihandle* ih
+IUP::PPlot;KILLFOCUS_CB;;int;Ihandle* ih
+IUP::PPlot;K_ANY;i;int;Ihandle* ih,int c
+IUP::PPlot;LEAVEWINDOW_CB;;int;Ihandle* ih
+IUP::PPlot;MAP_CB;;int;Ihandle* ih
+IUP::PPlot;POSTDRAW_CB;v;int;Ihandle* ih,cdCanvas* cnv
+IUP::PPlot;PREDRAW_CB;v;int;Ihandle* ih,cdCanvas* cnv
+IUP::PPlot;SELECTBEGIN_CB;;int;Ihandle* ih
+IUP::PPlot;SELECTEND_CB;;int;Ihandle* ih
+IUP::PPlot;SELECT_CB;iiffi;int;Ihandle* ih,int index,int sample_index,float x,float y,int select
+IUP::PPlot;UNMAP_CB;;int;Ihandle* ih
+IUP::ProgressBar;MAP_CB;;int;Ihandle* ih
+IUP::ProgressBar;UNMAP_CB;;int;Ihandle* ih
+IUP::Spin;SPIN_CB;i;int;Ihandle* ih,int inc
+IUP::Spinbox;SPIN_CB;i;int;Ihandle* ih,int inc
+IUP::Submenu;HIGHLIGHT_CB;;int;Ihandle* ih
+IUP::Submenu;MAP_CB;;int;Ihandle* ih
+IUP::Submenu;UNMAP_CB;;int;Ihandle* ih
+IUP::Tabs;ENTERWINDOW_CB;;int;Ihandle* ih
+IUP::Tabs;GETFOCUS_CB;;int;Ihandle* ih
+IUP::Tabs;HELP_CB;;int;Ihandle* ih
+IUP::Tabs;KILLFOCUS_CB;;int;Ihandle* ih
+IUP::Tabs;K_ANY;i;int;Ihandle* ih,int c
+IUP::Tabs;LEAVEWINDOW_CB;;int;Ihandle* ih
+IUP::Tabs;MAP_CB;;int;Ihandle* ih
+IUP::Tabs;TABCHANGE_CB;nn;int;Ihandle* ih,Ihandle* new_tab,Ihandle* old_tab
+IUP::Tabs;UNMAP_CB;;int;Ihandle* ih
+IUP::Text;ACTION;is;int;Ihandle* ih,int c,char* new_value
+IUP::Text;BUTTON_CB;iiiis;int;Ihandle* ih,int button,int pressed,int x,int y,char* status
+IUP::Text;CARET_CB;iii;int;Ihandle* ih,int lin,int col,int pos
+IUP::Text;DROPFILES_CB;siii;int;Ihandle* ih,const char* filename,int num,int x,int y
+IUP::Text;ENTERWINDOW_CB;;int;Ihandle* ih
+IUP::Text;GETFOCUS_CB;;int;Ihandle* ih
+IUP::Text;HELP_CB;;int;Ihandle* ih
+IUP::Text;KILLFOCUS_CB;;int;Ihandle* ih
+IUP::Text;K_ANY;i;int;Ihandle* ih,int c
+IUP::Text;LEAVEWINDOW_CB;;int;Ihandle* ih
+IUP::Text;MAP_CB;;int;Ihandle* ih
+IUP::Text;MOTION_CB;iis;int;Ihandle* ih,int x,int y,char* status
+IUP::Text;SPIN_CB;i;int;Ihandle* ih,int pos
+IUP::Text;UNMAP_CB;;int;Ihandle* ih
+IUP::Text;VALUECHANGED_CB;;int;Ihandle* ih
+IUP::Timer;ACTION_CB;;int;Ihandle* ih
+IUP::Toggle;ACTION;i;int;Ihandle* ih,int state
+IUP::Toggle;ENTERWINDOW_CB;;int;Ihandle* ih
+IUP::Toggle;GETFOCUS_CB;;int;Ihandle* ih
+IUP::Toggle;HELP_CB;;int;Ihandle* ih
+IUP::Toggle;KILLFOCUS_CB;;int;Ihandle* ih
+IUP::Toggle;K_ANY;i;int;Ihandle* ih,int c
+IUP::Toggle;LEAVEWINDOW_CB;;int;Ihandle* ih
+IUP::Toggle;MAP_CB;;int;Ihandle* ih
+IUP::Toggle;UNMAP_CB;;int;Ihandle* ih
+IUP::Toggle;VALUECHANGED_CB;;int;Ihandle* ih
+IUP::Tree;BRANCHCLOSE_CB;i;int;Ihandle* ih,int id
+IUP::Tree;BRANCHOPEN_CB;i;int;Ihandle* ih,int id
+IUP::Tree;BUTTON_CB;iiiis;int;Ihandle* ih,int button,int pressed,int x,int y,char* status
+IUP::Tree;DRAGDROP_CB;iiii;int;Ihandle* ih,int drag_id,int drop_id,int isshift,int iscontrol
+IUP::Tree;DROPFILES_CB;siii;int;Ihandle* ih,const char* filename,int num,int x,int y
+IUP::Tree;ENTERWINDOW_CB;;int;Ihandle* ih
+IUP::Tree;EXECUTELEAF_CB;i;int;Ihandle* ih,int id
+IUP::Tree;GETFOCUS_CB;;int;Ihandle* ih
+IUP::Tree;HELP_CB;;int;Ihandle* ih
+IUP::Tree;KILLFOCUS_CB;;int;Ihandle* ih
+IUP::Tree;K_ANY;i;int;Ihandle* ih,int c
+IUP::Tree;LEAVEWINDOW_CB;;int;Ihandle* ih
+IUP::Tree;MAP_CB;;int;Ihandle* ih
+IUP::Tree;MOTION_CB;iis;int;Ihandle* ih,int x,int y,char* status
+IUP::Tree;MULTISELECTION_CB;Ai;int;Ihandle* ih,int* ids,int n
+IUP::Tree;MULTIUNSELECTION_CB;Ai;int;Ihandle* ih,int* ids,int n
+IUP::Tree;NODEREMOVED_CB;s;int;Ihandle* ih,void* userdata
+IUP::Tree;RENAME_CB;is;int;Ihandle* ih,int id,char* title
+IUP::Tree;RIGHTCLICK_CB;i;int;Ihandle* ih,int id
+IUP::Tree;SELECTION_CB;ii;int;Ihandle* ih,int id,int status
+IUP::Tree;SHOWRENAME_CB;i;int;Ihandle* ih,int id
+IUP::Tree;UNMAP_CB;;int;Ihandle* ih
+IUP::Val;ENTERWINDOW_CB;;int;Ihandle* ih
+IUP::Val;GETFOCUS_CB;;int;Ihandle* ih
+IUP::Val;HELP_CB;;int;Ihandle* ih
+IUP::Val;KILLFOCUS_CB;;int;Ihandle* ih
+IUP::Val;K_ANY;i;int;Ihandle* ih,int c
+IUP::Val;LEAVEWINDOW_CB;;int;Ihandle* ih
+IUP::Val;MAP_CB;;int;Ihandle* ih
+IUP::Val;UNMAP_CB;;int;Ihandle* ih
+IUP::Val;VALUECHANGED_CB;;int;Ihandle* ih
View
68 _generators/Callback_pm.tt
@@ -0,0 +1,68 @@
+#!/usr/bin/env perl
+
+# BEWARE: this is a generated file, DO NOT EDIT THIS FILE MANUALLY!!!
+
+package IUP::Internal::Callback;
+
+use strict;
+use warnings;
+require DynaLoader;
+our @ISA = qw/ DynaLoader /;
+
+bootstrap IUP::Internal::Callback;
+
+my $cb_table = {
+[% FOR i IN pmitems -%]
+ '[% i.module %]' => {
+[% FOR j IN i.actions -%]
+ [% j.action %] => \&[% j.xs_init_cb %],
+[% END -%]
+ },
+[% END -%]
+};
+
+sub _execute_cb { #TODO: maybe return something else then -1 in case of error
+ my ($ih, $action, @args) = @_;
+ my $ref = _translate_ih($ih);
+ return -1 unless ref($ref);
+ my $func = $ref->{$action};
+ return -1 unless (ref($func) eq 'CODE');
+ my $rv = &$func($ref, @args);
+ return -1 unless defined $rv;
+ return $rv;
+}
+
+sub _get_cb_init_function {
+ my ($pkg, $action) = @_;
+ my $rv = $cb_table->{$pkg};
+ return $rv ? $rv->{$action} : undef;
+}
+
+sub _is_cb_valid {
+ my ($pkg, $action) = @_;
+ my $h = $cb_table->{$pkg};
+ return 0 unless defined($h);
+ return defined($h->{$action}) ? 1 : 0;
+}
+
+sub _get_cb_list {
+ my ($element) = @_;
+ my $h = $cb_table->{$element} or return;
+ return keys %$h;
+}
+
+#TODO: maybe something more thread safe
+my %ih_register; #global table mapping IUP Ihandles to perl objrefs
+sub _translate_ih { $ih_register{$_[0]} } #params: ih
+sub _unregister_ih { delete $ih_register{$_[0]} } #params: ih
+sub _register_ih { $ih_register{$_[0]} = $_[1] } #params: ih, objref
+
+1;
+
+__END__
+
+=head1 NAME
+
+IUP::Internal::Callback - INTERNAL FUNCTIONS, do not use them from outside!
+
+=cut
View
59 _generators/Callback_xs.tt
@@ -0,0 +1,59 @@
+/* BEWARE: this is a generated file, DO NOT EDIT THIS FILE MANUALLY!!! */
+
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+#include "ppport.h"
+
+#include <iup.h>
+#include <cd.h>
+[% FOREACH i IN xsitems %]
+[% i.c_retval %]
+[% i.xs_internal_cb %] [% i.xs_internal_cb_params %]
+{
+ dSP;
+ int count;
+ [% i.c_retval %] rv;
+[% FOR j IN i.xs_internal_cb_locvar -%]
+ [% j %]
+[% END -%]
+
+ ENTER;
+ SAVETMPS;
+
+ /* push params for [% i.xs_internal_cb_pfunc %]() */
+ PUSHMARK(SP);
+ XPUSHs(sv_2mortal(newSViv(PTR2IV(ih))));
+[% FOREACH j IN i.xs_internal_cb_push -%]
+ [% j %]
+[% END -%]
+ PUTBACK;
+
+ count = call_pv("IUP::Internal::Callback::[% i.xs_internal_cb_pfunc %]",G_SCALAR);
+
+ SPAGAIN;
+
+ [% i.xs_internal_cb_rvcheck %]
+ rv = [% i.xs_internal_cb_pop %];
+[% FOR j IN i.xs_internal_cb_extrapop -%]
+ [% j %]
+[% END -%]
+
+ PUTBACK;
+ FREETMPS;
+ LEAVE;
+
+ return rv;
+}
+[% END %]
+
+MODULE = IUP::Internal::Callback PACKAGE = IUP::Internal::Callback
+
+[% FOREACH i IN xsitems %]
+void
+[% i.xs_init_cb %](ih,action)
+ Ihandle* ih;
+ char* action;
+ CODE:
+ IupSetCallback(ih, action, (Icallback)[% i.xs_internal_cb %]);
+[% END %]
View
181 _generators/do_callbacks.pl
@@ -0,0 +1,181 @@
+use strict;
+use warnings;
+
+use File::Slurp 'slurp';
+use Template;
+use Data::Dumper;
+
+my $cb_csv = 'Callback.csv';
+
+my $pfunc_default = '_execute_cb';
+my $pfunc_table = {
+ internal_cb_DRAW_CB_iiiiiiv => '_execute_cb_cnv7',
+ internal_cb_POSTDRAW_CB_v => '_execute_cb_cnv1',
+ internal_cb_PREDRAW_CB_v => '_execute_cb_cnv1',
+};
+
+sub file2hash {
+ my $fname = shift;
+ my $rv;
+
+ die "File '$fname' does not exist!\n" unless -f $fname;
+ my ($head, @lines) = slurp($fname);
+ chomp ($head);
+ chomp (@lines);
+ my @cols = split(';', $head);
+ s/^#//g for (@cols);
+ for (@lines) {
+ my @items = split(';', $_);
+ for(my $i=2; $i < scalar(@cols); $i++) {
+ $rv->{$items[0]}->{$items[1]}->{$cols[$i]} = $items[$i];
+ }
+ }
+ return $rv;
+}
+
+sub generate1 {
+ my $h = shift;
+ for my $m (keys %$h) {
+ for my $a (keys %{$h->{$m}}) {
+ my $if = "internal_cb_$a\_$h->{$m}->{$a}->{type}";
+ $h->{$m}->{$a}->{xs_internal_cb} = $if;
+ $h->{$m}->{$a}->{xs_internal_cb_params} = "($h->{$m}->{$a}->{c_params})";
+ $h->{$m}->{$a}->{xs_internal_cb_pfunc} = $pfunc_table->{$if} || $pfunc_default;
+
+ my @l_rvname;
+ my $c_retval = $h->{$m}->{$a}->{c_retval};
+ if ($c_retval eq 'int') {
+ $h->{$m}->{$a}->{xs_internal_cb_pop} = 'POPi';
+ push @l_rvname, '$rv_num';
+ }
+ elsif ($c_retval eq 'char*') {
+ $h->{$m}->{$a}->{xs_internal_cb_pop} = 'POPpx';
+ push @l_rvname, '$rv_string';
+ }
+ else {
+ die "this should not happen";
+ }
+
+ my $pf = "_init_cb_$a\_$h->{$m}->{$a}->{type}";
+
+ my @l_name = ( '$self' );
+
+ my @l_xspush = ( "XPUSHs(sv_2mortal(newSVpvn(\"$a\", ".length($a).")));" );
+ my @l_xspop = ();
+ my @l_xslocvar = ();
+ my $rv_count = 1;
+ my @fp = split(',', $h->{$m}->{$a}->{c_params});
+ die "invalid value '$fp[0]'" if $fp[0] ne 'Ihandle* ih';
+ my @tp = split('', $h->{$m}->{$a}->{type});
+ die "[$m.$a] mismatch: '$h->{$m}->{$a}->{type}' vs. '$h->{$m}->{$a}->{c_params}'" unless scalar(@tp)+1==scalar(@fp);
+ for(my $i=1; $i<scalar(@fp); $i++) {
+ my $n = 'xxx';
+ if ($fp[$i] =~ /^.*?([^ ]*)$/) {
+ $n = $1;
+ }
+ else {
+ die "this should not happen";
+ }
+ if ($tp[$i-1] =~ /^(i|c)$/) {
+ push @l_name, "\$$n";
+ push @l_xspush, "XPUSHs(sv_2mortal(newSViv($n)));";
+ }
+ elsif ($tp[$i-1] =~ /^(n|v)$/) {
+ push @l_name, "\$$n";
+ push @l_xspush, "XPUSHs(sv_2mortal(newSViv(PTR2IV($n))));";
+ }
+ elsif ($tp[$i-1] =~ /^(I)$/) {
+ push @l_xspop, "*$n = POPi;"; # xxx TODO needs testing + pod update
+ $rv_count++;
+ push @l_rvname, "\$$n";
+ }
+ elsif ($tp[$i-1] =~ /^(F)$/) {
+ push @l_xspop, "*$n = POPn;"; # xxx TODO needs testing + pod update
+ $rv_count++;
+ push @l_rvname, "\$$n";
+ }
+ elsif ($tp[$i-1] =~ /^(A)$/) { # xxx TODO needs testing + pod update
+ push @l_name, "\@$n\_list";
+ # xxx hack for MULTISELECTION_CB MULTIUNSELECTION_CB - do not use 'A' for anything else
+ push @l_xspush, "for(loc_i=0; loc_i++; loc_i<n) XPUSHs(sv_2mortal(newSViv(ids[loc_i])));";
+ push @l_xslocvar, "int loc_i;";
+ last;
+ }
+ elsif ($tp[$i-1] =~ /^(f|d)$/) {
+ push @l_name, "\$$n";
+ push @l_xspush, "XPUSHs(sv_2mortal(newSVnv($n)));";
+ }
+ elsif ($tp[$i-1] =~ /^(s)$/) {
+ push @l_name, "\$$n";
+ push @l_xspush, "XPUSHs(sv_2mortal(newSVpv($n, 0)));";
+ }
+ else {
+ die "[$m.$a] error: '$h->{$m}->{$a}->{type}' vs. '$h->{$m}->{$a}->{c_params}'";
+ }
+ }
+
+ #die Dumper(\@l);
+ $h->{$m}->{$a}->{xs_init_cb} = $pf;
+ $h->{$m}->{$a}->{xs_internal_cb_push} = \@l_xspush;
+ $h->{$m}->{$a}->{xs_internal_cb_extrapop} = \@l_xspop;
+ $h->{$m}->{$a}->{xs_internal_cb_locvar} = \@l_xslocvar;
+ if($rv_count == 1) {
+ $h->{$m}->{$a}->{xs_internal_cb_rvcheck} = "if (count != 1) croak(\"Error: _execute_cb($a) has not returned single scalar value!\\n\");";
+ }
+ else {
+ $h->{$m}->{$a}->{xs_internal_cb_rvcheck} = "if (count != $rv_count) croak(\"Error: _execute_cb($a) has not returned $rv_count values!\\n\");";
+ }
+
+ $h->{$m}->{$a}->{pod_sample_params} = '(' . join(', ', @l_name) . ')';
+ if(scalar(@l_rvname)>2) {
+ $h->{$m}->{$a}->{pod_sample_rv} = '(' . join(', ', @l_rvname) . ')';
+ }
+ else {
+ $h->{$m}->{$a}->{pod_sample_rv} = $l_rvname[0];
+ }
+
+ #print "DONE: " . Dumper($h->{$m}->{$a});
+ }
+ }
+}
+
+sub hash2xsitems {
+ my $h = shift;
+ my @rv;
+ my %seen;
+
+ foreach my $m (sort keys %$h) {
+ for my $a (sort keys %{$h->{$m}}) {
+ push @rv, $h->{$m}->{$a} unless $seen{"$h->{$m}->{$a}->{xs_init_cb}"};
+ $seen{"$h->{$m}->{$a}->{xs_init_cb}"} = 1;
+ }
+ }
+ return \@rv;
+}
+
+sub hash2pmitems {
+ my $h = shift;
+ my @rv;
+ foreach my $m (sort keys %$h) {
+ my @a;
+ for my $a (sort keys %{$h->{$m}}) {
+ push @a, { action=>$a, xs_init_cb=>$h->{$m}->{$a}->{xs_init_cb} };
+ }
+#warn ">>>processing $m $a ".Dumper(\@a);
+ push @rv, { module=>$m, actions=>\@a };
+ }
+ return \@rv;
+}
+
+
+my $h = file2hash($cb_csv);
+generate1($h);
+my $data1 = {
+ xsitems => hash2xsitems($h),
+ pmitems => hash2pmitems($h),
+};
+
+#die Dumper($data1);
+my $tt = Template->new();
+$tt->process('Callback_xs.tt', $data1, 'Callback.xs') || die $tt->error();
+$tt->process('Callback_pm.tt', $data1, 'Callback.pm') || die $tt->error();
View
309 _generators/do_html2pod.pl
@@ -0,0 +1,309 @@
+use strict;
+use warnings;
+use Data::Dumper;
+use Template;
+use HTML::TreeBuilder;
+use Pod::HTML2Pod;
+use File::Path qw(make_path remove_tree);
+use File::Slurp;
+use Pod::Simple::HTMLBatch;
+
+my $docroot = 'y:\@repos\perl-iup\_internal\doc\iup';
+my $podroot = './pod.tt';
+my $htmlout = './pod.tt.html';
+
+my $html_files = {
+ 'Attributes::00main' => 'html/en/attrib.html',
+ 'Attributes::ACTIVE' => 'html/en/attrib/iup_active.html',
+ 'Attributes::BGCOLOR' => 'html/en/attrib/iup_bgcolor.html',
+ 'Attributes::CLIENTSIZE' => 'html/en/attrib/iup_clientsize.html',
+ 'Attributes::CONTROL' => 'html/en/attrib/iup_control.html',
+ 'Attributes::CURSOR' => 'html/en/attrib/iup_cursor.html',
+ 'Attributes::DX' => 'html/en/attrib/iup_dx.html',
+ 'Attributes::DY' => 'html/en/attrib/iup_dy.html',
+ 'Attributes::EXPAND' => 'html/en/attrib/iup_expand.html',
+ 'Attributes::FGCOLOR' => 'html/en/attrib/iup_fgcolor.html',
+ 'Attributes::FLOATING' => 'html/en/attrib/iup_floating.html',
+ 'Attributes::FONT' => 'html/en/attrib/iup_font.html',
+ 'Attributes::FONT' => 'html/en/attrib/iup_font2.html',
+ 'Attributes::FONT' => 'html/en/attrib/iup_formatting.html',
+ 'Attributes::Global Attributes' => 'html/en/attrib/iup_globals.html',
+ 'Attributes::ICON' => 'html/en/attrib/iup_icon.html',
+ 'Attributes::KEY' => 'html/en/attrib/iup_key.html',
+ 'Attributes::iupMask' => 'html/en/attrib/iup_mask.html',
+ 'Attributes::MAXSIZE' => 'html/en/attrib/iup_maxsize.html',
+ 'Attributes::MAXSIZE' => 'html/en/attrib/iup_minsize.html',
+ 'Attributes::NAME' => 'html/en/attrib/iup_name.html',
+ 'Attributes::PARENTDIALOG' => 'html/en/attrib/iup_parentdialog.html',
+ 'Attributes::POSITION' => 'html/en/attrib/iup_position.html',
+ 'Attributes::POSX' => 'html/en/attrib/iup_posx.html',
+ 'Attributes::POSY' => 'html/en/attrib/iup_posy.html',
+ 'Attributes::RASTERSIZE' => 'html/en/attrib/iup_rastersize.html',
+ 'Attributes::SCROLLBAR' => 'html/en/attrib/iup_scrollbar.html',
+ 'Attributes::SHRINK' => 'html/en/attrib/iup_shrink.html',
+ 'Attributes::SIZE' => 'html/en/attrib/iup_size.html',
+ 'Attributes::TIP' => 'html/en/attrib/iup_tip.html',
+ 'Attributes::TITLE' => 'html/en/attrib/iup_title.html',
+ 'Attributes::VALUE' => 'html/en/attrib/iup_value.html',
+ 'Attributes::VISIBLE' => 'html/en/attrib/iup_visible.html',
+ 'Attributes::WID' => 'html/en/attrib/iup_wid.html',
+ 'Attributes::X' => 'html/en/attrib/iup_x.html',
+ 'Attributes::XMAX' => 'html/en/attrib/iup_xmax.html',
+ 'Attributes::XMIN' => 'html/en/attrib/iup_xmin.html',
+ 'Attributes::Y' => 'html/en/attrib/iup_y.html',
+ 'Attributes::YMAX' => 'html/en/attrib/iup_ymax.html',
+ 'Attributes::YMIN' => 'html/en/attrib/iup_ymin.html',
+ 'Attributes::ZORDER' => 'html/en/attrib/iup_zorder.html',
+ 'Attributes::Keyboard Codes' => 'html/en/attrib/key.html',
+ 'Manual::Attributes' => 'html/en/attrib_guide.html',
+ 'Manual::App_Basic' => 'html/en/basic/index.html',
+ 'Callbacks::00main' => 'html/en/call.html',
+ 'Callbacks::ACTION' => 'html/en/call/iup_action.html',
+ 'Callbacks::BUTTON_CB' => 'html/en/call/iup_button_cb.html',
+ 'Callbacks::CLOSE_CB' => 'html/en/call/iup_close_cb.html',
+ 'Callbacks::DEFAULT_ACTION' => 'html/en/call/iup_default_action.html',
+ 'Callbacks::DESTROY_CB' => 'html/en/call/iup_destroy_cb.html',
+ 'Callbacks::DROPFILES_CB' => 'html/en/call/iup_dropfiles_cb.html',
+ 'Callbacks::ENTERWINDOW_CB' => 'html/en/call/iup_enterwindow_cb.html',
+ 'Callbacks::GETFOCUS_CB' => 'html/en/call/iup_getfocus_cb.html',
+ 'Callbacks::HELP_CB' => 'html/en/call/iup_help_cb.html',
+ 'Callbacks::HIGHLIGHT_CB' => 'html/en/call/iup_highlight_cb.html',
+ 'Callbacks::IDLE_ACTION' => 'html/en/call/iup_idle_action.html',
+ 'Callbacks::K_ANY' => 'html/en/call/iup_k_any.html',
+ 'Callbacks::KEYPRESS_CB' => 'html/en/call/iup_keypress_cb.html',
+ 'Callbacks::KILLFOCUS_CB' => 'html/en/call/iup_killfocus_cb.html',
+ 'Callbacks::LEAVEWINDOW_CB' => 'html/en/call/iup_leavewindow_cb.html',
+ 'Callbacks::MAP_CB' => 'html/en/call/iup_map_cb.html',
+ 'Callbacks::MENUCLOSE_CB' => 'html/en/call/iup_menuclose_cb.html',
+ 'Callbacks::MOTION_CB' => 'html/en/call/iup_motion_cb.html',
+ 'Callbacks::OPEN_CB' => 'html/en/call/iup_open_cb.html',
+ 'Callbacks::RESIZE_CB' => 'html/en/call/iup_resize_cb.html',
+ 'Callbacks::SCROLL_CB' => 'html/en/call/iup_scroll_cb.html',
+ 'Callbacks::SHOW_CB' => 'html/en/call/iup_show_cb.html',
+ 'Callbacks::UNMAP_CB' => 'html/en/call/iup_unmap_cb.html',
+ 'Callbacks::WHEEL_CB' => 'html/en/call/iup_wheel_cb.html',
+ 'Callbacks::WOM_CB' => 'html/en/call/iup_wom_cb.html',
+ 'Callbacks::Events and Callbacks Guide' => 'html/en/call_guide.html',
+ 'Manual::Controls1' => 'html/en/controls.html',
+ 'Manual::Controls2' => 'html/en/cpi.html',
+ 'IUP::PPlot' => 'html/en/ctrl/iup_pplot.html',
+ 'IUP::Cells' => 'html/en/ctrl/iupcells.html',
+ 'IUP::ColorBar' => 'html/en/ctrl/iupcolorbar.html',
+ 'IUP::ColorBrowser' => 'html/en/ctrl/iupcolorbrowser.html',
+ 'IUP::Dial' => 'html/en/ctrl/iupdial.html',
+ 'IUP::Gauge' => 'html/en/ctrl/iupgauge.html',
+ 'IUP::GLCanvas' => 'html/en/ctrl/iupglcanvas.html',
+ 'IUP::Mask' => 'html/en/ctrl/iupmask.html',
+ 'IUP::Matrix_00main' => 'html/en/ctrl/iupmatrix.html',
+ 'IUP::Matrix_A' => 'html/en/ctrl/iupmatrix_attrib.html',
+ 'IUP::Matrix_C' => 'html/en/ctrl/iupmatrix_cb.html',
+ 'IUP::OleControl' => 'html/en/ctrl/iupole.html',
+ 'Manual::Dialogs' => 'html/en/dialogs.html',
+ 'IUP::Alarm' => 'html/en/dlg/iupalarm.html',
+ 'IUP::ColorDlg' => 'html/en/dlg/iupcolordlg.html',
+ 'IUP::Dialog' => 'html/en/dlg/iupdialog.html',
+ 'IUP::FileDlg' => 'html/en/dlg/iupfiledlg.html',
+ 'IUP::FontDlg' => 'html/en/dlg/iupfontdlg.html',
+ 'IUP::GetColor' => 'html/en/dlg/iupgetcolor.html',
+ 'IUP::GetFile' => 'html/en/dlg/iupgetfile.html',
+ 'IUP::GetParam' => 'html/en/dlg/iupgetparam.html',
+ 'IUP::GetText' => 'html/en/dlg/iupgettext.html',
+ 'IUP::ListDialog' => 'html/en/dlg/iuplistdialog.html',
+ 'IUP::Message' => 'html/en/dlg/iupmessage.html',
+ 'IUP::MessageDlg' => 'html/en/dlg/iupmessagedlg.html',
+ 'IUP::Scanf' => 'html/en/dlg/iupscanf.html',
+ 'Manual::IUPproject_Download1' => 'html/en/download.html',
+ 'Manual::IUPproject_Download2' => 'html/en/download_tips.html',
+ 'Manual::IUPproject_License' => 'html/en/copyright.html',
+ 'Manual::Driver_GTK' => 'html/en/drv/gtk.html',
+ 'Manual::Driver_Motif' => 'html/en/drv/motif.html',
+ 'Manual::Driver_Win32' => 'html/en/drv/win32.html',
+ 'IUP::Button' => 'html/en/elem/iupbutton.html',
+ 'IUP::Canvas' => 'html/en/elem/iupcanvas.html',
+ 'IUP::Cbox' => 'html/en/elem/iupcbox.html',
+ 'IUP::Clipboard' => 'html/en/elem/iupclipboard.html',
+ 'IUP::Fill' => 'html/en/elem/iupfill.html',
+ 'IUP::Frame' => 'html/en/elem/iupframe.html',
+ 'IUP::Hbox' => 'html/en/elem/iuphbox.html',
+ 'IUP::Image' => 'html/en/elem/iupimage.html',
+ 'IUP::Item' => 'html/en/elem/iupitem.html',
+ 'IUP::Label' => 'html/en/elem/iuplabel.html',
+ 'IUP::List' => 'html/en/elem/iuplist.html',
+ 'IUP::Menu' => 'html/en/elem/iupmenu.html',
+ 'IUP::MultiLine' => 'html/en/elem/iupmultiline.html',
+ 'IUP::Normalizer' => 'html/en/elem/iupnormalizer.html',
+ 'IUP::ProgressBar' => 'html/en/elem/iupprogressbar.html',
+ 'IUP::Radio' => 'html/en/elem/iupradio.html',
+ 'IUP::Sbox' => 'html/en/elem/iupsbox.html',
+ 'IUP::Separator' => 'html/en/elem/iupseparator.html',
+ 'IUP::Spin' => 'html/en/elem/iupspin.html',
+ 'IUP::Split' => 'html/en/elem/iupsplit.html',
+ 'IUP::Submenu' => 'html/en/elem/iupsubmenu.html',
+ 'IUP::Tabs' => 'html/en/elem/iuptabs.html',
+ 'IUP::Text' => 'html/en/elem/iuptext.html',
+ 'IUP::Timer' => 'html/en/elem/iuptimer.html',
+ 'IUP::Toggle' => 'html/en/elem/iuptoggle.html',
+ 'IUP::Tree_00main' => 'html/en/elem/iuptree.html',
+ 'IUP::Tree_A' => 'html/en/elem/iuptree_attrib.html',
+ 'IUP::Tree_C' => 'html/en/elem/iuptree_cb.html',
+ 'IUP::User' => 'html/en/elem/iupuser.html',
+ 'IUP::Val' => 'html/en/elem/iupval.html',
+ 'IUP::Vbox' => 'html/en/elem/iupvbox.html',
+ 'IUP::Zbox' => 'html/en/elem/iupzbox.html',
+ 'Func::Append' => 'html/en/func/iupappend.html',
+ 'Func::Close' => 'html/en/func/iupclose.html',
+ 'Func::ConvertXYToPos' => 'html/en/func/iupconvertxytopos.html',
+ 'Func::Create' => 'html/en/func/iupcreate.html',
+ 'Func::Destroy' => 'html/en/func/iupdestroy.html',
+ 'Func::Detach' => 'html/en/func/iupdetach.html',
+ 'Func::ExitLoop' => 'html/en/func/iupexitloop.html',
+ 'Func::Flush' => 'html/en/func/iupflush.html',
+ 'Func::GetActionName' => 'html/en/func/iupgetactionname.html',
+ 'Func::GetAllAttributes' => 'html/en/func/iupgetallattributes.html',
+ 'Func::GetAllDialogs' => 'html/en/func/iupgetalldialogs.html',
+ 'Func::GetAllNames' => 'html/en/func/iupgetallnames.html',
+ 'Func::GetAttribute' => 'html/en/func/iupgetattribute.html',
+ 'Func::GetAttributeHandle' => 'html/en/func/iupgetattributehandle.html',
+ 'Func::GetAttributes' => 'html/en/func/iupgetattributes.html',
+ 'Func::GetBrother' => 'html/en/func/iupgetbrother.html',
+ 'Func::GetCallback' => 'html/en/func/iupgetcallback.html',
+ 'Func::GetChild' => 'html/en/func/iupgetchild.html',
+ 'Func::GetChildCount' => 'html/en/func/iupgetchildcount.html',
+ 'Func::GetChildPos' => 'html/en/func/iupgetchildpos.html',
+ 'Func::GetClassAttributes' => 'html/en/func/iupgetclassattributes.html',
+ 'Func::GetClassName' => 'html/en/func/iupgetclassname.html',
+ 'Func::GetClassType' => 'html/en/func/iupgetclasstype.html',
+ 'Func::GetDialog' => 'html/en/func/iupgetdialog.html',
+ 'Func::GetDialogChild' => 'html/en/func/iupgetdialogchild.html',
+ 'Func::GetFloat' => 'html/en/func/iupgetfloat.html',
+ 'Func::GetFocus' => 'html/en/func/iupgetfocus.html',
+ 'Func::GetFunction' => 'html/en/func/iupgetfunction.html',
+ 'Func::GetGlobal' => 'html/en/func/iupgetglobal.html',
+ 'Func::GetHandle' => 'html/en/func/iupgethandle.html',
+ 'Func::GetInt' => 'html/en/func/iupgetint.html',
+ 'Func::GetLanguage' => 'html/en/func/iupgetlanguage.html',
+ 'Func::GetName' => 'html/en/func/iupgetname.html',
+ 'Func::GetNextChild' => 'html/en/func/iupgetnextchild.html',
+ 'Func::GetParent' => 'html/en/func/iupgetparent.html',
+ 'Func::Help' => 'html/en/func/iuphelp.html',
+ 'Func::Hide' => 'html/en/func/iuphide.html',
+ 'Func::Insert' => 'html/en/func/iupinsert.html',
+ 'Func::Load' => 'html/en/func/iupload.html',
+ 'Func::LoopStep' => 'html/en/func/iuploopstep.html',
+ 'xiupluaopen' => 'html/en/func/iuplua_open.html',
+ 'Func::MainLoop' => 'html/en/func/iupmainloop.html',
+ 'Func::MainLoopLevel' => 'html/en/func/iupmainlooplevel.html',
+ 'Func::Map' => 'html/en/func/iupmap.html',
+ 'Func::MapFont' => 'html/en/func/iupmapfont.html',
+ 'Func::NextField' => 'html/en/func/iupnextfield.html',
+ 'Func::Open' => 'html/en/func/iupopen.html',
+ 'Func::Popup' => 'html/en/func/iuppopup.html',
+ 'Func::PreviousField' => 'html/en/func/iuppreviousfield.html',
+ 'Func::Redraw' => 'html/en/func/iupredraw.html',
+ 'Func::Refresh' => 'html/en/func/iuprefresh.html',
+ 'Func::Append' => 'html/en/func/iupreparent.html',
+ 'Func::ResetAttribute' => 'html/en/func/iupresetattribute.html',
+ 'Func::SaveClassAttributes' => 'html/en/func/iupsaveclassattributes.html',
+ 'Func::SaveImageAsText' => 'html/en/func/iupsaveimageastext.html',
+ 'Func::SetAttributes' => 'html/en/func/iupsetatt.html',
+ 'Func::SetAttribute' => 'html/en/func/iupsetattribute.html',
+ 'Func::SetAttributeHandle' => 'html/en/func/iupsetattributehandle.html',
+ 'Func::SetAttributes' => 'html/en/func/iupsetattributes.html',
+ 'Func::SetCallback' => 'html/en/func/iupsetcallback.html',
+ 'Func::SetCallbacks' => 'html/en/func/iupsetcallbacks.html',
+ 'Func::SetClassDefaultAttribute' => 'html/en/func/iupsetclassdefaultattribute.html',
+ 'Func::SetfAttribute' => 'html/en/func/iupsetfattribute.html',
+ 'Func::SetFocus' => 'html/en/func/iupsetfocus.html',
+ 'Func::SetFunction' => 'html/en/func/iupsetfunction.html',
+ 'Func::SetGlobal' => 'html/en/func/iupsetglobal.html',
+ 'Func::SetHandle' => 'html/en/func/iupsethandle.html',
+ 'Func::SetLanguage' => 'html/en/func/iupsetlanguage.html',
+ 'Func::Show' => 'html/en/func/iupshow.html',
+ 'Func::ShowXY' => 'html/en/func/iupshowxy.html',
+ 'Func::StoreAttribute' => 'html/en/func/iupstoreattribute.html',
+ 'Func::StoreGlobal' => 'html/en/func/iupstoreglobal.html',
+ 'Func::Unmap' => 'html/en/func/iupunmap.html',
+ 'Func::UnMapFont' => 'html/en/func/iupunmapfont.html',
+ 'Func::Update' => 'html/en/func/iupupdate.html',
+ 'Func::Version' => 'html/en/func/iupversion.html',
+ 'Manual::Gallery_StandardControls' => 'html/en/gallery.html',
+ 'Manual::Gallery_AdditionalControls' => 'html/en/gallery_ctrl.html',
+ 'Manual::Gallery_PreDefinedDialogs' => 'html/en/gallery_dlg.html',
+ 'xGuide' => 'html/en/guide.html',
+ 'xIUP' => 'html/en/home.html',
+ 'xAdditionalControls' => 'html/en/iupcontrols.html',
+ 'IUP-IM' => 'html/en/iupim.html',
+ 'IUP::ImageLib' => 'html/en/iupimglib.html',
+ 'IUP::ImageLib' => 'html/en/iupimglib2.html',
+ 'xLuaAdvancedGuide1' => 'html/en/iuplua.html',
+ 'xLuaAdvancedGuide2' => 'html/en/iuplua_adv.html',
+ 'xKeyboard' => 'html/en/keyboard.html',
+ 'xLayoutComposition' => 'html/en/layout.html',
+ 'xLayoutGuide' => 'html/en/layout_guide.html',
+ 'xOverview' => 'html/en/prod.html',
+ 'xResources' => 'html/en/resources.html',
+ 'xOtherToolkits' => 'html/en/toolkits.html',
+};
+
+foreach my $n (keys %$html_files) {
+ my $f = $docroot . '/' . $html_files->{$n};
+ die "File $f not exists" unless -f $f;
+
+ my $html = read_file($f);
+ # HTML replacements here
+ $html =~ s|href="|href="pod:|gi;
+
+ my $tree = HTML::TreeBuilder->new_from_content($html);
+
+ my $t = $tree->find('title');
+ (my $class = $t->as_text) =~ s/^Iup/IUP::/;
+ my $b = $tree->find('body');
+
+ ($t) = $tree->look_down( '_tag' => 'div', 'id' => 'navigation');
+ $t->delete() if defined $t;
+
+ my $pod = Pod::HTML2Pod::convert(
+ 'content' => $b->as_HTML,
+ 'a_href' => 1, # try converting links
+ 'a_name' => 1,
+ );
+
+ my $name = $n;
+ $name =~ s|::|/|g;
+ $name = "$podroot/$name.pod";
+ $name =~ s|\\|/|g;
+
+ my $dir = $name;
+ $dir =~ s|[^/]*$||;
+ make_path($dir);
+
+ # POD replacements here
+ $pod =~ s|X<SeeAlso>||g;
+ $pod =~ s|=head1 [Ii]up(.*)|=head1 NAME_xxx\n\nIUP::$1 - xxx_short_info_xxx\n\n=head1 DESCRIPTION_xxx|g;
+ $pod =~ s|=head2 Creation|=head1 USAGE\n\n=head2 Creation_xxx|g;
+ $pod =~ s|=head2 Callbacks|=head2 Callbacks_xxx|g;
+ $pod =~ s|=head2 Attributes|=head2 Attributes_xxx|g;
+ $pod =~ s|=head2 Notes|=head2 Notes_xxx|g;
+ $pod =~ s|=head2 Examples|=head1 EXAMPLES_xxx|g;
+ $pod =~ s|=head2 See Also|=head1 SEE ALSO_xxx|g;
+ if ($pod =~ /=head2 Attributes_xxx(.*?)=head/s ) {
+ my $c = $1;
+ $c =~ s|\n([LB]<[^ :]*)[ :]*|\n=item * $1\n\n|g;
+ #$c =~ s|): *([^\n])|):\n\n$1|g;
+ $pod =~ s|=head2 Attributes_xxx(.*?)=head|=head2 Attributes_xxx\n\nAttr intro text_xxx\n\n=over$c=back\n\n=head|sg;
+ $pod =~ s|=over\n\n----\n\n=back|=back\n\nCommon attributes_xxx:\n\n=over|;
+ }
+
+ print STDERR "Writting '$name' ...\n";
+
+ open DAT, ">", $name;
+ print DAT $pod;
+ close DAT;
+}
+
+
+my $batchconv = Pod::Simple::HTMLBatch->new;
+#$batchconv->some_option( some_value );
+#$batchconv->some_other_option( some_other_value );
+$batchconv->batch_convert($podroot, $htmlout);
+
View
9 doc/Button.pod
@@ -0,0 +1,9 @@
+=pod
+
+=head1 NAME
+
+IUP::Button - Demo POD
+
+=head1 ToDo
+
+=cut
View
530 lib/IUP.pm
@@ -0,0 +1,530 @@
+package IUP;
+
+use strict;
+use warnings;
+
+use Carp;
+use IUP::Internal::LibraryIUP;
+use IUP::Internal::Callback;
+
+# the following modules will be autoimported by calling 'use IUP;'
+use IUP::Button;
+use IUP::Canvas;
+use IUP::Cbox;
+use IUP::Cells;
+use IUP::Clipboard;
+use IUP::ColorBar;
+use IUP::ColorBrowser;
+use IUP::ColorDlg;
+use IUP::Constants;
+use IUP::Dial;
+use IUP::Dialog; # required by IUP.pm (GetParam)
+use IUP::FileDlg;
+use IUP::Fill;
+use IUP::FontDlg;
+use IUP::Frame;
+use IUP::GLCanvas;
+use IUP::Hbox;
+use IUP::Image;
+use IUP::ImageRGB;
+use IUP::ImageRGBA;
+use IUP::Item;
+use IUP::Label;
+use IUP::List;
+use IUP::Matrix;
+use IUP::Menu;
+use IUP::MessageDlg;
+use IUP::MultiLine;
+use IUP::Normalizer;
+use IUP::OleControl;
+use IUP::PPlot;
+use IUP::ProgressBar;
+use IUP::Radio;
+use IUP::Sbox;
+use IUP::Separator;
+use IUP::Spin;
+use IUP::Spinbox;
+use IUP::Split;
+use IUP::Submenu;
+use IUP::Tabs;
+use IUP::Text;
+use IUP::Timer;
+use IUP::Toggle;
+use IUP::Tree;
+use IUP::User;
+use IUP::Val;
+use IUP::Vbox;
+use IUP::Zbox;
+
+sub import {
+ IUP::Constants->import(caller); #kind of a hack - see IUP/Constants.pm
+
+ IUP::Button->import();
+ IUP::Canvas->import();
+ IUP::Cbox->import();
+ IUP::Cells->import();
+ IUP::Clipboard->import();
+ IUP::ColorBar->import();
+ IUP::ColorBrowser->import();
+ IUP::ColorDlg->import();
+ IUP::Dial->import();
+ IUP::Dialog->import();
+ IUP::FileDlg->import();
+ IUP::Fill->import();
+ IUP::FontDlg->import();
+ IUP::Frame->import();
+ IUP::GLCanvas->import();
+ IUP::Hbox->import();
+ IUP::Image->import();
+ IUP::ImageRGB->import();
+ IUP::ImageRGBA->import();
+ IUP::Item->import();
+ IUP::Label->import();
+ IUP::List->import();
+ IUP::Matrix->import();
+ IUP::Menu->import();
+ IUP::MessageDlg->import();
+ IUP::Multiline->import();
+ IUP::Normalizer->import();
+ IUP::OleControl->import();
+ IUP::PPlot->import();
+ IUP::ProgressBar->import();
+ IUP::Radio->import();
+ IUP::Sbox->import();
+ IUP::Separator->import();
+ IUP::Spin->import();
+ IUP::Spinbox->import();
+ IUP::Split->import();
+ IUP::Submenu->import();
+ IUP::Tabs->import();
+ IUP::Text->import();
+ IUP::Timer->import();
+ IUP::Toggle->import();
+ IUP::Tree->import();
+ IUP::User->import();
+ IUP::Val->import();
+ IUP::Vbox->import();
+ IUP::Zbox->import();
+};
+
+our $VERSION = 'v0.0.0_1';
+
+use Data::Dumper;
+
+### the main IUP control functions
+
+sub MainLoop {
+ #int IupMainLoop(void); [in C]
+ #iup.MainLoop() -> ret: number [in Lua]
+ return IUP::Internal::LibraryIUP::_IupMainLoop();
+}
+
+sub MainLoopLevel {
+ #int IupMainLoopLevel(void); [in C]
+ #iup.MainLoopLevel() -> ret: number [in Lua]
+ return IUP::Internal::LibraryIUP::_IupMainLoopLevel();
+}
+
+sub LoopStep {
+ #int IupLoopStep(void); [in C]
+ #iup.LoopStep() -> ret: number [in Lua]
+ return IUP::Internal::LibraryIUP::_IupLoopStep();
+}
+
+sub LoopStepWait {
+ #int IupLoopStepWait(void); [in C]
+ #iup.LoopStepWait() -> ret: number [in Lua]
+ return IUP::Internal::LibraryIUP::_IupLoopStepWait();
+}
+
+sub ExitLoop {
+ #void IupExitLoop(void); [in C]
+ #iup.ExitLoop() [in Lua]
+ IUP::Internal::LibraryIUP::_IupExitLoop();
+}
+
+sub Flush {
+ #void IupFlush(void); [in C]
+ #iup.Flush() [in Lua]
+ IUP::Internal::LibraryIUP::_IupFlush();
+}
+
+### helper functions
+
+sub Close {
+ #void IupClose(void); [in C]
+ #iup.Close() [in Lua]
+ IUP::Internal::LibraryIUP::_IupClose();
+}
+
+sub GetAllDialogs {
+ #int IupGetAllDialogs(char** names, int max_n); [in C]
+ #iup.GetAllDialogs(max_n: number) -> (names: table, n: number) [in Lua]
+ my ($pkg, $max_n) = @_;
+ IUP::Internal::LibraryIUP::_IupGetAllDialogs($max_n);
+}
+
+sub GetAllNames {
+ #int IupGetAllNames(char** names, int max_n); [in C]
+ #iup.GetAllNames(max_n: number) -> (names: table, n: number) [in Lua]
+ my ($pkg, $max_n) = @_;
+ IUP::Internal::LibraryIUP::_IupGetAllNames($max_n);
+}
+
+sub GetFocus {
+ #Ihandle* IupGetFocus(void); [in C]
+ #iup.GetFocus() -> elem: ihandle [in Lua]
+ my $ih = IUP::Internal::LibraryIUP::_IupGetFocus();
+ return IUP->GetOrCreateByIhandle($ih);
+}
+
+sub GetClassName {
+ #char* IupGetClassName(Ihandle* ih); [in C]
+ #iup.GetClassName(ih: ihandle) -> (name: string) [in Lua]
+ my ($pkg, $ih) = @_;
+ return IUP::Internal::LibraryIUP::_IupGetClassName($ih);
+}
+
+sub GetByName {
+ return GetHandle(@_);
+}
+
+sub GetHandle {
+ #Ihandle *IupGetHandle(const char *name); [in C]
+ #iup.GetHandle(name: string) -> ih: ihandle [in Lua]
+ my ($pkg, $name) = @_;
+ my $ih = IUP::Internal::LibraryIUP::_IupGetHandle($name);
+ return IUP->GetOrCreateByIhandle($ih);
+}
+
+sub GetByIhandle {
+ my ($pkg, $ih) = @_;
+ return IUP::Internal::Callback::_translate_ih($ih) if defined $ih;
+ return; #undef
+}
+
+sub GetOrCreateByIhandle {
+ my ($pkg, $ih) = @_;
+ my $mapping = {
+ button => "IUP::Button",
+ canvas => "IUP::Canvas",
+ cbox => "IUP::Cbox",
+ cells => "IUP::Cells",
+ clipboard => "IUP::Clipboard",
+ colorbar => "IUP::ColorBar",
+ colorbrowser => "IUP::ColorBrowser",
+ colordlg => "IUP::ColorDlg",
+ constants => "IUP::Constants",
+ dial => "IUP::Dial",
+ dialog => "IUP::Dialog",
+ filedlg => "IUP::FileDlg",
+ fill => "IUP::Fill",
+ fontdlg => "IUP::FontDlg",
+ frame => "IUP::Frame",
+ glcanvas => "IUP::GLCanvas",
+ hbox => "IUP::Hbox",
+ image => "IUP::Image",
+ imagergb => "IUP::ImageRGB",
+ imagergba => "IUP::ImageRGBA",
+ item => "IUP::Item",
+ label => "IUP::Label",
+ list => "IUP::List",
+ matrix => "IUP::Matrix",
+ menu => "IUP::Menu",
+ messagedlg => "IUP::MessageDlg",
+ multiline => "IUP::MultiLine",
+ normalizer => "IUP::Normalizer",
+ olecontrol => "IUP::OleControl",
+ pplot => "IUP::PPlot",
+ progressbar => "IUP::ProgressBar",
+ radio => "IUP::Radio",
+ sbox => "IUP::Sbox",
+ separator => "IUP::Separator",
+ spin => "IUP::Spin",
+ spinbox => "IUP::Spinbox",
+ split => "IUP::Split",
+ submenu => "IUP::Submenu",
+ tabs => "IUP::Tabs",
+ text => "IUP::Text",
+ timer => "IUP::Timer",
+ toggle => "IUP::Toggle",
+ tree => "IUP::Tree",
+ user => "IUP::User",
+ val => "IUP::Val",
+ vbox => "IUP::Vbox",
+ zbox => "IUP::Zbox",
+ };
+ return unless $ih;
+ my $e = IUP::Internal::Callback::_translate_ih($ih);
+ return $e if defined $e;
+ my $c = IUP->GetClassName($ih);
+ return unless $c;
+ my $p = $mapping->{$c};
+ return unless $p;
+ return $p->new_from_ihandle($ih);
+}
+
+sub Help {
+ #int IupHelp(const char* url); [in C]
+ #iup.Help(url: string) [in Lua]
+ my ($pkg, $url) = @_;
+ return IUP::Internal::LibraryIUP::_IupHelp($url);
+}
+
+sub Load {
+ #char *IupLoad(const char *filename); [in C]
+ #iup.Load(filename: string) -> error: string [in Lua]
+ my ($pkg, $filename) = @_;
+ return IUP::Internal::LibraryIUP::_IupLoad($filename);
+}
+
+sub LoadBuffer {
+ # xxx TODO maybe integrate into one Load() or accept also filehandle
+ #char *IupLoadBuffer(const char *buffer); [in C] (since 3.0)
+ #iup.LoadBuffer(buffer: string) -> error: string [in Lua]
+ my ($pkg, $buffer) = @_;
+ return IUP::Internal::LibraryIUP::_IupLoadBuffer($buffer);
+}
+
+sub GetClassAttributes {
+ #int IupGetClassAttributes(const char* classname, char** names, int max_n); [in C]
+ #iup.GetClassAttributes(classname: string, max_n: number) -> (names: table, n: number) [in Lua]
+ my ($pkg, $classname, $max_n) = @_;
+ return IUP::Internal::LibraryIUP::_IupGetClassAttributes($classname, $max_n);
+}
+
+sub SetClassDefaultAttribute {
+ #void IupSetClassDefaultAttribute(const char* classname, const char *name, const char *value); [in C]
+ #iup.SetClassDefaultAttribute(classname, name, value: string) [in Lua]
+ my ($pkg, $classname, $name, $value) = @_;
+ IUP::Internal::LibraryIUP::_IupSetClassDefaultAttribute($classname, $name, $value);
+}
+
+sub GetGlobal {
+ #char *IupGetGlobal(const char *name); [in C]
+ #iup.GetGlobal(name: string) -> value: string [in Lua]
+ my ($pkg, $name) = @_;
+ return IUP::Internal::LibraryIUP::_IupGetGlobal($name);
+}
+
+sub SetGlobal {
+ #void IupSetGlobal(const char *name, const char *value); [in C]
+ #iup.SetGlobal(name: string, value: string) [in Lua]
+ my ($pkg, $name, $value) = @_;
+ #IUP::Internal::LibraryIUP::_IupSetGlobal($name, $value); # xxx TODO SetGlobal vs. StoreGlobal xxx
+ IUP::Internal::LibraryIUP::_IupStoreGlobal($name, $value);
+}
+
+sub StoreGlobal {
+ #void IupStoreGlobal(const char *name, const char *value); [in C]
+ #iup.StoreGlobal(name: string, value: string) [in Lua]
+ my ($pkg, $name, $value) = @_;
+ IUP::Internal::LibraryIUP::_IupStoreGlobal($name, $value);
+}
+
+sub GetLanguage {
+ #char* IupGetLanguage(void); [in C]
+ #iup.GetLanguage() -> (language: string) [in Lua]
+ return IUP::Internal::LibraryIUP::_IupGetLanguage();
+}
+
+sub SetLanguage {
+ #void IupSetLanguage(const char *lng); [in C]
+ #iup.SetLanguage(lng: string) [in Lua]
+ my ($pkg, $lng) = @_;
+ IUP::Internal::LibraryIUP::_IupSetLanguage($lng);
+}
+
+sub MapFont {
+ #char* IupMapFont(const char *iupfont); [in C]
+ #iup.MapFont(iupfont : string) -> (driverfont : string) [in Lua]
+ my ($pkg, $iupfont) = @_;
+ return IUP::Internal::LibraryIUP::_IupMapFont($iupfont);
+}
+
+sub UnMapFont {
+ #char* IupUnMapFont(const char *driverfont); [in C]
+ #iup.UnMapFont(driverfont :string) -> (iupfont : string) [in Lua]
+ my ($pkg, $driverfont) = @_;
+ IUP::Internal::LibraryIUP::_IupUnMapFont($driverfont);
+}
+
+sub Version {
+ #char* IupVersion(void); [in C]
+ #iup.Version() -> (version: string) [in Lua]
+ return IUP::Internal::LibraryIUP::_IupVersion();
+}
+
+sub VersionNumber {
+ #int IupVersionNumber(void); [in C]
+ #iup.VersionNumber() -> (version: number) [in Lua]
+ return IUP::Internal::LibraryIUP::_IupVersionNumber();
+}
+
+### simple dialogues
+
+sub GetColor {
+ my ($pkg, $x, $y, $r, $g, $b) = @_;
+ # returns array: ($retval, $new_r, $new_g, $new_b)
+ return IUP::Internal::LibraryIUP::_IupGetColor($x, $y, $r, $g, $b);
+}
+
+sub GetFile {
+ my ($pkg, $filename_filter) = @_;
+ # returns array: ($retval, $filename)
+ return IUP::Internal::LibraryIUP::_IupGetFile($filename_filter);
+}
+
+sub GetParam {
+ #int IupGetParam(const char* title, Iparamcb action, void* user_data, const char* format,...); [in C]
+ #iup.GetParam(title: string, action: function, format: string,...) -> (status: boolean, ...) [in Lua]
+ my ($pkg, $title, $action, $format, @initial_values) = @_;
+ my $dlg = IUP::Dialog->new_no_ihandle();
+ # we do not have ihandle of the new dialog at this point
+ # we are gonna set ihandle doring the first callback invocation (see XS code)
+ my ($status, @output_values) = IUP::Internal::LibraryIUP::_IupGetParam($title, $action, $dlg, $format, @initial_values);
+ return ($status, @output_values);
+}
+
+sub ListDialog {
+ #int IupListDialog(int type, const char *title, int size, const char** list, int op, int max_col, int max_lin, int* marks); [in C]
+ #iup.ListDialog(type: number, title: string, size: number, list: table of strings, op: number, max_col: number, max_lin: number, marks: table of numbers) -> status: number [in Lua]
+ my ($pkg, $type, $title, $list, $op, $max_col, $max_lin, $marks) = @_;
+ # perl function does not require 'size' param which is calculater from the size of 'list' array
+ return IUP::Internal::LibraryIUP::_IupListDialog($type, $title, $list, $op, $max_col, $max_lin, $marks);
+}
+
+sub GetText {
+ my $pkg = shift;
+ if (scalar @_ == 1) {
+ return IUP::Internal::LibraryIUP::_IupGetText('', $_[0]);
+ }
+ elsif (scalar @_ == 2) {
+ return IUP::Internal::LibraryIUP::_IupGetText($_[0], $_[1]);
+ }
+ carp('Warning: wrong params - IUP->GetText($title, $msg)');
+ return;
+}
+
+sub Alarm {
+ my ($pkg, $t, $m, $b1, $b2, $b3) = @_;
+ return IUP::Internal::LibraryIUP::_IupAlarm($t, $m, $b1, $b2, $b3);
+}
+
+sub Message {
+ my $pkg = shift;
+ if (scalar @_ == 1) {
+ return IUP::Internal::LibraryIUP::_IupMessage('', $_[0]);
+ }
+ elsif (scalar @_ == 2) {
+ return IUP::Internal::LibraryIUP::_IupMessage($_[0], $_[1]);
+ }
+ carp('Warning: wrong params - IUP->Message($title, $msg)');
+ return;
+}
+
+###
+
+=head1 NAME
+
+IUP - The great new IUP!
+
+=head1 VERSION
+
+Version 0.0.0_1
+
+=head1 SYNOPSIS
+
+Quick summary of what the module does.
+
+Perhaps a little code snippet.
+
+ use IUP;
+
+ my $foo = IUP->new();
+ ...
+
+=head1 EXPORT
+
+A list of functions that can be exported. You can delete this section
+if you don't export anything, such as for a purely object-oriented module.
+
+=head1 SUBROUTINES/METHODS
+
+=head2 function1
+
+=head2 function2
+
+=head1 AUTHOR
+
+KMX, C<< <kmx at cpan.org> >>
+
+=head1 BUGS
+
+Please report any bugs or feature requests to C<bug-iup at rt.cpan.org>, or through
+the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=IUP>. I will be notified, and then you'll
+automatically be notified of progress on your bug as I make changes.
+
+=head1 SUPPORT
+
+You can find documentation for this module with the perldoc command.
+
+ perldoc IUP
+
+You can also look for information at:
+
+=over 4
+
+=item * RT: CPAN's request tracker
+
+L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=IUP>
+
+=item * AnnoCPAN: Annotated CPAN documentation
+
+L<http://annocpan.org/dist/IUP>
+
+=item * CPAN Ratings
+
+L<http://cpanratings.perl.org/d/IUP>
+
+=item * Search CPAN
+
+L<http://search.cpan.org/dist/IUP/>
+
+=back
+
+=head1 ACKNOWLEDGEMENTS
+
+xxx
+
+=head1 LICENSE AND COPYRIGHT
+
+Copyright 2010 KMX.
+
+This program is distributed under the MIT (X11) License:
+L<http://www.opensource.org/licenses/mit-license.php>
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+=cut
+
+1; # End of IUP
View
16 lib/IUP/Button.pm
@@ -0,0 +1,16 @@
+#!/usr/bin/env perl
+
+package IUP::Button;
+use strict;
+use warnings;
+use base 'IUP::Internal::Element';
+use IUP::Internal::LibraryIUP;
+
+sub _create_element {
+ my ($self, $args) = @_;
+ my $ih = IUP::Internal::LibraryIUP::_IupButton($args->{TITLE}, 0); # xxx TODO fix '0'
+ delete $args->{TITLE};
+ return $ih;
+}
+
+1;
View
39 lib/IUP/Canvas.pm
@@ -0,0 +1,39 @@
+#!/usr/bin/env perl
+
+package IUP::Canvas;
+use strict;
+use warnings;
+use base 'IUP::Internal::Element';
+use IUP::Internal::LibraryIUP;
+#use IUP::Internal::LibraryCD;
+
+sub _create_element {
+ my($self, $args) = @_;
+ my $ih = IUP::Internal::LibraryIUP::_IupCanvas(0); #xxx TODO fix '0'
+ #my $cnvh = IUP::Internal::LibraryIUP::_cdCreateCanvas(CD_IUP, $ih);
+ return $ih;
+}
+
+sub Box {
+ my($self, $x1, $y1, $x2, $y2) = @_;
+ #return IUP::Internal::LibraryCD::_cdCanvasBox($self->cvnhandle, $x1, $x2, $y1, $y2);
+}
+
+#cdCanvasBegin(canvas, CD_PATH);
+#cdCanvasPathSet(canvas, CD_PATH_MOVETO);
+#cdCanvasVertex(canvas, x1, y1);
+#cdCanvasEnd(canvas);
+
+#void cdCanvasText(cdCanvas* canvas, int x, int y, const char* text); [in C]
+#void cdCanvasFont(cdCanvas* canvas, const char* typeface, int style, int size); [in C]
+
+#void cdCanvasLine(cdCanvas* canvas, int x1, int y1, int x2, int y2); [in C]
+#void cdCanvasRect(cdCanvas* canvas, int xmin, int xmax, int ymin, int ymax); [in C]
+#void cdCanvasArc(cdCanvas* canvas, int xc, int yc, int w, int h, double angle1, double angle2); [in C]
+#int cdCanvasLineStyle(cdCanvas* canvas, int style); [in C]
+#void cdCanvasLineStyleDashes(cdCanvas* canvas, const int* dashes, int count); [in C]
+#int cdCanvasLineWidth(cdCanvas* canvas, int width); [in C]
+#int cdCanvasLineJoin(cdCanvas* canvas, int style); [in C]
+#int cdCanvasLineCap(cdCanvas* canvas, int style); [in C]
+
+1;
View
36 lib/IUP/Cbox.pm
@@ -0,0 +1,36 @@
+#!/usr/bin/env perl
+
+package IUP::Cbox;
+use strict;
+use warnings;
+use base 'IUP::Internal::Element';
+use IUP::Internal::LibraryIUP;
+
+sub _create_element {
+ my ($self, $args, $firstonly) = @_;
+ my $ih;
+ if (defined $firstonly) {
+ if (ref($firstonly) eq 'ARRAY') {
+ $ih = IUP::Internal::LibraryIUP::_IupCbox(@$firstonly);
+ }
+ else {
+ $ih = IUP::Internal::LibraryIUP::_IupCbox($firstonly);
+ }
+ }
+ elsif (defined $args && defined $args->{child}) {
+ if (ref($args->{child}) eq 'ARRAY') {
+ my @list = map ($_->ihandle, @{$args->{child}});
+ $ih = IUP::Internal::LibraryIUP::_IupCbox(@list);
+ }
+ else {
+ $ih = IUP::Internal::LibraryIUP::_IupCbox($args->{child}->ihandle);
+ }
+ delete $args->{child};
+ }
+ else {
+ $ih = IUP::Internal::LibraryIUP::_IupCbox();
+ }
+ return $ih;
+}
+
+1;
View
18 lib/IUP/Cells.pm
@@ -0,0 +1,18 @@
+#!/usr/bin/env perl
+
+package IUP::Cells;
+use strict;
+use warnings;
+use base 'IUP::Internal::Element';
+use IUP::Internal::LibraryIUP;
+
+sub _create_element {
+ my($self, $args) = @_;
+ my $ih = IUP::Internal::LibraryIUP::_IupCells();
+ return $ih;
+}
+
+#Note:
+# LIMITSL:C - does not have an accessor
+
+1;
View
14 lib/IUP/Clipboard.pm
@@ -0,0 +1,14 @@
+#!/usr/bin/env perl
+
+package IUP::Clipboard;
+use strict;
+use warnings;
+use base 'IUP::Internal::Element';
+use IUP::Internal::LibraryIUP;
+
+sub _create_element {
+ my($self, $args) = @_;
+ return IUP::Internal::LibraryIUP::_IupClipboard();
+}
+
+1;
View
17 lib/IUP/ColorBrowser.pm
@@ -0,0 +1,17 @@
+#!/usr/bin/env perl
+
+package IUP::ColorBrowser;
+use strict;
+use warnings;
+use base 'IUP::Internal::Element';
+use IUP::Internal::LibraryIUP;
+
+sub _create_element {
+ my($self, $args) = @_;
+ my $ih = IUP::Internal::LibraryIUP::_IupColorBrowser(); # xxx TODO not in XS yet
+ return $ih;
+ warn "xxx TODO not in XS yet!";
+ return undef;
+}
+
+1;
View
14 lib/IUP/ColorDlg.pm
@@ -0,0 +1,14 @@
+#!/usr/bin/env perl
+
+package IUP::ColorDlg;
+use strict;
+use warnings;
+use base 'IUP::Internal::Element';
+use IUP::Internal::LibraryIUP;
+
+sub _create_element {
+ my($self, $args) = @_;
+ return IUP::Internal::LibraryIUP::_IupColorDlg();
+}
+
+1;
View
15 lib/IUP/Colorbar.pm
@@ -0,0 +1,15 @@
+#!/usr/bin/env perl
+
+package IUP::ColorBar;
+use strict;
+use warnings;
+use base 'IUP::Internal::Element';
+use IUP::Internal::LibraryIUP;
+
+sub _create_element {
+ my($self, $args) = @_;
+ my $ih = IUP::Internal::LibraryIUP::_IupColorbar();
+ return $ih;
+}
+
+1;
View
71 lib/IUP/Constants.pm
@@ -0,0 +1,71 @@
+#!/usr/bin/env perl
+
+package IUP::Constants;
+use strict;
+use warnings;
+
+use base 'Exporter';
+#use vars qw(@EXPORT @EXPORT_OK %EXPORT_TAGS);
+
+our @EXPORT = qw(
+ IUP_ERROR
+ IUP_NOERROR
+ IUP_OPENED
+ IUP_INVALID
+
+ IUP_IGNORE
+ IUP_DEFAULT
+ IUP_CLOSE
+ IUP_CONTINUE
+
+ IUP_CENTER
+ IUP_LEFT
+ IUP_RIGHT
+ IUP_MOUSEPOS
+ IUP_CURRENT
+ IUP_CENTERPARENT
+ IUP_TOP
+ IUP_BOTTOM
+
+ IUP_BUTTON1
+ IUP_BUTTON2
+ IUP_BUTTON3
+ IUP_BUTTON4
+ IUP_BUTTON5
+);
+
+use constant IUP_ERROR => 1;
+use constant IUP_NOERROR => 0;
+use constant IUP_OPENED => -1;
+use constant IUP_INVALID => -1;
+
+use constant IUP_IGNORE => -1;
+use constant IUP_DEFAULT => -2;
+use constant IUP_CLOSE => -3;
+use constant IUP_CONTINUE => -4;
+
+use constant IUP_CENTER => 0xFFFF; # 65535
+use constant IUP_LEFT => 0xFFFE; # 65534
+use constant IUP_RIGHT => 0xFFFD; # 65533
+use constant IUP_MOUSEPOS => 0xFFFC; # 65532
+use constant IUP_CURRENT => 0xFFFB; # 65531
+use constant IUP_CENTERPARENT => 0xFFFA; # 65530
+use constant IUP_TOP => 0xFFFE; # = IUP_LEFT
+use constant IUP_BOTTOM => 0xFFFD; # = IUP_RIGHT
+
+use constant IUP_BUTTON1 => 1;
+use constant IUP_BUTTON2 => 2;
+use constant IUP_BUTTON3 => 3;
+use constant IUP_BUTTON4 => 4;
+use constant IUP_BUTTON5 => 5;
+
+sub import {
+ # hack: import Constants into caller's namespace
+ my ($pkg, $callpkg) = @_;
+ $callpkg ||= caller();
+ #xxx warn "USING CALLER: $callpkg";
+ no strict 'refs';
+ *{"$callpkg\::$_"} = \&{"IUP::Constants::$_"} foreach @IUP::Constants::EXPORT;
+}
+
+1;
View
16 lib/IUP/Dial.pm
@@ -0,0 +1,16 @@
+#!/usr/bin/env perl
+
+package IUP::Dial;
+use strict;
+use warnings;
+use base 'IUP::Internal::Element';
+use IUP::Internal::LibraryIUP;
+
+sub _create_element {
+ my($self, $args) = @_;
+ my $ih = IUP::Internal::LibraryIUP::_IupDial($args->{TYPE});
+ delete $args->{TYPE};
+ return $ih;
+}
+
+1;
View
22 lib/IUP/Dialog.pm
@@ -0,0 +1,22 @@
+#!/usr/bin/env perl
+
+package IUP::Dialog;
+use strict;
+use warnings;
+use base 'IUP::Internal::Element';
+use IUP::Internal::LibraryIUP;
+
+sub _create_element {
+ my($self, $args) = @_;
+ my $c = defined $args->{child} ? $args->{child}->ihandle : undef;
+ my $ih = IUP::Internal::LibraryIUP::_IupDialog($c);
+ delete $args->{child};
+ return $ih;
+}
+
+sub ShowXY {
+ my ($self, $x, $y) = @_;
+ return IUP::Internal::LibraryIUP::_IupShowXY($self->ihandle, $x, $y);
+}
+
+1;
View
14 lib/IUP/FileDlg.pm
@@ -0,0 +1,14 @@
+#!/usr/bin/env perl
+
+package IUP::FileDlg;
+use strict;
+use warnings;
+use base 'IUP::Internal::Element';
+use IUP::Internal::LibraryIUP;
+
+sub _create_element {
+ my($self, $args) = @_;
+ return IUP::Internal::LibraryIUP::_IupFileDlg();
+}
+
+1;
View
14 lib/IUP/Fill.pm
@@ -0,0 +1,14 @@
+#!/usr/bin/env perl
+
+package IUP::Fill;
+use strict;
+use warnings;
+use base 'IUP::Internal::Element';
+use IUP::Internal::LibraryIUP;
+
+sub _create_element {
+ my($self, $args) = @_;
+ return IUP::Internal::LibraryIUP::_IupFill();
+}
+
+1;
View
14 lib/IUP/FontDlg.pm
@@ -0,0 +1,14 @@
+#!/usr/bin/env perl
+
+package IUP::FontDlg;
+use strict;
+use warnings;
+use base 'IUP::Internal::Element';
+use IUP::Internal::LibraryIUP;
+
+sub _create_element {
+ my($self, $args) = @_;
+ return IUP::Internal::LibraryIUP::_IupFontDlg();
+}
+
+1;
View
25 lib/IUP/Frame.pm
@@ -0,0 +1,25 @@
+#!/usr/bin/env perl
+
+package IUP::Frame;
+use strict;
+use warnings;
+use base 'IUP::Internal::Element';
+use IUP::Internal::LibraryIUP;
+
+sub _create_element {
+ my ($self, $args, $firstonly) = @_;
+ my $ih;
+ if (defined $firstonly) {
+ $ih = IUP::Internal::LibraryIUP::_IupFrame($firstonly);
+ }
+ elsif (defined $args && defined $args->{child}) {
+ $ih = IUP::Internal::LibraryIUP::_IupFrame($args->{child}->ihandle);
+ delete $args->{child};
+ }
+ else {
+ $ih = IUP::Internal::LibraryIUP::_IupFrame(undef);
+ }
+ return $ih;
+}
+
+1;
View
45 lib/IUP/GLCanvas.pm
@@ -0,0 +1,45 @@
+#!/usr/bin/env perl
+
+package IUP::GLCanvas;
+use strict;
+use warnings;
+use base 'IUP::Internal::Element';
+use IUP::Internal::LibraryIUP;
+
+sub _create_element {
+ my($self, $args) = @_;
+ my $ih = IUP::Internal::LibraryIUP::_IupGLCanvas(0); #xxx TODO fix '0' + not in XS yet
+ return $ih;
+}
+
+sub GLMakeCurrent {
+ my $self = shift;
+ return IUP::Internal::LibraryIUP::_IupGLMakeCurrent($self->ihandle);
+}
+
+sub GLIsCurrent {
+ my $self = shift;
+ return IUP::Internal::LibraryIUP::_IupGLIsCurrent($self->ihandle);
+}
+
+sub GLSwapBuffers {
+ my $self = shift;
+ return IUP::Internal::LibraryIUP::_IupGLSwapBuffers($self->ihandle);
+}
+
+sub GLPalette {
+ my ($self, $index, $r, $g, $b) = @_;
+ return IUP::Internal::LibraryIUP::_IupGLPalette($self->ihandle, $index, $r, $g, $b);
+}
+
+sub GLUseFont {
+ my ($self, $first, $count, $list_base) = @_;
+ return IUP::Internal::LibraryIUP::_IupGLUseFont($self->ihandle, $first, $count, $list_base);
+}
+
+sub GLWait {
+ my ($self, $gl) = @_;
+ return IUP::Internal::LibraryIUP::_IupGLWait($gl);
+}
+
+1;
View
36 lib/IUP/Hbox.pm
@@ -0,0 +1,36 @@
+#!/usr/bin/env perl
+
+package IUP::Hbox;
+use strict;
+use warnings;
+use base 'IUP::Internal::Element';
+use IUP::Internal::LibraryIUP;
+
+sub _create_element {
+ my ($self, $args, $firstonly) = @_;
+ my $ih;
+ if (defined $firstonly) {
+ if (ref($firstonly) eq 'ARRAY') {
+ $ih = IUP::Internal::LibraryIUP::_IupHbox(@$firstonly);
+ }
+ else {
+ $ih = IUP::Internal::LibraryIUP::_IupHbox($firstonly);
+ }
+ }
+ elsif (defined $args && defined $args->{child}) {
+ if (ref($args->{child}) eq 'ARRAY') {
+ my @list = map ($_->ihandle, @{$args->{child}});
+ $ih = IUP::Internal::LibraryIUP::_IupHbox(@list);
+ }
+ else {
+ $ih = IUP::Internal::LibraryIUP::_IupHbox($args->{child}->ihandle);
+ }
+ delete $args->{child};
+ }
+ else {
+ $ih = IUP::Internal::LibraryIUP::_IupHbox();
+ }
+ return $ih;
+}
+
+1;
View
43 lib/IUP/Image.pm
@@ -0,0 +1,43 @@
+#!/usr/bin/env perl
+
+package IUP::Image;
+use strict;
+use warnings;
+use base 'IUP::Internal::Element';
+use IUP::Internal::LibraryIUP;
+use Carp;
+
+sub _create_element {
+ my($self, $args) = @_;
+
+ my $p = $args->{pixels};
+ my $w = $args->{width} || 0;
+ my $h = $args->{height} || 0;
+ my $size = $w * $h; # 1 byte per pixel
+ my $ih;
+
+ if ($size == 0) {
+ carp "Warning: zero or undefined image size (check 'width' and 'height')";
+ }
+ elsif (defined $p) {
+ $p = pack('C*', @$p) if ref($p) eq 'ARRAY';
+ my $l = length($p);
+ if ($l == $size) {
+ $ih = IUP::Internal::LibraryIUP::_IupImage($w, $h, $p);
+ }
+ else {
+ carp "Warning: invalid image data size: $l, expected: $size";
+ }
+ }
+ else {
+ carp "Warning: no image data (check 'pixels')";
+ }
+
+ delete $args->{pixels};
+ delete $args->{width};
+ delete $args->{height};
+
+ return $ih;
+}
+
+1;
View
43 lib/IUP/ImageRGB.pm
@@ -0,0 +1,43 @@
+#!/usr/bin/env perl
+
+package IUP::ImageRGB;
+use strict;
+use warnings;
+use base 'IUP::Internal::Element';
+use IUP::Internal::LibraryIUP;
+use