commit 15f2369e9e34b1d42e4251deb98d7a9a342da6d7
Author: unknown <TobyC@.(none)>
Date: Wed Mar 4 13:27:59 2009 +1100
Adjust bootstrapping of sub packages to try and resolve RT37665
diff --git a/GUI.pm b/GUI.pm
index 58a78f9..5f81ef0 100644
--- a/GUI.pm
+++ b/GUI.pm
@@ -12,9 +12,7 @@
#
###############################################################################
package Win32::GUI;
-
-require DynaLoader; # to dynuhlode the module.
-@ISA = qw( DynaLoader );
+use base 'DynaLoader';
###############################################################################
# STATIC OBJECT PROPERTIES
@@ -105,30 +103,30 @@ sub constant {
# delegated to Win32::GUI::Constants. Use of this is deprecated, and will be
# removed in the future
-sub AUTOLOAD {
- my $constant = $AUTOLOAD;
- $constant =~ s/.*:://;
- my ($callpkg, $file, $line) = caller;
- require Win32::GUI::Constants;
- my $val = Win32::GUI::Constants::constant($constant);
-
- if(defined $val) {
- no warnings; # avoid perl 5.6 warning about prototype mismatches
- eval "sub $AUTOLOAD() {$val}";
- use warnings;
- warnings::warnif 'deprecated',
- "Use of '$AUTOLOAD' is deprecated. Use 'Win32::GUI::Constants::$constant' instead.";
- goto &$AUTOLOAD;
- }
-
- #TODO - should we die? Many unknown methods may also end up here - can we find a better wording?
- die "Can't find '$constant' in package ". __PACKAGE__ .
- ". Used at $file line $line.\n";
-}
+#sub AUTOLOAD {
+# my $constant = $AUTOLOAD;
+# $constant =~ s/.*:://;
+# my ($callpkg, $file, $line) = caller;
+# require Win32::GUI::Constants;
+# my $val = Win32::GUI::Constants::constant($constant);
+#
+# if(defined $val) {
+# no warnings; # avoid perl 5.6 warning about prototype mismatches
+# eval "sub $AUTOLOAD() {$val}";
+# use warnings;
+# warnings::warnif 'deprecated',
+# "Use of '$AUTOLOAD' is deprecated. Use 'Win32::GUI::Constants::$constant' instead.";
+# goto &$AUTOLOAD;
+# }
+#
+# #TODO - should we die? Many unknown methods may also end up here - can we find a better wording?
+# die "Can't find '$constant' in package ". __PACKAGE__ .
+# ". Used at $file line $line.\n";
+#}
+#
sub bootstrap_subpackage {
my($package) = @_;
- $package = 'Win32::GUI::' . $package;
my $symbol = $package;
$symbol =~ s/\W/_/g;
no strict 'refs';
@@ -2717,6 +2715,7 @@ sub DESTROY {
# which contains the major version number of the shell32.dll library that
# has been loaded.
package Win32::GUI::NotifyIcon;
+
our $SHELLDLL_VERSION = (Win32::GUI::GetDllVersion('shell32'))[0];
###########################################################################
@@ -2978,6 +2977,7 @@ sub DESTROY {
# Work with a Window's DC (Drawing Context)
#
package Win32::GUI::DC;
+use base 'Win32::GUI';
###########################################################################
# (@)METHOD:new Win32::GUI::DC(WINDOW | DRIVER, DEVICE)
@@ -3488,6 +3488,9 @@ sub DESTROY {
###############################################################################
# dynamically load in the GUI.dll module.
#
+package Win32::GUI::MDI;
+use base 'Win32::GUI';
+
package Win32::GUI;
@@ -3495,34 +3498,34 @@ package Win32::GUI;
# Win32::GUI::GetDllVersion during use/compile time
#bootstrap Win32::GUI;
-bootstrap_subpackage 'Animation';
-bootstrap_subpackage 'Bitmap';
-bootstrap_subpackage 'Button';
-bootstrap_subpackage 'Combobox';
-bootstrap_subpackage 'DateTime';
-bootstrap_subpackage 'DC';
-bootstrap_subpackage 'Font';
-bootstrap_subpackage 'Header';
-bootstrap_subpackage 'ImageList';
-bootstrap_subpackage 'Label';
-bootstrap_subpackage 'Listbox';
-bootstrap_subpackage 'ListView';
-bootstrap_subpackage 'NotifyIcon';
-bootstrap_subpackage 'ProgressBar';
-bootstrap_subpackage 'Rebar';
-bootstrap_subpackage 'RichEdit';
-bootstrap_subpackage 'Splitter';
-bootstrap_subpackage 'TabStrip';
-bootstrap_subpackage 'Textfield';
-bootstrap_subpackage 'Toolbar';
-bootstrap_subpackage 'Tooltip';
-bootstrap_subpackage 'Trackbar';
-bootstrap_subpackage 'TreeView';
-bootstrap_subpackage 'StatusBar';
-bootstrap_subpackage 'UpDown';
-bootstrap_subpackage 'Window';
-bootstrap_subpackage 'MDI';
-bootstrap_subpackage 'MonthCal';
+bootstrap Win32::GUI::Animation;
+bootstrap Win32::GUI::Bitmap;
+bootstrap Win32::GUI::Button;
+bootstrap Win32::GUI::Combobox;
+bootstrap Win32::GUI::DateTime;
+bootstrap Win32::GUI::DC;
+bootstrap_subpackage 'Win32::GUI::Font';
+bootstrap Win32::GUI::Header;
+bootstrap Win32::GUI::ImageList;
+bootstrap Win32::GUI::Label;
+bootstrap Win32::GUI::Listbox;
+bootstrap Win32::GUI::ListView;
+bootstrap_subpackage 'Win32::GUI::NotifyIcon';
+bootstrap Win32::GUI::ProgressBar;
+bootstrap Win32::GUI::Rebar;
+bootstrap_subpackage 'Win32::GUI::RichEdit';
+bootstrap Win32::GUI::Splitter;
+bootstrap Win32::GUI::TabStrip;
+bootstrap Win32::GUI::Textfield;
+bootstrap Win32::GUI::Toolbar;
+bootstrap Win32::GUI::Tooltip;
+bootstrap Win32::GUI::Trackbar;
+bootstrap Win32::GUI::TreeView;
+bootstrap Win32::GUI::StatusBar;
+bootstrap Win32::GUI::UpDown;
+bootstrap Win32::GUI::Window;
+bootstrap Win32::GUI::MDI;
+bootstrap Win32::GUI::MonthCal;
# Preloaded methods go here.