9 our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
11 # set the version for version checking
14 @EXPORT = qw(&func1 &func2 &func4);
16 # your exported package globals go here,
17 # as well as any optionally exported functions
18 @EXPORT_OK = qw($Var1 %Hashit &func3);
22 ##################################################
24 # Contains data and methods used by both Function (C++ declarations) and GtkDefs::Function (C defs descriptions)
25 # Note that GtkDefs::Signal inherits from GtkDefs::Function so it get these methods too.
27 # class Function : FunctionBase
29 # string array param_types;
30 # string array param_names;
31 # string array param_documentation;
32 # string return_documention;
36 # $string args_types_only($)
37 # comma-delimited argument types.
38 sub args_types_only($)
42 my $param_types = $$self{param_types};
43 return join(", ", @$param_types);
46 # $string args_names_only($)
47 sub args_names_only($)
51 my $param_names = $$self{param_names};
52 return join(", ", @$param_names);
55 # $string args_types_and_names($)
56 sub args_types_and_names($)
62 my $param_names = $$self{param_names};
63 my $param_types = $$self{param_types};
72 for ($i = 0; $i < $#$param_types + 1; $i++)
74 my $str = sprintf("%s %s", $$param_types[$i], $$param_names[$i]);
78 my $result = join(", ", @out);
82 # $string args_names_only_without_object($)
83 sub args_names_only_without_object2($)
87 my $param_names = $$self{param_names};
90 my $bInclude = 0; #Ignore the first (object) arg.
91 foreach (@{$param_names})
93 # Add comma if there was an arg before this one:
99 # Append this arg if it's not the first one:
111 # $string args_types_and_names_without_object($)
112 sub args_types_and_names_without_object($)
116 my $param_names = $$self{param_names};
117 my $param_types = $$self{param_types};
121 for ($i = 1; $i < $#$param_types + 1; $i++) #Ignore the first arg.
123 my $str = sprintf("%s %s", $$param_types[$i], $$param_names[$i]);
127 return join(", ", @out);
130 # $string args_names_only_without_object($)
131 sub args_names_only_without_object($)
135 my $param_names = $$self{param_names};
138 my $bInclude = 0; #Ignore the first (object) arg.
139 foreach (@{$param_names})
141 # Add comma if there was an arg before this one:
147 # Append this arg if it's not the first one:
163 my $param_types = $$self{param_types};
164 my $param_names = $$self{param_names};
166 print "<function>\n";
167 foreach (keys %$self)
169 print " <$_ value=\"$$self{$_}\"/>\n" if (!ref $$self{$_} && $$self{$_} ne "");
172 if (scalar(@$param_types)>0)
174 print " <parameters>\n";
176 for (my $i = 0; $i < scalar(@$param_types); $i++)
178 print " \"$$param_types[$i]\" \"$$param_names[$i]\" \n";
181 print " </parameters>\n";
184 print "</function>\n\n";
187 sub args_types_and_names_with_default_values($)
193 my $param_names = $$self{param_names};
194 my $param_types = $$self{param_types};
195 my $param_default_values = $$self{param_default_values};
198 for ($i = 0; $i < $#$param_types + 1; $i++)
200 my $str = sprintf("%s %s", $$param_types[$i], $$param_names[$i]);
202 if(defined($$param_default_values[$i]))
204 if($$param_default_values[$i] ne "")
206 $str .= " = " . $$param_default_values[$i];
213 return join(", ", @out);
216 1; # indicate proper module load.