Update of /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-Grid
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20182

Modified Files:
        Changes Grid.pm Grid.xs Makefile.PL TYPEMAP 
Added Files:
        GridRC.PL TODO 
Removed Files:
        MANIFEST README 
Log Message:
Merge Grid into core distribution

Index: Makefile.PL
===================================================================
RCS file: /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-Grid/Makefile.PL,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Makefile.PL 1 Nov 2005 12:34:46 -0000       1.1
--- Makefile.PL 11 Jun 2006 16:42:11 -0000      1.2
***************
*** 1,38 ****
  use ExtUtils::MakeMaker;
! # See lib/ExtUtils/MakeMaker.pm for details of how to influence
! # the contents of the Makefile that is written.
  
! WriteMakefile(
!     'NAME'         => 'Win32::GUI::Grid',
!     'VERSION_FROM' => 'Grid.pm',
!     'XS'           => { 'Grid.xs' => 'Grid.cpp' },
!     'LIBS'         => ['Comctl32.lib Mfc42.lib Eafxis.lib'],   # e.g., '-lm'
!     'DEFINE'       => '',     # e.g., '-DHAVE_SOMETHING'
!     'INC'          => '',     # e.g., '-I/usr/include/other'
!     'MYEXTLIB'     => './MFCGrid/Lib/MFCGrid.lib',
!      ($] ge '5.005')
!      ? (
!       'AUTHOR'   => 'ROCHER Laurent ([EMAIL PROTECTED])',
!       'ABSTRACT' => 'Add a Grid control to Win32::GUI (MFC Grid from 
CodeProject.com)',
!      )
!      : (),
  );
  
  
! sub MY::xs_c {
! '
  
! .xs.c:
!     $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG) 
$(XSUBPPARGS) $*.xs > $*.c
  
! .xs.cpp:
!     $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG) 
$(XSUBPPARGS) $*.xs > $*.cpp
  
! ./MFCGrid/Lib/MFCGrid.lib: MFCGrid/makefile
!     cd MFCGrid
!     nmake
!     cd ..
  
! ';
  }
  
--- 1,97 ----
+ #!perl -w
+ use strict;
+ use warnings;
+ 
+ # Makefile.PL for Win32::GUI::Grid
+ # $Id$
+ 
+ use 5.006;
+ use Config;
  use ExtUtils::MakeMaker;
! use File::Find();
  
! my @demos;
! File::Find::find(sub { push @demos, $File::Find::name if $File::Find::name =~ 
/\.(pl|bmp)$/ }, 'demos');
! 
! my %config = (
!     NAME          =>  'Win32::GUI::Grid',
!     VERSION_FROM  =>  'Grid.pm',
!     ABSTRACT_FROM =>  'Grid.pm',
!     AUTHOR        =>  'ROCHER Laurent ([EMAIL PROTECTED])',
!     XS            => { 'Grid.xs' => 'Grid.cpp' },
!     LIBS          => ['-lcomctl32 -lMfc42 -lEafxis'],
!     MYEXTLIB      =>  './MFCGrid/Lib/MFCGrid.lib',
!     PL_FILES      => {'GridRC.PL' => '$(BASEEXT).rc', },
!     OBJECT        =>  '$(BASEEXT)$(OBJ_EXT) $(BASEEXT).res',
!     macro         => {RC => 'rc.exe',
!                       RCFLAGS => '',
!                       INST_DEMODIR => 
'$(INST_LIB)/Win32/GUI/demos/$(BASEEXT)',
!                       DEMOS => "@demos", },
!     clean         => {FILES => '*.rc *.res', },
  );
  
+ # if building using gcc (MinGW or cygwin) use windres
+ # as the resource compiler
+ # and the MinGW C++ standard library
+ if($Config{cc} =~ /gcc/i) {
+     $config{macro}->{RC} =      'windres';
+     $config{macro}->{RCFLAGS} = '-O coff -o $*.res';
+     $config{LIBS} = [':nodefault -lcomctl32 -lmsvcp60'];
+ }
  
! # Can only build with mscv.
! if($Config{cc} !~ /cl/i) {
!     print <<__EXPLAIN;
  
! Win32::GUI::Grid can only be built using MSVC, not '$Config{cc}',
! as it requires the MFC framework.  Win32::GUI::Grid will be skipped
! during the current build process.
  
! __EXPLAIN
!     ExtUtils::MakeMaker::WriteEmptyMakefile(NAME => 'Win32::GUI::Grid');
! }
! else {
!     WriteMakefile(%config);
! }
  
! package MY;
  
! sub xs_c {
!   my $inherited = shift->SUPER::xs_c(@_);
!   $inherited =~ s/\.c/.cpp/g;
!   return $inherited;
  }
  
+ # Add rule to make MFCGrid.lib
+ # Add rule for .rc to .res conversion
+ # Add rules to install demo scripts
+ sub postamble {
+   return <<'__POSTAMBLE';
+ 
+ # Win32::GUI::Grid MFCGrid.lib section
+ 
+ ./MFCGrid/Lib/MFCGrid.lib: MFCGrid/makefile
+       cd MFCGrid
+       $(MAKE) $(PASTHRU)
+       cd ..
+ 
+ # Win32::GUI::Grid RC section
+ 
+ .rc.res:
+       $(RC) $(RCFLAGS) $<
+ 
+ # Win32::GUI::Grid demo script section
+ 
+ pure_all :: demo_to_blib
+       $(NOECHO) $(NOOP)
+ 
+ demo_to_blib: $(DEMOS)
+       $(NOECHO) $(MKPATH) $(INST_DEMODIR)
+       $(CP) $? $(INST_DEMODIR)
+       $(NOECHO) $(TOUCH) demo_to_blib
+ 
+ clean ::
+       -$(RM_F) demo_to_blib
+ 
+ __POSTAMBLE
+ }

--- NEW FILE: TODO ---
- Watch for new versions of MFC grid
- Is build possible under mingw?
- Is static build possible, so as not to depend on mfc42.dll?
- make clean should clean MFCGrid/Build and MFCGrid/Lib
- more tests!
- fix 'unreferenced targ' compiler warnings

--- MANIFEST DELETED ---

Index: Grid.xs
===================================================================
RCS file: /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-Grid/Grid.xs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Grid.xs     1 Nov 2005 12:34:46 -0000       1.1
--- Grid.xs     11 Jun 2006 16:42:10 -0000      1.2
***************
*** 3,6 ****
--- 3,8 ----
  /**********************************************************************/
  
+ /* $Id */
+ 
  //////////////////////////////////////////////////////////////////////
  // Include
***************
*** 69,73 ****
  #define WM_EXITLOOP   (WM_APP+1)
  
! // Return a COLOREF from a SV
  COLORREF SvCOLORREF(pTHX_ SV* c)
  {
--- 71,75 ----
  #define WM_EXITLOOP   (WM_APP+1)
  
! // Return a COLORREF from a SV
  COLORREF SvCOLORREF(pTHX_ SV* c)
  {
***************
*** 299,302 ****
--- 301,305 ----
  int constant (char * name, int arg)
  {
+   errno = 0;
    switch(name[2])
    {
***************
*** 428,431 ****
--- 431,435 ----
    }
  
+   errno = EINVAL;
    return 0;
  }
***************
*** 830,833 ****
--- 834,839 ----
  MODULE = Win32::GUI::Grid       PACKAGE = Win32::GUI::Grid
  
+ PROTOTYPES: ENABLE
+ 
    ##################################################################
    #                                                                #
***************
*** 2701,2704 ****
--- 2707,2711 ----
    else if (pCell && pCell->IsKindOf(RUNTIME_CLASS(CGridCellURL)))
    {
+     RETVAL = FALSE;
      next_i = -1;
      for(i = 3; i < items; i++) {
***************
*** 2708,2711 ****
--- 2715,2719 ----
            next_i = i + 1;
            ((CGridCellURL*)pCell)->SetAutoLaunchUrl((LONG) SvIV(ST(next_i)));
+           RETVAL = TRUE;
          }
        }
***************
*** 2716,2719 ****
--- 2724,2728 ----
    else if (pCell && pCell->IsKindOf(RUNTIME_CLASS(CGridCellCheck)))
    {
+     RETVAL = FALSE;
      next_i = -1;
      for(i = 3; i < items; i++) {
***************
*** 2723,2726 ****
--- 2732,2736 ----
            next_i = i + 1;
            ((CGridCellCheck*)pCell)->SetCheck((LONG) SvIV(ST(next_i)));
+           RETVAL = TRUE;
          }
        }
***************
*** 2910,2920 ****
    # void EnsureVisible(CCellID &cell);
    # void EnsureVisible(int nRow, int nCol);
! void
! EnsureVisible(object, nRow, nCol)
!   CMFCWnd* object
!   int nRow
!   int nCol
! CODE:
!   object->EnsureVisible(nRow, nCol);
  
  void
--- 2920,2931 ----
    # void EnsureVisible(CCellID &cell);
    # void EnsureVisible(int nRow, int nCol);
!   # Duplicate of EnsureCellVisible??
!   # void
!   # EnsureVisible(object, nRow, nCol)
!   # CMFCWnd* object
!   #   int nRow
!   #   int nCol
!   # CODE:
!   #   object->EnsureVisible(nRow, nCol);
  
  void

Index: Grid.pm
===================================================================
RCS file: /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-Grid/Grid.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Grid.pm     1 Nov 2005 12:34:46 -0000       1.1
--- Grid.pm     11 Jun 2006 16:42:10 -0000      1.2
***************
*** 1,108 ****
  package Win32::GUI::Grid;
  
  use strict;
! use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD);
! use Carp 'croak','carp';
! use Win32::GUI;
  
  require Exporter;
  require DynaLoader;
- require AutoLoader;
[...2095 lines suppressed...]
+ =item L<Win32::GUI|Win32::GUI>
+ 
+ =item L<http://perl-win32-gui.sourceforge.net/>
+ 
+ =item L<http://www.codeproject.com/miscctrl/gridctrl.asp>
+ 
+ MFC Grid Control by Chris Maunder
+ 
+ =back
+ 
+ =head1 DEPENDENCIES
+ 
  Win32::GUI
+ Microsoft Foundation Classes (MFC)
+ 
+ =head1 AUTHOR
+ 
+ Laurent Rocher ([EMAIL PROTECTED])
  
  =cut

Index: Changes
===================================================================
RCS file: /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-Grid/Changes,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Changes     1 Nov 2005 12:34:46 -0000       1.1
--- Changes     11 Jun 2006 16:42:10 -0000      1.2
***************
*** 2,45 ****
  Revision history for Perl extension Win32::GUI::Grid.
  
  0.07  14/02/2004
!         - Use MFC Grid control 2.25
!         - Correct EnsureCellVisible methods ( bad name in XS, but keep 
EnsureVisible for compatibility)
!         - Fix locale setting problem.
  
  0.06  14/02/2004
!         - Fix Clipboard error (Ctrl+C) [Thank to Andrew St. Denis]
!         - Fix some Grid draw problem
!         - Add WM_PRINTCLIENT support for new Win32::GUI -noflicker option.
!         - New Cell Type (Calendar, URL)
!         - SetCellOptions : New options
  
  0.05  07/09/2003
!         - Add SetCellEditable method.
!         - Add List cell editing.
!         - New event _ChangedEdit for COMBO and LIST edit control when select 
change in list.
  
  0.04  07/08/2003
!         - Correct -heigth option.
!         - In InsertColumn, set last parameter optional.
!         - Add Column Perl Sort method.
  
  0.03  03/06/2003
!         - Correct Abnormal terminaison when multiple grid instance
  
  0.02  03/06/2003
!         - Correct crash when destroy grid during cell edit.
!         - Virtual Mode support.
!         - New cell editing support.
!             + Numeric
!             + Date
!             + Time
!             + Check
!             + Combo
!         - Add Perl Sort method.
  
  0.01  28/05/2003
!         - First build Win32::GUI::Grid
!         - Use MFC Grid control 2.24
  
  TODO
!    - Printing support (???)
--- 2,49 ----
  Revision history for Perl extension Win32::GUI::Grid.
  
+ 0.08  24/05/2006
+     - Merge into Win32::GUI core distribution
+     - Minor fix to constants() XS and AUTOLOAD() functions ( not re-setting 
$! )
+ 
  0.07  14/02/2004
!     - Use MFC Grid control 2.25
!     - Correct EnsureCellVisible methods ( bad name in XS, but keep 
EnsureVisible for compatibility)
!     - Fix locale setting problem.
  
  0.06  14/02/2004
!     - Fix Clipboard error (Ctrl+C) [Thank to Andrew St. Denis]
!     - Fix some Grid draw problem
!     - Add WM_PRINTCLIENT support for new Win32::GUI -noflicker option.
!     - New Cell Type (Calendar, URL)
!     - SetCellOptions : New options
  
  0.05  07/09/2003
!     - Add SetCellEditable method.
!     - Add List cell editing.
!     - New event _ChangedEdit for COMBO and LIST edit control when select 
change in list.
  
  0.04  07/08/2003
!     - Correct -heigth option.
!     - In InsertColumn, set last parameter optional.
!     - Add Column Perl Sort method.
  
  0.03  03/06/2003
!     - Correct Abnormal termination when multiple grid instance
  
  0.02  03/06/2003
!     - Correct crash when destroy grid during cell edit.
!     - Virtual Mode support.
!     - New cell editing support.
!         + Numeric
!         + Date
!         + Time
!         + Check
!         + Combo
!     - Add Perl Sort method.
  
  0.01  28/05/2003
!     - First build Win32::GUI::Grid
!     - Use MFC Grid control 2.24
  
  TODO
!     - Printing support (???)

--- README DELETED ---

--- NEW FILE: GridRC.PL ---
#!perl -w
use strict;
use warnings;
use ExtUtils::MakeMaker;

# $Id: GridRC.PL,v 1.1 2006/06/11 16:42:10 robertemay Exp $
# perl script to produce the RC file for
# Win32::GUI::Grid  create Resource
# file with a VERSIONINFO section

# The variables:
my %info = (
    Version => MM->parse_version('Grid.pm'),
    Dllname => 'Grid.dll',
    Years   => '2003..2006',
    Win32GUIVersion => MM->parse_version('../GUI.pm'),
);

# Open the target file
if ( @ARGV > 0 ) {
    my $file = $ARGV[0];
    open(my $fh, '>', $file) or die qq(Failed to open '$file': $!);
    select $fh;
}

{
    my $fileVersion = $info{Version};
    $fileVersion .= "_00" unless $fileVersion =~ m/_/;
    $info{FileVersion} =
        sprintf("%02d,%02d,%02d,00", $fileVersion =~ m/^(.*)\.([^_]*)_?(.*)$/);
    my $prodVersion = $info{Win32GUIVersion};
    $prodVersion .= "_00" unless $prodVersion =~ m/_/;
    $info{ProductVersion} =
        sprintf("%02d,%02d,%02d,00", $prodVersion =~ m/^(.*)\.([^_]*)_?(.*)$/);
}

print <<"__RC";
#include "Winver.h"

1 VERSIONINFO
FILEVERSION    $info{FileVersion}
PRODUCTVERSION $info{ProductVersion}
FILEOS         VOS__WINDOWS32
FILETYPE       VFT_DLL
{
  BLOCK "StringFileInfo"
  {
    BLOCK "040904E4"
    {
      VALUE "Comments"         , "Win32::GUI::Grid, part of the perl Win32::GUI 
module. Includes code by Chris Maunder from MFCGrid: 
http://www.codeproject.com/miscctrl/gridctrl.asp";
      VALUE "CompanyName"      , "perl-win32-gui.sourceforge.net"
      VALUE "FileDescription"  , "Win32::GUI::Grid perl extension"
      VALUE "FileVersion"      , "$info{Version}"
      VALUE "InternalName"     , "$info{Dllname}"
      VALUE "LegalCopyright"   , "Copyright © Laurent Rocher $info{Years}"
      VALUE "LegalTrademarks"  , "GNU and Artistic licences"
      VALUE "OriginalFilename" , "$info{Dllname}"
      VALUE "ProductName"      , "Win32::GUI perl extension"
      VALUE "ProductVersion"   , "$info{Win32GUIVersion}"
    }
  }

  BLOCK "VarFileInfo"
  {
    VALUE "Translation", 0x0409, 0x04E4
  }
}
__RC

exit(0);
__END__

Index: TYPEMAP
===================================================================
RCS file: /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-Grid/TYPEMAP,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TYPEMAP     1 Nov 2005 12:34:46 -0000       1.1
--- TYPEMAP     11 Jun 2006 16:42:11 -0000      1.2
***************
*** 1,27 ****
  TYPEMAP
  LPCTSTR                   T_PV
- LPCSTR                    T_PV
- LPTSTR                    T_PV
  DWORD                     T_IV
  UINT                      T_IV
  BOOL                      T_IV
- HBITMAP                   T_HANDLE
  HDC                       T_HANDLE
- HFONT                     T_HANDLE
  HIMAGELIST                T_HANDLE
  HWND                      T_HANDLE
  CMFCWnd*                  T_MFCWND
  COLORREF                  T_COLOR
- 
  
################################################################################
  INPUT
  T_HANDLE
      if(SvROK($arg)) {
!         if(hv_fetch((HV*)SvRV($arg), \"-handle\", 7, 0) != NULL)
!             $var = ($type) SvIV(*(hv_fetch((HV*)SvRV($arg), \"-handle\", 7, 
0)));
          else
              $var = NULL;
      } else
!         $var = ($type) SvIV($arg);
  
  T_MFCWND
--- 1,23 ----
  TYPEMAP
  LPCTSTR                   T_PV
  DWORD                     T_IV
  UINT                      T_IV
  BOOL                      T_IV
  HDC                       T_HANDLE
  HIMAGELIST                T_HANDLE
  HWND                      T_HANDLE
  CMFCWnd*                  T_MFCWND
  COLORREF                  T_COLOR
  
################################################################################
  INPUT
  T_HANDLE
      if(SvROK($arg)) {
!         SV** out=hv_fetch((HV*)SvRV($arg), \"-handle\", 7, 0);
!         if(out != NULL)
!             $var = INT2PTR($type,SvIV(*out));
          else
              $var = NULL;
      } else
!        $var = INT2PTR($type,SvIV($arg));
  
  T_MFCWND
***************
*** 34,39 ****
  OUTPUT
  T_HANDLE
!     sv_setiv($arg, (IV) $var);
  T_COLOR
      sv_setiv($arg, (IV) $var);
- 
--- 30,34 ----
  OUTPUT
  T_HANDLE
!     sv_setiv($arg, PTR2IV($var));
  T_COLOR
      sv_setiv($arg, (IV) $var);


Reply via email to