/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

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