Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Importing initial version

  • Loading branch information...
commit e8cb0bb10e4ce6e7a342f65a6b933bbd90c1fb6d 1 parent 2d12206
authored September 15, 2010

Showing 79 changed files with 18,184 additions and 0 deletions. Show diff stats Hide diff stats

  1. 15  .gitignore
  2. 42  Build.PL
  3. 5  Changes
  4. 25  MANIFEST.SKIP
  5. 73  README
  6. 88  TODO
  7. 0  _generators/Attribute.csv
  8. 0  _generators/Attribute_pm.tt
  9. 252  _generators/Callback.csv
  10. 68  _generators/Callback_pm.tt
  11. 59  _generators/Callback_xs.tt
  12. 181  _generators/do_callbacks.pl
  13. 309  _generators/do_html2pod.pl
  14. 9  doc/Button.pod
  15. 530  lib/IUP.pm
  16. 16  lib/IUP/Button.pm
  17. 39  lib/IUP/Canvas.pm
  18. 36  lib/IUP/Cbox.pm
  19. 18  lib/IUP/Cells.pm
  20. 14  lib/IUP/Clipboard.pm
  21. 17  lib/IUP/ColorBrowser.pm
  22. 14  lib/IUP/ColorDlg.pm
  23. 15  lib/IUP/Colorbar.pm
  24. 71  lib/IUP/Constants.pm
  25. 16  lib/IUP/Dial.pm
  26. 22  lib/IUP/Dialog.pm
  27. 14  lib/IUP/FileDlg.pm
  28. 14  lib/IUP/Fill.pm
  29. 14  lib/IUP/FontDlg.pm
  30. 25  lib/IUP/Frame.pm
  31. 45  lib/IUP/GLCanvas.pm
  32. 36  lib/IUP/Hbox.pm
  33. 43  lib/IUP/Image.pm
  34. 43  lib/IUP/ImageRGB.pm
  35. 43  lib/IUP/ImageRGBA.pm
  36. 910  lib/IUP/Internal/Attribute.pm
  37. 372  lib/IUP/Internal/Callback.pm
  38. 3,903  lib/IUP/Internal/Callback.xs
  39. 475  lib/IUP/Internal/Element.pm
  40. 18  lib/IUP/Internal/LibraryCD.pm
  41. 25  lib/IUP/Internal/LibraryCD.xs
  42. 18  lib/IUP/Internal/LibraryIUP.pm
  43. 2,081  lib/IUP/Internal/LibraryIUP.xs
  44. 16  lib/IUP/Item.pm
  45. 16  lib/IUP/Label.pm
  46. 14  lib/IUP/List.pm
  47. 60  lib/IUP/Matrix.pm
  48. 37  lib/IUP/Menu.pm
  49. 14  lib/IUP/MessageDlg.pm
  50. 14  lib/IUP/Multiline.pm
  51. 37  lib/IUP/Normalizer.pm
  52. 19  lib/IUP/OleControl.pm
  53. 74  lib/IUP/PPlot.pm
  54. 14  lib/IUP/ProgressBar.pm
  55. 25  lib/IUP/Radio.pm
  56. 23  lib/IUP/Sbox.pm
  57. 14  lib/IUP/Separator.pm
  58. 14  lib/IUP/Spin.pm
  59. 27  lib/IUP/Spinbox.pm
  60. 22  lib/IUP/Split.pm
  61. 22  lib/IUP/Submenu.pm
  62. 37  lib/IUP/Tabs.pm
  63. 22  lib/IUP/Text.pm
  64. 14  lib/IUP/Timer.pm
  65. 16  lib/IUP/Toggle.pm
  66. 14  lib/IUP/Tree.pm
  67. 14  lib/IUP/User.pm
  68. 25  lib/IUP/Val.pm
  69. 36  lib/IUP/Vbox.pm
  70. 36  lib/IUP/Zbox.pm
  71. 7,063  src/ppport.h
  72. 10  t/00-load.t
  73. 51  t/01-load-submodules.t
  74. 53  t/empty-new.t
  75. 75  t/iup-global-funcs.t
  76. 168  t/iup.t
  77. 13  t/manifest.t
  78. 12  t/pod.t
  79. 50  typemap
15  .gitignore
... ...
@@ -0,0 +1,15 @@
  1
+blib*
  2
+Build
  3
+Build.bat
  4
+_build*
  5
+pm_to_blib*
  6
+tmp*
  7
+*.tar.gz
  8
+*.old
  9
+*.bak
  10
+*.o
  11
+*.c
  12
+_internal
  13
+META.yml
  14
+MYMETA.yml
  15
+MANIFEST
42  Build.PL
... ...
@@ -0,0 +1,42 @@
  1
+use strict;
  2
+use warnings;
  3
+
  4
+use Module::Build;
  5
+
  6
+eval { require Alien::IUP };
  7
+die "You need to have Alien::IUP installed\n" if $@;
  8
+
  9
+my $builder = Module::Build->new(
  10
+  module_name          => 'IUP',
  11
+  license              => 'mit',
  12
+  dist_abstract        => 'IUP bindings to Perl',
  13
+  dist_author          => 'KMX <kmx@cpan.org>',
  14
+  dist_version_from    => 'lib/IUP.pm',
  15
+  requires             => {
  16
+    'Carp'                 => 0,
  17
+    'constant'             => 0,
  18
+  },
  19
+  build_requires       => { # need to have for running: ./Build (install|test)
  20
+    'Module::Build'        => 0,
  21
+    'Alien::IUP'           => 0,
  22
+    'Test::More'           => 0,
  23
+    'Carp'                 => 0,
  24
+    'constant'             => 0,
  25
+  },
  26
+  configure_requires   => { # need to have for running: perl Buil.PL
  27
+    'Module::Build'        => 0,
  28
+    'Alien::IUP'           => 0,
  29
+  },
  30
+  add_to_cleanup       => [ 'IUP-*' ],
  31
+  c_source             => 'src', # ppport.h
  32
+  extra_compiler_flags => Alien::IUP->config('INC'),
  33
+  extra_linker_flags   => Alien::IUP->config('LIBS'),
  34
+  meta_merge => {
  35
+    resources => {
  36
+      bugtracker => 'http://rt.cpan.org/NoAuth/Bugs.html?Dist=IUP',
  37
+      repository => 'http://github.com/kmx/perl-iup',
  38
+    }
  39
+  },
  40
+);
  41
+
  42
+$builder->create_build_script();
5  Changes
... ...
@@ -0,0 +1,5 @@
  1
+Revision history for IUP
  2
+
  3
+0.01    Date/time
  4
+        First version, released on an unsuspecting world.
  5
+
25  MANIFEST.SKIP
... ...
@@ -0,0 +1,25 @@
  1
+.git
  2
+_build
  3
+_tmp
  4
+stage
  5
+blib*
  6
+pm_to_blib*
  7
+deps
  8
+^Build$
  9
+^Build.bat$
  10
+^MYMETA.yml$
  11
+^MANIFEST.SKIP$
  12
+^tmp
  13
+^build_
  14
+^download
  15
+^share
  16
+^tmp
  17
+^test
  18
+\.c$
  19
+\.o$
  20
+\.old$
  21
+\.tmp$
  22
+\.bak$
  23
+\.zip$
  24
+\.gz$
  25
+pod2htm*.tmp
73  README
... ...
@@ -0,0 +1,73 @@
  1
+IUP
  2
+
  3
+The README is used to introduce the module and provide instructions on
  4
+how to install the module, any machine dependencies it may have (for
  5
+example C compilers and installed libraries) and any other information
  6
+that should be provided before the module is installed.
  7
+
  8
+A README file is required for CPAN modules since CPAN extracts the README
  9
+file from a module distribution so that people browsing the archive
  10
+can use it to get an idea of the module's uses. It is usually a good idea
  11
+to provide version information here so that people can decide whether
  12
+fixes for the module are worth downloading.
  13
+
  14
+
  15
+INSTALLATION
  16
+
  17
+To install this module, run the following commands:
  18
+
  19
+	perl Build.PL
  20
+	./Build
  21
+	./Build test
  22
+	./Build install
  23
+
  24
+SUPPORT AND DOCUMENTATION
  25
+
  26
+After installing, you can find documentation for this module with the
  27
+perldoc command.
  28
+
  29
+    perldoc IUP
  30
+
  31
+You can also look for information at:
  32
+
  33
+    RT, CPAN's request tracker
  34
+        http://rt.cpan.org/NoAuth/Bugs.html?Dist=IUP
  35
+
  36
+    AnnoCPAN, Annotated CPAN documentation
  37
+        http://annocpan.org/dist/IUP
  38
+
  39
+    CPAN Ratings
  40
+        http://cpanratings.perl.org/d/IUP
  41
+
  42
+    Search CPAN
  43
+        http://search.cpan.org/dist/IUP/
  44
+
  45
+
  46
+LICENSE AND COPYRIGHT
  47
+
  48
+Copyright (C) 2010 KMX
  49
+
  50
+This program is distributed under the MIT (X11) License:
  51
+L<http://www.opensource.org/licenses/mit-license.php>
  52
+
  53
+Permission is hereby granted, free of charge, to any person
  54
+obtaining a copy of this software and associated documentation
  55
+files (the "Software"), to deal in the Software without
  56
+restriction, including without limitation the rights to use,
  57
+copy, modify, merge, publish, distribute, sublicense, and/or sell
  58
+copies of the Software, and to permit persons to whom the
  59
+Software is furnished to do so, subject to the following
  60
+conditions:
  61
+
  62
+The above copyright notice and this permission notice shall be
  63
+included in all copies or substantial portions of the Software.
  64
+
  65
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  66
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  67
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  68
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  69
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  70
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  71
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  72
+OTHER DEALINGS IN THE SOFTWARE.
  73
+
88  TODO
... ...
@@ -0,0 +1,88 @@
  1
+GLOBAL
  2
+- _generators 
  3
+  + attributes
  4
+  + check against GetAttrNames
  5
+- rewrite all examples from lua to perl
  6
+- consider redesign
  7
+  IUP::Internal::LibraryIUP
  8
+  IUP::Internal::LibraryCD
  9
+  IUP::Internal::LibraryIM
  10
+  IUP::Internal::LibraryIMLIB
  11
+  ...
  12
+- move global ihandle table from IUP::Internal::Callback to IUP::Internal::LibraryIUP
  13
+- put somewhere key related functions (see iupkey.h + iup.h) - ?IUP::Keys?
  14
+  sub isAltXkey
  15
+  sub isCtrlXkey
  16
+  sub isShiftXkey
  17
+  sub isSysXkey
  18
+  sub isXkey
  19
+  sub isalt
  20
+  sub iscontrol
  21
+  sub isdouble
  22
+  sub isprint
  23
+  sub isshift
  24
+  sub issys
  25
+  sub isxkey
  26
+  sub isbutton1
  27
+  sub isbutton2
  28
+  sub isbutton3
  29
+  sub isbutton4
  30
+  sub isbutton5
  31
+- update README + Changes
  32
+
  33
+IUP
  34
+- maybe missing (comparing to LUA)
  35
+  sub SetHandle ... IUP->SetHandle('xx', $d->ihandle);  
  36
+- maybe not needed (comparing to LUA)
  37
+  sub Close
  38
+  sub GetFocus  (we have in Element)
  39
+  sub GetHandle (we have in Element)
  40
+- consider:
  41
+  sub Open (probably not)
  42
+- tests for all global functions
  43
+
  44
+IUP::Constants
  45
+- K_* (see iupkey.h)
  46
+
  47
+IUP::Internal::Element
  48
+- maybe missing (comparing to LUA)
  49
+  sub GetAttributeData (see LUA implementation)
  50
+  sub SetAttributes vs. sub StoreAttribute
  51
+  sub GetName (we have $self->name)
  52
+- maybe not needed (comparing to LUA)
  53
+  sub GetCallback
  54
+- GetAttributes 
  55
+  in scalar context = string, in list? context = hash?
  56
+  or: GetAttributesStr vs. GetAttributesHRef
  57
+- tests for all common functions
  58
+
  59
+IUP::Image*
  60
+- move relevant methods from IUP::Internal::Element > IUP::Image
  61
+- add missing methods 
  62
+  iup.LoadImage(file_name: string) -> (elem: ihandle) [in Lua]
  63
+  iup.SaveImage(ih: ihandle, file_name, format: string) -> (ret: boolean) [in Lua]
  64
+  iup.GetNativeHandleImage(handle: userdata) -> (image: imImage) [in Lua]
  65
+  iup.GetImageNativeHandle(image: imImage) -> (handle: userdata) [in Lua]
  66
+- base IUP::Image::* on IUP::Image
  67
+- new( ... colors=>[ ] )
  68
+- new( ... pixels=>pack('C*', @array) );
  69
+- 1=>.. 2=>.. 3=>..
  70
+
  71
+IUP::(dialogs)
  72
+- move relevant methods from IUP::Internal::Element > IUP::Dialog
  73
+  IUP::Dialog->popup([x, y: number]) -> (ret: number) [in Lua]
  74
+  IUP::Dialog->show() -> (ret: number) [in IupLua]
  75
+  IUP::Dialog->showxy([x, y: number]) -> (ret: number) [in Lua]
  76
+  IUP::Dialog->hide() -> (ret: number) [in Lua]
  77
+- base IUP::(File|Message|Color|Font)Dlg on IUP::Dialog
  78
+
  79
+IUP::Canvas
  80
+- implement missing methods
  81
+
  82
+IUP::OleControl
  83
+- missing
  84
+- maybe not neccesarry in the first release
  85
+
  86
+IUP::ImageLib
  87
+- missing
  88
+- check memory consumption
0  _generators/Attribute.csv
No changes.
0  _generators/Attribute_pm.tt
No changes.
252  _generators/Callback.csv
... ...
@@ -0,0 +1,252 @@
  1
+#module;#action;#type;#c_retval;#c_params
  2
+IUP::Button;ACTION;;int;Ihandle* ih
  3
+IUP::Button;BUTTON_CB;iiiis;int;Ihandle* ih,int button,int pressed,int x,int y,char* status
  4
+IUP::Button;ENTERWINDOW_CB;;int;Ihandle* ih
  5
+IUP::Button;GETFOCUS_CB;;int;Ihandle* ih
  6
+IUP::Button;HELP_CB;;int;Ihandle* ih
  7
+IUP::Button;KILLFOCUS_CB;;int;Ihandle* ih
  8
+IUP::Button;K_ANY;i;int;Ihandle* ih,int c
  9
+IUP::Button;LEAVEWINDOW_CB;;int;Ihandle* ih
  10
+IUP::Button;MAP_CB;;int;Ihandle* ih
  11
+IUP::Button;UNMAP_CB;;int;Ihandle* ih
  12
+IUP::Canvas;ACTION;ff;int;Ihandle* ih,float posx,float posy
  13
+IUP::Canvas;BUTTON_CB;iiiis;int;Ihandle* ih,int button,int pressed,int x,int y,char* status
  14
+IUP::Canvas;DROPFILES_CB;siii;int;Ihandle* ih,const char* filename,int num,int x,int y
  15
+IUP::Canvas;ENTERWINDOW_CB;;int;Ihandle* ih
  16
+IUP::Canvas;FOCUS_CB;i;int;Ihandle* ih,int focus
  17
+IUP::Canvas;GETFOCUS_CB;;int;Ihandle* ih
  18
+IUP::Canvas;HELP_CB;;int;Ihandle* ih
  19
+IUP::Canvas;KEYPRESS_CB;ii;int;Ihandle* ih,int c,int press
  20
+IUP::Canvas;KILLFOCUS_CB;;int;Ihandle* ih
  21
+IUP::Canvas;K_ANY;i;int;Ihandle* ih,int c
  22
+IUP::Canvas;LEAVEWINDOW_CB;;int;Ihandle* ih
  23
+IUP::Canvas;MAP_CB;;int;Ihandle* ih
  24
+IUP::Canvas;MOTION_CB;iis;int;Ihandle* ih,int x,int y,char* status
  25
+IUP::Canvas;RESIZE_CB;ii;int;Ihandle* ih,int width,int height
  26
+IUP::Canvas;SCROLL_CB;iff;int;Ihandle* ih,int op,float posx,float posy
  27
+IUP::Canvas;UNMAP_CB;;int;Ihandle* ih
  28
+IUP::Canvas;WHEEL_CB;fiis;int;Ihandle* ih,float delta,int x,int y,char* status
  29
+IUP::Canvas;WOM_CB;i;int;Ihandle* ih,int state
  30
+IUP::Cells;DRAW_CB;iiiiiiv;int;Ihandle* ih,int line,int column,int xmin,int xmax,int ymin,int ymax,cdCanvas* canvas
  31
+IUP::Cells;ENTERWINDOW_CB;;int;Ihandle* ih
  32
+IUP::Cells;GETFOCUS_CB;;int;Ihandle* ih
  33
+IUP::Cells;HEIGHT_CB;i;int;Ihandle* ih,int line
  34
+IUP::Cells;HELP_CB;;int;Ihandle* ih
  35
+IUP::Cells;HSPAN_CB;ii;int;Ihandle* ih,int line,int column
  36
+IUP::Cells;KILLFOCUS_CB;;int;Ihandle* ih
  37
+IUP::Cells;K_ANY;i;int;Ihandle* ih,int c
  38
+IUP::Cells;LEAVEWINDOW_CB;;int;Ihandle* ih
  39
+IUP::Cells;MAP_CB;;int;Ihandle* ih
  40
+IUP::Cells;MOUSECLICK_CB;iiiiiis;int;Ihandle* ih,int button,int pressed,int line,int column,int x,int y,char* status
  41
+IUP::Cells;MOUSEMOTION_CB;iiiis;int;Ihandle* ih,int line,int column,int x,int y,char* r
  42
+IUP::Cells;NCOLS_CB;;int;Ihandle* ih
  43
+IUP::Cells;NLINES_CB;;int;Ihandle* ih
  44
+IUP::Cells;SCROLLING_CB;ii;int;Ihandle* ih,int line,int column
  45
+IUP::Cells;UNMAP_CB;;int;Ihandle* ih
  46
+IUP::Cells;VSPAN_CB;ii;int;Ihandle* ih,int line,int column
  47
+IUP::Cells;WIDTH_CB;i;int;Ihandle* ih,int column
  48
+IUP::ColorBrowser;CHANGE_CB;ccc;int;Ihandle* ih,unsigned char r,unsigned char g,unsigned char b
  49
+IUP::ColorBrowser;DRAG_CB;ccc;int;Ihandle* ih,unsigned char r,unsigned char g,unsigned char b
  50
+IUP::ColorBrowser;ENTERWINDOW_CB;;int;Ihandle* ih
  51
+IUP::ColorBrowser;GETFOCUS_CB;;int;Ihandle* ih
  52
+IUP::ColorBrowser;HELP_CB;;int;Ihandle* ih
  53
+IUP::ColorBrowser;KILLFOCUS_CB;;int;Ihandle* ih
  54
+IUP::ColorBrowser;K_ANY;i;int;Ihandle* ih,int c
  55
+IUP::ColorBrowser;LEAVEWINDOW_CB;;int;Ihandle* ih
  56
+IUP::ColorBrowser;MAP_CB;;int;Ihandle* ih
  57
+IUP::ColorBrowser;UNMAP_CB;;int;Ihandle* ih
  58
+IUP::ColorBrowser;VALUECHANGED_CB;;int;Ihandle* ih
  59
+IUP::ColorDlg;HELP_CB;;int;Ihandle* ih
  60
+IUP::Colorbar;CELL_CB;i;char*;Ihandle* ih,int cell
  61
+IUP::Colorbar;ENTERWINDOW_CB;;int;Ihandle* ih
  62
+IUP::Colorbar;EXTENDED_CB;i;int;Ihandle* ih,int cell
  63
+IUP::Colorbar;GETFOCUS_CB;;int;Ihandle* ih
  64
+IUP::Colorbar;HELP_CB;;int;Ihandle* ih
  65
+IUP::Colorbar;KILLFOCUS_CB;;int;Ihandle* ih
  66
+IUP::Colorbar;K_ANY;i;int;Ihandle* ih,int c
  67
+IUP::Colorbar;LEAVEWINDOW_CB;;int;Ihandle* ih
  68
+IUP::Colorbar;MAP_CB;;int;Ihandle* ih
  69
+IUP::Colorbar;SELECT_CB;ii;int;Ihandle* ih,int cell,int type
  70
+IUP::Colorbar;SWITCH_CB;ii;int;Ihandle* ih,int prim_cell,int sec_cell
  71
+IUP::Colorbar;UNMAP_CB;;int;Ihandle* ih
  72
+IUP::Dial;BUTTON_PRESS_CB;d;int;Ihandle* ih,double angle
  73
+IUP::Dial;BUTTON_RELEASE_CB;d;int;Ihandle* ih,double angle
  74
+IUP::Dial;ENTERWINDOW_CB;;int;Ihandle* ih
  75
+IUP::Dial;GETFOCUS_CB;;int;Ihandle* ih
  76
+IUP::Dial;HELP_CB;;int;Ihandle* ih
  77
+IUP::Dial;KILLFOCUS_CB;;int;Ihandle* ih
  78
+IUP::Dial;K_ANY;i;int;Ihandle* ih,int c
  79
+IUP::Dial;LEAVEWINDOW_CB;;int;Ihandle* ih
  80
+IUP::Dial;MAP_CB;;int;Ihandle* ih
  81
+IUP::Dial;MOUSEMOVE_CB;d;int;Ihandle* ih,double angle
  82
+IUP::Dial;UNMAP_CB;;int;Ihandle* ih
  83
+IUP::Dial;VALUECHANGED_CB;;int;Ihandle* ih
  84
+IUP::Dialog;CLOSE_CB;;int;Ihandle* ih
  85
+IUP::Dialog;COPYDATA_CB;si;int;Ihandle* ih,char* cmdLine,int size
  86
+IUP::Dialog;DROPFILES_CB;siii;int;Ihandle* ih,const char* filename,int num,int x,int y
  87
+IUP::Dialog;ENTERWINDOW_CB;;int;Ihandle* ih
  88
+IUP::Dialog;GETFOCUS_CB;;int;Ihandle* ih
  89
+IUP::Dialog;HELP_CB;;int;Ihandle* ih
  90
+IUP::Dialog;KILLFOCUS_CB;;int;Ihandle* ih
  91
+IUP::Dialog;K_ANY;i;int;Ihandle* ih,int c
  92
+IUP::Dialog;LEAVEWINDOW_CB;;int;Ihandle* ih
  93
+IUP::Dialog;MAP_CB;;int;Ihandle* ih
  94
+IUP::Dialog;MDIACTIVATE_CB;;int;Ihandle* ih
  95
+IUP::Dialog;MOVE_CB;ii;int;Ihandle* ih,int x,int y
  96
+IUP::Dialog;RESIZE_CB;ii;int;Ihandle* ih,int width,int height
  97
+IUP::Dialog;SHOW_CB;i;int;Ihandle* ih,int state
  98
+IUP::Dialog;TRAYCLICK_CB;iii;int;Ihandle* ih,int but,int pressed,int dclick
  99
+IUP::Dialog;UNMAP_CB;;int;Ihandle* ih
  100
+IUP::FileDlg;FILE_CB;ss;int;Ihandle* ih,const char* file_name,const char* status
  101
+IUP::FileDlg;HELP_CB;;int;Ihandle* ih
  102
+IUP::FontDlg;HELP_CB;;int;Ihandle* ih
  103
+IUP::Frame;MAP_CB;;int;Ihandle* ih
  104
+IUP::Frame;UNMAP_CB;;int;Ihandle* ih
  105
+IUP::GLCanvas;RESIZE_CB;ii;int;Ihandle* ih,int width,int height
  106
+IUP::Item;ACTION;;int;Ihandle* ih
  107
+IUP::Item;HELP_CB;;int;Ihandle* ih
  108
+IUP::Item;HIGHLIGHT_CB;;int;Ihandle* ih
  109
+IUP::Item;MAP_CB;;int;Ihandle* ih
  110
+IUP::Item;UNMAP_CB;;int;Ihandle* ih
  111
+IUP::Label;MAP_CB;;int;Ihandle* ih
  112
+IUP::Label;UNMAP_CB;;int;Ihandle* ih
  113
+IUP::List;ACTION;sii;int;Ihandle* ih,char* text,int pos,int state
  114
+IUP::List;BUTTON_CB;iiiis;int;Ihandle* ih,int button,int pressed,int x,int y,char* status
  115
+IUP::List;CARET_CB;iii;int;Ihandle* ih,int lin,int col,int pos
  116
+IUP::List;DBLCLICK_CB;is;int;Ihandle* ih,int pos,char* text
  117
+IUP::List;DROPDOWN_CB;i;int;Ihandle* ih,int state
  118
+IUP::List;DROPFILES_CB;siii;int;Ihandle* ih,const char* filename,int num,int x,int y
  119
+IUP::List;EDIT_CB;is;int;Ihandle* ih,int c,char* new_value
  120
+IUP::List;ENTERWINDOW_CB;;int;Ihandle* ih
  121
+IUP::List;GETFOCUS_CB;;int;Ihandle* ih
  122
+IUP::List;HELP_CB;;int;Ihandle* ih
  123
+IUP::List;KILLFOCUS_CB;;int;Ihandle* ih
  124
+IUP::List;K_ANY;i;int;Ihandle* ih,int c
  125
+IUP::List;LEAVEWINDOW_CB;;int;Ihandle* ih
  126
+IUP::List;MAP_CB;;int;Ihandle* ih
  127
+IUP::List;MOTION_CB;iis;int;Ihandle* ih,int x,int y,char* status
  128
+IUP::List;MULTISELECT_CB;s;int;Ihandle* ih,char* value
  129
+IUP::List;UNMAP_CB;;int;Ihandle* ih
  130
+IUP::List;VALUECHANGED_CB;;int;Ihandle* ih
  131
+IUP::Matrix;ACTION_CB;iiiis;int;Ihandle* ih,int c,int lin,int col,int edition,char* after
  132
+IUP::Matrix;BGCOLOR_CB;iiIII;int;Ihandle* ih,int lin,int col,unsigned int* red,unsigned int* green,unsigned int* blue
  133
+IUP::Matrix;CLICK_CB;iis;int;Ihandle* ih,int lin,int col,char* status
  134
+IUP::Matrix;DRAW_CB;iiiiiiv;int;Ihandle* ih,int lin,int col,int x1,int x2,int y1,int y2,cdCanvas* cnv
  135
+IUP::Matrix;DROPCHECK_CB;ii;int;Ihandle* ih,int lin,int col
  136
+IUP::Matrix;DROPSELECT_CB;iinsii;int;Ihandle* ih,int lin,int col,Ihandle* drop,char* t,int i,int v
  137
+IUP::Matrix;DROP_CB;nii;int;Ihandle* ih,Ihandle* drop,int lin,int col
  138
+IUP::Matrix;EDITION_CB;iiii;int;Ihandle* ih,int lin,int col,int mode,int update
  139
+IUP::Matrix;ENTERITEM_CB;ii;int;Ihandle* ih,int lin,int col
  140
+IUP::Matrix;FGCOLOR_CB;iiIII;int;Ihandle* ih,int lin,int col,unsigned int* red,unsigned int* green,unsigned int* blue
  141
+IUP::Matrix;FONT_CB;ii;char*;Ihandle* ih,int lin,int col
  142
+IUP::Matrix;LEAVEITEM_CB;ii;int;Ihandle* ih,int lin,int col
  143
+IUP::Matrix;MARKEDIT_CB;iii;int;Ihandle* ih,int lin,int col,int marked
  144
+IUP::Matrix;MARK_CB;ii;int;Ihandle* ih,int lin,int col
  145
+IUP::Matrix;MOUSEMOVE_CB;ii;int;Ihandle* ih,int lin,int col
  146
+IUP::Matrix;RELEASE_CB;iis;int;Ihandle* ih,int lin,int col,char* status
  147
+IUP::Matrix;SCROLLTOP_CB;ii;int;Ihandle* ih,int lin,int col
  148
+IUP::Matrix;VALUE_CB;ii;char*;Ihandle* ih,int lin,int col
  149
+IUP::Matrix;VALUE_EDIT_CB;iis;int;Ihandle* ih,int lin,int col,char* newval
  150
+IUP::Menu;MAP_CB;;int;Ihandle* ih
  151
+IUP::Menu;MENUCLOSE_CB;;int;Ihandle* ih
  152
+IUP::Menu;OPEN_CB;;int;Ihandle* ih
  153
+IUP::Menu;UNMAP_CB;;int;Ihandle* ih
  154
+IUP::MessageDlg;HELP_CB;;int;Ihandle* ih
  155
+IUP::OleControl;ENTERWINDOW_CB;;int;Ihandle* ih
  156
+IUP::OleControl;GETFOCUS_CB;;int;Ihandle* ih
  157
+IUP::OleControl;KILLFOCUS_CB;;int;Ihandle* ih
  158
+IUP::OleControl;LEAVEWINDOW_CB;;int;Ihandle* ih
  159
+IUP::OleControl;MAP_CB;;int;Ihandle* ih
  160
+IUP::OleControl;UNMAP_CB;;int;Ihandle* ih
  161
+IUP::PPlot;DELETEBEGIN_CB;;int;Ihandle* ih
  162
+IUP::PPlot;DELETEEND_CB;;int;Ihandle* ih
  163
+IUP::PPlot;DELETE_CB;iiff;int;Ihandle* ih,int index,int sample_index,float x,float y
  164
+IUP::PPlot;EDITBEGIN_CB;;int;Ihandle* ih
  165
+IUP::PPlot;EDITEND_CB;;int;Ihandle* ih
  166
+IUP::PPlot;EDIT_CB;iiffFF;int;Ihandle* ih,int index,int sample_index,float x,float y,float* new_x,float* new_y
  167
+IUP::PPlot;ENTERWINDOW_CB;;int;Ihandle* ih
  168
+IUP::PPlot;GETFOCUS_CB;;int;Ihandle* ih
  169
+IUP::PPlot;HELP_CB;;int;Ihandle* ih
  170
+IUP::PPlot;KILLFOCUS_CB;;int;Ihandle* ih
  171
+IUP::PPlot;K_ANY;i;int;Ihandle* ih,int c
  172
+IUP::PPlot;LEAVEWINDOW_CB;;int;Ihandle* ih
  173
+IUP::PPlot;MAP_CB;;int;Ihandle* ih
  174
+IUP::PPlot;POSTDRAW_CB;v;int;Ihandle* ih,cdCanvas* cnv
  175
+IUP::PPlot;PREDRAW_CB;v;int;Ihandle* ih,cdCanvas* cnv
  176
+IUP::PPlot;SELECTBEGIN_CB;;int;Ihandle* ih
  177
+IUP::PPlot;SELECTEND_CB;;int;Ihandle* ih
  178
+IUP::PPlot;SELECT_CB;iiffi;int;Ihandle* ih,int index,int sample_index,float x,float y,int select
  179
+IUP::PPlot;UNMAP_CB;;int;Ihandle* ih
  180
+IUP::ProgressBar;MAP_CB;;int;Ihandle* ih
  181
+IUP::ProgressBar;UNMAP_CB;;int;Ihandle* ih
  182
+IUP::Spin;SPIN_CB;i;int;Ihandle* ih,int inc
  183
+IUP::Spinbox;SPIN_CB;i;int;Ihandle* ih,int inc
  184
+IUP::Submenu;HIGHLIGHT_CB;;int;Ihandle* ih
  185
+IUP::Submenu;MAP_CB;;int;Ihandle* ih
  186
+IUP::Submenu;UNMAP_CB;;int;Ihandle* ih
  187
+IUP::Tabs;ENTERWINDOW_CB;;int;Ihandle* ih
  188
+IUP::Tabs;GETFOCUS_CB;;int;Ihandle* ih
  189
+IUP::Tabs;HELP_CB;;int;Ihandle* ih
  190
+IUP::Tabs;KILLFOCUS_CB;;int;Ihandle* ih
  191
+IUP::Tabs;K_ANY;i;int;Ihandle* ih,int c
  192
+IUP::Tabs;LEAVEWINDOW_CB;;int;Ihandle* ih
  193
+IUP::Tabs;MAP_CB;;int;Ihandle* ih
  194
+IUP::Tabs;TABCHANGE_CB;nn;int;Ihandle* ih,Ihandle* new_tab,Ihandle* old_tab
  195
+IUP::Tabs;UNMAP_CB;;int;Ihandle* ih
  196
+IUP::Text;ACTION;is;int;Ihandle* ih,int c,char* new_value
  197
+IUP::Text;BUTTON_CB;iiiis;int;Ihandle* ih,int button,int pressed,int x,int y,char* status
  198
+IUP::Text;CARET_CB;iii;int;Ihandle* ih,int lin,int col,int pos
  199
+IUP::Text;DROPFILES_CB;siii;int;Ihandle* ih,const char* filename,int num,int x,int y
  200
+IUP::Text;ENTERWINDOW_CB;;int;Ihandle* ih
  201
+IUP::Text;GETFOCUS_CB;;int;Ihandle* ih
  202
+IUP::Text;HELP_CB;;int;Ihandle* ih
  203
+IUP::Text;KILLFOCUS_CB;;int;Ihandle* ih
  204
+IUP::Text;K_ANY;i;int;Ihandle* ih,int c
  205
+IUP::Text;LEAVEWINDOW_CB;;int;Ihandle* ih
  206
+IUP::Text;MAP_CB;;int;Ihandle* ih
  207
+IUP::Text;MOTION_CB;iis;int;Ihandle* ih,int x,int y,char* status
  208
+IUP::Text;SPIN_CB;i;int;Ihandle* ih,int pos
  209
+IUP::Text;UNMAP_CB;;int;Ihandle* ih
  210
+IUP::Text;VALUECHANGED_CB;;int;Ihandle* ih
  211
+IUP::Timer;ACTION_CB;;int;Ihandle* ih
  212
+IUP::Toggle;ACTION;i;int;Ihandle* ih,int state
  213
+IUP::Toggle;ENTERWINDOW_CB;;int;Ihandle* ih
  214
+IUP::Toggle;GETFOCUS_CB;;int;Ihandle* ih
  215
+IUP::Toggle;HELP_CB;;int;Ihandle* ih
  216
+IUP::Toggle;KILLFOCUS_CB;;int;Ihandle* ih
  217
+IUP::Toggle;K_ANY;i;int;Ihandle* ih,int c
  218
+IUP::Toggle;LEAVEWINDOW_CB;;int;Ihandle* ih
  219
+IUP::Toggle;MAP_CB;;int;Ihandle* ih
  220
+IUP::Toggle;UNMAP_CB;;int;Ihandle* ih
  221
+IUP::Toggle;VALUECHANGED_CB;;int;Ihandle* ih
  222
+IUP::Tree;BRANCHCLOSE_CB;i;int;Ihandle* ih,int id
  223
+IUP::Tree;BRANCHOPEN_CB;i;int;Ihandle* ih,int id
  224
+IUP::Tree;BUTTON_CB;iiiis;int;Ihandle* ih,int button,int pressed,int x,int y,char* status
  225
+IUP::Tree;DRAGDROP_CB;iiii;int;Ihandle* ih,int drag_id,int drop_id,int isshift,int iscontrol
  226
+IUP::Tree;DROPFILES_CB;siii;int;Ihandle* ih,const char* filename,int num,int x,int y
  227
+IUP::Tree;ENTERWINDOW_CB;;int;Ihandle* ih
  228
+IUP::Tree;EXECUTELEAF_CB;i;int;Ihandle* ih,int id
  229
+IUP::Tree;GETFOCUS_CB;;int;Ihandle* ih
  230
+IUP::Tree;HELP_CB;;int;Ihandle* ih
  231
+IUP::Tree;KILLFOCUS_CB;;int;Ihandle* ih
  232
+IUP::Tree;K_ANY;i;int;Ihandle* ih,int c
  233
+IUP::Tree;LEAVEWINDOW_CB;;int;Ihandle* ih
  234
+IUP::Tree;MAP_CB;;int;Ihandle* ih
  235
+IUP::Tree;MOTION_CB;iis;int;Ihandle* ih,int x,int y,char* status
  236
+IUP::Tree;MULTISELECTION_CB;Ai;int;Ihandle* ih,int* ids,int n
  237
+IUP::Tree;MULTIUNSELECTION_CB;Ai;int;Ihandle* ih,int* ids,int n
  238
+IUP::Tree;NODEREMOVED_CB;s;int;Ihandle* ih,void* userdata
  239
+IUP::Tree;RENAME_CB;is;int;Ihandle* ih,int id,char* title
  240
+IUP::Tree;RIGHTCLICK_CB;i;int;Ihandle* ih,int id
  241
+IUP::Tree;SELECTION_CB;ii;int;Ihandle* ih,int id,int status
  242
+IUP::Tree;SHOWRENAME_CB;i;int;Ihandle* ih,int id
  243
+IUP::Tree;UNMAP_CB;;int;Ihandle* ih
  244
+IUP::Val;ENTERWINDOW_CB;;int;Ihandle* ih
  245
+IUP::Val;GETFOCUS_CB;;int;Ihandle* ih
  246
+IUP::Val;HELP_CB;;int;Ihandle* ih
  247
+IUP::Val;KILLFOCUS_CB;;int;Ihandle* ih
  248
+IUP::Val;K_ANY;i;int;Ihandle* ih,int c
  249
+IUP::Val;LEAVEWINDOW_CB;;int;Ihandle* ih
  250
+IUP::Val;MAP_CB;;int;Ihandle* ih
  251
+IUP::Val;UNMAP_CB;;int;Ihandle* ih
  252
+IUP::Val;VALUECHANGED_CB;;int;Ihandle* ih
68  _generators/Callback_pm.tt
... ...
@@ -0,0 +1,68 @@
  1
+#!/usr/bin/env perl
  2
+
  3
+# BEWARE: this is a generated file, DO NOT EDIT THIS FILE MANUALLY!!!
  4
+
  5
+package IUP::Internal::Callback;
  6
+
  7
+use strict;
  8
+use warnings;
  9
+require DynaLoader;
  10
+our @ISA = qw/ DynaLoader /;
  11
+
  12
+bootstrap IUP::Internal::Callback;
  13
+
  14
+my $cb_table = {
  15
+[% FOR i IN pmitems -%]
  16
+  '[% i.module %]' => {
  17
+[% FOR j IN i.actions -%]
  18
+    [% j.action %] => \&[% j.xs_init_cb %],
  19
+[% END -%]
  20
+  },
  21
+[% END -%]
  22
+};
  23
+
  24
+sub _execute_cb { #TODO: maybe return something else then -1 in case of error
  25
+  my ($ih, $action, @args) = @_;
  26
+  my $ref = _translate_ih($ih);
  27
+  return -1 unless ref($ref);
  28
+  my $func = $ref->{$action};
  29
+  return -1 unless (ref($func) eq 'CODE');
  30
+  my $rv = &$func($ref, @args);
  31
+  return -1 unless defined $rv;
  32
+  return $rv;
  33
+}
  34
+
  35
+sub _get_cb_init_function {
  36
+  my ($pkg, $action) = @_;
  37
+  my $rv = $cb_table->{$pkg};
  38
+  return $rv ? $rv->{$action} : undef;
  39
+}
  40
+
  41
+sub _is_cb_valid {
  42
+  my ($pkg, $action) = @_;
  43
+  my $h = $cb_table->{$pkg};
  44
+  return 0 unless defined($h);
  45
+  return defined($h->{$action}) ? 1 : 0;
  46
+}
  47
+
  48
+sub _get_cb_list {
  49
+  my ($element) = @_;
  50
+  my $h = $cb_table->{$element} or return;
  51
+  return keys %$h;
  52
+}
  53
+
  54
+#TODO: maybe something more thread safe
  55
+my %ih_register; #global table mapping IUP Ihandles to perl objrefs
  56
+sub _translate_ih  { $ih_register{$_[0]} }         #params: ih
  57
+sub _unregister_ih { delete $ih_register{$_[0]} }  #params: ih
  58
+sub _register_ih   { $ih_register{$_[0]} = $_[1] } #params: ih, objref
  59
+
  60
+1;
  61
+
  62
+__END__
  63
+
  64
+=head1 NAME
  65
+
  66
+IUP::Internal::Callback - INTERNAL FUNCTIONS, do not use them from outside!
  67
+
  68
+=cut
59  _generators/Callback_xs.tt
... ...
@@ -0,0 +1,59 @@
  1
+/* BEWARE: this is a generated file, DO NOT EDIT THIS FILE MANUALLY!!! */
  2
+
  3
+#include "EXTERN.h"
  4
+#include "perl.h"
  5
+#include "XSUB.h"
  6
+#include "ppport.h"
  7
+
  8
+#include <iup.h>
  9
+#include <cd.h>
  10
+[% FOREACH i IN xsitems %]
  11
+[% i.c_retval %]
  12
+[% i.xs_internal_cb %] [% i.xs_internal_cb_params %]
  13
+{
  14
+	dSP;
  15
+	int count;
  16
+	[% i.c_retval %] rv;
  17
+[% FOR j IN i.xs_internal_cb_locvar -%]
  18
+	[% j %]
  19
+[% END -%]
  20
+
  21
+	ENTER;
  22
+	SAVETMPS;
  23
+
  24
+	/* push params for [% i.xs_internal_cb_pfunc %]() */
  25
+	PUSHMARK(SP);
  26
+	XPUSHs(sv_2mortal(newSViv(PTR2IV(ih))));
  27
+[% FOREACH j IN i.xs_internal_cb_push -%]
  28
+	[% j %]
  29
+[% END -%]
  30
+	PUTBACK;
  31
+
  32
+	count = call_pv("IUP::Internal::Callback::[% i.xs_internal_cb_pfunc %]",G_SCALAR);
  33
+
  34
+	SPAGAIN;
  35
+
  36
+	[% i.xs_internal_cb_rvcheck %]
  37
+	rv = [% i.xs_internal_cb_pop %];
  38
+[% FOR j IN i.xs_internal_cb_extrapop -%]
  39
+	[% j %]
  40
+[% END -%]
  41
+
  42
+	PUTBACK;
  43
+	FREETMPS;
  44
+	LEAVE;
  45
+	
  46
+	return rv;
  47
+} 
  48
+[% END %]
  49
+
  50
+MODULE = IUP::Internal::Callback	PACKAGE = IUP::Internal::Callback
  51
+
  52
+[% FOREACH i IN xsitems %]
  53
+void
  54
+[% i.xs_init_cb %](ih,action)
  55
+		Ihandle* ih;
  56
+		char* action;
  57
+	CODE:
  58
+		IupSetCallback(ih, action, (Icallback)[% i.xs_internal_cb %]);
  59
+[% END %]
181  _generators/do_callbacks.pl
... ...
@@ -0,0 +1,181 @@
  1
+use strict;
  2
+use warnings;
  3
+
  4
+use File::Slurp 'slurp';
  5
+use Template;
  6
+use Data::Dumper;
  7
+
  8
+my $cb_csv = 'Callback.csv';
  9
+
  10
+my $pfunc_default = '_execute_cb';
  11
+my $pfunc_table = {
  12
+  internal_cb_DRAW_CB_iiiiiiv => '_execute_cb_cnv7',
  13
+  internal_cb_POSTDRAW_CB_v   => '_execute_cb_cnv1',
  14
+  internal_cb_PREDRAW_CB_v    => '_execute_cb_cnv1',
  15
+};
  16
+
  17
+sub file2hash {
  18
+  my $fname = shift;
  19
+  my $rv;
  20
+  
  21
+  die "File '$fname' does not exist!\n" unless -f $fname;
  22
+  my ($head, @lines) = slurp($fname);
  23
+  chomp ($head);
  24
+  chomp (@lines);
  25
+  my @cols = split(';', $head);
  26
+  s/^#//g for (@cols);
  27
+  for (@lines) {
  28
+    my @items = split(';', $_);
  29
+    for(my $i=2; $i < scalar(@cols); $i++) {
  30
+      $rv->{$items[0]}->{$items[1]}->{$cols[$i]} = $items[$i];
  31
+    }
  32
+  }
  33
+  return $rv;
  34
+}
  35
+
  36
+sub generate1 {
  37
+  my $h = shift;
  38
+  for my $m (keys %$h) {
  39
+    for my $a (keys %{$h->{$m}}) {  
  40
+      my $if = "internal_cb_$a\_$h->{$m}->{$a}->{type}";      
  41
+      $h->{$m}->{$a}->{xs_internal_cb} = $if;
  42
+      $h->{$m}->{$a}->{xs_internal_cb_params} = "($h->{$m}->{$a}->{c_params})";
  43
+      $h->{$m}->{$a}->{xs_internal_cb_pfunc} = $pfunc_table->{$if} || $pfunc_default;
  44
+      
  45
+      my @l_rvname;
  46
+      my $c_retval = $h->{$m}->{$a}->{c_retval};
  47
+      if ($c_retval eq 'int') {
  48
+        $h->{$m}->{$a}->{xs_internal_cb_pop} = 'POPi';
  49
+	push @l_rvname, '$rv_num';
  50
+      }
  51
+      elsif ($c_retval eq 'char*') {
  52
+        $h->{$m}->{$a}->{xs_internal_cb_pop} = 'POPpx';
  53
+	push @l_rvname, '$rv_string';
  54
+      }
  55
+      else {
  56
+        die "this should not happen";
  57
+      }      
  58
+
  59
+      my $pf = "_init_cb_$a\_$h->{$m}->{$a}->{type}";      
  60
+
  61
+      my @l_name = ( '$self' );      
  62
+      
  63
+      my @l_xspush = ( "XPUSHs(sv_2mortal(newSVpvn(\"$a\", ".length($a).")));" );
  64
+      my @l_xspop = ();
  65
+      my @l_xslocvar = ();
  66
+      my $rv_count = 1;
  67
+      my @fp = split(',', $h->{$m}->{$a}->{c_params});
  68
+      die "invalid value '$fp[0]'" if $fp[0] ne 'Ihandle* ih';      
  69
+      my @tp = split('', $h->{$m}->{$a}->{type});
  70
+      die "[$m.$a] mismatch: '$h->{$m}->{$a}->{type}' vs. '$h->{$m}->{$a}->{c_params}'" unless scalar(@tp)+1==scalar(@fp);
  71
+      for(my $i=1; $i<scalar(@fp); $i++) {
  72
+        my $n = 'xxx';
  73
+        if ($fp[$i] =~ /^.*?([^ ]*)$/) {
  74
+	  $n = $1;	  
  75
+        }
  76
+	else {
  77
+	  die "this should not happen";
  78
+	}	
  79
+        if ($tp[$i-1] =~ /^(i|c)$/) {
  80
+	  push @l_name, "\$$n";
  81
+	  push @l_xspush, "XPUSHs(sv_2mortal(newSViv($n)));";	  
  82
+	}
  83
+	elsif ($tp[$i-1] =~ /^(n|v)$/) {
  84
+	  push @l_name, "\$$n";
  85
+	  push @l_xspush, "XPUSHs(sv_2mortal(newSViv(PTR2IV($n))));";
  86
+	}
  87
+	elsif ($tp[$i-1] =~ /^(I)$/) {
  88
+	  push @l_xspop, "*$n = POPi;"; # xxx TODO needs testing + pod update
  89
+	  $rv_count++;
  90
+	  push @l_rvname, "\$$n";
  91
+	}
  92
+	elsif ($tp[$i-1] =~ /^(F)$/) {
  93
+	  push @l_xspop, "*$n = POPn;"; # xxx TODO needs testing + pod update
  94
+	  $rv_count++;
  95
+	  push @l_rvname, "\$$n";
  96
+	}
  97
+	elsif ($tp[$i-1] =~ /^(A)$/) {  # xxx TODO needs testing + pod update
  98
+	  push @l_name, "\@$n\_list";
  99
+	  # xxx hack for MULTISELECTION_CB MULTIUNSELECTION_CB - do not use 'A' for anything else
  100
+	  push @l_xspush, "for(loc_i=0; loc_i++; loc_i<n) XPUSHs(sv_2mortal(newSViv(ids[loc_i])));";
  101
+	  push @l_xslocvar, "int loc_i;";
  102
+	  last;
  103
+	}
  104
+	elsif ($tp[$i-1] =~ /^(f|d)$/) {
  105
+	  push @l_name, "\$$n";
  106
+	  push @l_xspush, "XPUSHs(sv_2mortal(newSVnv($n)));";
  107
+	}
  108
+	elsif ($tp[$i-1] =~ /^(s)$/) {
  109
+	  push @l_name, "\$$n";
  110
+	  push @l_xspush, "XPUSHs(sv_2mortal(newSVpv($n, 0)));";
  111
+	}
  112
+	else {
  113
+	  die "[$m.$a] error: '$h->{$m}->{$a}->{type}' vs. '$h->{$m}->{$a}->{c_params}'";
  114
+	}
  115
+      }
  116
+      
  117
+      #die Dumper(\@l);
  118
+      $h->{$m}->{$a}->{xs_init_cb} = $pf;
  119
+      $h->{$m}->{$a}->{xs_internal_cb_push} = \@l_xspush;
  120
+      $h->{$m}->{$a}->{xs_internal_cb_extrapop} = \@l_xspop;
  121
+      $h->{$m}->{$a}->{xs_internal_cb_locvar} = \@l_xslocvar;
  122
+      if($rv_count == 1) {
  123
+        $h->{$m}->{$a}->{xs_internal_cb_rvcheck} = "if (count != 1) croak(\"Error: _execute_cb($a) has not returned single scalar value!\\n\");";
  124
+      }
  125
+      else {
  126
+        $h->{$m}->{$a}->{xs_internal_cb_rvcheck} = "if (count != $rv_count) croak(\"Error: _execute_cb($a) has not returned $rv_count values!\\n\");";
  127
+      }
  128
+            
  129
+      $h->{$m}->{$a}->{pod_sample_params} = '(' . join(', ', @l_name) . ')';
  130
+      if(scalar(@l_rvname)>2) {
  131
+        $h->{$m}->{$a}->{pod_sample_rv} = '(' . join(', ', @l_rvname) . ')';
  132
+      }
  133
+      else {
  134
+        $h->{$m}->{$a}->{pod_sample_rv} = $l_rvname[0];
  135
+      }
  136
+      
  137
+      #print "DONE: " . Dumper($h->{$m}->{$a});
  138
+    }
  139
+  }
  140
+}
  141
+
  142
+sub hash2xsitems {
  143
+  my $h = shift;
  144
+  my @rv;
  145
+  my %seen;
  146
+  
  147
+  foreach my $m (sort keys %$h) {
  148
+    for my $a (sort keys %{$h->{$m}}) {  
  149
+      push @rv, $h->{$m}->{$a} unless $seen{"$h->{$m}->{$a}->{xs_init_cb}"};
  150
+      $seen{"$h->{$m}->{$a}->{xs_init_cb}"} = 1;
  151
+    }
  152
+  }
  153
+  return \@rv;
  154
+}
  155
+
  156
+sub hash2pmitems {
  157
+  my $h = shift;
  158
+  my @rv;
  159
+  foreach my $m (sort keys %$h) {
  160
+    my @a;
  161
+    for my $a (sort keys %{$h->{$m}}) {  
  162
+      push @a, { action=>$a, xs_init_cb=>$h->{$m}->{$a}->{xs_init_cb} };
  163
+    }
  164
+#warn ">>>processing $m $a ".Dumper(\@a);
  165
+    push @rv, { module=>$m, actions=>\@a };
  166
+  }
  167
+  return \@rv;
  168
+}
  169
+
  170
+
  171
+my $h = file2hash($cb_csv);
  172
+generate1($h);
  173
+my $data1 = {
  174
+  xsitems => hash2xsitems($h),
  175
+  pmitems => hash2pmitems($h),
  176
+};
  177
+
  178
+#die Dumper($data1);
  179
+my $tt = Template->new();
  180
+$tt->process('Callback_xs.tt', $data1, 'Callback.xs') || die $tt->error();
  181
+$tt->process('Callback_pm.tt', $data1, 'Callback.pm') || die $tt->error();
309  _generators/do_html2pod.pl
... ...
@@ -0,0 +1,309 @@
  1
+use strict;
  2
+use warnings;
  3
+use Data::Dumper;
  4
+use Template;
  5
+use HTML::TreeBuilder;
  6
+use Pod::HTML2Pod;
  7
+use File::Path qw(make_path remove_tree);
  8
+use File::Slurp;
  9
+use Pod::Simple::HTMLBatch;
  10
+
  11
+my $docroot = 'y:\@repos\perl-iup\_internal\doc\iup';
  12
+my $podroot = './pod.tt';
  13
+my $htmlout = './pod.tt.html';
  14
+
  15
+my $html_files = {
  16
+  'Attributes::00main' => 'html/en/attrib.html',
  17
+  'Attributes::ACTIVE' => 'html/en/attrib/iup_active.html',
  18
+  'Attributes::BGCOLOR' => 'html/en/attrib/iup_bgcolor.html',
  19
+  'Attributes::CLIENTSIZE' => 'html/en/attrib/iup_clientsize.html',
  20
+  'Attributes::CONTROL' => 'html/en/attrib/iup_control.html',
  21
+  'Attributes::CURSOR' => 'html/en/attrib/iup_cursor.html',
  22
+  'Attributes::DX' => 'html/en/attrib/iup_dx.html',
  23
+  'Attributes::DY' => 'html/en/attrib/iup_dy.html',
  24
+  'Attributes::EXPAND' => 'html/en/attrib/iup_expand.html',
  25
+  'Attributes::FGCOLOR' => 'html/en/attrib/iup_fgcolor.html',
  26
+  'Attributes::FLOATING' => 'html/en/attrib/iup_floating.html',
  27
+  'Attributes::FONT' => 'html/en/attrib/iup_font.html',
  28
+  'Attributes::FONT' => 'html/en/attrib/iup_font2.html',
  29
+  'Attributes::FONT' => 'html/en/attrib/iup_formatting.html',
  30
+  'Attributes::Global Attributes' => 'html/en/attrib/iup_globals.html',
  31
+  'Attributes::ICON' => 'html/en/attrib/iup_icon.html',
  32
+  'Attributes::KEY' => 'html/en/attrib/iup_key.html',
  33
+  'Attributes::iupMask' => 'html/en/attrib/iup_mask.html',
  34
+  'Attributes::MAXSIZE' => 'html/en/attrib/iup_maxsize.html',
  35
+  'Attributes::MAXSIZE' => 'html/en/attrib/iup_minsize.html',
  36
+  'Attributes::NAME' => 'html/en/attrib/iup_name.html',
  37
+  'Attributes::PARENTDIALOG' => 'html/en/attrib/iup_parentdialog.html',
  38
+  'Attributes::POSITION' => 'html/en/attrib/iup_position.html',
  39
+  'Attributes::POSX' => 'html/en/attrib/iup_posx.html',
  40
+  'Attributes::POSY' => 'html/en/attrib/iup_posy.html',
  41
+  'Attributes::RASTERSIZE' => 'html/en/attrib/iup_rastersize.html',
  42
+  'Attributes::SCROLLBAR' => 'html/en/attrib/iup_scrollbar.html',
  43
+  'Attributes::SHRINK' => 'html/en/attrib/iup_shrink.html',
  44
+  'Attributes::SIZE' => 'html/en/attrib/iup_size.html',
  45
+  'Attributes::TIP' => 'html/en/attrib/iup_tip.html',
  46
+  'Attributes::TITLE' => 'html/en/attrib/iup_title.html',
  47
+  'Attributes::VALUE' => 'html/en/attrib/iup_value.html',
  48
+  'Attributes::VISIBLE' => 'html/en/attrib/iup_visible.html',
  49
+  'Attributes::WID' => 'html/en/attrib/iup_wid.html',
  50
+  'Attributes::X' => 'html/en/attrib/iup_x.html',
  51
+  'Attributes::XMAX' => 'html/en/attrib/iup_xmax.html',
  52
+  'Attributes::XMIN' => 'html/en/attrib/iup_xmin.html',
  53
+  'Attributes::Y' => 'html/en/attrib/iup_y.html',
  54
+  'Attributes::YMAX' => 'html/en/attrib/iup_ymax.html',
  55
+  'Attributes::YMIN' => 'html/en/attrib/iup_ymin.html',
  56
+  'Attributes::ZORDER' => 'html/en/attrib/iup_zorder.html',
  57
+  'Attributes::Keyboard Codes' => 'html/en/attrib/key.html',
  58
+  'Manual::Attributes' => 'html/en/attrib_guide.html',
  59
+  'Manual::App_Basic' => 'html/en/basic/index.html',
  60
+  'Callbacks::00main' => 'html/en/call.html',
  61
+  'Callbacks::ACTION' => 'html/en/call/iup_action.html',
  62
+  'Callbacks::BUTTON_CB' => 'html/en/call/iup_button_cb.html',
  63
+  'Callbacks::CLOSE_CB' => 'html/en/call/iup_close_cb.html',
  64
+  'Callbacks::DEFAULT_ACTION' => 'html/en/call/iup_default_action.html',
  65
+  'Callbacks::DESTROY_CB' => 'html/en/call/iup_destroy_cb.html',
  66
+  'Callbacks::DROPFILES_CB' => 'html/en/call/iup_dropfiles_cb.html',
  67
+  'Callbacks::ENTERWINDOW_CB' => 'html/en/call/iup_enterwindow_cb.html',
  68
+  'Callbacks::GETFOCUS_CB' => 'html/en/call/iup_getfocus_cb.html',
  69
+  'Callbacks::HELP_CB' => 'html/en/call/iup_help_cb.html',
  70
+  'Callbacks::HIGHLIGHT_CB' => 'html/en/call/iup_highlight_cb.html',
  71
+  'Callbacks::IDLE_ACTION' => 'html/en/call/iup_idle_action.html',
  72
+  'Callbacks::K_ANY' => 'html/en/call/iup_k_any.html',
  73
+  'Callbacks::KEYPRESS_CB' => 'html/en/call/iup_keypress_cb.html',
  74
+  'Callbacks::KILLFOCUS_CB' => 'html/en/call/iup_killfocus_cb.html',
  75
+  'Callbacks::LEAVEWINDOW_CB' => 'html/en/call/iup_leavewindow_cb.html',
  76
+  'Callbacks::MAP_CB' => 'html/en/call/iup_map_cb.html',
  77
+  'Callbacks::MENUCLOSE_CB' => 'html/en/call/iup_menuclose_cb.html',
  78
+  'Callbacks::MOTION_CB' => 'html/en/call/iup_motion_cb.html',
  79
+  'Callbacks::OPEN_CB' => 'html/en/call/iup_open_cb.html',
  80
+  'Callbacks::RESIZE_CB' => 'html/en/call/iup_resize_cb.html',
  81
+  'Callbacks::SCROLL_CB' => 'html/en/call/iup_scroll_cb.html',
  82
+  'Callbacks::SHOW_CB' => 'html/en/call/iup_show_cb.html',
  83
+  'Callbacks::UNMAP_CB' => 'html/en/call/iup_unmap_cb.html',
  84
+  'Callbacks::WHEEL_CB' => 'html/en/call/iup_wheel_cb.html',
  85
+  'Callbacks::WOM_CB' => 'html/en/call/iup_wom_cb.html',
  86
+  'Callbacks::Events and Callbacks Guide' => 'html/en/call_guide.html',
  87
+  'Manual::Controls1' => 'html/en/controls.html',
  88
+  'Manual::Controls2' => 'html/en/cpi.html',
  89
+  'IUP::PPlot' => 'html/en/ctrl/iup_pplot.html',
  90
+  'IUP::Cells' => 'html/en/ctrl/iupcells.html',
  91
+  'IUP::ColorBar' => 'html/en/ctrl/iupcolorbar.html',
  92
+  'IUP::ColorBrowser' => 'html/en/ctrl/iupcolorbrowser.html',
  93
+  'IUP::Dial' => 'html/en/ctrl/iupdial.html',
  94
+  'IUP::Gauge' => 'html/en/ctrl/iupgauge.html',
  95
+  'IUP::GLCanvas' => 'html/en/ctrl/iupglcanvas.html',
  96
+  'IUP::Mask' => 'html/en/ctrl/iupmask.html',
  97
+  'IUP::Matrix_00main' => 'html/en/ctrl/iupmatrix.html',
  98
+  'IUP::Matrix_A' => 'html/en/ctrl/iupmatrix_attrib.html',
  99
+  'IUP::Matrix_C' => 'html/en/ctrl/iupmatrix_cb.html',
  100
+  'IUP::OleControl' => 'html/en/ctrl/iupole.html',
  101
+  'Manual::Dialogs' => 'html/en/dialogs.html',
  102
+  'IUP::Alarm' => 'html/en/dlg/iupalarm.html',
  103
+  'IUP::ColorDlg' => 'html/en/dlg/iupcolordlg.html',
  104
+  'IUP::Dialog' => 'html/en/dlg/iupdialog.html',
  105
+  'IUP::FileDlg' => 'html/en/dlg/iupfiledlg.html',
  106
+  'IUP::FontDlg' => 'html/en/dlg/iupfontdlg.html',
  107
+  'IUP::GetColor' => 'html/en/dlg/iupgetcolor.html',
  108
+  'IUP::GetFile' => 'html/en/dlg/iupgetfile.html',
  109
+  'IUP::GetParam' => 'html/en/dlg/iupgetparam.html',
  110
+  'IUP::GetText' => 'html/en/dlg/iupgettext.html',
  111
+  'IUP::ListDialog' => 'html/en/dlg/iuplistdialog.html',
  112
+  'IUP::Message' => 'html/en/dlg/iupmessage.html',
  113
+  'IUP::MessageDlg' => 'html/en/dlg/iupmessagedlg.html',
  114
+  'IUP::Scanf' => 'html/en/dlg/iupscanf.html',
  115
+  'Manual::IUPproject_Download1' => 'html/en/download.html',
  116
+  'Manual::IUPproject_Download2' => 'html/en/download_tips.html',
  117
+  'Manual::IUPproject_License' => 'html/en/copyright.html',
  118
+  'Manual::Driver_GTK' => 'html/en/drv/gtk.html',
  119
+  'Manual::Driver_Motif' => 'html/en/drv/motif.html',
  120
+  'Manual::Driver_Win32' => 'html/en/drv/win32.html',
  121
+  'IUP::Button' => 'html/en/elem/iupbutton.html',
  122
+  'IUP::Canvas' => 'html/en/elem/iupcanvas.html',
  123
+  'IUP::Cbox' => 'html/en/elem/iupcbox.html',
  124
+  'IUP::Clipboard' => 'html/en/elem/iupclipboard.html',
  125
+  'IUP::Fill' => 'html/en/elem/iupfill.html',
  126
+  'IUP::Frame' => 'html/en/elem/iupframe.html',
  127
+  'IUP::Hbox' => 'html/en/elem/iuphbox.html',
  128
+  'IUP::Image' => 'html/en/elem/iupimage.html',
  129
+  'IUP::Item' => 'html/en/elem/iupitem.html',
  130
+  'IUP::Label' => 'html/en/elem/iuplabel.html',
  131
+  'IUP::List' => 'html/en/elem/iuplist.html',
  132
+  'IUP::Menu' => 'html/en/elem/iupmenu.html',
  133
+  'IUP::MultiLine' => 'html/en/elem/iupmultiline.html',
  134
+  'IUP::Normalizer' => 'html/en/elem/iupnormalizer.html',
  135
+  'IUP::ProgressBar' => 'html/en/elem/iupprogressbar.html',
  136
+  'IUP::Radio' => 'html/en/elem/iupradio.html',
  137
+  'IUP::Sbox' => 'html/en/elem/iupsbox.html',
  138
+  'IUP::Separator' => 'html/en/elem/iupseparator.html',
  139
+  'IUP::Spin' => 'html/en/elem/iupspin.html',
  140
+  'IUP::Split' => 'html/en/elem/iupsplit.html',
  141
+  'IUP::Submenu' => 'html/en/elem/iupsubmenu.html',
  142
+  'IUP::Tabs' => 'html/en/elem/iuptabs.html',
  143
+  'IUP::Text' => 'html/en/elem/iuptext.html',
  144
+  'IUP::Timer' => 'html/en/elem/iuptimer.html',
  145
+  'IUP::Toggle' => 'html/en/elem/iuptoggle.html',
  146
+  'IUP::Tree_00main' => 'html/en/elem/iuptree.html',
  147
+  'IUP::Tree_A' => 'html/en/elem/iuptree_attrib.html',
  148
+  'IUP::Tree_C' => 'html/en/elem/iuptree_cb.html',
  149
+  'IUP::User' => 'html/en/elem/iupuser.html',
  150
+  'IUP::Val' => 'html/en/elem/iupval.html',
  151
+  'IUP::Vbox' => 'html/en/elem/iupvbox.html',
  152
+  'IUP::Zbox' => 'html/en/elem/iupzbox.html',
  153
+  'Func::Append' => 'html/en/func/iupappend.html',
  154
+  'Func::Close' => 'html/en/func/iupclose.html',
  155
+  'Func::ConvertXYToPos' => 'html/en/func/iupconvertxytopos.html',
  156
+  'Func::Create' => 'html/en/func/iupcreate.html',
  157
+  'Func::Destroy' => 'html/en/func/iupdestroy.html',
  158
+  'Func::Detach' => 'html/en/func/iupdetach.html',
  159
+  'Func::ExitLoop' => 'html/en/func/iupexitloop.html',
  160
+  'Func::Flush' => 'html/en/func/iupflush.html',
  161
+  'Func::GetActionName' => 'html/en/func/iupgetactionname.html',
  162
+  'Func::GetAllAttributes' => 'html/en/func/iupgetallattributes.html',
  163
+  'Func::GetAllDialogs' => 'html/en/func/iupgetalldialogs.html',
  164
+  'Func::GetAllNames' => 'html/en/func/iupgetallnames.html',
  165
+  'Func::GetAttribute' => 'html/en/func/iupgetattribute.html',
  166
+  'Func::GetAttributeHandle' => 'html/en/func/iupgetattributehandle.html',
  167
+  'Func::GetAttributes' => 'html/en/func/iupgetattributes.html',
  168
+  'Func::GetBrother' => 'html/en/func/iupgetbrother.html',
  169
+  'Func::GetCallback' => 'html/en/func/iupgetcallback.html',
  170
+  'Func::GetChild' => 'html/en/func/iupgetchild.html',
  171
+  'Func::GetChildCount' => 'html/en/func/iupgetchildcount.html',
  172
+  'Func::GetChildPos' => 'html/en/func/iupgetchildpos.html',
  173
+  'Func::GetClassAttributes' => 'html/en/func/iupgetclassattributes.html',
  174
+  'Func::GetClassName' => 'html/en/func/iupgetclassname.html',
  175
+  'Func::GetClassType' => 'html/en/func/iupgetclasstype.html',
  176
+  'Func::GetDialog' => 'html/en/func/iupgetdialog.html',
  177
+  'Func::GetDialogChild' => 'html/en/func/iupgetdialogchild.html',
  178
+  'Func::GetFloat' => 'html/en/func/iupgetfloat.html',
  179
+  'Func::GetFocus' => 'html/en/func/iupgetfocus.html',
  180
+  'Func::GetFunction' => 'html/en/func/iupgetfunction.html',
  181
+  'Func::GetGlobal' => 'html/en/func/iupgetglobal.html',
  182
+  'Func::GetHandle' => 'html/en/func/iupgethandle.html',
  183
+  'Func::GetInt' => 'html/en/func/iupgetint.html',
  184
+  'Func::GetLanguage' => 'html/en/func/iupgetlanguage.html',
  185
+  'Func::GetName' => 'html/en/func/iupgetname.html',
  186
+  'Func::GetNextChild' => 'html/en/func/iupgetnextchild.html',
  187
+  'Func::GetParent' => 'html/en/func/iupgetparent.html',
  188
+  'Func::Help' => 'html/en/func/iuphelp.html',
  189
+  'Func::Hide' => 'html/en/func/iuphide.html',
  190
+  'Func::Insert' => 'html/en/func/iupinsert.html',
  191
+  'Func::Load' => 'html/en/func/iupload.html',
  192
+  'Func::LoopStep' => 'html/en/func/iuploopstep.html',
  193
+  'xiupluaopen' => 'html/en/func/iuplua_open.html',
  194
+  'Func::MainLoop' => 'html/en/func/iupmainloop.html',
  195
+  'Func::MainLoopLevel' => 'html/en/func/iupmainlooplevel.html',
  196
+  'Func::Map' => 'html/en/func/iupmap.html',
  197
+  'Func::MapFont' => 'html/en/func/iupmapfont.html',
  198
+  'Func::NextField' => 'html/en/func/iupnextfield.html',
  199
+  'Func::Open' => 'html/en/func/iupopen.html',
  200
+  'Func::Popup' => 'html/en/func/iuppopup.html',
  201
+  'Func::PreviousField' => 'html/en/func/iuppreviousfield.html',
  202
+  'Func::Redraw' => 'html/en/func/iupredraw.html',
  203
+  'Func::Refresh' => 'html/en/func/iuprefresh.html',
  204
+  'Func::Append' => 'html/en/func/iupreparent.html',
  205
+  'Func::ResetAttribute' => 'html/en/func/iupresetattribute.html',
  206
+  'Func::SaveClassAttributes' => 'html/en/func/iupsaveclassattributes.html',
  207
+  'Func::SaveImageAsText' => 'html/en/func/iupsaveimageastext.html',
  208
+  'Func::SetAttributes' => 'html/en/func/iupsetatt.html',
  209
+  'Func::SetAttribute' => 'html/en/func/iupsetattribute.html',
  210
+  'Func::SetAttributeHandle' => 'html/en/func/iupsetattributehandle.html',
  211
+  'Func::SetAttributes' => 'html/en/func/iupsetattributes.html',
  212
+  'Func::SetCallback' => 'html/en/func/iupsetcallback.html',
  213
+  'Func::SetCallbacks' => 'html/en/func/iupsetcallbacks.html',
  214
+  'Func::SetClassDefaultAttribute' => 'html/en/func/iupsetclassdefaultattribute.html',
  215
+  'Func::SetfAttribute' => 'html/en/func/iupsetfattribute.html',
  216
+  'Func::SetFocus' => 'html/en/func/iupsetfocus.html',
  217
+  'Func::SetFunction' => 'html/en/func/iupsetfunction.html',
  218
+  'Func::SetGlobal' => 'html/en/func/iupsetglobal.html',
  219
+  'Func::SetHandle' => 'html/en/func/iupsethandle.html',
  220
+  'Func::SetLanguage' => 'html/en/func/iupsetlanguage.html',
  221
+  'Func::Show' => 'html/en/func/iupshow.html',
  222
+  'Func::ShowXY' => 'html/en/func/iupshowxy.html',
  223
+  'Func::StoreAttribute' => 'html/en/func/iupstoreattribute.html',
  224
+  'Func::StoreGlobal' => 'html/en/func/iupstoreglobal.html',
  225
+  'Func::Unmap' => 'html/en/func/iupunmap.html',
  226
+  'Func::UnMapFont' => 'html/en/func/iupunmapfont.html',
  227
+  'Func::Update' => 'html/en/func/iupupdate.html',
  228
+  'Func::Version' => 'html/en/func/iupversion.html',
  229
+  'Manual::Gallery_StandardControls' => 'html/en/gallery.html',
  230
+  'Manual::Gallery_AdditionalControls' => 'html/en/gallery_ctrl.html',
  231
+  'Manual::Gallery_PreDefinedDialogs' => 'html/en/gallery_dlg.html',
  232
+  'xGuide' => 'html/en/guide.html',
  233
+  'xIUP' => 'html/en/home.html',
  234
+  'xAdditionalControls' => 'html/en/iupcontrols.html',
  235
+  'IUP-IM' => 'html/en/iupim.html',
  236
+  'IUP::ImageLib' => 'html/en/iupimglib.html',
  237
+  'IUP::ImageLib' => 'html/en/iupimglib2.html',
  238
+  'xLuaAdvancedGuide1' => 'html/en/iuplua.html',
  239
+  'xLuaAdvancedGuide2' => 'html/en/iuplua_adv.html',
  240
+  'xKeyboard' => 'html/en/keyboard.html',
  241
+  'xLayoutComposition' => 'html/en/layout.html',
  242
+  'xLayoutGuide' => 'html/en/layout_guide.html',
  243
+  'xOverview' => 'html/en/prod.html',
  244
+  'xResources' => 'html/en/resources.html',
  245
+  'xOtherToolkits' => 'html/en/toolkits.html',
  246
+};
  247
+
  248
+foreach my $n (keys %$html_files) {
  249
+  my $f = $docroot . '/' . $html_files->{$n};
  250
+  die "File $f not exists" unless -f $f;
  251
+  
  252
+  my $html = read_file($f);
  253
+  # HTML replacements here
  254
+  $html =~ s|href="|href="pod:|gi;  
  255
+  
  256
+  my $tree = HTML::TreeBuilder->new_from_content($html);
  257
+
  258
+  my $t = $tree->find('title');
  259
+  (my $class = $t->as_text) =~ s/^Iup/IUP::/;
  260
+  my $b = $tree->find('body');
  261
+  
  262
+  ($t) = $tree->look_down( '_tag' => 'div', 'id' => 'navigation');
  263
+  $t->delete() if defined $t;
  264
+  
  265
+  my $pod = Pod::HTML2Pod::convert(
  266
+    'content' => $b->as_HTML,
  267
+    'a_href' => 1,  # try converting links
  268
+    'a_name' => 1,
  269
+  );
  270
+  
  271
+  my $name = $n;
  272
+  $name =~ s|::|/|g;
  273
+  $name = "$podroot/$name.pod";
  274
+  $name =~ s|\\|/|g;
  275
+
  276
+  my $dir = $name;
  277
+  $dir =~ s|[^/]*$||;
  278
+  make_path($dir);
  279
+  
  280
+  # POD replacements here
  281
+  $pod =~ s|X<SeeAlso>||g;
  282
+  $pod =~ s|=head1 [Ii]up(.*)|=head1 NAME_xxx\n\nIUP::$1 - xxx_short_info_xxx\n\n=head1 DESCRIPTION_xxx|g;
  283
+  $pod =~ s|=head2 Creation|=head1 USAGE\n\n=head2 Creation_xxx|g;
  284
+  $pod =~ s|=head2 Callbacks|=head2 Callbacks_xxx|g;
  285
+  $pod =~ s|=head2 Attributes|=head2 Attributes_xxx|g;
  286
+  $pod =~ s|=head2 Notes|=head2 Notes_xxx|g;
  287
+  $pod =~ s|=head2 Examples|=head1 EXAMPLES_xxx|g;
  288
+  $pod =~ s|=head2 See Also|=head1 SEE ALSO_xxx|g;
  289
+  if ($pod =~ /=head2 Attributes_xxx(.*?)=head/s ) {
  290
+    my $c = $1;
  291
+    $c =~ s|\n([LB]<[^ :]*)[ :]*|\n=item * $1\n\n|g;
  292
+    #$c =~ s|): *([^\n])|):\n\n$1|g;
  293
+    $pod =~ s|=head2 Attributes_xxx(.*?)=head|=head2 Attributes_xxx\n\nAttr intro text_xxx\n\n=over$c=back\n\n=head|sg;    
  294
+    $pod =~ s|=over\n\n----\n\n=back|=back\n\nCommon attributes_xxx:\n\n=over|;
  295
+  }
  296
+  
  297
+  print STDERR "Writting '$name' ...\n";
  298
+  
  299
+  open DAT, ">", $name;
  300
+  print DAT $pod;
  301
+  close DAT;  
  302
+}
  303
+
  304
+
  305
+my $batchconv = Pod::Simple::HTMLBatch->new;
  306
+#$batchconv->some_option( some_value );
  307
+#$batchconv->some_other_option( some_other_value );
  308
+$batchconv->batch_convert($podroot, $htmlout);
  309
+
9  doc/Button.pod
Source Rendered
... ...
@@ -0,0 +1,9 @@
  1
+=pod
  2
+
  3
+=head1 NAME
  4
+
  5
+IUP::Button - Demo POD