| 1 | package Gapp::Moose; | ||
| 2 | |||
| 3 | our $VERSION = 0.01; | ||
| 4 | our $AUTHORITY = 'cpan:JHALLOCK'; | ||
| 5 | |||
| 6 | 4 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 4 | ▶ | use Moose::Meta::Method; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 4 | ▶ | use Moose::Exporter; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 0 | ▶ | use Gapp; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 11 | use Gapp::Gtk2; | ||
| 12 | use Gapp::Moose::Meta::Attribute::Trait::GappActionGroup; | ||
| 13 | use Gapp::Moose::Meta::Attribute::Trait::GappAssistant; | ||
| 14 | use Gapp::Moose::Meta::Attribute::Trait::GappBox; | ||
| 15 | use Gapp::Moose::Meta::Attribute::Trait::GappCheckButton; | ||
| 16 | use Gapp::Moose::Meta::Attribute::Trait::GappCheckMenuItem; | ||
| 17 | use Gapp::Moose::Meta::Attribute::Trait::GappComboBox; | ||
| 18 | use Gapp::Moose::Meta::Attribute::Trait::GappButton; | ||
| 19 | use Gapp::Moose::Meta::Attribute::Trait::GappDateEntry; | ||
| 20 | use Gapp::Moose::Meta::Attribute::Trait::GappEntry; | ||
| 21 | use Gapp::Moose::Meta::Attribute::Trait::GappExpander; | ||
| 22 | use Gapp::Moose::Meta::Attribute::Trait::GappEventBox; | ||
| 23 | use Gapp::Moose::Meta::Attribute::Trait::GappFileChooserDialog; | ||
| 24 | use Gapp::Moose::Meta::Attribute::Trait::GappFileFilter; | ||
| 25 | use Gapp::Moose::Meta::Attribute::Trait::GappFrame; | ||
| 26 | use Gapp::Moose::Meta::Attribute::Trait::GappHBox; | ||
| 27 | use Gapp::Moose::Meta::Attribute::Trait::GappHButtonBox; | ||
| 28 | use Gapp::Moose::Meta::Attribute::Trait::GappHPaned; | ||
| 29 | use Gapp::Moose::Meta::Attribute::Trait::GappVPaned; | ||
| 30 | use Gapp::Moose::Meta::Attribute::Trait::GappImage; | ||
| 31 | use Gapp::Moose::Meta::Attribute::Trait::GappLabel; | ||
| 32 | use Gapp::Moose::Meta::Attribute::Trait::GappListStore; | ||
| 33 | use Gapp::Moose::Meta::Attribute::Trait::GappDefault; | ||
| 34 | use Gapp::Moose::Meta::Attribute::Trait::GappDialog; | ||
| 35 | use Gapp::Moose::Meta::Attribute::Trait::GappMenu; | ||
| 36 | use Gapp::Moose::Meta::Attribute::Trait::GappMenuBar; | ||
| 37 | use Gapp::Moose::Meta::Attribute::Trait::GappMenuToolButton; | ||
| 38 | use Gapp::Moose::Meta::Attribute::Trait::GappNotebook; | ||
| 39 | use Gapp::Moose::Meta::Attribute::Trait::GappRadioMenuItem; | ||
| 40 | use Gapp::Moose::Meta::Attribute::Trait::GappRadioToolButton; | ||
| 41 | use Gapp::Moose::Meta::Attribute::Trait::GappScrolledWindow; | ||
| 42 | use Gapp::Moose::Meta::Attribute::Trait::GappSeparatorMenuItem; | ||
| 43 | use Gapp::Moose::Meta::Attribute::Trait::GappSeparatorToolItem; | ||
| 44 | use Gapp::Moose::Meta::Attribute::Trait::GappSpinButton; | ||
| 45 | use Gapp::Moose::Meta::Attribute::Trait::GappStatusbar; | ||
| 46 | use Gapp::Moose::Meta::Attribute::Trait::GappStatusIcon; | ||
| 47 | use Gapp::Moose::Meta::Attribute::Trait::GappTable; | ||
| 48 | use Gapp::Moose::Meta::Attribute::Trait::GappTearoffMenuItem; | ||
| 49 | use Gapp::Moose::Meta::Attribute::Trait::GappTextBuffer; | ||
| 50 | use Gapp::Moose::Meta::Attribute::Trait::GappTextTagTable; | ||
| 51 | use Gapp::Moose::Meta::Attribute::Trait::GappTextView; | ||
| 52 | use Gapp::Moose::Meta::Attribute::Trait::GappTimeEntry; | ||
| 53 | use Gapp::Moose::Meta::Attribute::Trait::GappToggleToolButton; | ||
| 54 | use Gapp::Moose::Meta::Attribute::Trait::GappToolbar; | ||
| 55 | use Gapp::Moose::Meta::Attribute::Trait::GappToolButton; | ||
| 56 | use Gapp::Moose::Meta::Attribute::Trait::GappToolItemGroup; | ||
| 57 | use Gapp::Moose::Meta::Attribute::Trait::GappToolPalette; | ||
| 58 | use Gapp::Moose::Meta::Attribute::Trait::GappTreeView; | ||
| 59 | use Gapp::Moose::Meta::Attribute::Trait::GappUIManager; | ||
| 60 | use Gapp::Moose::Meta::Attribute::Trait::GappWindow; | ||
| 61 | use Gapp::Moose::Meta::Attribute::Trait::GappWidget; | ||
| 62 | use Gapp::Moose::Meta::Attribute::Trait::GappVBox; | ||
| 63 | use Gapp::Moose::Meta::Attribute::Trait::GappVButtonBox; | ||
| 64 | use Gapp::Moose::Meta::Attribute::Trait::GappViewport; | ||
| 65 | |||
| 66 | Moose::Exporter->setup_import_methods( | ||
| 67 | with_meta => ['widget'], | ||
| 68 | also => ['Moose' ], | ||
| 69 | ); | ||
| 70 | |||
| 71 | sub init_meta { | ||
| 72 | shift; | ||
| 73 | return Moose->init_meta( @_ ); | ||
| 74 | } | ||
| 75 | |||
| 76 | sub widget { | ||
| 77 | my $meta = shift; | ||
| 78 | my $name = shift; | ||
| 79 | |||
| 80 | Moose->throw_error('Usage: widget \'name\' => ( key => value, ... )') if @_ % 2 == 1; | ||
| 81 | |||
| 82 | my %args = @_; | ||
| 83 | |||
| 84 | # apply GtkWidget trait | ||
| 85 | $args{traits} = [] if ! exists $args{traits}; | ||
| 86 | push @{ $args{traits} }, 'GappWidget'; | ||
| 87 | |||
| 88 | # pass on to moose to handle | ||
| 89 | &Moose::has( $meta, $name, %args ); | ||
| 90 | } | ||
| 91 | |||
| 92 | 1; | ||
| 93 | |||
| 94 | |||
| 95 | __END__ | ||