.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "GConf 3pm" .TH GConf 3pm "2016-08-30" "perl v5.24.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Gnome2::GConf \- Perl wrappers for the GConf configuration engine. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Gnome2::GConf; \& \& my $client = Gnome2::GConf::Client\->get_default; \& my $app_key = "/apps/myapp/mykey"; \& \& $client\->add_dir($app_key, \*(Aqpreload\-none\*(Aq); \& \& # add a notify for the key \& my $notify_id = $client\->notify_add($app_key, sub { \& my ($client, $cnxn_id, $entry) = @_; \& return unless $entry\->{value}; \& \& if ($entry\->{value}\->{type} eq \*(Aqstring\*(Aq) { \& printf "key \*(Aq%s\*(Aq changed to \*(Aq%s\*(Aq\en", \& $entry\->{key}, \& $entry\->{value}\->{value}; \& } \& }); \& \& my $string = $client\->get_string($app_key); \& $string = \*(Aqsome string\*(Aq unless $string; \& \& $client\->set($app_key, { type => \*(Aqstring\*(Aq, data => $string }); \& \& # set a schema for the key \& $client\->set_schema ($app_key, \& { \& type => \*(Aqstring\*(Aq, \& locale => \*(AqC\*(Aq, \& short_desc => \*(AqSome key.\*(Aq, \& long_desc => \*(AqThis key does something.\*(Aq, \& owner => \*(Aqsome_program\*(Aq \& }); \& \& # remove the notification callback \& $client\->notify_remove($notify_id); .Ve .SH "ABSTRACT" .IX Header "ABSTRACT" Perl bindings to the 2.2 series of the GConf configuration engine libraries, for use with gtk2\-perl. .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module allows you to use the GConf configuration system in order to store/retrieve the configuration of an application. The GConf system is a powerful configuration manager based on a user daemon that handles a set of key and value pairs, and notifies any changes of the value to every program that monitors those keys. GConf is used by \s-1GNOME 2\s0.x. .PP To discuss gtk2\-perl, ask questions and flame/praise the authors, join gtk\-perl\-list@gnome.org at lists.gnome.org. .PP Find out more about Gnome at http://www.gnome.org. .SH "DIFFERENT DATA TYPES" .IX Header "DIFFERENT DATA TYPES" Some opaque data types in GConf are not registered inside the Glib type system. Thus, they have been implemented in a more perlish way, when possible, for the sake of coherency and following the principle of least surprise for the perl developer. These changes try to preserve semantics, to add syntactic sugar and to remove the need for accessor methods. .IP "GConfEntry" 4 .IX Item "GConfEntry" See Gnome2::GConf::Entry .IP "GConfValue" 4 .IX Item "GConfValue" See Gnome2::GConf::Value .IP "GConfChangeSet" 4 .IX Item "GConfChangeSet" See Gnome2::GConf::ChangeSet .IP "GConfSchema" 4 .IX Item "GConfSchema" See Gnome2::GConf::Schema .SH "DIFFERENT CALL SIGNATURES" .IX Header "DIFFERENT CALL SIGNATURES" Reflecting the changes operated for the data types, some methods that use those type have had the call signature modified. .IP "GConfNotifyFunc" 4 .IX Item "GConfNotifyFunc" In C, the function passed to \f(CW\*(C`Gnome2::GConf::notify_add\*(C'\fR must have the following signature: .Sp .Vb 3 \& void (GConfNotifyFunc *) (GConfClient * client, \& guint cnxn_id, \& GConfEntry * entry); .Ve .Sp Where \f(CW\*(C`GConfEntry\*(C'\fR is a container for the key/value pair. Since in perl there's no \f(CW\*(C`GConfEntry\*(C'\fR (see above), the \f(CW\*(C`entry\*(C'\fR parameter is an hashref. .IP "GConfClient::get" 4 .IX Item "GConfClient::get" .PD 0 .IP "GConfClient::set" 4 .IX Item "GConfClient::set" .PD In C, these accessor methods return/use a \f(CW\*(C`GConfValue\*(C'\fR. In perl, they return/use an hashref. See Gnome2::GConf::Value .IP "GConfClient::get_list" 4 .IX Item "GConfClient::get_list" .PD 0 .IP "GConfClient::set_list" 4 .IX Item "GConfClient::set_list" .PD These accessor methods use a string for setting the type of the lists (lists may have values of only \fBone\fR type), and an arrayref containing the values. .IP "GConfClient::get_pair" 4 .IX Item "GConfClient::get_pair" .PD 0 .IP "GConfClient::set_pair" 4 .IX Item "GConfClient::set_pair" .PD These accessor methods use two hashref (representing \f(CW\*(C`GConfValue\*(C'\fRs) for the \f(CW\*(C`car\*(C'\fR and the \f(CW\*(C`cdr\*(C'\fR parameters. .IP "GConfClient::get_schema" 4 .IX Item "GConfClient::get_schema" .PD 0 .IP "GConfClient::set_schema" 4 .IX Item "GConfClient::set_schema" .PD Similarly to the get/set pair above, these two methods return/use an hashref. See Gnome2::GConf::Schema. .IP "GConfClient::commit_change_set" 4 .IX Item "GConfClient::commit_change_set" In C, this method return a boolean value (\s-1TRUE\s0 on success, \s-1FALSE\s0 on failure). On user request (using the boolean parameter \&\f(CW\*(C`remove_committed\*(C'\fR), it also returns the \f(CW\*(C`GConfChangeSet\*(C'\fR, pruned of the successfully committed keys. In perl, this method returns a boolean value both in scalar context or if the user sets to \s-1FALSE\s0 the \&\f(CW\*(C`remove_committed\*(C'\fR parameter; in array context or if the user requests the uncommitted keys, returns both the return value and the pruned \&\f(CW\*(C`GConfChangeSet\*(C'\fR. .SH "SEE ALSO" .IX Header "SEE ALSO" perl(1), Glib(3pm). .SH "AUTHOR" .IX Header "AUTHOR" Emmanuele Bassi .PP gtk2\-perl created by the gtk2\-perl team: http://gtk2\-perl.sf.net .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright 2003\-2006 by Emmanuele Bassi .PP This library is free software; you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. .PP This library is distributed in the hope that it will be useful, but \s-1WITHOUT ANY WARRANTY\s0; without even the implied warranty of \&\s-1MERCHANTABILITY\s0 or \s-1FITNESS FOR A PARTICULAR PURPOSE. \s0 See the \s-1GNU\s0 Library General Public License for more details. .PP You should have received a copy of the \s-1GNU\s0 Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place \- Suite 330, Boston, \s-1MA 02111\-1307 USA.\s0