PageRenderTime 57ms CodeModel.GetById 39ms app.highlight 15ms RepoModel.GetById 1ms app.codeStats 0ms

/packages/gnome1/src/gconf/gconf.pp

https://github.com/slibre/freepascal
Puppet | 147 lines | 125 code | 22 blank | 0 comment | 2 complexity | d903a05ed730f4b264c2a71c21130b07 MD5 | raw file
Possible License(s): LGPL-2.0, LGPL-2.1, LGPL-3.0
  1{
  2
  3   GConf
  4   Copyright (C) 1999, 2000 Red Hat Inc.
  5
  6   This library is free software; you can redistribute it and/or
  7   modify it under the terms of the GNU Library General Public
  8   License as published by the Free Software Foundation; either
  9   version 2 of the License, or (at your option) any later version.
 10
 11   This library is distributed in the hope that it will be useful,
 12   but WITHOUT ANY WARRANTY; without even the implied warranty of
 13   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 14   Library General Public License for more details.
 15
 16   You should have received a copy of the GNU Library General Public
 17   License along with this library; if not, write to the
 18   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 19   Boston, MA 02111-1307, USA.
 20}
 21unit gconf;
 22
 23{$PACKRECORDS C}
 24{$mode objfpc}
 25
 26interface
 27
 28Uses glib;
 29
 30const
 31 gconfdll='gconf-1';
 32
 33type
 34   TGConfValueType = (GCONF_VALUE_INVALID,GCONF_VALUE_STRING,
 35     GCONF_VALUE_INT,GCONF_VALUE_FLOAT,GCONF_VALUE_BOOL,
 36     GCONF_VALUE_SCHEMA,GCONF_VALUE_LIST,GCONF_VALUE_PAIR
 37     );
 38
 39type
 40   PGConfSchema = ^TGConfSchema;
 41   PPGConfValue = ^PGConfValue;
 42   PGConfValue = ^TGConfValue;
 43
 44   TGConfSchema = record
 45        thetype : TGConfValueType;
 46        list_type : TGConfValueType;
 47        car_type : TGConfValueType;
 48        cdr_type : TGConfValueType;
 49        locale : pgchar;
 50        theowner : pgchar;
 51        short_desc : pgchar;
 52        long_desc : pgchar;
 53        default_value : PGConfValue;
 54     end;
 55
 56   TGConfValue = record
 57        thetype : TGConfValueType;
 58        d : record
 59            case longint of
 60               0 : ( string_data : Pgchar );
 61               1 : ( int_data : gint );
 62               2 : ( bool_data : gboolean );
 63               3 : ( float_data : gdouble );
 64               4 : ( schema_data : PGConfSchema );
 65               5 : ( list_data : record
 66                    listtype : TGConfValueType;
 67                    list : PGSList;
 68                 end );
 69               6 : ( pair_data : record
 70                    car : PGConfValue;
 71                    cdr : PGConfValue;
 72                 end );
 73            end;
 74     end;
 75
 76{$define read_interface}
 77{$undef read_implementation}
 78
 79{$include gconfglibpublic.inc}
 80{$include gconferror.inc}
 81{$include gconfvalue.inc}
 82{$include gconfschema.inc}
 83{$include gconfengine.inc}
 84
 85function gconf_is_initialized:gboolean;cdecl;external gconfdll name 'gconf_is_initialized';
 86
 87type
 88   TGConfNotifyFunc = procedure (conf:PGConfEngine; cnxn_id:guint; entry:PGConfEntry; user_data:gpointer);cdecl;
 89
 90function gconf_engine_notify_add(conf:PGConfEngine; namespace_section:Pgchar; func:TGConfNotifyFunc; user_data:gpointer; err:PPGError):guint;cdecl;external gconfdll name 'gconf_engine_notify_add';
 91procedure gconf_engine_notify_remove(conf:PGConfEngine; cnxn:guint);cdecl;external gconfdll name 'gconf_engine_notify_remove';
 92function gconf_engine_get(conf:PGConfEngine; key:Pgchar; err:PPGError):PGConfValue;cdecl;external gconfdll name 'gconf_engine_get';
 93function gconf_engine_get_without_default(conf:PGConfEngine; key:Pgchar; err:PPGError):PGConfValue;cdecl;external gconfdll name 'gconf_engine_get_without_default';
 94function gconf_engine_get_entry(conf:PGConfEngine; key:Pgchar; locale:Pgchar; use_schema_default:gboolean; err:PPGError):PGConfEntry;cdecl;external gconfdll name 'gconf_engine_get_entry';
 95function gconf_engine_get_with_locale(conf:PGConfEngine; key:Pgchar; locale:Pgchar; err:PPGError):PGConfValue;cdecl;external gconfdll name 'gconf_engine_get_with_locale';
 96function gconf_engine_get_default_from_schema(conf:PGConfEngine; key:Pgchar; err:PPGError):PGConfValue;cdecl;external gconfdll name 'gconf_engine_get_default_from_schema';
 97function gconf_engine_set(conf:PGConfEngine; key:Pgchar; value:PGConfValue; err:PPGError):gboolean;cdecl;external gconfdll name 'gconf_engine_set';
 98function gconf_engine_unset(conf:PGConfEngine; key:Pgchar; err:PPGError):gboolean;cdecl;external gconfdll name 'gconf_engine_unset';
 99function gconf_engine_associate_schema(conf:PGConfEngine; key:Pgchar; schema_key:Pgchar; err:PPGError):gboolean;cdecl;external gconfdll name 'gconf_engine_associate_schema';
100function gconf_engine_all_entries(conf:PGConfEngine; dir:Pgchar; err:PPGError):PGSList;cdecl;external gconfdll name 'gconf_engine_all_entries';
101function gconf_engine_all_dirs(conf:PGConfEngine; dir:Pgchar; err:PPGError):PGSList;cdecl;external gconfdll name 'gconf_engine_all_dirs';
102procedure gconf_engine_suggest_sync(conf:PGConfEngine; err:PPGError);cdecl;external gconfdll name 'gconf_engine_suggest_sync';
103function gconf_engine_dir_exists(conf:PGConfEngine; dir:Pgchar; err:PPGError):gboolean;cdecl;external gconfdll name 'gconf_engine_dir_exists';
104procedure gconf_engine_remove_dir(conf:PGConfEngine; dir:Pgchar; err:PPGError);cdecl;external gconfdll name 'gconf_engine_remove_dir';
105function gconf_engine_key_is_writable(conf:PGConfEngine; key:Pgchar; err:PPGError):gboolean;cdecl;external gconfdll name 'gconf_engine_key_is_writable';
106function gconf_valid_key(key:Pgchar; why_invalid:PPgchar):gboolean;cdecl;external gconfdll name 'gconf_valid_key';
107function gconf_key_is_below(above:Pgchar; below:Pgchar):gboolean;cdecl;external gconfdll name 'gconf_key_is_below';
108function gconf_concat_dir_and_key(dir:Pgchar; key:Pgchar):pgchar;cdecl;external gconfdll name 'gconf_concat_dir_and_key';
109function gconf_unique_key:pgchar;cdecl;external gconfdll name 'gconf_unique_key';
110function gconf_engine_get_float(conf:PGConfEngine; key:Pgchar; err:PPGError):gdouble;cdecl;external gconfdll name 'gconf_engine_get_float';
111function gconf_engine_get_int(conf:PGConfEngine; key:Pgchar; err:PPGError):gint;cdecl;external gconfdll name 'gconf_engine_get_int';
112function gconf_engine_get_string(conf:PGConfEngine; key:Pgchar; err:PPGError):pgchar;cdecl;external gconfdll name 'gconf_engine_get_string';
113function gconf_engine_get_bool(conf:PGConfEngine; key:Pgchar; err:PPGError):gboolean;cdecl;external gconfdll name 'gconf_engine_get_bool';
114function gconf_engine_get_schema(conf:PGConfEngine; key:Pgchar; err:PPGError):PGConfSchema;cdecl;external gconfdll name 'gconf_engine_get_schema';
115function gconf_engine_get_list(conf:PGConfEngine; key:Pgchar; list_type:TGConfValueType; err:PPGError):PGSList;cdecl;external gconfdll name 'gconf_engine_get_list';
116function gconf_engine_get_pair(conf:PGConfEngine; key:Pgchar; car_type:TGConfValueType; cdr_type:TGConfValueType; car_retloc:gpointer;
117           cdr_retloc:gpointer; err:PPGError):gboolean;cdecl;external gconfdll name 'gconf_engine_get_pair';
118function gconf_engine_set_float(conf:PGConfEngine; key:Pgchar; val:gdouble; err:PPGError):gboolean;cdecl;external gconfdll name 'gconf_engine_set_float';
119function gconf_engine_set_int(conf:PGConfEngine; key:Pgchar; val:gint; err:PPGError):gboolean;cdecl;external gconfdll name 'gconf_engine_set_int';
120function gconf_engine_set_string(conf:PGConfEngine; key:Pgchar; val:Pgchar; err:PPGError):gboolean;cdecl;external gconfdll name 'gconf_engine_set_string';
121function gconf_engine_set_bool(conf:PGConfEngine; key:Pgchar; val:gboolean; err:PPGError):gboolean;cdecl;external gconfdll name 'gconf_engine_set_bool';
122function gconf_engine_set_schema(conf:PGConfEngine; key:Pgchar; val:PGConfSchema; err:PPGError):gboolean;cdecl;external gconfdll name 'gconf_engine_set_schema';
123function gconf_engine_set_list(conf:PGConfEngine; key:Pgchar; list_type:TGConfValueType; list:PGSList; err:PPGError):gboolean;cdecl;external gconfdll name 'gconf_engine_set_list';
124function gconf_engine_set_pair(conf:PGConfEngine; key:Pgchar; car_type:TGConfValueType; cdr_type:TGConfValueType; const address_of_car:gpointer;
125           const address_of_cdr:gpointer; err:PPGError):gboolean;cdecl;external gconfdll name 'gconf_engine_set_pair';
126type
127   TGConfEnumStringPair = record
128        enum_value : gint;
129        str : pgchar;
130     end;
131
132function gconf_string_to_enum(lookup_table:array of TGConfEnumStringPair; str:Pgchar; enum_value_retloc:Pgint):gboolean;cdecl;external gconfdll name 'gconf_string_to_enum';
133function gconf_enum_to_string(lookup_table:array of TGConfEnumStringPair; enum_value:gint):pgchar;cdecl;external gconfdll name 'gconf_enum_to_string';
134function gconf_init(argc:longint; argv:PPchar; err:PPGError):gboolean;cdecl;external gconfdll name 'gconf_init';
135
136implementation
137
138{$undef read_interface}
139{$define read_implementation}
140
141{$include gconfglibpublic.inc}
142{$include gconferror.inc}
143{$include gconfvalue.inc}
144{$include gconfschema.inc}
145{$include gconfengine.inc}
146
147end.