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

Added Files:
        Constants.PL Constants.pm Constants.xs ConstantsRC.PL 
        Makefile.PL Tags.pm ppport.h 
Log Message:
Add Win32-GUI-Constants directory and module code

--- NEW FILE: Makefile.PL ---
#!perl -w
use strict;
use warnings;

# Makefile.PL for Win32::GUI::Constants
# $Id: Makefile.PL,v 1.1 2006/05/13 15:39:30 robertemay Exp $

use 5.006;
use Config;
use ExtUtils::MakeMaker;

my %config = (
    NAME          =>  'Win32::GUI::Constants',
    VERSION_FROM  =>  'Constants.pm',
    ABSTRACT_FROM =>  'Constants.pm',
    AUTHOR        =>  'Robert May <[EMAIL PROTECTED]>',
    PM            => {'Constants.pm' => '$(INST_LIBDIR)/Constants.pm',
                      'Tags.pm'      => '$(INST_LIBDIR)/$(BASEEXT)/Tags.pm', },
    PL_FILES      => {'ConstantsRC.PL' => '$(BASEEXT).rc',
                      'Constants.PL'   => [ 'constants.src', 'constants.h', 
't/70_values.def', 'phash.inc'], },
    OBJECT        =>  '$(BASEEXT)$(OBJ_EXT) $(BASEEXT).res',
    macro         => {RC => 'rc.exe',
                      RCFLAGS => '',
                      INST_DEMODIR => '$(INST_LIB)/Win32/GUI/demos/$(BASEEXT)',
                      DEMOS => 'demos/ConstantsDemo.pl' },
    clean         => {FILES => '*.rc *.res constants.src constants.h 
t/70_values.def phash.inc phash.def', },
    depend        => {'Constants.c' => 'constants.h phash.def phash.inc', },
);

# if building using gcc (MinGW or cygwin) use windres
# as the resource compiler
if($Config{cc} =~ /gcc/i) {
    $config{macro}->{RC} =      'windres';
    $config{macro}->{RCFLAGS} = '-O coff -o $*.res';
}

WriteMakefile(%config);

package MY;

# Add rule for .rc to .res conversion
# Add rules to install demo scripts
# Add rules to make the perfect hash code (phash.inc)
sub postamble {
  return <<'__POSTAMBLE';

# Win32::GUI::Constansts RC section

.rc.res:
        $(RC) $(RCFLAGS) $<

# Win32::GUI::Constansts 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

# Win32::GUI::Constansts perfect hash section

phash.def :: subdirs

phash.def :: constants.src
        hash\perfect.exe < constants.src

__POSTAMBLE
}

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

# $Id: ConstantsRC.PL,v 1.1 2006/05/13 15:39:30 robertemay Exp $
# perl script to produce the RC file for
# Win32::GUI::Constants:  create Resource
# file with a VERSIONINFO section

# The variables:
my %info = (
    Version => MM->parse_version('Constants.pm'),
    Dllname => 'Constants.dll',
    Years   => '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::Constants, part of the perl 
Win32::GUI module."
      VALUE "CompanyName"      , "perl-win32-gui.sourceforge.net"
      VALUE "FileDescription"  , "Win32::GUI::Constants perl extension"
      VALUE "FileVersion"      , "$info{Version}"
      VALUE "InternalName"     , "$info{Dllname}"
      VALUE "LegalCopyright"   , "Copyright © Robert May $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__

--- NEW FILE: ppport.h ---
#if 0
<<'SKIP';
#endif
/*
----------------------------------------------------------------------

    ppport.h -- Perl/Pollution/Portability Version 3.06 
   
    Automatically created by Devel::PPPort running under
    perl 5.008007 on Fri Mar 17 15:01:07 2006.
    
    Do NOT edit this file directly! -- Edit PPPort_pm.PL and the
    includes in parts/inc/ instead.
 
    Use 'perldoc ppport.h' to view the documentation below.

----------------------------------------------------------------------

SKIP
[...4855 lines suppressed...]

#ifdef NO_XSLOCKS
#  ifdef dJMPENV
#    define dXCPT             dJMPENV; int rEtV = 0
#    define XCPT_TRY_START    JMPENV_PUSH(rEtV); if (rEtV == 0)
#    define XCPT_TRY_END      JMPENV_POP;
#    define XCPT_CATCH        if (rEtV != 0)
#    define XCPT_RETHROW      JMPENV_JUMP(rEtV)
#  else
#    define dXCPT             Sigjmp_buf oldTOP; int rEtV = 0
#    define XCPT_TRY_START    Copy(top_env, oldTOP, 1, Sigjmp_buf); rEtV = 
Sigsetjmp(top_env, 1); if (rEtV == 0)
#    define XCPT_TRY_END      Copy(oldTOP, top_env, 1, Sigjmp_buf);
#    define XCPT_CATCH        if (rEtV != 0)
#    define XCPT_RETHROW      Siglongjmp(top_env, rEtV)
#  endif
#endif

#endif /* _P_P_PORTABILITY_H_ */

/* End of File ppport.h */

--- NEW FILE: Constants.pm ---
package Win32::GUI::Constants;

# $Id: Constants.pm,v 1.1 2006/05/13 15:39:30 robertemay Exp $
# Win32::GUI::Constants, part of the Win32::GUI package
# (c) Robert May, 2005..2006
# released under the same terms as Perl.

use 5.006;
use strict;
use warnings;
use warnings::register;

=head1 NAME

Win32::GUI::Constants - exporter for Win32 API constants

=cut

our $VERSION = '0.01';

require XSLoader;
XSLoader::load('Win32::GUI::Constants', $VERSION);

our ($Verbose, $AUTOLOAD);

=head1 SYNOPSIS

  use Win32:GUI::Constants;

or

  use Win32:GUI::Constants ();

or

  use Win32::GUI::Constansts [EMAIL PROTECTED],] [EMAIL PROTECTED];


Win32::GUI::Constants is a module that provides definitions and export
capabilities for Win32 API constant values.  There is access to more
than 1600 Win32 API constants.  Nothing is exported by default.

=head1 EXPORT SYNTAX

Win32::GUI::Constants provides its own 'import' funcion for performance
reasons, but follows the L<Exporter|Exporter> module's definition for the
syntax, with some additional pragmata to control the export behaviour.

=head2 Standard Syntax

=over 4

=item C<use Win32::GUI::Constants;>

This imports all the default symbols into your namespace.  Currently
there are no default symbols.

=item C<use Win32::GUI::Constants ();>

This loads the module without importing any symbols.

=item C<use Win32::GUI::Constants qw(...);>

This imports only the symbols listed into your namespace. An error
occurs if you try to import a symbol that does not exist.
The advanced export features are accessed like this,
but with list entries that are syntactically distinct from symbol names.

=back

=head2 Advanced Syntax

If any of the entries in an import list begins with !, : or / then
the list is treated as a series of specifications which either add to
or delete from the list of names to import. They are processed left to
right. Specifications are in the form:

  [!]name         This name only
  [!]:tag         All names in class 'tag'
  [!]/pattern/    All names which match pattern

A leading ! indicates that matching names should be deleted from the
list of names to import.

Remember that most patterns (using //) will need to be anchored
with a leading ^, e.g., C</^TPM_/> rather than C</TPM/>.

You can say C<BEGIN { $Win32::GUI::Constants::Verbose=1 }> before your
C<use Win32::GUI::Constants qw( ... );> line to see how the
specifications are being processed and what is actually being imported
into your namespace.

If any of the entries in an import begins with a - then the entry is
treated as a pragma that affects the way in which the exporting is
performed.

=cut

# We're only exporting our own subroutines, write our own import function, 
simplifying
# Exporter::Heavy::heavy_export.  This implementation can only export 
subroutines, and
# export list must not pre-pend '&' to the subroutine names.
sub import
{
    my $pkg = shift;
    my $callpkg = caller;
    my @imports;
    my $inline = 0;
    my $export = 1;
    my $autoload = 0;
    my $oops = 0;

=head1 PRAGMATA

The following pragmata ae provided to affect the behaviour of the
export capabilities of Win32::GUI::Constants.

=over

=item B<-inline>

Causes the constant subroutine body to be generated at compile
time.  This sacrifices some compile time speed for the ability
for the constants that are listed to be inlined by the
compiler, which gains some runtime speed.

=item B<-noexport>

The same behaviour as B<-inline>, except that the constants
that are listed are not exported, and so must be used by their
fully qualified package names.
(e.g. C<Win32::GUI::Constants::CW_USEDEFAULT>)

=item -B<exportpkg>, I<pkgname>

Causes exported symbols to be exported to the I<pkgname>
namespace, rather than to the caller's namespace. I<pkgname>
must appear as the next item in the list. Omitting
I<pkgname> from the list is likely to cause behaviour
that is difficult to understand.

=item B<-autoload>

Causes Win32::GUI::Constants' AUTOLOAD subroutine
to be exported, making all non-exported constants
available in that namespace.

=back

=head1 EXPORT TAGS

See the L<Win32::GUI::Constants::Tags|Win32::GUI::Constants::Tags>
documentation for available tag classes.

Use of :tag export definitions adds some overhead both in terms of compile-time
speed and memory usage.

=cut

    # detect and remove our pragmas from the import list, and do
    # version checking:
    my $setpkg = 0;
    foreach (@_) {
        # Always expect the export package name immediately after
        # the -exportpkg pragma
        $callpkg=$_,$setpkg=0, next if $setpkg;
        $inline=1,             next if /^-inline$/;
        # Always inline if not exporting, otherwise -noexport does nothing
        $export=0, $inline=1,  next if /^-noexport$/;
        $setpkg=1,             next if /^-exportpkg$/;
        $autoload=1,           next if /^-autoload$/;
        # warn if we see an unrecognised pragma
        ++$oops, warnings::warn qq("$_" is not a recognised pragma), next if 
/^-/;
        $pkg->VERSION($_),     next if /^\d/;    # inherit from UNIVERSAL
        push @imports, $_;
    }

    if(@imports) {
        # expand @imports, if necessary
        if (grep m{^[/!:]}, @imports) {
            my %imports;
            # negated first item implies starting with default set:
            # our default is empty, so don't add anything
            #unshift @imports, ':DEFAULT' if $imports[0] =~ m/^!/;
            foreach my $spec (@imports) {
                my @names;
                my $remove = $spec =~ s/^!//;

                if ($spec =~ s/^://){
                    # Only require Tags module if we need it
                    require Win32::GUI::Constants::Tags;
                    if(my $namesref = Win32::GUI::Constants::Tags::tag($spec)){
                        @names = @$namesref;
                    }
                    else {
                        warnings::warn qq(tag ":$spec" is not defined by $pkg);
                        ++$oops;
                        next;
                    }
                }
                elsif ($spec =~ m:^/(.*)/$:){
                    my $patn = $1;
                    # If we expect to see lots of these, then we
                    # may want to store the reference rather than
                    # calling _export_ok() each time
                    @names = grep(/$patn/, @{_export_ok()}); # not anchored by 
default
                }
                else {
                    @names = ($spec); # is a normal symbol name
                }

                warn "Import ".($remove ? "del":"add").": @names " if $Verbose;

                if ($remove) {
                    foreach my $sym (@names) { delete $imports{$sym} } 
                }
                else {
                    @[EMAIL PROTECTED] = (1) x @names;
                }
            }
            @imports = keys %imports;
        }
    }

    # If we did
    #   use Win32::GUI::Constants 0.01, '';
    # I.e. a version check with no imports, then imports contains a single 
entry with value ''
    if( @imports == 1 and $imports[0] eq '' ) {
        @imports = ();
    }

    # export @imports to caller's namespace
    if($Verbose) {
        my $t = join(", ", sort @imports) . "\n" . scalar(@imports) . " symbols 
being ";
        $t   .= "imported into $callpkg from $pkg " if $export;
        $t   .= "and " if $export and $inline;
        $t   .= "prepared for inlining " if $inline;
        warn $t;
    }

    {
        no strict 'refs';
        # Single loop with statement modifiers is faster than 2 loops,
        # unless both $export and $inline are false.  That doesn't
        # happen
        my @export_ok = @{_export_ok()};
        foreach my $sym (@imports) {
            #check that $sym can be exported, and croak if not.
            if(not grep /^$sym$/, @export_ok) {
                warnings::warn qq("$sym" is not exported by $pkg);
                ++$oops;
                next;
            }
            *{"${callpkg}::$sym"} = \&{"${pkg}::$sym"} if $export;
            &{"${pkg}::$sym"} if $inline;  # force AUTOLOAD
        }

        *{"${callpkg}::AUTOLOAD"} = \&{"${pkg}::AUTOLOAD"} if $autoload;
    }

    if($oops) {
        # only require Carp if we need it
        require Carp;
        Carp::croak qq(Can't continue after import errors);
    }
}

sub AUTOLOAD
{
    my $constant = $AUTOLOAD;
    $constant =~ s/.*:://;

    my $val = constant($constant);

    if(defined $val) {
        {
            no warnings; # avoid perl 5.6 warning about prototype mismatches
            eval "sub $AUTOLOAD() {$val}";
        }
        goto &$AUTOLOAD;
    }

    #TODO: use Carp?  Change to 'Constant $constant is not found by 
Win32::GUI::Constants'
    warnings::warnif("AUTOLOAD failed to find '$constant'");
    return undef;
}

1; # End of Constants.pm
__END__

=head1 FUNCTIONS

=head2 constant

  my $value = Win32::GUI::Constants::constant('SOME_CONST');

The C<constant()> function may be used to perform the lookup of a string
constant identifier to its numeric value.  This has the advantage of not
resulting in any memory overhead due to created symbol table entries,
at the expense of speed, as the lookup must be performed every time this
function is called.

Returns the constant's numeric value on success, undef on failure.

=head1 REQUIRES

No prerequsites other than perl core modules (strict, warnings,
warnings::register, Carp).

Win32::GUI::Constants may be useful to other Win32::* packages.

=head1 SEE ALSO

MSDN L<http://msdn.microsoft.com> and individual api documentation
for more information on constants required for any particular call.

L<Win32::GUI|Win32::GUI>

=head1 SUPPORT

Homepage: L<http://perl-win32-gui.sourceforge.net/>.

For further support join the users mailing list
(C<[EMAIL PROTECTED]>) from the website
at L<http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users>.
There is a searchable list archive at
L<http://sourceforge.net/mail/?group_id=16572>

=head1 BUGS

No all constants are covered.  If you find missing constants
please raise a feature support at
L<http://sourceforge.net/tracker/?group_id=16572&atid=366572>

=head1 AUTHORS

Robert May, E<lt>[EMAIL PROTECTED]<gt>

=head1 ACKNOWLEDGEMENTS

Many thanks to the Win32::GUI developers at
L<http://perl-win32-gui.sourceforge.net/> for suggestions
and assistance.

=head1 COPYRIGHT & LICENSE

Copyright 2005..2006 Robert May, All Rights Reserved.

This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.

=cut

--- NEW FILE: Constants.PL ---
#!perl -w

# Script to create the Win32::GUI::Constants
# definitions
#
# Creates constants.src, used as input to perfect.exe
# Creates constants.h, defining all the values for sub-optimal
#   sets of system header files
# Creates t\70_values.def testing all values
# Creates phash.inc, the hash source code
# 
# (c) Robert May 2005, 2006
#
# $Id: Constants.PL,v 1.1 2006/05/13 15:39:30 robertemay Exp $

use strict;
use warnings;

use File::Basename;
[...2140 lines suppressed...]
WS_EX_WINDOWEDGE               0x00000100  
WS_EX_CLIENTEDGE               0x00000200  
WS_EX_CONTEXTHELP              0x00000400  
WS_EX_RIGHT                    0x00001000  
WS_EX_LEFT                     0x00000000  
WS_EX_RTLREADING               0x00002000  
WS_EX_LTRREADING               0x00000000  
WS_EX_LEFTSCROLLBAR            0x00004000  
WS_EX_RIGHTSCROLLBAR           0x00000000  
WS_EX_CONTROLPARENT            0x00010000  
WS_EX_STATICEDGE               0x00020000  
WS_EX_APPWINDOW                0x00040000  
WS_EX_OVERLAPPEDWINDOW         0x00000300  # (WS_EX_WINDOWEDGE | 
WS_EX_CLIENTEDGE)
WS_EX_PALETTEWINDOW            0x00000188  # (WS_EX_WINDOWEDGE | 
WS_EX_TOOLWINDOW | WS_EX_TOPMOST)
WS_EX_LAYERED                  0x00080000  
WS_EX_NOINHERITLAYOUT          0x00100000  
WS_EX_LAYOUTRTL                0x00400000  
WS_EX_COMPOSITED               0x02000000  
WS_EX_NOACTIVATE               0x08000000  


--- NEW FILE: Constants.xs ---
/* $Id: Constants.xs,v 1.1 2006/05/13 15:39:30 robertemay Exp $
 * Copyright (c) Robert May 2006
 *
 * Code for the Minimal Perfect Hash algorithm from
 * http://burtleburtle.net/bob/hash/perfect.html,
 * modified by Robert May.
 */

#define _WIN32_IE 0x0501
#define _WIN32_WINNT 0x0501
#define WINVER 0x0501

#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"

#include "ppport.h"

/* Headers to define all the constants that
 * we want
 */
#include <windows.h>
#include <richedit.h>
#include <commctrl.h>
#include <shlobj.h>
#include "constants.h"

/* Perfect Hash implementation for Win32::GUI::Constants */
#include "phash.inc"

MODULE = Win32::GUI::Constants        PACKAGE = Win32::GUI::Constants

PROTOTYPES: ENABLE

     ##########################################################################
     # (@)METHOD:constant(key)
     # Looks up string constant C<key> to its numeric value
     # See Constants.pm for full documentation
void constant(c)
    SV* c
PREINIT:
    ULONG hash;
    STRLEN len;
    LPSTR key;
PPCODE:
    key = SvPV(c,len);
    hash = phash(key,len);
    if(hash < PHASHNKEYS) {
        const LPSTR str = stringpool + const_table[hash].offset;
        if(*key == *str && !strncmp(key+1, str+1, len-1) && str[len] == '\0') {
            if(const_table[hash].flags & F_UV) {
                XSRETURN_UV((UV)const_table[hash].value);
            }
            else {
                XSRETURN_IV((IV)const_table[hash].value);
            }
        }
    }
    errno = EINVAL;
    SetLastError(ERROR_INVALID_PARAMETER);
    XSRETURN_UNDEF; //error - not found

     ##########################################################################
     # (@)INTERNAL:_export_ok()
     # Return an array ref to an array of all possible constants.
     # Array consists of readonly PV's that point into
     # our string table:  this avoids copying the strings, which
     # saves memory and is over 3 times faster than the obvious:
     # INIT:
     #    int i;
     #    AV *list = newAV()
     # CODE:
     #    for(i=0; i < PHASHNKEYS; ++i) {
     #        av_push(list, newSVpv((stringpool + const_table[i].offset),0);
     #    }
     #    RETVAL = newRV_noinc((SV *)list);
     # OUTPUT:
     #    RETVAL
SV* _export_ok()
INIT:
    int i;
    AV *list = newAV();
    av_extend(list, PHASHNKEYS-1);
CODE:
    for(i=0; i < PHASHNKEYS; ++i) {
        SV *sv;
        LPSTR s = (stringpool + const_table[i].offset);
        sv = newSV(0);             /* create new SV */
        sv_upgrade(sv, SVt_PV);    /* upgrade to PV */
        SvPV_set(sv, s);           /* set PV string pointer to point into our 
string table */
        SvCUR_set(sv, strlen(s));  /* set the string length in the PV */
        SvLEN_set(sv, 0);          /* set the allocated length to 0 to prevent 
perl trying to free it */
        SvREADONLY_on(sv);         /* set the readonly flag */
        SvPOK_on(sv);              /* There's a vaild string pointer in the PV 
*/
        av_store(list, i, sv);     /* store the SV in the array */
    }
    RETVAL = newRV_noinc((SV *)list);  /* return an RV referencing the array */
OUTPUT:
    RETVAL


--- NEW FILE: Tags.pm ---
package Win32::GUI::Constants::Tags;
# $Id: Tags.pm,v 1.1 2006/05/13 15:39:30 robertemay Exp $

use strict;
use warnings;

# On one line so MakeMaker will see it.
require Win32::GUI::Constants;  our $VERSION = $Win32::GUI::Constants::VERSION;

use AutoLoader 'AUTOLOAD';

=head1 NAME

Win32::GUI::Constants::Tags - export :tag definitions for Win32::GUI::Constants

=head1 SYNOPSIS

  use Win32::GUI::Constants qw ( :tag ... );

Win32::GUI::Constants::Tags provide export :tag definitions for use with
Win32::GUI::Constants.  It is seperated into a seperate module to improve
the speed and memory usage of Win32::GUI::Constants if no :tag symbols
are used on the import line.

=head1 EXPORT TAGS

The following tags are defined for use with Win32::GUI::Constants:

=head2 General Export Tags

=over

=item B<:common>

A somewhat subjective list of commonly used constants.

=item B<:customdraw>

Constants related to custom draw handling.

=item B<:stockobjects>

Constants defining the system objects that can be created with GetStockObject().

=item B<:compatibility_win32_gui>

All constants exported by default by Win32::GUI up to v1.03.  Note that this is 
a large list.

=item B<:all>

All defined constants.  Note that this is a very large list.

=back

=head2 Package Specific Export Tags

The following list of export tags is defined, each exporting constant that may 
be
useful with the related Win32::GUI package(s).  Note that some currently export 
nothing.

:accelerator, :animation, :bitmap, :brush, :button, :class, :combobox, :cursor,
:datetime, :dc, :font, :header, :icon, :imagelist, :label, :listbox, :listview, 
:mdi,
:menu, :monthcal, :notifyicon, :pen, :progressbar, :rebar, :region, :richedit,
:scrollbar, :slider, :splitter, :statusbar, :tabstrip, :textfield, :timer, 
:toolbar,
:tooltip, :treeview, :updown, :window

=cut

# tag spec's
# keys are tags, values are array ref containg regex patterns of
# constants to match.  If value is undef, then the definition will
# be the return value of a subroutine named tag_spec().  These
# subroutines are defined after the __END__ token in this file, and processed
# by AutoSplit and AutoLoader.
our %TAG_SPECS = (
    common      => [ qw( ^CW_USEDEFAULT$ ) ],
    customdraw  => [ qw( ^CDDS_ ^CDRF_ ) ],
    stockobjects=> undef,
    all         => [ qw( .* ) ],

    compatibility_win32_gui => undef,

    accelerator => [ qw( ^VK_ ) ],
    animation   => [ qw( ^ACS_ ) ],
    bitmap      => [ qw() ],
    brush       => [ qw() ],
    button      => undef,
    class       => [ qw( ^COLOR_ ^CS_ ) ],
    combobox    => [ qw( ^CBS_ ^CBES_ ) ],
    cursor      => [ qw( ^IDC_ ) ],
    datetime    => [ qw( ^DTS_ ) ],
    dc          => undef,
    font        => [ qw() ],
    header      => [ qw( ^HDS_ ) ],
    icon        => [ qw( ^IDI_ ) ],
    imagelist   => [ qw( ^ILC_ ^ILD_ ^ILS_ ^CLR_NONE$ ^CLR_DEFAULT$ ^IMAGE_ ) ],
    label       => [ qw( ^IMAGE_ ) ],
    listbox     => [ qw( ^LBS_ ) ],
    listview    => [ qw( ^LVS_ ^LVIS_ ^CLR_NONE$ ) ],
    mdi         => [ qw() ],
    menu        => [ qw( ^MF_ ^SC_ ^TPM_ ) ],
    monthcal    => [ qw( ^MCS_ ^MCSC_ ) ],
    notifyicon  => [ qw() ],
    pen         => [ qw( ^PS_ ) ],
    progressbar => [ qw( ^CLR_DEFAULT$ ) ],
    rebar       => [ qw( ^CLR_DEFAULT$ ^RBBS_ ) ],
    region      => [ qw( ^RGN_ ) ],
    richedit    => [ qw( ^CP_ ^EM_ ^ENM_ ^ES_ ^GT_ ^SF_ ^SFF_ ) ],
    scrollbar   => [ qw( ^SB_ ) ],
    slider      => [ qw( ^TBTS_ ) ],
    splitter    => [ qw() ],
    statusbar   => [ qw( ^CLR_DEFAULT$ ^SBT_ ) ],
    tabstrip    => [ qw() ],
    textfield   => [ qw( ^EM_ ^ES_ ) ],
    timer       => [ qw() ],
    toolbar     => [ qw( ^BTNS_ ^TBSTATE_ ^TBSTYLE_ ^I_ ^CLR_DEFAULT$ 
^TRANSPARENT$
                         ^OPAQUE$ ^HINST_COMMCTRL$ ^IBD_ ) ],
    tooltip     => [ qw() ],
    treeview    => [ qw( ^CLR_DEFAULT$ ^TVGN_ ) ],
    updown      => [ qw() ],
    window      => [ qw( ^DS_ ^ID.[^_]+ ^MA_ ^MK_ ^NM_ ^RDW_ ^SIZE_ ^SW_ ^WA_ 
^WM_
                             ^WS_ ) ],
);

# tag() returns a reference to a list of constant names,
# or undef if the tag passed has no definition
sub tag {
    my $spec = shift;

    if(exists $TAG_SPECS{$spec}) {
        my $patterns;
        if(defined($TAG_SPECS{$spec})) {
            $patterns = $TAG_SPECS{$spec};
        }
        else {
            no strict 'refs';
            $patterns = &{"tag_$spec"};
        }
        my @names = ();
        my @syms = @{Win32::GUI::Constants::_export_ok()};
        foreach my $patn (@$patterns) {
            push @names, grep(/$patn/, @syms);
        }
        return [EMAIL PROTECTED];
    }
       
    return undef;
}

1; #End of Tags.pm

=head1 SUPPORT

Homepage: L<http://perl-win32-gui.sourceforge.net/>.

For further support join the users mailing list
(C<[EMAIL PROTECTED]>) from the website
at L<http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users>.
There is a searchable list archive at
L<http://sourceforge.net/mail/?group_id=16572>

=head1 BUGS

No all constants are covered.  If you find missing constants
please raise a feature support at
L<http://sourceforge.net/tracker/?group_id=16572&atid=366572>

=head1 AUTHORS

Robert May, E<lt>[EMAIL PROTECTED]<gt>

=head1 ACKNOWLEDGEMENTS

Many thanks to the Win32::GUI developers at
L<http://perl-win32-gui.sourceforge.net/> for suggestions
and assistance.

=head1 COPYRIGHT & LICENSE

Copyright 2005..2006 Robert May, All Rights Reserved.

=cut

#AutoLoaded subs go after the __END__ token
# each sub here is the name of a tag, and returns an array ref
# to a list of patterns to match
__END__
sub tag_stockobjects() { [
qw( ^WHITE_BRUSH$ ^LTGRAY_BRUSH$ ^GRAY_BRUSH$ ^DKGRAY_BRUSH$ ^BLACK_BRUSH$ 
^NULL_BRUSH$
    ^HOLLOW_BRUSH$ ^WHITE_PEN$ ^BLACK_PEN$ ^NULL_PEN$ ^OEM_FIXED_FONT$ 
^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IBPATTERN$ ^BS_DIBPATTERNPT$
    ^BS_PATTERN8X8$ ^BS_DIBPATTERN8X8$ ^BS_MONOPATTERN$ ^HS_ ^PS_ ^BLACKONWHITE$
    ^WHITEONBLACK$ ^COLORONCOLOR$ ^HALFTONE$ ^STRETCH_ )
] }
sub tag_compatibility_win32_gui() { [
qw( ^BS_3STATE$ ^BS_AUTO3STATE$ ^BS_AUTOCHECKBOX$ ^BS_AUTORADIOBUTTON$ 
^BS_CHECKBOX$
    ^BS_DEFPUSHBUTTON$ ^BS_GROUPBOX$ ^BS_LEFTTEXT$ ^BS_NOTIFY$ ^BS_OWNERDRAW$
    ^BS_PUSHBUTTON$ ^BS_RADIOBUTTON$ ^BS_USERBUTTON$ ^BS_BITMAP$ ^BS_BOTTOM$ 
^BS_CENTER$
    ^BS_ICON$ ^BS_LEFT$ ^BS_MULTILINE$ ^BS_RIGHT$ ^BS_RIGHTBUTTON$ ^BS_TEXT$ 
^BS_TOP$
    ^BS_VCENTER$ ^COLOR_3DFACE$ ^COLOR_ACTIVEBORDER$ ^COLOR_ACTIVECAPTION$
    ^COLOR_APPWORKSPACE$ ^COLOR_BACKGROUND$ ^COLOR_BTNFACE$ ^COLOR_BTNSHADOW$
    ^COLOR_BTNTEXT$ ^COLOR_CAPTIONTEXT$ ^COLOR_GRAYTEXT$ ^COLOR_HIGHLIGHT$
    ^COLOR_HIGHLIGHTTEXT$ ^COLOR_INACTIVEBORDER$ ^COLOR_INACTIVECAPTION$ 
^COLOR_MENU$
    ^COLOR_MENUTEXT$ ^COLOR_SCROLLBAR$ ^COLOR_WINDOW$ ^COLOR_WINDOWFRAME$
    ^COLOR_WINDOWTEXT$ ^DS_3DLOOK$ ^DS_ABSALIGN$ ^DS_CENTER$ ^DS_CENTERMOUSE$
    ^DS_CONTEXTHELP$ ^DS_CONTROL$ ^DS_FIXEDSYS$ ^DS_LOCALEDIT$ ^DS_MODALFRAME$
    ^DS_NOFAILCREATE$ ^DS_NOIDLEMSG$ ^DS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