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

Modified Files:
        CHANGELOG GUI.pm GUI_Events.cpp GUI_MessageLoops.cpp 
        GUI_Options.cpp Makefile.PL 
Log Message:
Start of DropFiles Integration

Index: Makefile.PL
===================================================================
RCS file: /cvsroot/perl-win32-gui/Win32-GUI/Makefile.PL,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** Makefile.PL 16 Mar 2006 21:11:12 -0000      1.17
--- Makefile.PL 12 Apr 2006 20:00:06 -0000      1.18
***************
*** 6,9 ****
--- 6,10 ----
  use Config;
  
+ our $W32G_CORE = 1;
  $main::USERESOURCE = 1;
  $main::BUILDENV = '';
***************
*** 256,259 ****
--- 257,265 ----
  use warnings;
  
+ sub pasthru {
+   my $inherited = shift->SUPER::pasthru(@_);
+   return "$inherited W32G_CORE=1";
+ }
+ 
  sub xs_c {
    my $inherited = shift->SUPER::xs_c(@_);

Index: GUI.pm
===================================================================
RCS file: /cvsroot/perl-win32-gui/Win32-GUI/GUI.pm,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** GUI.pm      16 Mar 2006 21:11:11 -0000      1.39
--- GUI.pm      12 Apr 2006 20:00:05 -0000      1.40
***************
*** 610,613 ****
--- 610,632 ----
  }
  
+     
###########################################################################
+     # (@)METHOD:AcceptFiles([FLAG])
+     # Gets/sets the 
L<Win32::GUI::Reference::Options\-acceptfiles|-acceptfiles>
+     # options on a window.  If C<FLAG> is not provided, returns the current
+     # state.  If FLAG is provided it sets or unsets the state, returning the
+     # previous state.
+ sub AcceptFiles {
+     my $win = shift;
+     my $accept = shift;
+ 
+     my $old_accept = $win->GetWindowLong(GWL_EXSTYLE) & WS_EX_ACCEPTFILES() ? 
1 : 0;
+ 
+     if(defined $accept) {
+         $win->Change(-acceptfiles => $accept);
+     }
+ 
+     return $old_accept;
+ }
+ 
  
###############################################################################
  # SUB-PACKAGES

Index: CHANGELOG
===================================================================
RCS file: /cvsroot/perl-win32-gui/Win32-GUI/CHANGELOG,v
retrieving revision 1.75
retrieving revision 1.76
diff -C2 -d -r1.75 -r1.76
*** CHANGELOG   12 Apr 2006 19:49:21 -0000      1.75
--- CHANGELOG   12 Apr 2006 20:00:05 -0000      1.76
***************
*** 6,9 ****
--- 6,20 ----
  Win32-GUI ChangeLog
  ===================
+ + [Robert May] : 12 Apr 2006 - Start of DropFiles integration
+     - GUI.pm Add Acceptfiles method and documentation.
+     - GUI_Events.cpp Fix OEM callback to allow passing SV.
+     - GUI_MessageLoops.cpp modify WM_DROPFILES handling to pass
+       a Win32::GUI::DropFiles object, and update event documentation.
+     - GUI_Options.cpp Add -acceptfiles option for windows
+     - Makefile.PL set up W32G_CORE variable so that sub directories
+       can know if they arebeing called from a higher level Makefile,
+       and so that tests know how they are being run.
+     - docs/GUI/Reference/Options.pod added -acceptfiles documentation
+ 
  + [Robert May] : 12 Apr 2006 - Fix GetKeyState
      - GUI.xs Changed stack macros in GetKeyStae to those that exist

Index: GUI_Options.cpp
===================================================================
RCS file: /cvsroot/perl-win32-gui/Win32-GUI/GUI_Options.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** GUI_Options.cpp     16 Mar 2006 21:11:11 -0000      1.12
--- GUI_Options.cpp     12 Apr 2006 20:00:06 -0000      1.13
***************
*** 313,316 ****
--- 313,317 ----
              } else BitmaskOption("-hscroll", perlcs->cs.style, WS_HSCROLL)
              } else BitmaskOption("-vscroll", perlcs->cs.style, WS_VSCROLL)
+             } else BitmaskOption("-acceptfiles", perlcs->cs.dwExStyle, 
WS_EX_ACCEPTFILES)
              } else BitmaskOption("-container", perlcs->dwPlStyle, 
PERLWIN32GUI_CONTAINER)
              }

Index: GUI_Events.cpp
===================================================================
RCS file: /cvsroot/perl-win32-gui/Win32-GUI/GUI_Events.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** GUI_Events.cpp      16 Mar 2006 21:11:11 -0000      1.12
--- GUI_Events.cpp      12 Apr 2006 20:00:06 -0000      1.13
***************
*** 142,145 ****
--- 142,148 ----
                      XPUSHs(sv_2mortal(newSVpv(va_arg( args, char * ), 0)));
                      break;
+                 case PERLWIN32GUI_ARGTYPE_SV:
+                     XPUSHs(va_arg( args, SV *));
+                     break;
                  default:
                      warn("Win32::GUI: WARNING! unknown argument type (%d) to 
event '%s'", argtype, Name);

Index: GUI_MessageLoops.cpp
===================================================================
RCS file: /cvsroot/perl-win32-gui/Win32-GUI/GUI_MessageLoops.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** GUI_MessageLoops.cpp        16 Mar 2006 21:11:11 -0000      1.19
--- GUI_MessageLoops.cpp        12 Apr 2006 20:00:06 -0000      1.20
***************
*** 627,637 ****
      case WM_DROPFILES:
          /*
!          * (@)EVENT:DropFiles(DROP_HANDLE)
!          * Sent when the window receives dropped files.
           * (@)APPLIES_TO:*
           */
!         PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_DROPFILE, 
"DropFiles",
!                         PERLWIN32GUI_ARGTYPE_LONG, (LONG) wParam,
                          -1);
          break;
      }
--- 627,653 ----
      case WM_DROPFILES:
          /*
!          * (@)EVENT:DropFiles(DROP)
!          * Sent when the window receives dropped files.  To enable a window to
!        * be a target for files dragged from a shell window, you must set the
!        * window's L<-acceptfiles|Win32::GUI::Reference::Options\-acceptfiles>
!        * option or call C<< $win->AcceptFiles(1) >> on the window (See
!        * L<Win32::GUI::AcceptFiles|AccepFiles()>). The DROP parameter is 
either
!        * a Win32 drop handle (see MSDN) or a
!        * L<Win32::GUI::DropFiles|Win32::GUI::DropFiles> object if you have 
done
!        * C<use Win32::GUI::DropFiles;> somewhere in your code.
           * (@)APPLIES_TO:*
           */
!         { HV *dropfiles_stash = gv_stashpv("Win32::GUI::DropFiles", 0);
!           if(dropfiles_stash) { /* Win32::GUI::DropFiles is available */
!             PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_DROPFILE, 
"DropFiles",
!                          PERLWIN32GUI_ARGTYPE_SV, 
CreateObjectWithHandle(NOTXSCALL "Win32::GUI::DropFiles", (HWND)wParam),
                          -1);
+         } else { /* Win32::GUI::DropFiles is not available */
+             PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_DROPFILE, 
"DropFiles",
+                          PERLWIN32GUI_ARGTYPE_LONG, wParam,
+                         -1);
+             DragFinish((HDROP)wParam);
+         }
+       }
          break;
      }
***************
*** 966,972 ****
          break;
      case WM_DROPFILES:
!         PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_DROPFILE, 
"DropFiles",
!                         PERLWIN32GUI_ARGTYPE_LONG, (LONG) wParam,
                          -1);
      }
  
--- 982,997 ----
          break;
      case WM_DROPFILES:
!         { HV *dropfiles_stash = gv_stashpv("Win32::GUI::DropFiles", 0);
!           if(dropfiles_stash) { /* Win32::GUI::DropFiles is available */
!             PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_DROPFILE, 
"DropFiles",
!                          PERLWIN32GUI_ARGTYPE_SV, 
CreateObjectWithHandle(NOTXSCALL "Win32::GUI::DropFiles", (HWND)wParam),
                          -1);
+         } else { /* Win32::GUI::DropFiles is not available */
+             PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_DROPFILE, 
"DropFiles",
+                          PERLWIN32GUI_ARGTYPE_LONG, wParam,
+                         -1);
+             DragFinish((HDROP)wParam);
+         }
+       }
      }
  


Reply via email to