1Sprog::GearMetadata(3)User Contributed Perl DocumentationSprog::GearMetadata(3)
2
3
4

NAME

6       Sprog::GearMetaData - Information about installed Sprog::Gear classes
7

DESCRIPTION

9       This class is responsible for auto-discovering installed gear classes
10       and determining their attributes.
11
12       Querying the attributes of a class does not cause the class file to be
13       compiled.  Instead, each gear class is expected to start with a special
14       metadata POD section, like this:
15
16         package Sprog::Gear::Grep;
17
18         =begin sprog-gear-metadata
19
20           title: Pattern Match
21           type_in: P
22           type_out: P
23           keywords: grep regex regular expression search
24
25         =end sprog-gear-metadata
26
27         =cut
28
29       A cache of metadata is maintained so that each gear class file only
30       needs to be parsed once.
31

GEAR ATTRIBUTES

33       The following attributes can be defined in the metadata section:
34
35       title
36           Mandatory - defines the text which will appear on the gear.
37
38       type_in
39           Mandatory - the input connector type.  One of:
40
41             _ - no connector
42             P - a 'Pipe' connector
43             A - a 'List' connector
44             H - a 'Record' connector
45
46       type_out
47           Mandatory - the output connector type.  (Same values as above).
48
49       keywords
50           An optional list of keywords that describe the gears function.
51           Used by the palette search function.
52
53       no_properties
54           An optional boolean which should be set to true (1) if the gear has
55           no properties dialog.  This will cause the properties option to be
56           greyed out on the gear's right-click menu.
57
58       view_subclass
59           An optional attribute for defining a view (user interface) class
60           for the gear.  Rather than defining the whole class name, only the
61           final component is required.  For example, the Sprog::Gear::Tex‐
62           tWindow gear sets this value to 'TextWindow' which gets translated
63           to Sprog::GtkGearView::TextWindow.
64
65       custom_command_gear
66           This flag should be true for a gear created via the 'Make Command
67           Gear' dialog and false otherwise.
68

CLASS METHODS

70       gear_class_info( class_name )
71
72       Given a full class name (eg: "Sprog::Gear::ReadFile"), this method
73       returns a metadata object describing the class.  Returns undef if the
74       class does not exist or does not define the required metadata POD sec‐
75       tion.
76
77       search( input_connector_type, output_connector_type, keywords )
78
79       Returns a list of all classes matching the supplied arguments (all of
80       which are optional).  If no arguments are supplied, a list of all known
81       gear classes will be returned.
82
83       The input and output connector type arguments should each be a single
84       character as follows:
85
86         * - accept any connector type (this is the default)
87         _ - no connector at all (ie: input or output gears)
88         P - a 'Pipe' connector
89         A - a 'List' connector
90         H - a 'Record' connector
91
92       The 'keywords' argument (if supplied) should be a string which will be
93       used for a case-insensitive match against each gear's title and key‐
94       words attributes.
95
96       The list of gears returned will be those that match all three arguments
97       (or as many as were supplied).
98
99       connector_types
100
101       This method returns a list of connector type names and the correspond‐
102       ing codes.  It is intended to be used to build GUI widgets for select‐
103       ing input and output connector types.
104

OBJECT METHODS

106       Each metadata object returned from "gear_class_info()" or "search()"
107       will have the following (read-only) properties:
108
109       class
110
111       The class name for the gear (eg: "Sprog::Gear::ReadFile").
112
113       file
114
115       The pathname of the file which defines the class.
116
117       title
118
119       The human-readable name of the gear.
120
121       type_in
122
123       The type of the input connector ('_', 'P', 'A' or 'H').
124
125       type_out
126
127       The type of the output connector (same values as for "type_in").
128
129       keywords
130
131       A space separated string of keywords describing the gear.
132
133       view_subclass
134
135       The gear view subclass which implements the gear's user interface.
136
138       Copyright 2004-2005 Grant McLean <grantm@cpan.org>
139
140       This library is free software; you can redistribute it and/or modify it
141       under the same terms as Perl itself.
142
143
144
145perl v5.8.8                       2005-07-24            Sprog::GearMetadata(3)
Impressum