Browse Source

* Patch from Paul Ishenin:
- added goption.inc with apropriate glib symbols
- added gincludes.inc which contains all other include files (similar to
gtk/gdk bindings and simlify inclusion into glib2.pas)
- checked/corrected all the .inc files and make them follow to template used in gtk/gdk (4 sections:
read_forward_definitions, read_interface_types, read_interface_rest, read_implementation)
- removed from most of .inc files unneeded comments that has been taken from original glib .h files. Some of
them were used by glib devels and others repeats official documentation.

git-svn-id: trunk@11617 -

michael 17 years ago
parent
commit
996f298ee7
59 changed files with 2591 additions and 3234 deletions
  1. 2 0
      .gitattributes
  2. 72 126
      packages/gtk2/src/glib/garray.inc
  3. 15 9
      packages/gtk2/src/glib/gasyncqueue.inc
  4. 12 23
      packages/gtk2/src/glib/gbacktrace.inc
  5. 9 23
      packages/gtk2/src/glib/gboxed.inc
  6. 20 17
      packages/gtk2/src/glib/gcache.inc
  7. 17 35
      packages/gtk2/src/glib/gclosure.inc
  8. 30 28
      packages/gtk2/src/glib/gcompletion.inc
  9. 39 45
      packages/gtk2/src/glib/gconvert.inc
  10. 7 30
      packages/gtk2/src/glib/gdataset.inc
  11. 145 238
      packages/gtk2/src/glib/gdate.inc
  12. 13 9
      packages/gtk2/src/glib/gdir.inc
  13. 5 5
      packages/gtk2/src/glib/genums.inc
  14. 9 5
      packages/gtk2/src/glib/gerror.inc
  15. 61 62
      packages/gtk2/src/glib/gfileutils.inc
  16. 32 42
      packages/gtk2/src/glib/ghash.inc
  17. 108 141
      packages/gtk2/src/glib/ghook.inc
  18. 75 0
      packages/gtk2/src/glib/gincludes.inc
  19. 197 278
      packages/gtk2/src/glib/giochannel.inc
  20. 11 83
      packages/gtk2/src/glib/glib2.pas
  21. 13 12
      packages/gtk2/src/glib/glibconfig.inc
  22. 18 8
      packages/gtk2/src/glib/gmacros.inc
  23. 184 261
      packages/gtk2/src/glib/gmain.inc
  24. 84 111
      packages/gtk2/src/glib/gmarkup.inc
  25. 12 1
      packages/gtk2/src/glib/gmarshal.inc
  26. 7 5
      packages/gtk2/src/glib/gmem.inc
  27. 62 92
      packages/gtk2/src/glib/gmessages.inc
  28. 23 31
      packages/gtk2/src/glib/gmodule.inc
  29. 92 134
      packages/gtk2/src/glib/gnode.inc
  30. 14 6
      packages/gtk2/src/glib/gobject.inc
  31. 112 0
      packages/gtk2/src/glib/goption.inc
  32. 54 65
      packages/gtk2/src/glib/gparam.inc
  33. 17 20
      packages/gtk2/src/glib/gpattern.inc
  34. 18 16
      packages/gtk2/src/glib/gprimes.inc
  35. 22 12
      packages/gtk2/src/glib/gqsort.inc
  36. 36 44
      packages/gtk2/src/glib/gqueue.inc
  37. 31 50
      packages/gtk2/src/glib/grand.inc
  38. 30 56
      packages/gtk2/src/glib/grel.inc
  39. 262 299
      packages/gtk2/src/glib/gscanner.inc
  40. 21 21
      packages/gtk2/src/glib/gshell.inc
  41. 11 2
      packages/gtk2/src/glib/gsignal.inc
  42. 12 38
      packages/gtk2/src/glib/gslist.inc
  43. 24 43
      packages/gtk2/src/glib/gsourceclosure.inc
  44. 65 75
      packages/gtk2/src/glib/gspawn.inc
  45. 13 6
      packages/gtk2/src/glib/gstrfuncs.inc
  46. 24 55
      packages/gtk2/src/glib/gstring.inc
  47. 148 230
      packages/gtk2/src/glib/gthread.inc
  48. 16 39
      packages/gtk2/src/glib/gthreadpool.inc
  49. 11 4
      packages/gtk2/src/glib/gtimer.inc
  50. 12 1
      packages/gtk2/src/glib/gtree.inc
  51. 76 99
      packages/gtk2/src/glib/gtype.inc
  52. 6 3
      packages/gtk2/src/glib/gtypeplugin.inc
  53. 89 89
      packages/gtk2/src/glib/gunicode.inc
  54. 13 5
      packages/gtk2/src/glib/gutils.inc
  55. 21 18
      packages/gtk2/src/glib/gvalue.inc
  56. 9 23
      packages/gtk2/src/glib/gvaluearray.inc
  57. 7 3
      packages/gtk2/src/glib/gvaluecollector.inc
  58. 12 23
      packages/gtk2/src/glib/gvaluetypes.inc
  59. 31 35
      packages/gtk2/src/glib/gwin32.inc

+ 2 - 0
.gitattributes

@@ -2142,6 +2142,7 @@ packages/gtk2/src/glib/gerror.inc svneol=native#text/plain
 packages/gtk2/src/glib/gfileutils.inc svneol=native#text/plain
 packages/gtk2/src/glib/ghash.inc svneol=native#text/plain
 packages/gtk2/src/glib/ghook.inc svneol=native#text/plain
+packages/gtk2/src/glib/gincludes.inc svneol=native#text/plain
 packages/gtk2/src/glib/giochannel.inc svneol=native#text/plain
 packages/gtk2/src/glib/glib2.pas svneol=native#text/plain
 packages/gtk2/src/glib/glibconfig.inc svneol=native#text/plain
@@ -2155,6 +2156,7 @@ packages/gtk2/src/glib/gmessages.inc svneol=native#text/plain
 packages/gtk2/src/glib/gmodule.inc svneol=native#text/plain
 packages/gtk2/src/glib/gnode.inc svneol=native#text/plain
 packages/gtk2/src/glib/gobject.inc svneol=native#text/plain
+packages/gtk2/src/glib/goption.inc svneol=native#text/plain
 packages/gtk2/src/glib/gparam.inc svneol=native#text/plain
 packages/gtk2/src/glib/gparamspecs.inc svneol=native#text/plain
 packages/gtk2/src/glib/gpattern.inc svneol=native#text/plain

+ 72 - 126
packages/gtk2/src/glib/garray.inc

@@ -1,126 +1,72 @@
-
-{$ifndef __G_ARRAY_H__}
-{$define __G_ARRAY_H__}
-
-
-//{$include gtypes.inc}
-
-    type
-       PGArray = ^TGArray;
-       TGArray = record
-            data : Pgchar;
-            len : guint;
-         end;
-
-       PGByteArray = ^TGByteArray;
-       TGByteArray = record
-            data : Pguint8;
-            len : guint;
-         end;
-
-       PGPtrArray = ^TGPtrArray;
-       TGPtrArray = record
-            pdata : Pgpointer;
-            len : guint;
-         end;
-
-
-
-
-{* Resizable arrays, remove fills any cleared spot and shortens the
- * array, while preserving the order. remove_fast will distort the
- * order by moving the last element to the position of the removed
- *}
-
-
-{ macro function;  see glib.cc for implementation}
-
-    function g_array_append_val(a: PGArray; v : gpointer) : PGArray;
-
-    function g_array_prepend_val(a: PGArray; v : gpointer) : PGArray;
-
-    function g_array_insert_val(a: PGArray; i: guint; v : gpointer) : PGArray;
-
-
-
-    function g_array_new(zero_terminated:gboolean; clear:gboolean; element_size:guint):PGArray;cdecl;external gliblib name 'g_array_new';
-
-    function g_array_sized_new(zero_terminated:gboolean; clear:gboolean; element_size:guint; reserved_size:guint):PGArray;cdecl;external gliblib name 'g_array_sized_new';
-
-    function g_array_free(parray:PGArray; free_segment:gboolean):Pgchar;cdecl;external gliblib name 'g_array_free';
-
-    function g_array_append_vals(parray:PGArray; data:gconstpointer; len:guint):PGArray;cdecl;external gliblib name 'g_array_append_vals';
-
-    function g_array_prepend_vals(parray:PGArray; data:gconstpointer; len:guint):PGArray;cdecl;external gliblib name 'g_array_prepend_vals';
-
-    function g_array_insert_vals(parray:PGArray; index:guint; data:gconstpointer; len:guint):PGArray;cdecl;external gliblib name 'g_array_insert_vals';
-
-    function g_array_set_size(parray:PGArray; length:guint):PGArray;cdecl;external gliblib name 'g_array_set_size';
-
-    function g_array_remove_index(parray:PGArray; index:guint):PGArray;cdecl;external gliblib name 'g_array_remove_index';
-
-    function g_array_remove_index_fast(parray:PGArray; index:guint):PGArray;cdecl;external gliblib name 'g_array_remove_index_fast';
-
-    procedure g_array_sort(parray:PGArray; compare_func:TGCompareFunc);cdecl;external gliblib name 'g_array_sort';
-
-    procedure g_array_sort_with_data(parray:PGArray; compare_func:TGCompareDataFunc; user_data:gpointer);cdecl;external gliblib name 'g_array_sort_with_data';
-
-{* Resizable pointer array.  This interface is much less complicated
- * than the above.  Add appends appends a pointer.  Remove fills any
- * cleared spot and shortens the array. remove_fast will again distort
- * order.
- *}
-
- { macro function }
-    function g_ptr_array_index (parray: PGPtrArray; index: guint): gpointer;
-
-
-    function g_ptr_array_new:PGPtrArray;cdecl;external gliblib name 'g_ptr_array_new';
-
-    function g_ptr_array_sized_new(reserved_size:guint):PGPtrArray;cdecl;external gliblib name 'g_ptr_array_sized_new';
-
-    function g_ptr_array_free(parray:PGPtrArray; free_seg:gboolean):Pgpointer;cdecl;external gliblib name 'g_ptr_array_free';
-
-    procedure g_ptr_array_set_size(parray:PGPtrArray; length:gint);cdecl;external gliblib name 'g_ptr_array_set_size';
-
-    function g_ptr_array_remove_index(parray:PGPtrArray; index:guint):gpointer;cdecl;external gliblib name 'g_ptr_array_remove_index';
-
-    function g_ptr_array_remove_index_fast(parray:PGPtrArray; index:guint):gpointer;cdecl;external gliblib name 'g_ptr_array_remove_index_fast';
-
-    function g_ptr_array_remove(parray:PGPtrArray; data:gpointer):gboolean;cdecl;external gliblib name 'g_ptr_array_remove';
-
-    function g_ptr_array_remove_fast(parray:PGPtrArray; data:gpointer):gboolean;cdecl;external gliblib name 'g_ptr_array_remove_fast';
-
-    procedure g_ptr_array_add(parray:PGPtrArray; data:gpointer);cdecl;external gliblib name 'g_ptr_array_add';
-
-    procedure g_ptr_array_sort(parray:PGPtrArray; compare_func:TGCompareFunc);cdecl;external gliblib name 'g_ptr_array_sort';
-
-    procedure g_ptr_array_sort_with_data(parray:PGPtrArray; compare_func:TGCompareDataFunc; user_data:gpointer);cdecl;external gliblib name 'g_ptr_array_sort_with_data';
-
-
-
-    function g_byte_array_new:PGByteArray;cdecl;external gliblib name 'g_byte_array_new';
-
-    function g_byte_array_sized_new(reserved_size:guint):PGByteArray;cdecl;external gliblib name 'g_byte_array_sized_new';
-
-    function g_byte_array_free(parray:PGByteArray; free_segment:gboolean):Pguint8;cdecl;external gliblib name 'g_byte_array_free';
-
-    function g_byte_array_append(parray:PGByteArray; data:Pguint8; len:guint):PGByteArray;cdecl;external gliblib name 'g_byte_array_append';
-
-    function g_byte_array_prepend(parray:PGByteArray; data:Pguint8; len:guint):PGByteArray;cdecl;external gliblib name 'g_byte_array_prepend';
-
-    function g_byte_array_set_size(parray:PGByteArray; length:guint):PGByteArray;cdecl;external gliblib name 'g_byte_array_set_size';
-
-    function g_byte_array_remove_index(parray:PGByteArray; index:guint):PGByteArray;cdecl;external gliblib name 'g_byte_array_remove_index';
-
-    function g_byte_array_remove_index_fast(parray:PGByteArray; index:guint):PGByteArray;cdecl;external gliblib name 'g_byte_array_remove_index_fast';
-
-    procedure g_byte_array_sort(parray:PGByteArray; compare_func:TGCompareFunc);cdecl;external gliblib name 'g_byte_array_sort';
-
-    procedure g_byte_array_sort_with_data(parray:PGByteArray; compare_func:TGCompareDataFunc; user_data:gpointer);cdecl;external gliblib name 'g_byte_array_sort_with_data';
-
-{$endif}
-
-
-
-
+// included by glib2.pas
+
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_types}
+  PGArray = ^TGArray;
+  TGArray = record
+    data : Pgchar;
+    len : guint;
+  end;
+
+  PGByteArray = ^TGByteArray;
+  TGByteArray = record
+    data : Pguint8;
+    len : guint;
+  end;
+
+  PGPtrArray = ^TGPtrArray;
+  TGPtrArray = record
+    pdata : Pgpointer;
+    len : guint;
+  end;
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_rest}
+
+function g_array_append_val(a: PGArray; v : gpointer) : PGArray;
+function g_array_prepend_val(a: PGArray; v : gpointer) : PGArray;
+function g_array_insert_val(a: PGArray; i: guint; v : gpointer) : PGArray;
+
+function g_array_new(zero_terminated:gboolean; clear:gboolean; element_size:guint):PGArray;cdecl;external gliblib name 'g_array_new';
+function g_array_sized_new(zero_terminated:gboolean; clear:gboolean; element_size:guint; reserved_size:guint):PGArray;cdecl;external gliblib name 'g_array_sized_new';
+function g_array_free(parray:PGArray; free_segment:gboolean):Pgchar;cdecl;external gliblib name 'g_array_free';
+function g_array_append_vals(parray:PGArray; data:gconstpointer; len:guint):PGArray;cdecl;external gliblib name 'g_array_append_vals';
+function g_array_prepend_vals(parray:PGArray; data:gconstpointer; len:guint):PGArray;cdecl;external gliblib name 'g_array_prepend_vals';
+function g_array_insert_vals(parray:PGArray; index:guint; data:gconstpointer; len:guint):PGArray;cdecl;external gliblib name 'g_array_insert_vals';
+function g_array_set_size(parray:PGArray; length:guint):PGArray;cdecl;external gliblib name 'g_array_set_size';
+function g_array_remove_index(parray:PGArray; index:guint):PGArray;cdecl;external gliblib name 'g_array_remove_index';
+function g_array_remove_index_fast(parray:PGArray; index:guint):PGArray;cdecl;external gliblib name 'g_array_remove_index_fast';
+procedure g_array_sort(parray:PGArray; compare_func:TGCompareFunc);cdecl;external gliblib name 'g_array_sort';
+procedure g_array_sort_with_data(parray:PGArray; compare_func:TGCompareDataFunc; user_data:gpointer);cdecl;external gliblib name 'g_array_sort_with_data';
+
+function g_ptr_array_index (parray: PGPtrArray; index: guint): gpointer;
+
+function g_ptr_array_new:PGPtrArray;cdecl;external gliblib name 'g_ptr_array_new';
+function g_ptr_array_sized_new(reserved_size:guint):PGPtrArray;cdecl;external gliblib name 'g_ptr_array_sized_new';
+function g_ptr_array_free(parray:PGPtrArray; free_seg:gboolean):Pgpointer;cdecl;external gliblib name 'g_ptr_array_free';
+procedure g_ptr_array_set_size(parray:PGPtrArray; length:gint);cdecl;external gliblib name 'g_ptr_array_set_size';
+function g_ptr_array_remove_index(parray:PGPtrArray; index:guint):gpointer;cdecl;external gliblib name 'g_ptr_array_remove_index';
+function g_ptr_array_remove_index_fast(parray:PGPtrArray; index:guint):gpointer;cdecl;external gliblib name 'g_ptr_array_remove_index_fast';
+function g_ptr_array_remove(parray:PGPtrArray; data:gpointer):gboolean;cdecl;external gliblib name 'g_ptr_array_remove';
+function g_ptr_array_remove_fast(parray:PGPtrArray; data:gpointer):gboolean;cdecl;external gliblib name 'g_ptr_array_remove_fast';
+procedure g_ptr_array_add(parray:PGPtrArray; data:gpointer);cdecl;external gliblib name 'g_ptr_array_add';
+procedure g_ptr_array_sort(parray:PGPtrArray; compare_func:TGCompareFunc);cdecl;external gliblib name 'g_ptr_array_sort';
+procedure g_ptr_array_sort_with_data(parray:PGPtrArray; compare_func:TGCompareDataFunc; user_data:gpointer);cdecl;external gliblib name 'g_ptr_array_sort_with_data';
+
+function g_byte_array_new:PGByteArray;cdecl;external gliblib name 'g_byte_array_new';
+function g_byte_array_sized_new(reserved_size:guint):PGByteArray;cdecl;external gliblib name 'g_byte_array_sized_new';
+function g_byte_array_free(parray:PGByteArray; free_segment:gboolean):Pguint8;cdecl;external gliblib name 'g_byte_array_free';
+function g_byte_array_append(parray:PGByteArray; data:Pguint8; len:guint):PGByteArray;cdecl;external gliblib name 'g_byte_array_append';
+function g_byte_array_prepend(parray:PGByteArray; data:Pguint8; len:guint):PGByteArray;cdecl;external gliblib name 'g_byte_array_prepend';
+function g_byte_array_set_size(parray:PGByteArray; length:guint):PGByteArray;cdecl;external gliblib name 'g_byte_array_set_size';
+function g_byte_array_remove_index(parray:PGByteArray; index:guint):PGByteArray;cdecl;external gliblib name 'g_byte_array_remove_index';
+function g_byte_array_remove_index_fast(parray:PGByteArray; index:guint):PGByteArray;cdecl;external gliblib name 'g_byte_array_remove_index_fast';
+procedure g_byte_array_sort(parray:PGByteArray; compare_func:TGCompareFunc);cdecl;external gliblib name 'g_byte_array_sort';
+procedure g_byte_array_sort_with_data(parray:PGByteArray; compare_func:TGCompareDataFunc; user_data:gpointer);cdecl;external gliblib name 'g_byte_array_sort_with_data';
+{$ENDIF read_interface_rest}

+ 15 - 9
packages/gtk2/src/glib/gasyncqueue.inc

@@ -1,13 +1,20 @@
-{$ifndef __G_ASYNCQUEUE_H__}
-{$define __G_ASYNCQUEUE_H__}
+// included by glib2.pas
 
-// {$include gthread.inc}
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
 
-{* Asyncronous Queues, can be used to communicate between threads
- *}
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_types}
+  PGAsyncQueue = pointer;
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_rest}
+
+{ Asyncronous Queues, can be used to communicate between threads }
 
-    type
-      PGAsyncQueue = pointer;
 {* Get a new GAsyncQueue with the ref_count 1 *}
 
     function g_async_queue_new:PGAsyncQueue;cdecl;external gliblib name 'g_async_queue_new';
@@ -62,5 +69,4 @@
     function g_async_queue_length(queue:PGAsyncQueue):gint;cdecl;external gliblib name 'g_async_queue_length';
     function g_async_queue_length_unlocked(queue:PGAsyncQueue):gint;cdecl;external gliblib name 'g_async_queue_length_unlocked';
 
-{$endif}
-
+{$ENDIF read_interface_rest}

+ 12 - 23
packages/gtk2/src/glib/gbacktrace.inc

@@ -1,28 +1,17 @@
-{$ifndef __G_BACKTRACE_H__}
-{$define __G_BACKTRACE_H__}
+// included by glib2.pas
 
-//{$include gtypes.inc}
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
 
-{ Fatal error handlers.
-   g_on_error_query() will prompt the user to either
-   [E]xit, [H]alt, [P]roceed or show [S]tack trace.
-   g_on_error_stack_trace() invokes gdb, which attaches to the current
-   process and shows a stack trace.
-   These function may cause different actions on non-unix platforms.
-   The prg_name arg is required by gdb to find the executable, if it is
-   passed as NULL, g_on_error_query() will try g_get_prgname().
-}
+//------------------------------------------------------------------------------
 
-  procedure g_on_error_query (prg_name:Pgchar);cdecl;external gliblib name 'g_on_error_query';
-  procedure g_on_error_stack_trace(prg_name:Pgchar);cdecl;external gliblib name 'g_on_error_stack_trace';
+{$IFDEF read_interface_types}
+{$ENDIF read_interface_types}
 
-{ Hacker macro to place breakpoints for elected machines.
-  Actual use is strongly discouraged of course ;)
-
-}
-
-{*  Not implemented *}
-
-
-{$endif} { __G_BACKTRACE_H__  }
+//------------------------------------------------------------------------------
 
+{$IFDEF read_interface_rest}
+procedure g_on_error_query (prg_name:Pgchar);cdecl;external gliblib name 'g_on_error_query';
+procedure g_on_error_stack_trace(prg_name:Pgchar);cdecl;external gliblib name 'g_on_error_stack_trace';
+{$ENDIF read_interface_rest}
+// included by glib2.pas

+ 9 - 23
packages/gtk2/src/glib/gboxed.inc

@@ -1,34 +1,28 @@
-(*
- * gboxed.inc
- *   depends on gtype.inc
- *
- *   included by glib2.pas
- *)
+// included by glib2.pas
 
-{$ifdef read_forward_definitions}
-(* --- typedefs ---  *)
+{$IFDEF read_forward_definitions}
    TGBoxedCopyFunc = function (boxed:gpointer):gpointer; cdecl;
-
    TGBoxedFreeFunc = procedure (boxed:gpointer); cdecl;
-{$endif read_forward_definitions}
+{$ENDIF read_forward_definitions}
+
+//------------------------------------------------------------------------------
 
-(****************************************************************)
+{$IFDEF read_interface_types}
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
 
 {$ifdef read_interface_rest}
 
 (*** some macros ***)
 function G_TYPE_IS_BOXED(_type : GType) : gboolean;
-
 function G_VALUE_HOLDS_BOXED(value : PGValue) : gboolean;
 
 (*** GLib boxed types ***)
 
 function G_TYPE_CLOSURE : GType;
-
 function G_TYPE_VALUE : GType;
-
 function G_TYPE_VALUE_ARRAY : GType;
-
 function G_TYPE_GSTRING : GType;
 
 
@@ -36,26 +30,18 @@ function G_TYPE_GSTRING : GType;
 
 function  g_boxed_copy(boxed_type : GType;
                        src_boxed  : gconstpointer):gpointer; cdecl; external gobjectlib;
-
 procedure g_boxed_free(boxed_type : GType;
                        boxed      : gpointer); cdecl; external gobjectlib;
-
 procedure g_value_set_boxed(value : PGValue;
                           v_boxed : gconstpointer); cdecl; external gobjectlib;
-
 procedure g_value_set_static_boxed(value : PGValue;
                                  v_boxed : gconstpointer); cdecl; external gobjectlib;
-
 function g_value_get_boxed( value : PGValue):gpointer; cdecl; external gobjectlib;
-
 function g_value_dup_boxed( value : PGValue):gpointer; cdecl; external gobjectlib;
-
-
 function g_boxed_type_register_static(name       : Pgchar;
                                       boxed_copy : TGBoxedCopyFunc;
                                       boxed_free : TGBoxedFreeFunc):GType; cdecl; external gobjectlib;
 
-(*** internal (marshaller specific) ***)
 procedure g_value_set_boxed_take_ownership(value:PGValue;
                                            v_boxed:gconstpointer); cdecl; external gobjectlib;
 

+ 20 - 17
packages/gtk2/src/glib/gcache.inc

@@ -1,25 +1,28 @@
-// {include <glib/glist.h>}
+// included by glib2.pas
 
-type
-   PGCache   = pointer;
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
 
-   TGCacheNewFunc     = function (key:gpointer):gpointer;cdecl;
-   TGCacheDupFunc     = function (value:gpointer):gpointer;cdecl;
-   TGCacheDestroyFunc = procedure (value:gpointer);cdecl;
+//------------------------------------------------------------------------------
 
-{ Caches }
+{$IFDEF read_interface_types}
+  PGCache = pointer;
 
-    function  g_cache_new(value_new_func:TGCacheNewFunc; value_destroy_func:TGCacheDestroyFunc; key_dup_func:TGCacheDupFunc; key_destroy_func:TGCacheDestroyFunc; hash_key_func:TGHashFunc;
-                hash_value_func:TGHashFunc; key_equal_func:TGEqualFunc):PGCache;cdecl;external gliblib name 'g_cache_new';
+  TGCacheNewFunc     = function (key:gpointer):gpointer;cdecl;
+  TGCacheDupFunc     = function (value:gpointer):gpointer;cdecl;
+  TGCacheDestroyFunc = procedure (value:gpointer);cdecl;
+{$ENDIF read_interface_types}
 
-    procedure g_cache_destroy(cache:PGCache);cdecl;external gliblib name 'g_cache_destroy';
+//------------------------------------------------------------------------------
 
-    function  g_cache_insert(cache:PGCache; key:gpointer):gpointer;cdecl;external gliblib name 'g_cache_insert';
-
-    procedure g_cache_remove(cache:PGCache; value:gconstpointer);cdecl;external gliblib name 'g_cache_remove';
-
-    procedure g_cache_key_foreach(cache:PGCache; func:TGHFunc; user_data:gpointer);cdecl;external gliblib name 'g_cache_key_foreach';
-
-    procedure g_cache_value_foreach(cache:PGCache; func:TGHFunc; user_data:gpointer);cdecl;external gliblib name 'g_cache_value_foreach';
+{$IFDEF read_interface_rest}
+function g_cache_new(value_new_func:TGCacheNewFunc; value_destroy_func:TGCacheDestroyFunc; key_dup_func:TGCacheDupFunc; key_destroy_func:TGCacheDestroyFunc; hash_key_func:TGHashFunc;
+  hash_value_func:TGHashFunc; key_equal_func:TGEqualFunc):PGCache;cdecl;external gliblib name 'g_cache_new';
 
+procedure g_cache_destroy(cache:PGCache);cdecl;external gliblib name 'g_cache_destroy';
+function  g_cache_insert(cache:PGCache; key:gpointer):gpointer;cdecl;external gliblib name 'g_cache_insert';
+procedure g_cache_remove(cache:PGCache; value:gconstpointer);cdecl;external gliblib name 'g_cache_remove';
+procedure g_cache_key_foreach(cache:PGCache; func:TGHFunc; user_data:gpointer);cdecl;external gliblib name 'g_cache_key_foreach';
+procedure g_cache_value_foreach(cache:PGCache; func:TGHFunc; user_data:gpointer);cdecl;external gliblib name 'g_cache_value_foreach';
 
+{$ENDIF read_interface_rest}

+ 17 - 35
packages/gtk2/src/glib/gclosure.inc

@@ -1,37 +1,15 @@
 // included by glib2.pas
 
-{ -- typedefs ---  }
-type
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_types}
    PGClosure = ^TGClosure;
    PGClosureNotifyData = ^TGClosureNotifyData;
    TGClosureNotify = procedure (data:gpointer; closure:PGClosure); cdecl;
 
-{< private > }
-{< private > }
-{< private > }
-{< private > }
-{ finalization notifiers  }
-{< private > }
-{ invalidation notifiers  }
-{< private > }
-{< private > }
-{< protected > }
-{< public > }
-{< public > }
-{< private > }
-{out }
-{< protected > }
-{< private > }
-{ invariants/constrains:
-     - ->marshal and ->data are _invalid_ as soon as ->is_invalid==TRUE
-     - invocation of all inotifiers occours prior to fnotifiers
-     - order of inotifiers is random
-       inotifiers may _not_ free/invalidate parameter values (e.g. ->data)
-     - order of fnotifiers is random
-     - each notifier may only be removed before or during its invocation
-     - reference counting may only happen prior to fnotify invocation
-       (in that sense, fnotifiers are really finalization handlers)
-    }
    TGClosure = record
         flag0 : longint;
         marshal : procedure (closure:PGClosure; return_value:PGValue; n_param_values:guint; param_values:PGValue; invocation_hint:gpointer;
@@ -40,8 +18,13 @@ type
         notifiers : PGClosureNotifyData;
      end;
 
+   PGCClosure = ^TGCClosure;
+   TGCClosure = record
+        closure : TGClosure;
+        callback : gpointer;
+     end;
 
-   TGCallBackProcedure = procedure;
+   TGCallBackProcedure = procedure; 
    TGCallback = procedure (para1: TGCallBackProcedure); cdecl;
 
    TGClosureMarshal = procedure (closure:PGClosure; return_value:PGValue; n_param_values:guint; param_values:PGValue; invocation_hint:gpointer;
@@ -52,7 +35,11 @@ type
         notify : TGClosureNotify;
      end;
 
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
 
+{$IFDEF read_interface_rest}
 { --- defines ---  }
 
 function G_CLOSURE_NEEDS_MARSHAL(closure : Pointer) : boolean;
@@ -105,12 +92,6 @@ procedure set_is_invalid(var a : TGClosure; __is_invalid : guint);
 
 
 { closure for C function calls, callback() is the user function }
-type
-   PGCClosure = ^TGCClosure;
-   TGCClosure = record
-        closure : TGClosure;
-        callback : gpointer;
-     end;
 
 { --- prototypes ---  }
 
@@ -144,6 +125,7 @@ procedure g_closure_invoke(closure:PGClosure; return_value:PGValue; n_param_valu
    - need marshaller repo with decent aliasing to base types
    - provide marshaller collection, virtually covering anything out there
  }
+{$ENDIF read_interface_rest}
 
 // included by glib2.pas
 

+ 30 - 28
packages/gtk2/src/glib/gcompletion.inc

@@ -1,33 +1,35 @@
-// {$include <glib/glist.h>}
+// included by glib2.pas
 
-    type
-       PGCompletionFunc = ^TGCompletionFunc;
-       TGCompletionFunc = gchar;
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
 
-{ GCompletion   }
-
-       TGCompletionStrncmpFunc = function (s1:Pgchar; s2:Pgchar; n:gsize):gint;cdecl;
-       PGCompletion = ^TGCompletion;
-       TGCompletion = record
-            items  : PGList;
-            func   : TGCompletionFunc;
-            prefix : Pgchar;
-            cache  : PGList;
-            strncmp_func : TGCompletionStrncmpFunc;
-         end;
-
-
-    function  g_completion_new(func:TGCompletionFunc):PGCompletion;cdecl;external gliblib name 'g_completion_new';
-
-    procedure g_completion_add_items(cmp:PGCompletion; items:PGList);cdecl;external gliblib name 'g_completion_add_items';
+//------------------------------------------------------------------------------
 
-    procedure g_completion_remove_items(cmp:PGCompletion; items:PGList);cdecl;external gliblib name 'g_completion_remove_items';
+{$IFDEF read_interface_types}
+  PGCompletionFunc = ^TGCompletionFunc;
+  TGCompletionFunc = gchar;
 
-    procedure g_completion_clear_items(cmp:PGCompletion);cdecl;external gliblib name 'g_completion_clear_items';
-
-    function  g_completion_complete(cmp:PGCompletion; prefix:Pgchar; new_prefix:PPgchar):PGList;cdecl;external gliblib name 'g_completion_complete';
-
-    procedure g_completion_set_compare(cmp:PGCompletion; strncmp_func:TGCompletionStrncmpFunc);cdecl;external gliblib name 'g_completion_set_compare';
-
-    procedure g_completion_free(cmp:PGCompletion);cdecl;external gliblib name 'g_completion_free';
+{ GCompletion   }
 
+  TGCompletionStrncmpFunc = function (s1:Pgchar; s2:Pgchar; n:gsize):gint;cdecl;
+  PGCompletion = ^TGCompletion;
+  TGCompletion = record
+       items  : PGList;
+       func   : TGCompletionFunc;
+       prefix : Pgchar;
+       cache  : PGList;
+       strncmp_func : TGCompletionStrncmpFunc;
+    end;
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_rest}
+function  g_completion_new(func:TGCompletionFunc):PGCompletion;cdecl;external gliblib name 'g_completion_new';
+procedure g_completion_add_items(cmp:PGCompletion; items:PGList);cdecl;external gliblib name 'g_completion_add_items';
+procedure g_completion_remove_items(cmp:PGCompletion; items:PGList);cdecl;external gliblib name 'g_completion_remove_items';
+procedure g_completion_clear_items(cmp:PGCompletion);cdecl;external gliblib name 'g_completion_clear_items';
+function  g_completion_complete(cmp:PGCompletion; prefix:Pgchar; new_prefix:PPgchar):PGList;cdecl;external gliblib name 'g_completion_complete';
+procedure g_completion_set_compare(cmp:PGCompletion; strncmp_func:TGCompletionStrncmpFunc);cdecl;external gliblib name 'g_completion_set_compare';
+procedure g_completion_free(cmp:PGCompletion);cdecl;external gliblib name 'g_completion_free';
+{$ENDIF read_interface_rest}

+ 39 - 45
packages/gtk2/src/glib/gconvert.inc

@@ -1,56 +1,50 @@
-// {$include <stddef.h>      /* For size_t */}
-// {$include <glib/gerror.h>}
+// included by glib2.pas
 
-  type
-     PGConvertError = ^TGConvertError;
-     TGConvertError = (G_CONVERT_ERROR_NO_CONVERSION,
-                       G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
-                       G_CONVERT_ERROR_FAILED,
-                       G_CONVERT_ERROR_PARTIAL_INPUT,
-                       G_CONVERT_ERROR_BAD_URI,
-                       G_CONVERT_ERROR_NOT_ABSOLUTE_PATH
-       );
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
 
-    function G_CONVERT_ERROR : TGQuark;
+//------------------------------------------------------------------------------
 
+{$IFDEF read_interface_types}
+  PGConvertError = ^TGConvertError;
+  TGConvertError = (
+    G_CONVERT_ERROR_NO_CONVERSION,
+    G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
+    G_CONVERT_ERROR_FAILED,
+    G_CONVERT_ERROR_PARTIAL_INPUT,
+    G_CONVERT_ERROR_BAD_URI,
+    G_CONVERT_ERROR_NOT_ABSOLUTE_PATH
+  );
+  PGIConv = ^TGIConv;
+  TGIConv  = pointer;
+{$ENDIF read_interface_types}
 
-    function g_convert_error_quark:TGQuark;cdecl;external gliblib name 'g_convert_error_quark';
+//------------------------------------------------------------------------------
 
-{ Thin wrappers around iconv  }
-    type
-       PGIConv = ^TGIConv;
-       TGIConv  = pointer;
-
-    function g_iconv_open(to_codeset:Pgchar; from_codeset:Pgchar):TGIConv;cdecl;external gliblib name 'g_iconv_open';
-
-    function g_iconv(converter:TGIConv; inbuf:PPgchar; inbytes_left:Pgsize; outbuf:PPgchar; outbytes_left:Pgsize):gsize;cdecl;external gliblib name 'g_iconv';
+{$IFDEF read_interface_rest}
+function G_CONVERT_ERROR : TGQuark;
 
-    function g_iconv_close(converter:TGIConv):gint;cdecl;external gliblib name 'g_iconv_close';
+function g_convert_error_quark:TGQuark;cdecl;external gliblib name 'g_convert_error_quark';
 
-    function g_convert(str:Pgchar; len:gssize; to_codeset:Pgchar; from_codeset:Pgchar; bytes_read:Pgsize;
-                       bytes_written:Pgsize; error:PPGError):Pgchar;cdecl;external gliblib name 'g_convert';
-
-    function g_convert_with_iconv(str:Pgchar; len:gssize; converter:TGIConv; bytes_read:Pgsize; bytes_written:Pgsize;
-                                  error:PPGError):Pgchar;cdecl;external gliblib name 'g_convert_with_iconv';
-
-    function g_convert_with_fallback(str:Pgchar; len:gssize; to_codeset:Pgchar; from_codeset:Pgchar; fallback:Pgchar;
-                                     bytes_read:Pgsize; bytes_written:Pgsize; error:PPGError):Pgchar;cdecl;external gliblib name 'g_convert_with_fallback';
+{ Thin wrappers around iconv  }
+function g_iconv_open(to_codeset:Pgchar; from_codeset:Pgchar):TGIConv;cdecl;external gliblib name 'g_iconv_open';
+function g_iconv(converter:TGIConv; inbuf:PPgchar; inbytes_left:Pgsize; outbuf:PPgchar; outbytes_left:Pgsize):gsize;cdecl;external gliblib name 'g_iconv';
+function g_iconv_close(converter:TGIConv):gint;cdecl;external gliblib name 'g_iconv_close';
+function g_convert(str:Pgchar; len:gssize; to_codeset:Pgchar; from_codeset:Pgchar; bytes_read:Pgsize;
+  bytes_written:Pgsize; error:PPGError):Pgchar;cdecl;external gliblib name 'g_convert';
+function g_convert_with_iconv(str:Pgchar; len:gssize; converter:TGIConv; bytes_read:Pgsize; bytes_written:Pgsize;
+  error:PPGError):Pgchar;cdecl;external gliblib name 'g_convert_with_iconv';
+function g_convert_with_fallback(str:Pgchar; len:gssize; to_codeset:Pgchar; from_codeset:Pgchar; fallback:Pgchar;
+  bytes_read:Pgsize; bytes_written:Pgsize; error:PPGError):Pgchar;cdecl;external gliblib name 'g_convert_with_fallback';
 
 { Convert between libc's idea of strings and UTF-8. }
 
-    function g_locale_to_utf8(opsysstring:Pgchar; len:gssize; bytes_read:Pgsize; bytes_written:Pgsize; error:PPGError):Pgchar;cdecl;external gliblib name 'g_locale_to_utf8';
-
-    function g_locale_from_utf8(utf8string:Pgchar; len:gssize; bytes_read:Pgsize; bytes_written:Pgsize; error:PPGError):Pgchar;cdecl;external gliblib name 'g_locale_from_utf8';
-
-    { Convert between the operating system (or C runtime)
-       representation of file names and UTF-8.
-      }
-    function g_filename_to_utf8(opsysstring:Pgchar; len:gssize; bytes_read:Pgsize; bytes_written:Pgsize; error:PPGError):Pgchar;cdecl;external gliblib name 'g_filename_to_utf8';
-
-    function g_filename_from_utf8(utf8string:Pgchar; len:gssize; bytes_read:Pgsize; bytes_written:Pgsize; error:PPGError):Pgchar;cdecl;external gliblib name 'g_filename_from_utf8';
-
-    function g_filename_from_uri(uri:Pchar; hostname:PPchar; error:PPGError):Pgchar;cdecl;external gliblib name 'g_filename_from_uri';
-
-    function g_filename_to_uri(filename:Pchar; hostname:Pchar; error:PPGError):Pgchar;cdecl;external gliblib name 'g_filename_to_uri';
-
+function g_locale_to_utf8(opsysstring:Pgchar; len:gssize; bytes_read:Pgsize; bytes_written:Pgsize; error:PPGError):Pgchar;cdecl;external gliblib name 'g_locale_to_utf8';
+function g_locale_from_utf8(utf8string:Pgchar; len:gssize; bytes_read:Pgsize; bytes_written:Pgsize; error:PPGError):Pgchar;cdecl;external gliblib name 'g_locale_from_utf8';
 
+{ Convert between the operating system (or C runtime) representation of file names and UTF-8. }
+function g_filename_to_utf8(opsysstring:Pgchar; len:gssize; bytes_read:Pgsize; bytes_written:Pgsize; error:PPGError):Pgchar;cdecl;external gliblib name 'g_filename_to_utf8';
+function g_filename_from_utf8(utf8string:Pgchar; len:gssize; bytes_read:Pgsize; bytes_written:Pgsize; error:PPGError):Pgchar;cdecl;external gliblib name 'g_filename_from_utf8';
+function g_filename_from_uri(uri:Pchar; hostname:PPchar; error:PPGError):Pgchar;cdecl;external gliblib name 'g_filename_from_uri';
+function g_filename_to_uri(filename:Pchar; hostname:Pchar; error:PPGError):Pgchar;cdecl;external gliblib name 'g_filename_to_uri';
+{$ENDIF read_interface_rest}

+ 7 - 30
packages/gtk2/src/glib/gdataset.inc

@@ -1,73 +1,50 @@
 // included by glib2.pas
 
 {$IFDEF read_forward_definitions}
-   PPGData   = ^PGData;
-   PGData    =  pointer;
-
-
+  PPGData   = ^PGData;
+  PGData    =  pointer;
 {$ENDIF read_forward_definitions}
 
 //------------------------------------------------------------------------------
 
+{$IFDEF read_interface_types}
+  TGDataForeachFunc = procedure (key_id:TGQuark; data:gpointer; user_data:gpointer);cdecl;
+{$ENDIF read_interface_types}
+
 {$IFDEF read_interface_rest}
-type
-   TGDataForeachFunc = procedure (key_id:TGQuark; data:gpointer; user_data:gpointer);cdecl;
-{ Keyed Data List
-  }
+{ Keyed Data List }
 
 procedure g_datalist_init(datalist:PPGData);cdecl;external gliblib name 'g_datalist_init';
-
 procedure g_datalist_clear(datalist:PPGData);cdecl;external gliblib name 'g_datalist_clear';
-
 function  g_datalist_id_get_data(datalist:PPGData; key_id:TGQuark):gpointer;cdecl;external gliblib name 'g_datalist_id_get_data';
-
 procedure g_datalist_id_set_data_full(datalist:PPGData; key_id:TGQuark; data:gpointer; destroy_func:TGDestroyNotify);cdecl;external gliblib name 'g_datalist_id_set_data_full';
-
 function  g_datalist_id_remove_no_notify(datalist:PPGData; key_id:TGQuark):gpointer;cdecl;external gliblib name 'g_datalist_id_remove_no_notify';
-
 procedure g_datalist_foreach(datalist:PPGData; func:TGDataForeachFunc; user_data:gpointer);cdecl;external gliblib name 'g_datalist_foreach';
 
 {macros}
 procedure g_datalist_id_set_data (datalist: PPGData; key_id:TGQuark; data: gpointer);
-
 procedure g_datalist_id_remove_data (datalist: PPGData; key_id:TGQuark);
-
 function  g_datalist_get_data(datalist: PPGData; key_str:PGChar):PPGData;
-
 procedure g_datalist_set_data_full(datalist: PPGData; key_str:PGChar; data:gpointer; destroy_func:TGDestroyNotify);
-
 procedure g_datalist_set_data (datalist: PPGData; key_str:PGChar; data:gpointer);
-
 procedure g_datalist_remove_no_notify(datalist: PPGData; key_str:PGChar);
-
 procedure g_datalist_remove_data(datalist:PPGData; key_str:PGChar);
 
 
 { Location Associated Keyed Data  }
 
 function  g_dataset_id_get_data(dataset_location:gconstpointer; key_id:TGQuark):gpointer;cdecl;external gliblib name 'g_dataset_id_get_data';
-
 procedure g_dataset_id_set_data_full(dataset_location:gconstpointer; key_id:TGQuark; data:gpointer; destroy_func:TGDestroyNotify);cdecl;external gliblib name 'g_dataset_id_set_data_full';
-
 function  g_dataset_id_remove_no_notify(dataset_location:gconstpointer; key_id:TGQuark):gpointer;cdecl;external gliblib name 'g_dataset_id_remove_no_notify';
-
 procedure g_dataset_foreach(dataset_location:gconstpointer; func:TGDataForeachFunc; user_data:gpointer);cdecl;external gliblib name 'g_dataset_foreach';
 
-
-
 {macros}
 procedure g_dataset_id_set_data(location: gconstpointer; key_id:TGQuark; data:gpointer);
-
 procedure g_dataset_id_remove_data(location: gconstpointer; key_id:TGQuark);
-
 function  g_dataset_get_data(location: gconstpointer; key_str:PGChar): gpointer;
-
 procedure g_dataset_set_data_full(location: gconstpointer; key_str:PGChar; data:gpointer; destroy_func:TGDestroyNotify);
-
 procedure g_dataset_remove_no_notify(location: gconstpointer; key_str:PGChar);
-
 procedure g_dataset_set_data(location: gconstpointer; key_str:PGChar; data:gpointer);
-
 procedure g_dataset_remove_data(location:gconstpointer; key_str: PGChar);
 {$ENDIF read_interface_rest}
 

+ 145 - 238
packages/gtk2/src/glib/gdate.inc

@@ -1,241 +1,147 @@
-// {$include <glib/gquark.h>}
-{ GDate
-
-  Date calculations (not time for now, to be resolved). These are a
-  mutant combination of Steffen Beyer's DateCalc routines
- (http://www.perl.com/CPAN/authors/id/STBEY/) and Jon Trowbridge's
-  date routines (written for in-house software).  Written by Havoc
-  Pennington <[email protected]>
-}
-
-  type
-       PGTime      = ^TGTime;
-       TGTime      = gint32;
-
-       PGDateYear  = ^TGDateYear;
-       TGDateYear  = guint16;
-
-       PGDateDay   = ^TGDateDay;
-       TGDateDay   = guint8;   // day of the month
-
-    { day of the month  }
-    { make struct tm known without having to include time.h  }
-
-       { from time.h }
-       Ptm         = ^Ttm;
-       Ttm         = record
-                   tm_sec   : gint;                     // Seconds.     [0-60] (1 leap second)
-                   tm_min   : gint;                     // Minutes.     [0-59]
-                   tm_hour  : gint;                     // Hours.       [0-23]
-                   tm_mday  : gint;                     // Day.         [1-31]
-                   tm_mon   : gint;                     // Month.       [0-11]
-                   tm_year  : gint;                     // Year - 1900.
-                   tm_wday  : gint;                     // Day of week. [0-6]
-                   tm_yday  : gint;                     // Days in year.[0-365]
-                   tm_isdst : gint;                     // DST.         [-1/0/1]
-                   tm_gmtoff: glong;        // Seconds east of UTC.
-                   tm_zone  : pgchar;       // Timezone abbreviation.
-            end;
-
-
-    { enum used to specify order of appearance in parsed date strings  }
-
-     type
-       PGDateDMY = ^TGDateDMY;
-       TGDateDMY = integer;
-     const G_DATE_DAY = 0;
-           G_DATE_MONTH = 1;
-           G_DATE_YEAR = 2;
-
-    { actual week and month values  }
-
-     type
-       PGDateWeekday = ^TGDateWeekday;
-       TGDateWeekday = integer;
-     const G_DATE_BAD_WEEKDAY = 0;
-           G_DATE_MONDAY = 1;
-           G_DATE_TUESDAY = 2;
-           G_DATE_WEDNESDAY = 3;
-           G_DATE_THURSDAY = 4;
-           G_DATE_FRIDAY = 5;
-           G_DATE_SATURDAY = 6;
-           G_DATE_SUNDAY = 7;
-
-     type
-       PGDateMonth = ^TGDateMonth;
-       TGDateMonth = integer;
-     const
-       G_DATE_BAD_MONTH = 0;
-       G_DATE_JANUARY = 1;
-       G_DATE_FEBRUARY = 2;
-       G_DATE_MARCH = 3;
-       G_DATE_APRIL = 4;
-       G_DATE_MAY = 5;
-       G_DATE_JUNE = 6;
-       G_DATE_JULY = 7;
-       G_DATE_AUGUST = 8;
-       G_DATE_SEPTEMBER = 9;
-       G_DATE_OCTOBER = 10;
-       G_DATE_NOVEMBER = 11;
-       G_DATE_DECEMBER = 12;
-
-    const
-       G_DATE_BAD_JULIAN = 0;
-       G_DATE_BAD_DAY    = 0;
-       G_DATE_BAD_YEAR   = 0;
-
-    { Note: directly manipulating structs is generally a bad idea, but
-       in this case it's an  incredibly  bad idea, because all or part
-       of this struct can be invalid at any given time. Use the functions,
-       or you will get hosed, I promise.
-      }
-
-    { julian days representation - we use a
-                                  bitfield hoping that 64 bit platforms
-                                  will pack this whole struct in one big
-                                  int
-                                }
-    { julian is valid  }
-    { dmy is valid  }
-    { DMY representation  }
-
-    type
-       PGDate = ^TGDate;
-       TGDate = record
-            flag0 : longint;
-            flag1 : longint;
-         end;
-
-    { g_date_new() returns an invalid date, you then have to _set() stuff
-       to get a usable anObject. You can also allocate a GDate statically,
-       then call g_date_clear() to initialize.
-      }
-
-    function  g_date_new:PGDate; cdecl;external gliblib name 'g_date_new';
-
-    function  g_date_new_dmy(day:TGDateDay; month:TGDateMonth; year:TGDateYear):PGDate;cdecl;external gliblib name 'g_date_new_dmy';
-
-    function  g_date_new_julian(julian_day:guint32):PGDate;cdecl;external gliblib name 'g_date_new_julian';
-
-    procedure g_date_free(date:PGDate);cdecl;external gliblib name 'g_date_free';
-
-    { check g_date_valid() after doing an operation that might fail, like
-       _parse.  Almost all g_date operations are undefined on invalid
-       dates (the exceptions are the mutators, since you need those to
-       return to validity).
-      }
-
-    function g_date_valid         (date:PGDate):      gboolean;cdecl;external gliblib name 'g_date_valid';
-
-    function g_date_valid_month   (month:TGDateMonth):gboolean;cdecl;external gliblib name 'g_date_valid_month';
-
-    function g_date_valid_year    (year:TGDateYear):  gboolean;cdecl;external gliblib name 'g_date_valid_year';
-
-    function g_date_valid_weekday (weekday:TGDateWeekday):  gboolean;cdecl;external gliblib name 'g_date_valid_weekday';
-
-    function g_date_valid_julian  (julian_date:guint32):    gboolean;cdecl;external gliblib name 'g_date_valid_julian';
-
-
-
-    function g_date_get_weekday(date:PGDate):TGDateWeekday;cdecl;external gliblib name 'g_date_get_weekday';
-
-    function g_date_get_month(date:PGDate):TGDateMonth;cdecl;external gliblib name 'g_date_get_month';
-
-    function g_date_get_year(date:PGDate):TGDateYear;cdecl;external gliblib name 'g_date_get_year';
-
-    function g_date_get_day(date:PGDate):TGDateDay;cdecl;external gliblib name 'g_date_get_day';
-
-    function g_date_get_julian(date:PGDate):guint32;cdecl;external gliblib name 'g_date_get_julian';
-
-    function g_date_get_day_of_year(date:PGDate):guint;cdecl;external gliblib name 'g_date_get_day_of_year';
-
-    { First monday/sunday is the start of week 1; if we haven't reached
-       that day, return 0. These are not ISO weeks of the year; that
-       routine needs to be added.
-       these functions return the number of weeks, starting on the
-       corrsponding day
-      }
-
-    function g_date_get_monday_week_of_year(date:PGDate):guint;cdecl;external gliblib name 'g_date_get_monday_week_of_year';
-
-    function g_date_get_sunday_week_of_year(date:PGDate):guint;cdecl;external gliblib name 'g_date_get_sunday_week_of_year';
-
-    { If you create a static date struct you need to clear it to get it
-       in a sane state before use. You can clear a whole array at
-       once with the ndates argument.
-      }
-    procedure g_date_clear(date:PGDate; n_dates:guint);cdecl;external gliblib name 'g_date_clear';
-
-    { The parse routine is meant for dates typed in by a user, so it
-       permits many formats but tries to catch common typos. If your data
-       needs to be strictly validated, it is not an appropriate function.
-      }
-
-    procedure g_date_set_parse(date:PGDate; str:Pgchar);cdecl;external gliblib name 'g_date_set_parse';
-
-    procedure g_date_set_time(date:PGDate; time:TGTime);cdecl;external gliblib name 'g_date_set_time';
-
-    procedure g_date_set_month(date:PGDate; month:TGDateMonth);cdecl;external gliblib name 'g_date_set_month';
-
-    procedure g_date_set_day(date:PGDate; day:TGDateDay);cdecl;external gliblib name 'g_date_set_day';
-
-    procedure g_date_set_year(date:PGDate; year:TGDateYear);cdecl;external gliblib name 'g_date_set_year';
-
-    procedure g_date_set_dmy(date:PGDate; day:TGDateDay; month:TGDateMonth; y:TGDateYear);cdecl;external gliblib name 'g_date_set_dmy';
-
-    procedure g_date_set_julian(date:PGDate; julian_date:guint32);cdecl;external gliblib name 'g_date_set_julian';
-
-    function g_date_is_first_of_month(date:PGDate):gboolean;cdecl;external gliblib name 'g_date_is_first_of_month';
-
-    function g_date_is_last_of_month(date:PGDate):gboolean;cdecl;external gliblib name 'g_date_is_last_of_month';
-
-
-    { To go forward by some number of weeks just go forward weeks 7 days  }
-    procedure g_date_add_days(date:PGDate; n_days:guint);cdecl;external gliblib name 'g_date_add_days';
-
-    procedure g_date_subtract_days(date:PGDate; n_days:guint);cdecl;external gliblib name 'g_date_subtract_days';
-
-
-    { If you add/sub months while day > 28, the day might change  }
-    procedure g_date_add_months(date:PGDate; n_months:guint);cdecl;external gliblib name 'g_date_add_months';
-
-    procedure g_date_subtract_months(date:PGDate; n_months:guint);cdecl;external gliblib name 'g_date_subtract_months';
-
-
-    { If it's feb 29, changing years can move you to the 28th  }
-    procedure g_date_add_years(date:PGDate; n_years:guint);cdecl;external gliblib name 'g_date_add_years';
-
-    procedure g_date_subtract_years(date:PGDate; n_years:guint);cdecl;external gliblib name 'g_date_subtract_years';
-
-
-    function  g_date_is_leap_year (year:TGDateYear): gboolean; cdecl;external gliblib name 'g_date_is_leap_year';
-
-    function  g_date_get_days_in_month   (month: TGDateMonth; year: TGDateYear):guint8;cdecl;external gliblib name 'g_date_get_days_in_month';
-
-    function  g_date_get_monday_weeks_in_year (year:TGDateYear): guint8; cdecl;external gliblib name 'g_date_get_monday_weeks_in_year';
-
-    function  g_date_get_sunday_weeks_in_year (year:TGDateYear): guint8; cdecl;external gliblib name 'g_date_get_sunday_weeks_in_year';
-
-    { Returns the number of days between the two dates.  If date2 comes
-       before date1, a negative value is return.  }
-
-    function g_date_days_between(date1:PGDate; date2:PGDate):gint;cdecl;external gliblib name 'g_date_days_between';
-
-    { qsort-friendly (with a cast...)  }
-    function g_date_compare(lhs:PGDate; rhs:PGDate):gint;cdecl;external gliblib name 'g_date_compare';
-
-
-    procedure g_date_to_struct_tm(date:PGDate; tm:Ptm);cdecl;external gliblib name 'g_date_to_struct_tm';
-
-    procedure g_date_clamp(date:PGDate; min_date:PGDate; max_date:PGDate);cdecl;external gliblib name 'g_date_clamp';
-
-    { Swap date1 and date2's values if date1 > date2.  }
-    procedure g_date_order(date1:PGDate; date2:PGDate);cdecl;external gliblib name 'g_date_order';
-
-    { Just like strftime() except you can only use date-related formats.
-         Using a time format is undefined.
-      }
-    function g_date_strftime(s:Pgchar; slen:gsize; format:Pgchar; date:PGDate):gsize;cdecl;external gliblib name 'g_date_strftime';
+// included by glib2.pas
+
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_types}
+  PGTime      = ^TGTime;
+  TGTime      = gint32;
+
+  PGDateYear  = ^TGDateYear;
+  TGDateYear  = guint16;
+
+  PGDateDay   = ^TGDateDay;
+  TGDateDay   = guint8;   // day of the month
+
+  Ptm         = ^Ttm;
+  Ttm         = record
+              tm_sec   : gint;                     // Seconds.     [0-60] (1 leap second)
+              tm_min   : gint;                     // Minutes.     [0-59]
+              tm_hour  : gint;                     // Hours.       [0-23]
+              tm_mday  : gint;                     // Day.         [1-31]
+              tm_mon   : gint;                     // Month.       [0-11]
+              tm_year  : gint;                     // Year - 1900.
+              tm_wday  : gint;                     // Day of week. [0-6]
+              tm_yday  : gint;                     // Days in year.[0-365]
+              tm_isdst : gint;                     // DST.         [-1/0/1]
+              tm_gmtoff: glong;        // Seconds east of UTC.
+              tm_zone  : pgchar;       // Timezone abbreviation.
+       end;
+
+  PGDateDMY = ^TGDateDMY;
+  TGDateDMY = integer;
+
+  PGDateWeekday = ^TGDateWeekday;
+  TGDateWeekday = integer;
+
+  PGDateMonth = ^TGDateMonth;
+  TGDateMonth = integer;
+
+  PGDate = ^TGDate;
+  TGDate = record
+    flag0 : longint;
+    flag1 : longint;
+  end;
+{$ENDIF read_interface_types}
+
+{$IFDEF read_interface_rest}
+const 
+  G_DATE_DAY = 0;
+  G_DATE_MONTH = 1;
+  G_DATE_YEAR = 2;
+
+const 
+  G_DATE_BAD_WEEKDAY = 0;
+  G_DATE_MONDAY = 1;
+  G_DATE_TUESDAY = 2;
+  G_DATE_WEDNESDAY = 3;
+  G_DATE_THURSDAY = 4;
+  G_DATE_FRIDAY = 5;
+  G_DATE_SATURDAY = 6;
+  G_DATE_SUNDAY = 7;
+
+const
+  G_DATE_BAD_MONTH = 0;
+  G_DATE_JANUARY = 1;
+  G_DATE_FEBRUARY = 2;
+  G_DATE_MARCH = 3;
+  G_DATE_APRIL = 4;
+  G_DATE_MAY = 5;
+  G_DATE_JUNE = 6;
+  G_DATE_JULY = 7;
+  G_DATE_AUGUST = 8;
+  G_DATE_SEPTEMBER = 9;
+  G_DATE_OCTOBER = 10;
+  G_DATE_NOVEMBER = 11;
+  G_DATE_DECEMBER = 12;
+
+const
+  G_DATE_BAD_JULIAN = 0;
+  G_DATE_BAD_DAY    = 0;
+  G_DATE_BAD_YEAR   = 0;
+
+
+function  g_date_new:PGDate; cdecl;external gliblib name 'g_date_new';
+function  g_date_new_dmy(day:TGDateDay; month:TGDateMonth; year:TGDateYear):PGDate;cdecl;external gliblib name 'g_date_new_dmy';
+function  g_date_new_julian(julian_day:guint32):PGDate;cdecl;external gliblib name 'g_date_new_julian';
+procedure g_date_free(date:PGDate);cdecl;external gliblib name 'g_date_free';
+
+function g_date_valid         (date:PGDate):      gboolean;cdecl;external gliblib name 'g_date_valid';
+function g_date_valid_month   (month:TGDateMonth):gboolean;cdecl;external gliblib name 'g_date_valid_month';
+function g_date_valid_year    (year:TGDateYear):  gboolean;cdecl;external gliblib name 'g_date_valid_year';
+function g_date_valid_weekday (weekday:TGDateWeekday):  gboolean;cdecl;external gliblib name 'g_date_valid_weekday';
+function g_date_valid_julian  (julian_date:guint32):    gboolean;cdecl;external gliblib name 'g_date_valid_julian';
+
+
+function g_date_get_weekday(date:PGDate):TGDateWeekday;cdecl;external gliblib name 'g_date_get_weekday';
+function g_date_get_month(date:PGDate):TGDateMonth;cdecl;external gliblib name 'g_date_get_month';
+function g_date_get_year(date:PGDate):TGDateYear;cdecl;external gliblib name 'g_date_get_year';
+function g_date_get_day(date:PGDate):TGDateDay;cdecl;external gliblib name 'g_date_get_day';
+function g_date_get_julian(date:PGDate):guint32;cdecl;external gliblib name 'g_date_get_julian';
+function g_date_get_day_of_year(date:PGDate):guint;cdecl;external gliblib name 'g_date_get_day_of_year';
+
+function g_date_get_monday_week_of_year(date:PGDate):guint;cdecl;external gliblib name 'g_date_get_monday_week_of_year';
+function g_date_get_sunday_week_of_year(date:PGDate):guint;cdecl;external gliblib name 'g_date_get_sunday_week_of_year';
+
+procedure g_date_clear(date:PGDate; n_dates:guint);cdecl;external gliblib name 'g_date_clear';
+
+procedure g_date_set_parse(date:PGDate; str:Pgchar);cdecl;external gliblib name 'g_date_set_parse';
+procedure g_date_set_time(date:PGDate; time:TGTime);cdecl;external gliblib name 'g_date_set_time';
+procedure g_date_set_month(date:PGDate; month:TGDateMonth);cdecl;external gliblib name 'g_date_set_month';
+procedure g_date_set_day(date:PGDate; day:TGDateDay);cdecl;external gliblib name 'g_date_set_day';
+procedure g_date_set_year(date:PGDate; year:TGDateYear);cdecl;external gliblib name 'g_date_set_year';
+procedure g_date_set_dmy(date:PGDate; day:TGDateDay; month:TGDateMonth; y:TGDateYear);cdecl;external gliblib name 'g_date_set_dmy';
+procedure g_date_set_julian(date:PGDate; julian_date:guint32);cdecl;external gliblib name 'g_date_set_julian';
+function g_date_is_first_of_month(date:PGDate):gboolean;cdecl;external gliblib name 'g_date_is_first_of_month';
+function g_date_is_last_of_month(date:PGDate):gboolean;cdecl;external gliblib name 'g_date_is_last_of_month';
+
+
+procedure g_date_add_days(date:PGDate; n_days:guint);cdecl;external gliblib name 'g_date_add_days';
+procedure g_date_subtract_days(date:PGDate; n_days:guint);cdecl;external gliblib name 'g_date_subtract_days';
+
+procedure g_date_add_months(date:PGDate; n_months:guint);cdecl;external gliblib name 'g_date_add_months';
+procedure g_date_subtract_months(date:PGDate; n_months:guint);cdecl;external gliblib name 'g_date_subtract_months';
+
+procedure g_date_add_years(date:PGDate; n_years:guint);cdecl;external gliblib name 'g_date_add_years';
+procedure g_date_subtract_years(date:PGDate; n_years:guint);cdecl;external gliblib name 'g_date_subtract_years';
+
+function  g_date_is_leap_year (year:TGDateYear): gboolean; cdecl;external gliblib name 'g_date_is_leap_year';
+function  g_date_get_days_in_month   (month: TGDateMonth; year: TGDateYear):guint8;cdecl;external gliblib name 'g_date_get_days_in_month';
+function  g_date_get_monday_weeks_in_year (year:TGDateYear): guint8; cdecl;external gliblib name 'g_date_get_monday_weeks_in_year';
+function  g_date_get_sunday_weeks_in_year (year:TGDateYear): guint8; cdecl;external gliblib name 'g_date_get_sunday_weeks_in_year';
+
+function g_date_days_between(date1:PGDate; date2:PGDate):gint;cdecl;external gliblib name 'g_date_days_between';
+
+function g_date_compare(lhs:PGDate; rhs:PGDate):gint;cdecl;external gliblib name 'g_date_compare';
+
+procedure g_date_to_struct_tm(date:PGDate; tm:Ptm);cdecl;external gliblib name 'g_date_to_struct_tm';
+procedure g_date_clamp(date:PGDate; min_date:PGDate; max_date:PGDate);cdecl;external gliblib name 'g_date_clamp';
+
+procedure g_date_order(date1:PGDate; date2:PGDate);cdecl;external gliblib name 'g_date_order';
+
+function g_date_strftime(s:Pgchar; slen:gsize; format:Pgchar; date:PGDate):gsize;cdecl;external gliblib name 'g_date_strftime';
 
 { DEPRECATED functions are maped to their newer versions as the arguments and the return value are the same}
 
@@ -254,3 +160,4 @@
     function g_date_monday_weeks_in_year (year:TGDateYear): guint8; cdecl;external gliblib name 'g_date_get_monday_weeks_in_year';
     function g_date_sunday_weeks_in_year (year:TGDateYear): guint8; cdecl;external gliblib name 'g_date_get_sunday_weeks_in_year';
 }
+{$ENDIF read_interface_rest}

+ 13 - 9
packages/gtk2/src/glib/gdir.inc

@@ -1,13 +1,17 @@
-// {$include <glib/gerror.h>}
-    type
-      PGDir   = pointer;
+// included by glib2.pas
 
-    function  g_dir_open(path:Pgchar; flags:guint; error:PPGError):PGDir;cdecl;external gliblib name 'g_dir_open';
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
 
-    function  g_dir_read_name (dir:PGDir): pgchar; cdecl;external gliblib name 'g_dir_read_name';
-
-    procedure g_dir_rewind(dir:PGDir);cdecl;external gliblib name 'g_dir_rewind';
-
-    procedure g_dir_close(dir:PGDir);cdecl;external gliblib name 'g_dir_close';
+//------------------------------------------------------------------------------
 
+{$IFDEF read_interface_types}
+  PGDir   = pointer;
+{$ENDIF read_interface_types}
 
+{$IFDEF read_interface_rest}
+function  g_dir_open(path:Pgchar; flags:guint; error:PPGError):PGDir;cdecl;external gliblib name 'g_dir_open';
+function  g_dir_read_name (dir:PGDir): pgchar; cdecl;external gliblib name 'g_dir_read_name';
+procedure g_dir_rewind(dir:PGDir);cdecl;external gliblib name 'g_dir_rewind';
+procedure g_dir_close(dir:PGDir);cdecl;external gliblib name 'g_dir_close';
+{$ENDIF read_interface_rest}

+ 5 - 5
packages/gtk2/src/glib/genums.inc

@@ -5,9 +5,7 @@
 
 //------------------------------------------------------------------------------
 
-{$IFDEF read_interface_rest}
-{ --- enum/flag values & classes ---  }
-type
+{$IFDEF read_interface_types}
    PGEnumClass = ^TGEnumClass;
    PGEnumValue = ^TGEnumValue;
 
@@ -40,7 +38,11 @@ type
         value_name : Pgchar;
         value_nick : Pgchar;
      end;
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
 
+{$IFDEF read_interface_rest}
 { --- type macros ---  }
 function G_TYPE_IS_ENUM(_type : GType) : gboolean;
 function G_ENUM_CLASS(_class : pointer) : PGEnumClass;
@@ -83,5 +85,3 @@ procedure g_flags_complete_type_info(g_flags_type:GType; info:PGTypeInfo; const_
 {$ENDIF read_interface_rest}
 
 // included by glib2.pas
-
-

+ 9 - 5
packages/gtk2/src/glib/gerror.inc

@@ -1,9 +1,11 @@
-{$ifndef __G_ERROR_H__}
-{$define __G_ERROR_H__}
+// included by glib2.pas
 
-//{$include gquark.inc}
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
 
-  type
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_types}
     PPGError = ^PGError;
     PGError  = ^TGError;
     TGError  = record
@@ -11,7 +13,9 @@
             code    : gint;
             message : Pgchar;
          end;
+{$ENDIF read_interface_types}
 
+{$IFDEF read_interface_rest}
 {$IFNDEF KYLIX}
     function  g_error_new(domain:TGQuark; code:gint; format:Pgchar; args:array of const):PGError;cdecl;overload;external gliblib name 'g_error_new_literal';
     function  g_error_new(domain:TGQuark; code:gint; format:Pgchar):PGError;cdecl;overload;varargs;external gliblib name 'g_error_new_literal';
@@ -43,6 +47,6 @@
 
     { if (err &&  err) then g_error_free( err);  err = NULL;   }
     procedure g_clear_error(err:PPGError);cdecl;external gliblib name 'g_clear_error';
+{$ENDIF read_interface_rest}
 
-{$endif}    { __G_ERROR_H__  }
 

+ 61 - 62
packages/gtk2/src/glib/gfileutils.inc

@@ -1,76 +1,75 @@
-// {$include <glib/gerror.h>}
+// included by glib2.pas
 
-    type
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
 
-       PGFileError = ^TGFileError;
-       TGFileError =  gint;
+//------------------------------------------------------------------------------
 
-{ For backward-compat reasons, these are synced to an old
-  anonymous enum in libgnome. But don't use that enum
-  in new code.
-}
+{$IFDEF read_interface_types}
+  PGFileError = ^TGFileError;
+  TGFileError =  gint;
 
-    type
-       PGFileTest = ^TGFileTest;
-       TGFileTest = integer;
-    const
-       G_FILE_TEST_IS_REGULAR = 1 shl 0;
-       G_FILE_TEST_IS_SYMLINK = 1 shl 1;
-       G_FILE_TEST_IS_DIR = 1 shl 2;
-       G_FILE_TEST_IS_EXECUTABLE = 1 shl 3;
-       G_FILE_TEST_EXISTS = 1 shl 4;
+  PGFileTest = ^TGFileTest;
+  TGFileTest = integer;
+{$ENDIF read_interface_types}
 
-    const
-       G_FILE_ERROR_EXIST       = 0;
-       G_FILE_ERROR_ISDIR       = 1;
-       G_FILE_ERROR_ACCES       = 2;
-       G_FILE_ERROR_NAMETOOLONG = 3;
-       G_FILE_ERROR_NOENT       = 4;
-       G_FILE_ERROR_NOTDIR      = 5;
-       G_FILE_ERROR_NXIO        = 6;
-       G_FILE_ERROR_NODEV       = 7;
-       G_FILE_ERROR_ROFS        = 8;
-       G_FILE_ERROR_TXTBSY      = 9;
-       G_FILE_ERROR_FAULT       = 10;
-       G_FILE_ERROR_LOOP        = 11;
-       G_FILE_ERROR_NOSPC       = 12;
-       G_FILE_ERROR_NOMEM       = 13;
-       G_FILE_ERROR_MFILE       = 14;
-       G_FILE_ERROR_NFILE       = 15;
-       G_FILE_ERROR_BADF        = 16;
-       G_FILE_ERROR_INVAL       = 17;
-       G_FILE_ERROR_PIPE        = 18;
-       G_FILE_ERROR_AGAIN       = 19;
-       G_FILE_ERROR_INTR        = 20;
-       G_FILE_ERROR_IO          = 21;
-       G_FILE_ERROR_PERM        = 22;
-       G_FILE_ERROR_FAILED      = 23;
+//------------------------------------------------------------------------------
 
-    function G_FILE_ERROR: TGQuark;
+{$IFDEF read_interface_rest}
+const
+  G_FILE_TEST_IS_REGULAR = 1 shl 0;
+  G_FILE_TEST_IS_SYMLINK = 1 shl 1;
+  G_FILE_TEST_IS_DIR = 1 shl 2;
+  G_FILE_TEST_IS_EXECUTABLE = 1 shl 3;
+  G_FILE_TEST_EXISTS = 1 shl 4;
 
+const
+  G_FILE_ERROR_EXIST       = 0;
+  G_FILE_ERROR_ISDIR       = 1;
+  G_FILE_ERROR_ACCES       = 2;
+  G_FILE_ERROR_NAMETOOLONG = 3;
+  G_FILE_ERROR_NOENT       = 4;
+  G_FILE_ERROR_NOTDIR      = 5;
+  G_FILE_ERROR_NXIO        = 6;
+  G_FILE_ERROR_NODEV       = 7;
+  G_FILE_ERROR_ROFS        = 8;
+  G_FILE_ERROR_TXTBSY      = 9;
+  G_FILE_ERROR_FAULT       = 10;
+  G_FILE_ERROR_LOOP        = 11;
+  G_FILE_ERROR_NOSPC       = 12;
+  G_FILE_ERROR_NOMEM       = 13;
+  G_FILE_ERROR_MFILE       = 14;
+  G_FILE_ERROR_NFILE       = 15;
+  G_FILE_ERROR_BADF        = 16;
+  G_FILE_ERROR_INVAL       = 17;
+  G_FILE_ERROR_PIPE        = 18;
+  G_FILE_ERROR_AGAIN       = 19;
+  G_FILE_ERROR_INTR        = 20;
+  G_FILE_ERROR_IO          = 21;
+  G_FILE_ERROR_PERM        = 22;
+  G_FILE_ERROR_FAILED      = 23;
 
-    function g_file_error_quark:TGQuark;cdecl;external gliblib name 'g_file_error_quark';
+function G_FILE_ERROR: TGQuark;
 
-    { So other code can generate a GFileError  }
-    function g_file_error_from_errno(err_no:gint):TGFileError;cdecl;external gliblib name 'g_file_error_from_errno';
-
-    function g_file_test(filename:Pgchar; test:TGFileTest):gboolean;cdecl;external gliblib name 'g_file_test';
-
-    function g_file_get_contents(filename:Pgchar; contents:PPgchar; length:Pgsize; error:PPGError):gboolean;cdecl;external gliblib name 'g_file_get_contents';
-
-    { Wrapper / workalike for mkstemp()  }
-    function g_mkstemp(tmpl:Pchar):longint;cdecl;external gliblib name 'g_mkstemp';
-
-    { Wrapper for g_mkstemp  }
-    function g_file_open_tmp(tmpl:Pchar; name_used:PPchar; error:PPGError):longint;cdecl;external gliblib name 'g_file_open_tmp';
+function g_file_error_quark:TGQuark;cdecl;external gliblib name 'g_file_error_quark';
+function g_file_error_from_errno(err_no:gint):TGFileError;cdecl;external gliblib name 'g_file_error_from_errno';
+function g_file_test(filename:Pgchar; test:TGFileTest):gboolean;cdecl;external gliblib name 'g_file_test';
+function g_file_get_contents(filename:Pgchar; contents:PPgchar; length:Pgsize; error:PPGError):gboolean;cdecl;external gliblib name 'g_file_get_contents';
+function g_mkstemp(tmpl:Pchar):longint;cdecl;external gliblib name 'g_mkstemp';
+function g_file_open_tmp(tmpl:Pchar; name_used:PPchar; error:PPGError):longint;cdecl;external gliblib name 'g_file_open_tmp';
 
 {$IFNDEF KYLIX}
-    function g_build_path(separator:Pgchar; first_element:Pgchar; args:array of const):Pgchar;cdecl;overload;external gliblib name 'g_build_path';
-    function g_build_path(separator:Pgchar; first_element:Pgchar):Pgchar;cdecl;overload;varargs;external gliblib name 'g_build_path';
-    function g_build_filename(first_element:Pgchar; args:array of const):Pgchar;cdecl;overload;external gliblib name 'g_build_filename';
-    function g_build_filename(first_element:Pgchar):Pgchar;cdecl;overload;varargs;external gliblib name 'g_build_filename';
+  function g_build_path(separator:Pgchar; first_element:Pgchar; args:array of const):Pgchar;cdecl;overload;external gliblib name 'g_build_path';
+  function g_build_path(separator:Pgchar; first_element:Pgchar):Pgchar;cdecl;overload;varargs;external gliblib name 'g_build_path';
+  function g_build_filename(first_element:Pgchar; args:array of const):Pgchar;cdecl;overload;external gliblib name 'g_build_filename';
+  function g_build_filename(first_element:Pgchar):Pgchar;cdecl;overload;varargs;external gliblib name 'g_build_filename';
 {$ELSE}
-    function g_build_path(separator:Pgchar; first_element:Pgchar):Pgchar;varargs;cdecl;external gliblib name 'g_build_path';
-    function g_build_filename(first_element:Pgchar):Pgchar;varargs;cdecl;external gliblib name 'g_build_filename';
+  function g_build_path(separator:Pgchar; first_element:Pgchar):Pgchar;varargs;cdecl;external gliblib name 'g_build_path';
+  function g_build_filename(first_element:Pgchar):Pgchar;varargs;cdecl;external gliblib name 'g_build_filename';
 {$ENDIF}
 
+{$ENDIF read_interface_rest}
+// included by glib2.pas
+
+
+

+ 32 - 42
packages/gtk2/src/glib/ghash.inc

@@ -1,57 +1,47 @@
-// {$include <glib/gtypes.h>}
+// included by glib2.pas
 
-    type
-      PGHashTable = pointer;
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
 
-      TGHRFunc = function (key:gpointer; value:gpointer; user_data:gpointer):gboolean;cdecl;
+//------------------------------------------------------------------------------
 
-{ Hash tables }
-
-    function g_hash_table_new(hash_func:TGHashFunc; key_equal_func:TGEqualFunc):PGHashTable;cdecl;external gliblib name 'g_hash_table_new';
-
-    function g_hash_table_new_full(hash_func:TGHashFunc; key_equal_func:TGEqualFunc; key_destroy_func:TGDestroyNotify; value_destroy_func:TGDestroyNotify):PGHashTable;cdecl;external gliblib name 'g_hash_table_new_full';
-
-    procedure g_hash_table_destroy(hash_table:PGHashTable);cdecl;external gliblib name 'g_hash_table_destroy';
-
-    procedure g_hash_table_insert(hash_table:PGHashTable; key:gpointer; value:gpointer);cdecl;external gliblib name 'g_hash_table_insert';
-
-    procedure g_hash_table_replace(hash_table:PGHashTable; key:gpointer; value:gpointer);cdecl;external gliblib name 'g_hash_table_replace';
-
-    function g_hash_table_remove(hash_table:PGHashTable; key:gconstpointer):gboolean;cdecl;external gliblib name 'g_hash_table_remove';
+{$IFDEF read_interface_types}
+  PGHashTable = pointer;
 
-    function g_hash_table_steal(hash_table:PGHashTable; key:gconstpointer):gboolean;cdecl;external gliblib name 'g_hash_table_steal';
+  TGHRFunc = function (key:gpointer; value:gpointer; user_data:gpointer):gboolean;cdecl;
+{$ENDIF read_interface_types}
 
-    function g_hash_table_lookup(hash_table:PGHashTable; key:gconstpointer):gpointer;cdecl;external gliblib name 'g_hash_table_lookup';
+//------------------------------------------------------------------------------
 
-    function g_hash_table_lookup_extended(hash_table:PGHashTable; lookup_key:gconstpointer; orig_key:Pgpointer; value:Pgpointer):gboolean;cdecl;external gliblib name 'g_hash_table_lookup_extended';
-
-    procedure g_hash_table_foreach(hash_table:PGHashTable; func:TGHFunc; user_data:gpointer);cdecl;external gliblib name 'g_hash_table_foreach';
-
-    function g_hash_table_foreach_remove(hash_table:PGHashTable; func:TGHRFunc; user_data:gpointer):guint;cdecl;external gliblib name 'g_hash_table_foreach_remove';
-
-    function g_hash_table_foreach_steal(hash_table:PGHashTable; func:TGHRFunc; user_data:gpointer):guint;cdecl;external gliblib name 'g_hash_table_foreach_steal';
-
-    function g_hash_table_size(hash_table:PGHashTable):guint;cdecl;external gliblib name 'g_hash_table_size';
+{$IFDEF read_interface_rest}
+{ Hash tables }
 
+function g_hash_table_new(hash_func:TGHashFunc; key_equal_func:TGEqualFunc):PGHashTable;cdecl;external gliblib name 'g_hash_table_new';
+function g_hash_table_new_full(hash_func:TGHashFunc; key_equal_func:TGEqualFunc; key_destroy_func:TGDestroyNotify; value_destroy_func:TGDestroyNotify):PGHashTable;cdecl;external gliblib name 'g_hash_table_new_full';
+procedure g_hash_table_destroy(hash_table:PGHashTable);cdecl;external gliblib name 'g_hash_table_destroy';
+procedure g_hash_table_insert(hash_table:PGHashTable; key:gpointer; value:gpointer);cdecl;external gliblib name 'g_hash_table_insert';
+procedure g_hash_table_replace(hash_table:PGHashTable; key:gpointer; value:gpointer);cdecl;external gliblib name 'g_hash_table_replace';
+function g_hash_table_remove(hash_table:PGHashTable; key:gconstpointer):gboolean;cdecl;external gliblib name 'g_hash_table_remove';
+function g_hash_table_steal(hash_table:PGHashTable; key:gconstpointer):gboolean;cdecl;external gliblib name 'g_hash_table_steal';
+function g_hash_table_lookup(hash_table:PGHashTable; key:gconstpointer):gpointer;cdecl;external gliblib name 'g_hash_table_lookup';
+function g_hash_table_lookup_extended(hash_table:PGHashTable; lookup_key:gconstpointer; orig_key:Pgpointer; value:Pgpointer):gboolean;cdecl;external gliblib name 'g_hash_table_lookup_extended';
+procedure g_hash_table_foreach(hash_table:PGHashTable; func:TGHFunc; user_data:gpointer);cdecl;external gliblib name 'g_hash_table_foreach';
+function g_hash_table_foreach_remove(hash_table:PGHashTable; func:TGHRFunc; user_data:gpointer):guint;cdecl;external gliblib name 'g_hash_table_foreach_remove';
+function g_hash_table_foreach_steal(hash_table:PGHashTable; func:TGHRFunc; user_data:gpointer):guint;cdecl;external gliblib name 'g_hash_table_foreach_steal';
+function g_hash_table_size(hash_table:PGHashTable):guint;cdecl;external gliblib name 'g_hash_table_size';
 
 { Hash Functions  }
 
-    function g_str_equal(v:gconstpointer; v2:gconstpointer):gboolean;cdecl;external gliblib name 'g_str_equal';
-
-    function g_str_hash(v:gconstpointer):guint;cdecl;external gliblib name 'g_str_hash';
-
-    function g_int_equal(v:gconstpointer; v2:gconstpointer):gboolean;cdecl;external gliblib name 'g_int_equal';
+function g_str_equal(v:gconstpointer; v2:gconstpointer):gboolean;cdecl;external gliblib name 'g_str_equal';
+function g_str_hash(v:gconstpointer):guint;cdecl;external gliblib name 'g_str_hash';
+function g_int_equal(v:gconstpointer; v2:gconstpointer):gboolean;cdecl;external gliblib name 'g_int_equal';
+function g_int_hash(v:gconstpointer):guint;cdecl;external gliblib name 'g_int_hash';
 
-    function g_int_hash(v:gconstpointer):guint;cdecl;external gliblib name 'g_int_hash';
+function g_direct_hash(v:gconstpointer):guint;cdecl;external gliblib name 'g_direct_hash';
+function g_direct_equal(v:gconstpointer; v2:gconstpointer):gboolean;cdecl;external gliblib name 'g_direct_equal';
 
-    { This "hash" function will just return the key's adress as an
-       unsigned integer. Useful for hashing on plain adresses or
-       simple integer values.
-       passing NULL into g_hash_table_new() as GHashFunc has the
-       same effect as passing g_direct_hash().
-      }
+{$ENDIF read_interface_rest}
+// included by glib2.pas
 
-    function g_direct_hash(v:gconstpointer):guint;cdecl;external gliblib name 'g_direct_hash';
 
-    function g_direct_equal(v:gconstpointer; v2:gconstpointer):gboolean;cdecl;external gliblib name 'g_direct_equal';
 

+ 108 - 141
packages/gtk2/src/glib/ghook.inc

@@ -1,147 +1,114 @@
-{*
- * ghook.inc
- *
- * depends on gmem.inc
- *}
+// included by glib2.pas
+
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_types}
+  PGHook = ^TGHook;
+  TGHook = record
+    data : gpointer;
+    next : PGHook;
+    prev : PGHook;
+    ref_count : guint;
+    hook_id   : gulong;
+    flags   : guint;
+    func    : gpointer;
+    destroy : TGDestroyNotify;
+  end;
+
+  PGHookList = ^TGHookList;
+
+  TGHookCompareFunc     = function  (new_hook:PGHook; sibling:PGHook):gint;cdecl;
+  TGHookFindFunc        = function  (hook:PGHook;     data:gpointer):gboolean;cdecl;
+  TGHookMarshaller      = procedure (hook:PGHook; marshal_data:gpointer);cdecl;
+  TGHookCheckMarshaller = function (hook:PGHook; marshal_data:gpointer):gboolean;cdecl;
+  TGHookFunc            = procedure (data:gpointer);cdecl;
+  TGHookCheckFunc       = function (data:gpointer):gboolean;cdecl;
+  TGHookFinalizeFunc    = procedure (hook_list:PGHookList; hook:PGHook);cdecl;
+
+  TGHookList = record
+    seq_id : gulong;
+    flag0  : longint;
+    hooks  : PGHook;
+    hook_memchunk : PGMemChunk;
+    finalize_hook : TGHookFinalizeFunc;
+    dummy : array[0..1] of gpointer;
+  end;
+
+  PGHookFlagMask = ^TGHookFlagMask;
+  TGHookFlagMask = integer;
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_rest}
+
+const
+  G_HOOK_FLAG_ACTIVE = 1 shl 0;
+  G_HOOK_FLAG_IN_CALL = 1 shl 1;
+  G_HOOK_FLAG_MASK = $0f;
+
+const
+  G_HOOK_FLAG_USER_SHIFT = 4;
+
+   { added for manipulating the TGHookList structure }
+
+  bm_TGHookList_hook_size = $FFFF;
+  bp_TGHookList_hook_size = 0;
+  bm_TGHookList_is_setup  = $10000;
+  bp_TGHookList_is_setup  = 16;
+
+function  TGHookList_hook_size     (var a : TGHookList) : guint;
+procedure TGHookList_set_hook_size (var a : TGHookList; __hook_size : guint);
+function  TGHookList_is_setup      (var a : TGHookList) : guint;
+procedure TGHookList_set_is_setup  (var a : TGHookList; __is_setup : guint);
+
+{ --- macros ---  }
+
+function G_HOOK(hook : pointer) : PGHook;
+function G_HOOK_FLAGS(hook : PGHook) : guint;
+function G_HOOK_ACTIVE (hook: PGHook): boolean;
+function G_HOOK_IN_CALL (hook: PGHook): boolean;
+function G_HOOK_IS_VALID (hook: PGHook): boolean;
+function G_HOOK_IS_UNLINKED (hook: PGHook): boolean;
+
+{ --- prototypes ---  }
+
+procedure g_hook_list_init  (hook_list : PGHookList; hook_size : guint);cdecl; external gliblib name 'g_hook_list_init';
+procedure g_hook_list_clear(hook_list:PGHookList);cdecl;external gliblib name 'g_hook_list_clear';
+function g_hook_alloc(hook_list:PGHookList):PGHook;cdecl;external gliblib name 'g_hook_alloc';
+procedure g_hook_free(hook_list:PGHookList; hook:PGHook);cdecl;external gliblib name 'g_hook_free';
+procedure g_hook_ref(hook_list:PGHookList; hook:PGHook);cdecl;external gliblib name 'g_hook_ref';
+procedure g_hook_unref(hook_list:PGHookList; hook:PGHook);cdecl;external gliblib name 'g_hook_unref';
+function g_hook_destroy(hook_list:PGHookList; hook_id:gulong):gboolean;cdecl;external gliblib name 'g_hook_destroy';
+procedure g_hook_destroy_link(hook_list:PGHookList; hook:PGHook);cdecl;external gliblib name 'g_hook_destroy_link';
+procedure g_hook_prepend(hook_list:PGHookList; hook:PGHook);cdecl;external gliblib name 'g_hook_prepend';
+procedure g_hook_insert_before(hook_list:PGHookList; sibling:PGHook; hook:PGHook);cdecl;external gliblib name 'g_hook_insert_before';
+procedure g_hook_insert_sorted(hook_list:PGHookList; hook:PGHook; func:TGHookCompareFunc);cdecl;external gliblib name 'g_hook_insert_sorted';
+function g_hook_get(hook_list:PGHookList; hook_id:gulong):PGHook;cdecl;external gliblib name 'g_hook_get';
+function g_hook_find(hook_list:PGHookList; need_valids:gboolean; func:TGHookFindFunc; data:gpointer):PGHook;cdecl;external gliblib name 'g_hook_find';
+function g_hook_find_data(hook_list:PGHookList; need_valids:gboolean; data:gpointer):PGHook;cdecl;external gliblib name 'g_hook_find_data';
+function g_hook_find_func(hook_list:PGHookList; need_valids:gboolean; func:gpointer):PGHook;cdecl;external gliblib name 'g_hook_find_func';
+function g_hook_find_func_data(hook_list:PGHookList; need_valids:gboolean; func:gpointer; data:gpointer):PGHook;cdecl;external gliblib name 'g_hook_find_func_data';
+function g_hook_first_valid(hook_list:PGHookList; may_be_in_call:gboolean):PGHook;cdecl;external gliblib name 'g_hook_first_valid';
+function g_hook_next_valid(hook_list:PGHookList; hook:PGHook; may_be_in_call:gboolean):PGHook;cdecl;external gliblib name 'g_hook_next_valid';
+function g_hook_compare_ids(new_hook:PGHook; sibling:PGHook):gint;cdecl;external gliblib name 'g_hook_compare_ids';
+
+{ convenience macros  }
+
+procedure g_hook_append (hook_list: PGHookList; hook:PGHook);
+
+procedure g_hook_list_invoke_check(hook_list:PGHookList; may_recurse:gboolean);cdecl;external gliblib name 'g_hook_list_invoke_check';
+procedure g_hook_list_marshal(hook_list:PGHookList; may_recurse:gboolean; marshaller:TGHookMarshaller; marshal_data:gpointer);cdecl;external gliblib name 'g_hook_list_marshal';
+procedure g_hook_list_marshal_check(hook_list:PGHookList; may_recurse:gboolean; marshaller:TGHookCheckMarshaller; marshal_data:gpointer);cdecl;external gliblib name 'g_hook_list_marshal_check';
+
+{$ENDIF read_interface_rest}
+// included by glib2.pas
 
-  { --- typedefs ---  }
 
-    type
-       PGHook = ^TGHook;
-       TGHook = record
-            data : gpointer;
-            next : PGHook;
-            prev : PGHook;
-            ref_count : guint;
-            hook_id   : gulong;
-            flags   : guint;
-            func    : gpointer;
-            destroy : TGDestroyNotify;
-         end;
 
-       PGHookList = ^TGHookList;
 
-       TGHookCompareFunc     = function  (new_hook:PGHook; sibling:PGHook):gint;cdecl;
-
-       TGHookFindFunc        = function  (hook:PGHook;     data:gpointer):gboolean;cdecl;
-
-       TGHookMarshaller      = procedure (hook:PGHook; marshal_data:gpointer);cdecl;
-
-       TGHookCheckMarshaller = function (hook:PGHook; marshal_data:gpointer):gboolean;cdecl;
-
-       TGHookFunc            = procedure (data:gpointer);cdecl;
-
-       TGHookCheckFunc       = function (data:gpointer):gboolean;cdecl;
-
-       TGHookFinalizeFunc    = procedure (hook_list:PGHookList; hook:PGHook);cdecl;
-
-       TGHookList = record
-            seq_id : gulong;
-            flag0  : longint;
-            hooks  : PGHook;
-            hook_memchunk : PGMemChunk;
-            finalize_hook : TGHookFinalizeFunc;
-            dummy : array[0..1] of gpointer;
-         end;
-
-    type
-       PGHookFlagMask = ^TGHookFlagMask;
-       TGHookFlagMask = integer;
-    const
-       G_HOOK_FLAG_ACTIVE = 1 shl 0;
-       G_HOOK_FLAG_IN_CALL = 1 shl 1;
-       G_HOOK_FLAG_MASK = $0f;
-
-    const
-       G_HOOK_FLAG_USER_SHIFT = 4;
-
-       { added for manipulating the TGHookList structure }
-
-       bm_TGHookList_hook_size = $FFFF;
-       bp_TGHookList_hook_size = 0;
-       bm_TGHookList_is_setup  = $10000;
-       bp_TGHookList_is_setup  = 16;
-
-    function  TGHookList_hook_size     (var a : TGHookList) : guint;
-    procedure TGHookList_set_hook_size (var a : TGHookList; __hook_size : guint);
-    function  TGHookList_is_setup      (var a : TGHookList) : guint;
-    procedure TGHookList_set_is_setup  (var a : TGHookList; __is_setup : guint);
-
-
-    { --- macros ---  }
-
-    function G_HOOK(hook : pointer) : PGHook;
-
-    function G_HOOK_FLAGS(hook : PGHook) : guint;
-
-    function G_HOOK_ACTIVE (hook: PGHook): boolean;
-
-    function G_HOOK_IN_CALL (hook: PGHook): boolean;
-
-    function G_HOOK_IS_VALID (hook: PGHook): boolean;
-
-    function G_HOOK_IS_UNLINKED (hook: PGHook): boolean;
-
-
-    { --- prototypes ---  }
-    { callback mainenance functions  }
-    procedure g_hook_list_init  (hook_list : PGHookList; hook_size : guint);cdecl; external gliblib name 'g_hook_list_init';
-
-    procedure g_hook_list_clear(hook_list:PGHookList);cdecl;external gliblib name 'g_hook_list_clear';
-
-    function g_hook_alloc(hook_list:PGHookList):PGHook;cdecl;external gliblib name 'g_hook_alloc';
-
-    procedure g_hook_free(hook_list:PGHookList; hook:PGHook);cdecl;external gliblib name 'g_hook_free';
-
-    procedure g_hook_ref(hook_list:PGHookList; hook:PGHook);cdecl;external gliblib name 'g_hook_ref';
-
-    procedure g_hook_unref(hook_list:PGHookList; hook:PGHook);cdecl;external gliblib name 'g_hook_unref';
-
-    function g_hook_destroy(hook_list:PGHookList; hook_id:gulong):gboolean;cdecl;external gliblib name 'g_hook_destroy';
-
-    procedure g_hook_destroy_link(hook_list:PGHookList; hook:PGHook);cdecl;external gliblib name 'g_hook_destroy_link';
-
-    procedure g_hook_prepend(hook_list:PGHookList; hook:PGHook);cdecl;external gliblib name 'g_hook_prepend';
-
-    procedure g_hook_insert_before(hook_list:PGHookList; sibling:PGHook; hook:PGHook);cdecl;external gliblib name 'g_hook_insert_before';
-
-    procedure g_hook_insert_sorted(hook_list:PGHookList; hook:PGHook; func:TGHookCompareFunc);cdecl;external gliblib name 'g_hook_insert_sorted';
-
-    function g_hook_get(hook_list:PGHookList; hook_id:gulong):PGHook;cdecl;external gliblib name 'g_hook_get';
-
-    function g_hook_find(hook_list:PGHookList; need_valids:gboolean; func:TGHookFindFunc; data:gpointer):PGHook;cdecl;external gliblib name 'g_hook_find';
-
-    function g_hook_find_data(hook_list:PGHookList; need_valids:gboolean; data:gpointer):PGHook;cdecl;external gliblib name 'g_hook_find_data';
-
-    function g_hook_find_func(hook_list:PGHookList; need_valids:gboolean; func:gpointer):PGHook;cdecl;external gliblib name 'g_hook_find_func';
-
-    function g_hook_find_func_data(hook_list:PGHookList; need_valids:gboolean; func:gpointer; data:gpointer):PGHook;cdecl;external gliblib name 'g_hook_find_func_data';
-
-    { return the first valid hook, and increment its reference count  }
-    function g_hook_first_valid(hook_list:PGHookList; may_be_in_call:gboolean):PGHook;cdecl;external gliblib name 'g_hook_first_valid';
-
-    { return the next valid hook with incremented reference count, and
-       decrement the reference count of the original hook
-      }
-    function g_hook_next_valid(hook_list:PGHookList; hook:PGHook; may_be_in_call:gboolean):PGHook;cdecl;external gliblib name 'g_hook_next_valid';
-
-    { GHookCompareFunc implementation to insert hooks sorted by their id  }
-    function g_hook_compare_ids(new_hook:PGHook; sibling:PGHook):gint;cdecl;external gliblib name 'g_hook_compare_ids';
-
-    { convenience macros  }
-
-    procedure g_hook_append (hook_list: PGHookList; hook:PGHook);
-
-
-    { invoke all valid hooks with the ( GHookCheckFunc) signature,
-       and destroy the hook if FALSE is returned.
-      }
-    procedure g_hook_list_invoke_check(hook_list:PGHookList; may_recurse:gboolean);cdecl;external gliblib name 'g_hook_list_invoke_check';
-
-    { invoke a marshaller on all valid hooks.
-      }
-    procedure g_hook_list_marshal(hook_list:PGHookList; may_recurse:gboolean; marshaller:TGHookMarshaller; marshal_data:gpointer);cdecl;external gliblib name 'g_hook_list_marshal';
-
-    procedure g_hook_list_marshal_check(hook_list:PGHookList; may_recurse:gboolean; marshaller:TGHookCheckMarshaller; marshal_data:gpointer);cdecl;external gliblib name 'g_hook_list_marshal_check';
 
 

+ 75 - 0
packages/gtk2/src/glib/gincludes.inc

@@ -0,0 +1,75 @@
+{%MainUnit glib2.pas}
+
+{$include gtypes.inc}
+{$include gtype.inc}
+{$include glibconfig.inc}
+
+{$include gvalue.inc}
+{$include gvaluearray.inc}
+{$include gvaluecollector.inc}
+{$include gvaluetypes.inc}
+
+{$include gparam.inc}
+{$include gclosure.inc}
+{$include gsignal.inc}
+{$include gtypeplugin.inc}
+{$include gobject.inc}
+
+{$include gmacros.inc}
+{$include genums.inc}
+{$include gstrfuncs.inc}
+{$include gutils.inc}
+{$include galloca.inc}
+{$include ghash.inc}
+{$include gquark.inc}
+{$include gerror.inc}
+{$include gbacktrace.inc}
+{$include gmem.inc}
+{$include garray.inc}
+{$include gslist.inc}
+{$include glist.inc}
+{$include gcache.inc}
+{$include gcompletion.inc}
+{$include gconvert.inc}
+{$include gdataset.inc}
+{$include gdate.inc}
+{$include gdir.inc}
+{$include gfileutils.inc}
+{$include ghook.inc}
+
+{$include gthread.inc}
+{$include gthreadpool.inc}
+{$include gtimer.inc}
+{$include gmain.inc}
+{$include gasyncqueue.inc}
+
+{$include gunicode.inc}
+{$include gstring.inc}
+{$include giochannel.inc}
+
+{$include gmessages.inc}
+{$include gmarkup.inc}
+{$include gnode.inc}
+{$include gtree.inc}
+{$include gpattern.inc}
+{$include gprimes.inc}
+{$include gqsort.inc}
+{$include gqueue.inc}
+{$include grand.inc}
+{$include grel.inc}
+{$include gscanner.inc}
+{$include gshell.inc}
+{$include gspawn.inc}
+{$include gboxed.inc}
+
+{$include gmodule.inc}
+
+{$include gmarshal.inc}
+
+{$IFDEF win32}
+{$include gwin32.inc}
+{$ENDIF}
+
+{$include goption.inc}
+
+// included by glib2.pas

+ 197 - 278
packages/gtk2/src/glib/giochannel.inc

@@ -1,294 +1,213 @@
-{*
- *  giochannel.inc
- *
- * depends on gconvert.inc, gmain.inc, gstring.inc
- *}
-
-    type
-
-       PGIOError = ^TGIOError;
-       TGIOError = (G_IO_ERROR_NONE,
-                    G_IO_ERROR_AGAIN,
-                    G_IO_ERROR_INVAL,
-                    G_IO_ERROR_UNKNOWN);
-
-     function G_IO_CHANNEL_ERROR : TGQuark;
-
-
-    { Derived from errno  }
-    { Other  }
-
-    type
-
-       PGIOChannelError = ^TGIOChannelError;
-       TGIOChannelError = (G_IO_CHANNEL_ERROR_FBIG,
-                           G_IO_CHANNEL_ERROR_INVAL,
-                           G_IO_CHANNEL_ERROR_IO,
-                           G_IO_CHANNEL_ERROR_ISDIR,
-                           G_IO_CHANNEL_ERROR_NOSPC,
-                           G_IO_CHANNEL_ERROR_NXIO,
-                           G_IO_CHANNEL_ERROR_OVERFLOW,
-                           G_IO_CHANNEL_ERROR_PIPE,
-                           G_IO_CHANNEL_ERROR_FAILED);
-
-       PGIOStatus = ^TGIOStatus;
-       TGIOStatus = (G_IO_STATUS_ERROR,
-                     G_IO_STATUS_NORMAL,
-                     G_IO_STATUS_EOF,
-                     G_IO_STATUS_AGAIN);
-
-       PGSeekType = ^TGSeekType;
-       TGSeekType = (G_SEEK_CUR,
-                     G_SEEK_SET,
-                     G_SEEK_END);
-
-
-       PGIOCondition = ^TGIOCondition;
-       TGIOCondition = gint;
-
-    const
-       G_IO_IN      = GLIB_SYSDEF_POLLIN;
-       G_IO_OUT     = GLIB_SYSDEF_POLLOUT;
-       G_IO_PRI     = GLIB_SYSDEF_POLLPRI;
-       G_IO_ERR     = GLIB_SYSDEF_POLLERR;
-       G_IO_HUP     = GLIB_SYSDEF_POLLHUP;
-       G_IO_NVAL        = GLIB_SYSDEF_POLLNVAL;
-
-    type
-       PGIOFlags = ^TGIOFlags;
-       TGIOFlags = gint;
-    const
-       G_IO_FLAG_APPEND       = 1 shl 0;
-       G_IO_FLAG_NONBLOCK     = 1 shl 1;
-       G_IO_FLAG_IS_READABLE  = 1 shl 2;
-       G_IO_FLAG_IS_WRITEABLE = 1 shl 3;
-       G_IO_FLAG_IS_SEEKABLE  = 1 shl 4;
-       G_IO_FLAG_MASK         = (1 shl 5) - 1;
-       G_IO_FLAG_GET_MASK     = G_IO_FLAG_MASK;
-       G_IO_FLAG_SET_MASK     = G_IO_FLAG_APPEND or G_IO_FLAG_NONBLOCK;
-
-    type
-    {< private > }
-       PGIOChannel = ^TGIOChannel;
-
-       TGIOFunc = function (source:PGIOChannel; condition:TGIOCondition; data:gpointer):gboolean;cdecl;
-       PGIOFuncs = ^TGIOFuncs;
-
-       TGIOFuncs = record
-            io_read  : function (channel:PGIOChannel; buf:Pgchar; count:gsize; bytes_read:Pgsize; err:PPGError):TGIOStatus;cdecl;
-            io_write : function (channel:PGIOChannel; buf:Pgchar; count:gsize; bytes_written:Pgsize; err:PPGError):TGIOStatus;cdecl;
-            io_seek  : function (channel:PGIOChannel; offset:gint64; _type:TGSeekType; err:PPGError):TGIOStatus;cdecl;
-            io_close : function (channel:PGIOChannel; err:PPGError):TGIOStatus;cdecl;
-            io_create_watch : function (channel:PGIOChannel; condition:TGIOCondition):PGSource;cdecl;
-            io_free : procedure (channel:PGIOChannel);cdecl;
-            io_set_flags : function (channel:PGIOChannel; flags:TGIOFlags; err:PPGError):TGIOStatus;cdecl;
-            io_get_flags : function (channel:PGIOChannel):TGIOFlags;cdecl;
-         end;
-
-       TGIOChannel = record
-            ref_count : guint;
-            funcs     : PGIOFuncs;
-            encoding  : Pgchar;
-            read_cd   : TGIConv;
-            write_cd  : TGIConv;
-            line_term : Pgchar;                        // String which indicates the end of a line of text
-            line_term_len : guint;                     // So we can have null in the line term
-            buf_size  : gsize;
-            read_buf  : PGString;                      // Raw data from the channel
-            encoded_read_buf : PGString;               // Channel data converted to UTF-8
-            write_buf : PGString;                      // Data ready to be written to the file
-            partial_write_buf : array[0..5] of  gchar; // UTF-8 partial characters, null terminated
-
-             { Group the flags together, immediately after partial_write_buf, to save memory  }
-            flag0 : word;
-            reserved1 : gpointer;
-            reserved2 : gpointer;
-         end;
-
-    const
-       bm_TGIOChannel_use_buffer     = $1;
-       bp_TGIOChannel_use_buffer     = 0;
-       bm_TGIOChannel_do_encode      = $2;
-       bp_TGIOChannel_do_encode      = 1;
-       bm_TGIOChannel_close_on_unref = $4;
-       bp_TGIOChannel_close_on_unref = 2;
-       bm_TGIOChannel_is_readable    = $8;
-       bp_TGIOChannel_is_readable    = 3;
-       bm_TGIOChannel_is_writeable   = $10;
-       bp_TGIOChannel_is_writeable   = 4;
-       bm_TGIOChannel_is_seekable    = $20;
-       bp_TGIOChannel_is_seekable    = 5;
+// included by glib2.pas
+
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_types}
+  PGIOError = ^TGIOError;
+  TGIOError = (
+    G_IO_ERROR_NONE,
+    G_IO_ERROR_AGAIN,
+    G_IO_ERROR_INVAL,
+    G_IO_ERROR_UNKNOWN
+  );
+
+  PGIOChannelError = ^TGIOChannelError;
+  TGIOChannelError = (
+    G_IO_CHANNEL_ERROR_FBIG,
+    G_IO_CHANNEL_ERROR_INVAL,
+    G_IO_CHANNEL_ERROR_IO,
+    G_IO_CHANNEL_ERROR_ISDIR,
+    G_IO_CHANNEL_ERROR_NOSPC,
+    G_IO_CHANNEL_ERROR_NXIO,
+    G_IO_CHANNEL_ERROR_OVERFLOW,
+    G_IO_CHANNEL_ERROR_PIPE,
+    G_IO_CHANNEL_ERROR_FAILED
+  );
+
+  PGIOStatus = ^TGIOStatus;
+  TGIOStatus = (
+    G_IO_STATUS_ERROR,
+    G_IO_STATUS_NORMAL,
+    G_IO_STATUS_EOF,
+    G_IO_STATUS_AGAIN
+  );
+
+  PGSeekType = ^TGSeekType;
+  TGSeekType = (
+    G_SEEK_CUR,
+    G_SEEK_SET,
+    G_SEEK_END
+  );
+
+
+  PGIOCondition = ^TGIOCondition;
+  TGIOCondition = gint;
+
+  PGIOFlags = ^TGIOFlags;
+  TGIOFlags = gint;
+  PGIOChannel = ^TGIOChannel;
+  TGIOFunc = function (source:PGIOChannel; condition:TGIOCondition; data:gpointer):gboolean;cdecl;
+  PGIOFuncs = ^TGIOFuncs;
+
+  TGIOFuncs = record
+    io_read  : function (channel:PGIOChannel; buf:Pgchar; count:gsize; bytes_read:Pgsize; err:PPGError):TGIOStatus;cdecl;
+    io_write : function (channel:PGIOChannel; buf:Pgchar; count:gsize; bytes_written:Pgsize; err:PPGError):TGIOStatus;cdecl;
+    io_seek  : function (channel:PGIOChannel; offset:gint64; _type:TGSeekType; err:PPGError):TGIOStatus;cdecl;
+    io_close : function (channel:PGIOChannel; err:PPGError):TGIOStatus;cdecl;
+    io_create_watch : function (channel:PGIOChannel; condition:TGIOCondition):PGSource;cdecl;
+    io_free : procedure (channel:PGIOChannel);cdecl;
+    io_set_flags : function (channel:PGIOChannel; flags:TGIOFlags; err:PPGError):TGIOStatus;cdecl;
+    io_get_flags : function (channel:PGIOChannel):TGIOFlags;cdecl;
+  end;
+
+  TGIOChannel = record
+    ref_count : guint;
+    funcs     : PGIOFuncs;
+    encoding  : Pgchar;
+    read_cd   : TGIConv;
+    write_cd  : TGIConv;
+    line_term : Pgchar;                        // String which indicates the end of a line of text
+    line_term_len : guint;                     // So we can have null in the line term
+    buf_size  : gsize;
+    read_buf  : PGString;                      // Raw data from the channel
+    encoded_read_buf : PGString;               // Channel data converted to UTF-8
+    write_buf : PGString;                      // Data ready to be written to the file
+    partial_write_buf : array[0..5] of  gchar; // UTF-8 partial characters, null terminated
+
+     { Group the flags together, immediately after partial_write_buf, to save memory  }
+    flag0 : word;
+    reserved1 : gpointer;
+    reserved2 : gpointer;
+  end;
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_rest}
+
+function G_IO_CHANNEL_ERROR : TGQuark;
+
+const
+  G_IO_IN      = GLIB_SYSDEF_POLLIN;
+  G_IO_OUT     = GLIB_SYSDEF_POLLOUT;
+  G_IO_PRI     = GLIB_SYSDEF_POLLPRI;
+  G_IO_ERR     = GLIB_SYSDEF_POLLERR;
+  G_IO_HUP     = GLIB_SYSDEF_POLLHUP;
+  G_IO_NVAL    = GLIB_SYSDEF_POLLNVAL;
+
+const
+  G_IO_FLAG_APPEND       = 1 shl 0;
+  G_IO_FLAG_NONBLOCK     = 1 shl 1;
+  G_IO_FLAG_IS_READABLE  = 1 shl 2;
+  G_IO_FLAG_IS_WRITEABLE = 1 shl 3;
+  G_IO_FLAG_IS_SEEKABLE  = 1 shl 4;
+  G_IO_FLAG_MASK         = (1 shl 5) - 1;
+  G_IO_FLAG_GET_MASK     = G_IO_FLAG_MASK;
+  G_IO_FLAG_SET_MASK     = G_IO_FLAG_APPEND or G_IO_FLAG_NONBLOCK;
+
+
+const
+  bm_TGIOChannel_use_buffer     = $1;
+  bp_TGIOChannel_use_buffer     = 0;
+  bm_TGIOChannel_do_encode      = $2;
+  bp_TGIOChannel_do_encode      = 1;
+  bm_TGIOChannel_close_on_unref = $4;
+  bp_TGIOChannel_close_on_unref = 2;
+  bm_TGIOChannel_is_readable    = $8;
+  bp_TGIOChannel_is_readable    = 3;
+  bm_TGIOChannel_is_writeable   = $10;
+  bp_TGIOChannel_is_writeable   = 4;
+  bm_TGIOChannel_is_seekable    = $20;
+  bp_TGIOChannel_is_seekable    = 5;
 
 { use this to get/set information to the TGIOChannel struct}
-    function  TGIOChannel_use_buffer          (var a : TGIOChannel) : guint;
-    procedure TGIOChannel_set_use_buffer      (var a : TGIOChannel; __use_buffer : guint);
-    function  TGIOChannel_do_encode           (var a : TGIOChannel) : guint;
-    procedure TGIOChannel_set_do_encode       (var a : TGIOChannel; __do_encode : guint);
-    function  TGIOChannel_close_on_unref      (var a : TGIOChannel) : guint;
-    procedure TGIOChannel_set_close_on_unref  (var a : TGIOChannel; __close_on_unref : guint);
-    function  TGIOChannel_is_readable         (var a : TGIOChannel) : guint;
-    procedure TGIOChannel_set_is_readable     (var a : TGIOChannel; __is_readable : guint);
-    function  TGIOChannel_is_writeable        (var a : TGIOChannel) : guint;
-    procedure TGIOChannel_set_is_writeable    (var a : TGIOChannel; __is_writeable : guint);
-    function  TGIOChannel_is_seekable         (var a : TGIOChannel) : guint;
-    procedure TGIOChannel_set_is_seekable     (var a : TGIOChannel; __is_seekable : guint);
-
-
-    procedure g_io_channel_init(channel:PGIOChannel);cdecl;external gliblib name 'g_io_channel_init';
-
-    procedure g_io_channel_ref(channel:PGIOChannel);cdecl;external gliblib name 'g_io_channel_ref';
-
-    procedure g_io_channel_unref(channel:PGIOChannel);cdecl;external gliblib name 'g_io_channel_unref';
+function  TGIOChannel_use_buffer          (var a : TGIOChannel) : guint;
+procedure TGIOChannel_set_use_buffer      (var a : TGIOChannel; __use_buffer : guint);
+function  TGIOChannel_do_encode           (var a : TGIOChannel) : guint;
+procedure TGIOChannel_set_do_encode       (var a : TGIOChannel; __do_encode : guint);
+function  TGIOChannel_close_on_unref      (var a : TGIOChannel) : guint;
+procedure TGIOChannel_set_close_on_unref  (var a : TGIOChannel; __close_on_unref : guint);
+function  TGIOChannel_is_readable         (var a : TGIOChannel) : guint;
+procedure TGIOChannel_set_is_readable     (var a : TGIOChannel; __is_readable : guint);
+function  TGIOChannel_is_writeable        (var a : TGIOChannel) : guint;
+procedure TGIOChannel_set_is_writeable    (var a : TGIOChannel; __is_writeable : guint);
+function  TGIOChannel_is_seekable         (var a : TGIOChannel) : guint;
+procedure TGIOChannel_set_is_seekable     (var a : TGIOChannel; __is_seekable : guint);
+
+
+procedure g_io_channel_init(channel:PGIOChannel);cdecl;external gliblib name 'g_io_channel_init';
+procedure g_io_channel_ref(channel:PGIOChannel);cdecl;external gliblib name 'g_io_channel_ref';
+procedure g_io_channel_unref(channel:PGIOChannel);cdecl;external gliblib name 'g_io_channel_unref';
 
 {DEPRECATED functions}
 
-    function g_io_channel_read(channel:PGIOChannel; buf:Pgchar; count:gsize; bytes_read:Pgsize):TGIOError;cdecl;external gliblib name 'g_io_channel_read';
-
-    function g_io_channel_write(channel:PGIOChannel; buf:Pgchar; count:gsize; bytes_written:Pgsize):TGIOError;cdecl;external gliblib name 'g_io_channel_write';
-
-    function g_io_channel_seek(channel:PGIOChannel; offset:gint64; _type:TGSeekType):TGIOError;cdecl;external gliblib name 'g_io_channel_seek';
+function g_io_channel_read(channel:PGIOChannel; buf:Pgchar; count:gsize; bytes_read:Pgsize):TGIOError;cdecl;external gliblib name 'g_io_channel_read';
+function g_io_channel_write(channel:PGIOChannel; buf:Pgchar; count:gsize; bytes_written:Pgsize):TGIOError;cdecl;external gliblib name 'g_io_channel_write';
+function g_io_channel_seek(channel:PGIOChannel; offset:gint64; _type:TGSeekType):TGIOError;cdecl;external gliblib name 'g_io_channel_seek';
+procedure g_io_channel_close(channel:PGIOChannel);cdecl;external gliblib name 'g_io_channel_close';
 
-    procedure g_io_channel_close(channel:PGIOChannel);cdecl;external gliblib name 'g_io_channel_close';
 {end of DEPRECATED functions}
 
-    function g_io_channel_shutdown(channel:PGIOChannel; flush:gboolean; err:PPGError):TGIOStatus;cdecl;external gliblib name 'g_io_channel_shutdown';
-
-    function g_io_add_watch_full(channel:PGIOChannel; priority:gint; condition:TGIOCondition; func:TGIOFunc; user_data:gpointer;
-                                 notify:TGDestroyNotify):guint;cdecl;external gliblib name 'g_io_add_watch_full';
-
-    function g_io_create_watch(channel:PGIOChannel; condition:TGIOCondition):PGSource;cdecl;external gliblib name 'g_io_create_watch';
-
-    function g_io_add_watch(channel:PGIOChannel; condition:TGIOCondition; func:TGIOFunc; user_data:gpointer):guint;cdecl;external gliblib name 'g_io_add_watch';
-
-    { character encoding conversion involved functions.
-      }
-    procedure g_io_channel_set_buffer_size(channel:PGIOChannel; size:gsize);cdecl;external gliblib name 'g_io_channel_set_buffer_size';
-
-    function  g_io_channel_get_buffer_size(channel:PGIOChannel):gsize;cdecl;external gliblib name 'g_io_channel_get_buffer_size';
-
-    function  g_io_channel_get_buffer_condition(channel:PGIOChannel):TGIOCondition;cdecl;external gliblib name 'g_io_channel_get_buffer_condition';
-
-    function  g_io_channel_set_flags(channel:PGIOChannel; flags:TGIOFlags; error:PPGError):TGIOStatus;cdecl;external gliblib name 'g_io_channel_set_flags';
-
-    function  g_io_channel_get_flags(channel:PGIOChannel):TGIOFlags;cdecl;external gliblib name 'g_io_channel_get_flags';
-
-    procedure g_io_channel_set_line_term(channel:PGIOChannel; line_term:Pgchar; length:gint);cdecl;external gliblib name 'g_io_channel_set_line_term';
-
-    function  g_io_channel_get_line_term(channel:PGIOChannel; length:Pgint):pgchar;cdecl;external gliblib name 'g_io_channel_get_line_term';
-
-    procedure g_io_channel_set_buffered(channel:PGIOChannel; buffered:gboolean);cdecl;external gliblib name 'g_io_channel_set_buffered';
-
-    function g_io_channel_get_buffered(channel:PGIOChannel):gboolean;cdecl;external gliblib name 'g_io_channel_get_buffered';
-
-    function g_io_channel_set_encoding(channel:PGIOChannel; encoding:Pgchar; error:PPGError):TGIOStatus;cdecl;external gliblib name 'g_io_channel_set_encoding';
-
-    function  g_io_channel_get_encoding(channel:PGIOChannel):pgchar;cdecl;external gliblib name 'g_io_channel_get_encoding';
-
-    procedure g_io_channel_set_close_on_unref(channel:PGIOChannel; do_close:gboolean);cdecl;external gliblib name 'g_io_channel_set_close_on_unref';
-
-    function g_io_channel_get_close_on_unref(channel:PGIOChannel):gboolean;cdecl;external gliblib name 'g_io_channel_get_close_on_unref';
-
-    function g_io_channel_flush(channel:PGIOChannel; error:PPGError):TGIOStatus;cdecl;external gliblib name 'g_io_channel_flush';
-
-    function g_io_channel_read_line(channel:PGIOChannel; str_return:PPgchar; length:Pgsize; terminator_pos:Pgsize; error:PPGError):TGIOStatus;cdecl;external gliblib name 'g_io_channel_read_line';
-
-    function g_io_channel_read_line_string(channel:PGIOChannel; buffer:PGString; terminator_pos:Pgsize; error:PPGError):TGIOStatus;cdecl;external gliblib name 'g_io_channel_read_line_string';
-
-    function g_io_channel_read_to_end(channel:PGIOChannel; str_return:PPgchar; length:Pgsize; error:PPGError):TGIOStatus;cdecl;external gliblib name 'g_io_channel_read_to_end';
-
-    function g_io_channel_read_chars(channel:PGIOChannel; buf:Pgchar; count:gsize; bytes_read:Pgsize; error:PPGError):TGIOStatus;cdecl;external gliblib name 'g_io_channel_read_chars';
-
-    function g_io_channel_read_unichar(channel:PGIOChannel; thechar:Pgunichar; error:PPGError):TGIOStatus;cdecl;external gliblib name 'g_io_channel_read_unichar';
-
-    function g_io_channel_write_chars(channel:PGIOChannel; buf:Pgchar; count:gssize; bytes_written:Pgsize; error:PPGError):TGIOStatus;cdecl;external gliblib name 'g_io_channel_write_chars';
-
-    function g_io_channel_write_unichar(channel:PGIOChannel; thechar:gunichar; error:PPGError):TGIOStatus;cdecl;external gliblib name 'g_io_channel_write_unichar';
-
-    function g_io_channel_seek_position(channel:PGIOChannel; offset:gint64; _type:TGSeekType; error:PPGError):TGIOStatus;cdecl;external gliblib name 'g_io_channel_seek_position';
-
-    function g_io_channel_new_file(filename:Pgchar; mode:Pgchar; error:PPGError):PGIOChannel;cdecl;external gliblib name 'g_io_channel_new_file';
-
-
-    { Error handling  }
-    function g_io_channel_error_quark:TGQuark;cdecl;external gliblib name 'g_io_channel_error_quark';
-
-    function g_io_channel_error_from_errno(en:gint):TGIOChannelError;cdecl;external gliblib name 'g_io_channel_error_from_errno';
-
-    { On Unix, IO channels created with this function for any file
-       descriptor or socket.
-
-       On Win32, this can be used either for files opened with the MSVCRT
-       (the Microsoft run-time C library) _open() or _pipe, including file
-       descriptors 0, 1 and 2 (corresponding to stdin, stdout and stderr),
-       or for Winsock SOCKETs. If the parameter is a legal file
-       descriptor, it is assumed to be such, otherwise it should be a
-       SOCKET. This relies on SOCKETs and file descriptors not
-       overlapping. If you want to be certain, call either
-       g_io_channel_win32_new_fd() or g_io_channel_win32_new_socket()
-       instead as appropriate.
-
-       The term file descriptor as used in the context of Win32 refers to
-       the emulated Unix-like file descriptors MSVCRT provides. The native
-       corresponding concept is file HANDLE. There isn't as of yet a way to
-       get GIOChannels for Win32 file HANDLEs.
-      }
-    function g_io_channel_unix_new(fd:longint):PGIOChannel;cdecl;external gliblib name 'g_io_channel_unix_new';
-
-    function g_io_channel_unix_get_fd(channel:PGIOChannel):gint;cdecl;external gliblib name 'g_io_channel_unix_get_fd';
-
-    { Hook for GClosure / GSource integration. Don't touch  }
+function g_io_channel_shutdown(channel:PGIOChannel; flush:gboolean; err:PPGError):TGIOStatus;cdecl;external gliblib name 'g_io_channel_shutdown';
+function g_io_add_watch_full(channel:PGIOChannel; priority:gint; condition:TGIOCondition; func:TGIOFunc; user_data:gpointer;
+                             notify:TGDestroyNotify):guint;cdecl;external gliblib name 'g_io_add_watch_full';
+function g_io_create_watch(channel:PGIOChannel; condition:TGIOCondition):PGSource;cdecl;external gliblib name 'g_io_create_watch';
+function g_io_add_watch(channel:PGIOChannel; condition:TGIOCondition; func:TGIOFunc; user_data:gpointer):guint;cdecl;external gliblib name 'g_io_add_watch';
+
+{ character encoding conversion involved functions. }
+
+procedure g_io_channel_set_buffer_size(channel:PGIOChannel; size:gsize);cdecl;external gliblib name 'g_io_channel_set_buffer_size';
+function  g_io_channel_get_buffer_size(channel:PGIOChannel):gsize;cdecl;external gliblib name 'g_io_channel_get_buffer_size';
+function  g_io_channel_get_buffer_condition(channel:PGIOChannel):TGIOCondition;cdecl;external gliblib name 'g_io_channel_get_buffer_condition';
+function  g_io_channel_set_flags(channel:PGIOChannel; flags:TGIOFlags; error:PPGError):TGIOStatus;cdecl;external gliblib name 'g_io_channel_set_flags';
+function  g_io_channel_get_flags(channel:PGIOChannel):TGIOFlags;cdecl;external gliblib name 'g_io_channel_get_flags';
+procedure g_io_channel_set_line_term(channel:PGIOChannel; line_term:Pgchar; length:gint);cdecl;external gliblib name 'g_io_channel_set_line_term';
+function  g_io_channel_get_line_term(channel:PGIOChannel; length:Pgint):pgchar;cdecl;external gliblib name 'g_io_channel_get_line_term';
+procedure g_io_channel_set_buffered(channel:PGIOChannel; buffered:gboolean);cdecl;external gliblib name 'g_io_channel_set_buffered';
+function g_io_channel_get_buffered(channel:PGIOChannel):gboolean;cdecl;external gliblib name 'g_io_channel_get_buffered';
+function g_io_channel_set_encoding(channel:PGIOChannel; encoding:Pgchar; error:PPGError):TGIOStatus;cdecl;external gliblib name 'g_io_channel_set_encoding';
+function  g_io_channel_get_encoding(channel:PGIOChannel):pgchar;cdecl;external gliblib name 'g_io_channel_get_encoding';
+procedure g_io_channel_set_close_on_unref(channel:PGIOChannel; do_close:gboolean);cdecl;external gliblib name 'g_io_channel_set_close_on_unref';
+function g_io_channel_get_close_on_unref(channel:PGIOChannel):gboolean;cdecl;external gliblib name 'g_io_channel_get_close_on_unref';
+function g_io_channel_flush(channel:PGIOChannel; error:PPGError):TGIOStatus;cdecl;external gliblib name 'g_io_channel_flush';
+function g_io_channel_read_line(channel:PGIOChannel; str_return:PPgchar; length:Pgsize; terminator_pos:Pgsize; error:PPGError):TGIOStatus;cdecl;external gliblib name 'g_io_channel_read_line';
+function g_io_channel_read_line_string(channel:PGIOChannel; buffer:PGString; terminator_pos:Pgsize; error:PPGError):TGIOStatus;cdecl;external gliblib name 'g_io_channel_read_line_string';
+function g_io_channel_read_to_end(channel:PGIOChannel; str_return:PPgchar; length:Pgsize; error:PPGError):TGIOStatus;cdecl;external gliblib name 'g_io_channel_read_to_end';
+function g_io_channel_read_chars(channel:PGIOChannel; buf:Pgchar; count:gsize; bytes_read:Pgsize; error:PPGError):TGIOStatus;cdecl;external gliblib name 'g_io_channel_read_chars';
+function g_io_channel_read_unichar(channel:PGIOChannel; thechar:Pgunichar; error:PPGError):TGIOStatus;cdecl;external gliblib name 'g_io_channel_read_unichar';
+function g_io_channel_write_chars(channel:PGIOChannel; buf:Pgchar; count:gssize; bytes_written:Pgsize; error:PPGError):TGIOStatus;cdecl;external gliblib name 'g_io_channel_write_chars';
+function g_io_channel_write_unichar(channel:PGIOChannel; thechar:gunichar; error:PPGError):TGIOStatus;cdecl;external gliblib name 'g_io_channel_write_unichar';
+function g_io_channel_seek_position(channel:PGIOChannel; offset:gint64; _type:TGSeekType; error:PPGError):TGIOStatus;cdecl;external gliblib name 'g_io_channel_seek_position';
+function g_io_channel_new_file(filename:Pgchar; mode:Pgchar; error:PPGError):PGIOChannel;cdecl;external gliblib name 'g_io_channel_new_file';
+
+
+{ Error handling  }
+function g_io_channel_error_quark:TGQuark;cdecl;external gliblib name 'g_io_channel_error_quark';
+function g_io_channel_error_from_errno(en:gint):TGIOChannelError;cdecl;external gliblib name 'g_io_channel_error_from_errno';
+
+function g_io_channel_unix_new(fd:longint):PGIOChannel;cdecl;external gliblib name 'g_io_channel_unix_new';
+function g_io_channel_unix_get_fd(channel:PGIOChannel):gint;cdecl;external gliblib name 'g_io_channel_unix_get_fd';
+
+{ Hook for GClosure / GSource integration. Don't touch  }
 //GLIB_VAR GSourceFuncs g_io_watch_funcs;
 
 {$ifdef WIN32}
 
-    const
-       G_WIN32_MSG_HANDLE = 19981206;
-    { Use this to get a GPollFD from a GIOChannel, so that you can call
-       g_io_channel_win32_poll(). After calling this you should only use
-       g_io_channel_read() to read from the GIOChannel, i.e. never read()
-       from the underlying file descriptor. For SOCKETs, it is possible to call
-       recv().
-      }
-
-    procedure g_io_channel_win32_make_pollfd(channel:PGIOChannel; condition:TGIOCondition; fd:PGPollFD);cdecl;external gliblib name 'g_io_channel_win32_make_pollfd';
-
-    { This can be used to wait a until at least one of the channels is readable.
-       On Unix you would do a select() on the file descriptors of the channels.
-      }
-    function g_io_channel_win32_poll(fds:PGPollFD; n_fds:gint; timeout:gint):gint;cdecl;external gliblib name 'g_io_channel_win32_poll';
-
-    { This is used to add polling for Windows messages. GDK (GTk+) programs
-       should  not  use this.
-      }
-//    procedure g_main_poll_win32_msg_add(priority:gint; fd:PGPollFD; hwnd:guint);cdecl;external gliblib name 'g_main_poll_win32_msg_add';
-//
-//NOTE:  already defined in gmain.inc
-
-    { Create an IO channel for Windows messages for window handle hwnd.  }
-    function g_io_channel_win32_new_messages(hwnd:guint):PGIOChannel;cdecl;external gliblib name 'g_io_channel_win32_new_messages';
-
-    { Create an IO channel for C runtime (emulated Unix-like) file
-       descriptors. After calling g_io_add_watch() on a IO channel
-       returned by this function, you shouldn't call read() on the file
-       descriptor. This is because adding polling for a file descriptor is
-       implemented on Win32 by starting a thread that sits blocked in a
-       read() from the file descriptor most of the time. All reads from
-       the file descriptor should be done by this internal GLib
-       thread. Your code should call only g_io_channel_read().
-      }
-    function g_io_channel_win32_new_fd(fd:gint):PGIOChannel;cdecl;external gliblib name 'g_io_channel_win32_new_fd';
-
-    { Get the C runtime file descriptor of a channel.  }
-    function g_io_channel_win32_get_fd(channel:PGIOChannel):gint;cdecl;external gliblib name 'g_io_channel_win32_get_fd';
-
-    { Create an IO channel for a winsock socket. The parameter should be
-       a SOCKET. Contrary to IO channels for file descriptors (on  Win32),
-       you can use normal recv() or recvfrom() on sockets even if GLib
-       is polling them.
-      }
-    function g_io_channel_win32_new_socket(socket:gint):PGIOChannel;cdecl;external gliblib name 'g_io_channel_win32_new_socket';
+const
+  G_WIN32_MSG_HANDLE = 19981206;
 
-{$endif}
+procedure g_io_channel_win32_make_pollfd(channel:PGIOChannel; condition:TGIOCondition; fd:PGPollFD);cdecl;external gliblib name 'g_io_channel_win32_make_pollfd';
+function g_io_channel_win32_poll(fds:PGPollFD; n_fds:gint; timeout:gint):gint;cdecl;external gliblib name 'g_io_channel_win32_poll';
+function g_io_channel_win32_new_messages(hwnd:guint):PGIOChannel;cdecl;external gliblib name 'g_io_channel_win32_new_messages';
+function g_io_channel_win32_new_fd(fd:gint):PGIOChannel;cdecl;external gliblib name 'g_io_channel_win32_new_fd';
+function g_io_channel_win32_get_fd(channel:PGIOChannel):gint;cdecl;external gliblib name 'g_io_channel_win32_get_fd';
+function g_io_channel_win32_new_socket(socket:gint):PGIOChannel;cdecl;external gliblib name 'g_io_channel_win32_new_socket';
 
+{$endif}
 
 
+{$ENDIF read_interface_rest}
+// included by glib2.pas

+ 11 - 83
packages/gtk2/src/glib/glib2.pas

@@ -82,96 +82,24 @@ type
   PGTypePlugin = pointer;
   PGParamSpecPool = pointer;
 
-{$include gtypes.inc}
-{$include glibconfig.inc}
-{$include gquark.inc}
-{$include gvaluecollector.inc}
-{$include gtype.inc}
-{$include genums.inc}
-{$include gvalue.inc}
-{$include gtypeplugin.inc}
-{$include gdataset.inc}
-{$include gslist.inc}
-{$include glist.inc}
-{$include gparam.inc}
-{$include gboxed.inc}
+{$include gincludes.inc}
 {$UNDEF read_forward_definitions}
 
-{$DEFINE read_interface_rest}
-{$include gtype.inc}
-
-{$include gvalue.inc}
-{$include gvaluearray.inc}
-{$include gvaluecollector.inc}
-{$include gvaluetypes.inc}
-
-{$include gparam.inc}
-{$include gclosure.inc}
-{$include gsignal.inc}
-{$include gtypeplugin.inc}
-{$include gobject.inc}
-
-{$include gmacros.inc}
-{$include gtypes.inc}
-{$include genums.inc}
-{$include glibconfig.inc}
-{$include gstrfuncs.inc}
-{$include gutils.inc}
-{$include galloca.inc}
-{$include ghash.inc}
-{$include gquark.inc}
-{$include gerror.inc}
-{$include gbacktrace.inc}
-{$include gmem.inc}
-{$include garray.inc}
-{$include gslist.inc}
-{$include glist.inc}
-{$include gcache.inc}
-{$include gcompletion.inc}
-{$include gconvert.inc}
-{$include gdataset.inc}
-{$include gdate.inc}
-{$include gdir.inc}
-{$include gfileutils.inc}
-{$include ghook.inc}
-
-{$include gthread.inc}
-{$include gthreadpool.inc}
-{$include gtimer.inc}
-{$include gmain.inc}
-{$include gasyncqueue.inc}
-
-{$include gunicode.inc}
-{$include gstring.inc}
-{$include giochannel.inc}
-
-{$include gmessages.inc}
-{$include gmarkup.inc}
-{$include gnode.inc}
-{$include gtree.inc}
-{$include gpattern.inc}
-{$include gprimes.inc}
-{$include gqsort.inc}
-{$include gqueue.inc}
-{$include grand.inc}
-{$include grel.inc}
-{$include gscanner.inc}
-{$include gshell.inc}
-{$include gspawn.inc}
-{$include gboxed.inc}
-
-{$include gmodule.inc}
-
-{$include gmarshal.inc}
-
-{$IFDEF win32}
-{$include gwin32.inc}
-{$ENDIF}
+{$DEFINE read_interface_types}
+{$include gincludes.inc}
+{$UNDEF read_interface_types}
 
+{$DEFINE read_interface_rest}
+{$include gincludes.inc}
 {$UNDEF read_interface_rest}
 
 implementation
 
+{$DEFINE read_implementation}
+{$include gincludes.inc}
+{$UNDEF read_implementation}
+
+
 {$IFNDEF KYLIX}
 { There is a bug in the compiler. If an external variable is not used, it will
   create code, that can't be relocated by the linker.

+ 13 - 12
packages/gtk2/src/glib/glibconfig.inc

@@ -38,6 +38,19 @@
 
 {$ENDIF read_forward_definitions}
 
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_types}
+  PGSystemThread = ^TGSystemThread;
+  TGSystemThread = record
+    data           : array [0..3] of char;
+    dummy_double   : double;
+    dummy_pointer  : pointer;
+    dummy_long     : longint;
+  end;
+{$ENDIF read_interface_types}
+
 //------------------------------------------------------------------------------
 
 {$IFDEF read_interface_rest}
@@ -81,16 +94,6 @@ const
    GLIB_SIZEOF_LONG   = SizeOf(longint);
    GLIB_SIZEOF_SIZE_T = SizeOf(longint);
 
-type
-  PGSystemThread = ^TGSystemThread;
-  TGSystemThread = record
-        data           : array [0..3] of char;
-        dummy_double   : double;
-        dummy_pointer  : pointer;
-        dummy_long     : longint;
-      end;
-
-
 const
    GLIB_SYSDEF_POLLIN    = 1;
    GLIB_SYSDEF_POLLOUT   = 4;
@@ -107,8 +110,6 @@ const
 
 function GUINT_TO_POINTER(i: guint): pointer;
 
-
-
 {$ENDIF read_interface_rest}
 
 // included by glib2.pas

+ 18 - 8
packages/gtk2/src/glib/gmacros.inc

@@ -1,17 +1,27 @@
-{$ifndef __G_MACROS_H__}
-{$define __G_MACROS_H__}
+// included by glib2.pas
 
-  const
-     NULL = nil;
-     gTRUE = 1;
-     gFALSE = 0;
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
 
-function CLAMP(x, MinX, MaxX: integer): integer;
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_types}
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
 
+{$IFDEF read_interface_rest}
+const
+  NULL = nil;
+  gTRUE = 1;
+  gFALSE = 0;
+
+function CLAMP(x, MinX, MaxX: integer): integer;
 // Macros by analogy to GINT_TO_POINTER, GPOINTER_TO_INT
 function GPOINTER_TO_SIZE(p: GPointer): GSize;
 function GSIZE_TO_POINTER(s: GSize): GPointer;
 
-{$endif}    { __G_MACROS_H__  }
+{$ENDIF read_interface_rest}
+// included by glib2.pas
 
 

+ 184 - 261
packages/gtk2/src/glib/gmain.inc

@@ -1,268 +1,191 @@
-
-{$ifndef __G_MAIN_H__}
-{$define __G_MAIN_H__}
-
-//{$include gslist.inc}
-//{$include gthread.inc}
-
-  type
-    PGMainContext = pointer;
-    PGMainLoop    = pointer;
-
-    PGSourceFunc = ^TGSourceFunc;
-    TGSourceFunc = function (data:gpointer):gboolean;cdecl;
-
-    {< private > }
-    PGSourceCallbackFuncs = ^TGSourceCallbackFuncs;
-
-    PGSource = ^TGSource;
-    PGSourceFuncs = ^TGSourceFuncs;
-
-    TGSource = record
-            callback_data  : gpointer;
-            callback_funcs : PGSourceCallbackFuncs;
-            source_funcs   : PGSourceFuncs;
-            ref_count      : guint;
-            context        : PGMainContext;
-            priority       : gint;
-            flags          : guint;
-            source_id      : guint;
-            poll_fds       : PGSList;
-            prev           : PGSource;
-            next           : PGSource;
-            reserved1      : gpointer;
-            reserved2      : gpointer;
-         end;
-
-    TGSourceCallbackFuncs = record
-            ref   : procedure (cb_data:gpointer); cdecl;
-            unref : procedure (cb_data:gpointer); cdecl;
-            get   : procedure (cb_data:gpointer; source:PGSource; func:PGSourceFunc; data:Pgpointer); cdecl;
-         end;
-
-    TGSourceDummyMarshal = procedure {no parameters} ;cdecl;
-    { Can be NULL  }
-    { For use by g_source_set_closure  }
-    { Really is of type GClosureMarshal  }
-
-    TGSourceFuncs = record
-            prepare  : function  (source:PGSource; timeout:gint):gboolean; cdecl;
-            check    : function  (source:PGSource):gboolean; cdecl;
-            dispatch : function  (source:PGSource; callback:TGSourceFunc; user_data:gpointer):gboolean; cdecl;
-            finalize : procedure (source:PGSource); cdecl;
-            closure_callback : TGSourceFunc;
-            closure_marshal  : TGSourceDummyMarshal;
-         end;
-
-    { Any definitions using GPollFD or GPollFunc are primarily
-       for Unix and not guaranteed to be the compatible on all
-       operating systems on which GLib runs. Right now, the
-       GLib does use these functions on Win32 as well, but interprets
-       them in a fairly different way than on Unix. If you use
-       these definitions, you are should be prepared to recode
-       for different operating systems.
-
-
-       On Win32, the fd in a GPollFD should be Win32 HANDLE ( not  a file
-       descriptor as provided by the C runtime) that can be used by
-       MsgWaitForMultipleObjects. This does  not  include file handles
-       from CreateFile, SOCKETs, nor pipe handles. (But you can use
-       WSAEventSelect to signal events when a SOCKET is readable).
-
-       On Win32, fd can also be the special value G_WIN32_MSG_HANDLE to
-       indicate polling for messages. These message queue GPollFDs should
-       be added with the g_main_poll_win32_msg_add function.
-
-       But note that G_WIN32_MSG_HANDLE GPollFDs should not be used by GDK
-       (GTK) programs, as GDK itself wants to read messages and convert them
-       to GDK events.
-
-       So, unless you really know what you are doing, it's best not to try
-       to use the main loop polling stuff for your own needs on
-       Win32. It's really only written for the GIMP's needs so
-       far.
-      }
-
-       PGPollFD = ^TGPollFD;
-       TGPollFD = record
-            fd      : gint;
-            events  : gushort;
-            revents : gushort;
-         end;
-
-       TGPollFunc = function (ufds:PGPollFD; nfsd:guint; timeout:gint):gint;cdecl;
-
-    { Standard priorities  }
-
-    const
-       G_PRIORITY_HIGH         = -(100);
-       G_PRIORITY_DEFAULT      = 0;
-       G_PRIORITY_HIGH_IDLE    = 100;
-       G_PRIORITY_DEFAULT_IDLE = 200;
-       G_PRIORITY_LOW          = 300;
-    { GMainContext:  }
-
-    function g_main_context_new:PGMainContext;cdecl;external gliblib name 'g_main_context_new';
-
-    procedure g_main_context_ref(context:PGMainContext);cdecl;external gliblib name 'g_main_context_ref';
-
-    procedure g_main_context_unref(context:PGMainContext);cdecl;external gliblib name 'g_main_context_unref';
-
-    function g_main_context_default:PGMainContext;cdecl;external gliblib name 'g_main_context_default';
-
-    function g_main_context_iteration(context:PGMainContext; may_block:gboolean):gboolean;cdecl;external gliblib name 'g_main_context_iteration';
-
-    function g_main_context_pending(context:PGMainContext):gboolean;cdecl;external gliblib name 'g_main_context_pending';
-
-    { For implementation of legacy interfaces
-      }
-    function g_main_context_find_source_by_id(context:PGMainContext; source_id:guint):PGSource;cdecl;external gliblib name 'g_main_context_find_source_by_id';
-
-    function g_main_context_find_source_by_user_data(context:PGMainContext; user_data:gpointer):PGSource;cdecl;external gliblib name 'g_main_context_find_source_by_user_data';
-
-    function g_main_context_find_source_by_funcs_user_data(context:PGMainContext; funcs:PGSourceFuncs; user_data:gpointer):PGSource;cdecl;external gliblib name 'g_main_context_find_source_by_funcs_user_data';
-
-    { Low level functions for implementing custom main loops.
-      }
-    procedure g_main_context_wakeup(context:PGMainContext);cdecl;external gliblib name 'g_main_context_wakeup';
-
-    function g_main_context_acquire(context:PGMainContext):gboolean;cdecl;external gliblib name 'g_main_context_acquire';
-
-    procedure g_main_context_release(context:PGMainContext);cdecl;external gliblib name 'g_main_context_release';
-
-    function g_main_context_wait(context:PGMainContext; cond:PGCond; mutex:PGMutex):gboolean;cdecl;external gliblib name 'g_main_context_wait';
-
-    function g_main_context_prepare(context:PGMainContext; priority:Pgint):gboolean;cdecl;external gliblib name 'g_main_context_prepare';
-
-    function g_main_context_query(context:PGMainContext; max_priority:gint; timeout:Pgint; fds:PGPollFD; n_fds:gint):gint;cdecl;external gliblib name 'g_main_context_query';
-
-    function g_main_context_check(context:PGMainContext; max_priority:gint; fds:PGPollFD; n_fds:gint):gint;cdecl;external gliblib name 'g_main_context_check';
-
-    procedure g_main_context_dispatch(context:PGMainContext);cdecl;external gliblib name 'g_main_context_dispatch';
-
-    procedure g_main_context_set_poll_func(context:PGMainContext; func:TGPollFunc);cdecl;external gliblib name 'g_main_context_set_poll_func';
-
-    function g_main_context_get_poll_func(context:PGMainContext):TGPollFunc;cdecl;external gliblib name 'g_main_context_get_poll_func';
-
-    { Low level functions for use by source implementations
-      }
-    procedure g_main_context_add_poll(context:PGMainContext; fd:PGPollFD; priority:gint);cdecl;external gliblib name 'g_main_context_add_poll';
-
-    procedure g_main_context_remove_poll(context:PGMainContext; fd:PGPollFD);cdecl;external gliblib name 'g_main_context_remove_poll';
-
-    { GMainLoop:  }
-    function g_main_loop_new(context:PGMainContext; is_running:gboolean):PGMainLoop;cdecl;external gliblib name 'g_main_loop_new';
-
-    procedure g_main_loop_run(loop:PGMainLoop);cdecl;external gliblib name 'g_main_loop_run';
-
-    procedure g_main_loop_quit(loop:PGMainLoop);cdecl;external gliblib name 'g_main_loop_quit';
-
-    function g_main_loop_ref(loop:PGMainLoop):PGMainLoop;cdecl;external gliblib name 'g_main_loop_ref';
-
-    procedure g_main_loop_unref(loop:PGMainLoop);cdecl;external gliblib name 'g_main_loop_unref';
-
-    function g_main_loop_is_running(loop:PGMainLoop):gboolean;cdecl;external gliblib name 'g_main_loop_is_running';
-
-    function g_main_loop_get_context(loop:PGMainLoop):PGMainContext;cdecl;external gliblib name 'g_main_loop_get_context';
-
-    { GSource:  }
-    function g_source_new(source_funcs:PGSourceFuncs; struct_size:guint):PGSource;cdecl;external gliblib name 'g_source_new';
-
-    function g_source_ref(source:PGSource):PGSource;cdecl;external gliblib name 'g_source_ref';
-
-    procedure g_source_unref(source:PGSource);cdecl;external gliblib name 'g_source_unref';
-
-    function g_source_attach(source:PGSource; context:PGMainContext):guint;cdecl;external gliblib name 'g_source_attach';
-
-    procedure g_source_destroy(source:PGSource);cdecl;external gliblib name 'g_source_destroy';
-
-    procedure g_source_set_priority(source:PGSource; priority:gint);cdecl;external gliblib name 'g_source_set_priority';
-
-    function g_source_get_priority(source:PGSource):gint;cdecl;external gliblib name 'g_source_get_priority';
-
-    procedure g_source_set_can_recurse(source:PGSource; can_recurse:gboolean);cdecl;external gliblib name 'g_source_set_can_recurse';
-
-    function g_source_get_can_recurse(source:PGSource):gboolean;cdecl;external gliblib name 'g_source_get_can_recurse';
-
-    function g_source_get_id(source:PGSource):guint;cdecl;external gliblib name 'g_source_get_id';
-
-    function g_source_get_context(source:PGSource):PGMainContext;cdecl;external gliblib name 'g_source_get_context';
-
-    procedure g_source_set_callback(source:PGSource; func:TGSourceFunc; data:gpointer; notify:TGDestroyNotify);cdecl;external gliblib name 'g_source_set_callback';
-
-    { Used to implement g_source_connect_closure and internally }
-    procedure g_source_set_callback_indirect(source:PGSource; callback_data:gpointer; callback_funcs:PGSourceCallbackFuncs);cdecl;external gliblib name 'g_source_set_callback_indirect';
-
-    procedure g_source_add_poll(source:PGSource; fd:PGPollFD);cdecl;external gliblib name 'g_source_add_poll';
-
-    procedure g_source_remove_poll(source:PGSource; fd:PGPollFD);cdecl;external gliblib name 'g_source_remove_poll';
-
-    procedure g_source_get_current_time(source:PGSource; timeval:PGTimeVal);cdecl;external gliblib name 'g_source_get_current_time';
-
-    { void g_source_connect_closure (GSource         source,
-                                      GClosure        closure);
-      }
-    { Specific source types
-      }
-    function g_idle_source_new:PGSource;cdecl;external gliblib name 'g_idle_source_new';
-
-    function g_timeout_source_new(interval:guint):PGSource;cdecl;external gliblib name 'g_timeout_source_new';
-
-    { Miscellaneous functions
-      }
-    procedure g_get_current_time(result:PGTimeVal);cdecl;external gliblib name 'g_get_current_time';
-
-    { ============== Compat main loop stuff ==================  }
-
-    function g_main_new(is_running: gboolean): PGMainLoop;
-
-
-    { these functions are maped to their newer versions }
-    procedure g_main_run        (loop:PGMainLoop);cdecl;external gliblib name 'g_main_loop_run';
-    procedure g_main_quit       (loop:PGMainLoop);cdecl;external gliblib name 'g_main_loop_quit';
-    procedure g_main_destroy    (loop:PGMainLoop);cdecl;external gliblib name 'g_main_loop_unref';
-    function  g_main_is_running (loop:PGMainLoop):gboolean;cdecl;external gliblib name 'g_main_loop_is_running';
-
-
-    { Functions to manipulate the default main loop}
-    function  g_main_iteration  (may_block: gboolean): gboolean;
-    function  g_main_pending: gboolean;
-    //             g_main_context_pending        (NULL)
-    procedure g_main_set_poll_func(func:  TGPollFunc);
-    //   g_main_context_set_poll_func (NULL, func)
-
-    { ======= end of Compat main loop stuff ==================  }
-
-    { Source manipulation by ID  }
-
-    function g_source_remove(tag:guint):gboolean;cdecl;external gliblib name 'g_source_remove';
-
-    function g_source_remove_by_user_data(user_data:gpointer):gboolean;cdecl;external gliblib name 'g_source_remove_by_user_data';
-
-    function g_source_remove_by_funcs_user_data(funcs:PGSourceFuncs; user_data:gpointer):gboolean;cdecl;external gliblib name 'g_source_remove_by_funcs_user_data';
-
-    { Idles and timeouts  }
-    function g_timeout_add_full(priority:gint; interval:guint; _function:TGSourceFunc; data:gpointer; notify:TGDestroyNotify):guint;cdecl;external gliblib name 'g_timeout_add_full';
-
-    function g_timeout_add(interval:guint; _function:TGSourceFunc; data:gpointer):guint;cdecl;external gliblib name 'g_timeout_add';
-
-    function g_idle_add(_function:TGSourceFunc; data:gpointer):guint;cdecl;external gliblib name 'g_idle_add';
-
-    function g_idle_add_full(priority:gint; _function:TGSourceFunc; data:gpointer; notify:TGDestroyNotify):guint;cdecl;external gliblib name 'g_idle_add_full';
-
-    function g_idle_remove_by_data(data:gpointer):gboolean;cdecl;external gliblib name 'g_idle_remove_by_data';
-
-    { Hook for GClosure / GSource integration. Don't touch  }
+// included by glib2.pas
+
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_types}
+  PGMainContext = pointer;
+  PGMainLoop    = pointer;
+
+  PGSourceFunc = ^TGSourceFunc;
+  TGSourceFunc = function (data:gpointer):gboolean;cdecl;
+
+  {< private > }
+  PGSourceCallbackFuncs = ^TGSourceCallbackFuncs;
+
+  PGSource = ^TGSource;
+  PGSourceFuncs = ^TGSourceFuncs;
+
+  TGSource = record
+    callback_data  : gpointer;
+    callback_funcs : PGSourceCallbackFuncs;
+    source_funcs   : PGSourceFuncs;
+    ref_count      : guint;
+    context        : PGMainContext;
+    priority       : gint;
+    flags          : guint;
+    source_id      : guint;
+    poll_fds       : PGSList;
+    prev           : PGSource;
+    next           : PGSource;
+    reserved1      : gpointer;
+    reserved2      : gpointer;
+  end;
+
+  TGSourceCallbackFuncs = record
+    ref   : procedure (cb_data:gpointer); cdecl;
+    unref : procedure (cb_data:gpointer); cdecl;
+    get   : procedure (cb_data:gpointer; source:PGSource; func:PGSourceFunc; data:Pgpointer); cdecl;
+  end;
+
+  TGSourceDummyMarshal = procedure {no parameters} ;cdecl;
+  { Can be NULL  }
+  { For use by g_source_set_closure  }
+  { Really is of type GClosureMarshal  }
+
+  TGSourceFuncs = record
+    prepare  : function  (source:PGSource; timeout:gint):gboolean; cdecl;
+    check    : function  (source:PGSource):gboolean; cdecl;
+    dispatch : function  (source:PGSource; callback:TGSourceFunc; user_data:gpointer):gboolean; cdecl;
+    finalize : procedure (source:PGSource); cdecl;
+    closure_callback : TGSourceFunc;
+    closure_marshal  : TGSourceDummyMarshal;
+  end;
+
+  PGPollFD = ^TGPollFD;
+  TGPollFD = record
+    fd      : gint;
+    events  : gushort;
+    revents : gushort;
+  end;
+
+  TGPollFunc = function (ufds:PGPollFD; nfsd:guint; timeout:gint):gint;cdecl;
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_rest}
+{ Standard priorities  }
+
+const
+  G_PRIORITY_HIGH         = -(100);
+  G_PRIORITY_DEFAULT      = 0;
+  G_PRIORITY_HIGH_IDLE    = 100;
+  G_PRIORITY_DEFAULT_IDLE = 200;
+  G_PRIORITY_LOW          = 300;
+{ GMainContext:  }
+
+function g_main_context_new:PGMainContext;cdecl;external gliblib name 'g_main_context_new';
+procedure g_main_context_ref(context:PGMainContext);cdecl;external gliblib name 'g_main_context_ref';
+procedure g_main_context_unref(context:PGMainContext);cdecl;external gliblib name 'g_main_context_unref';
+function g_main_context_default:PGMainContext;cdecl;external gliblib name 'g_main_context_default';
+function g_main_context_iteration(context:PGMainContext; may_block:gboolean):gboolean;cdecl;external gliblib name 'g_main_context_iteration';
+function g_main_context_pending(context:PGMainContext):gboolean;cdecl;external gliblib name 'g_main_context_pending';
+
+{ For implementation of legacy interfaces }
+function g_main_context_find_source_by_id(context:PGMainContext; source_id:guint):PGSource;cdecl;external gliblib name 'g_main_context_find_source_by_id';
+function g_main_context_find_source_by_user_data(context:PGMainContext; user_data:gpointer):PGSource;cdecl;external gliblib name 'g_main_context_find_source_by_user_data';
+function g_main_context_find_source_by_funcs_user_data(context:PGMainContext; funcs:PGSourceFuncs; user_data:gpointer):PGSource;cdecl;external gliblib name 'g_main_context_find_source_by_funcs_user_data';
+
+{ Low level functions for implementing custom main loops. }
+procedure g_main_context_wakeup(context:PGMainContext);cdecl;external gliblib name 'g_main_context_wakeup';
+function g_main_context_acquire(context:PGMainContext):gboolean;cdecl;external gliblib name 'g_main_context_acquire';
+procedure g_main_context_release(context:PGMainContext);cdecl;external gliblib name 'g_main_context_release';
+function g_main_context_wait(context:PGMainContext; cond:PGCond; mutex:PGMutex):gboolean;cdecl;external gliblib name 'g_main_context_wait';
+function g_main_context_prepare(context:PGMainContext; priority:Pgint):gboolean;cdecl;external gliblib name 'g_main_context_prepare';
+function g_main_context_query(context:PGMainContext; max_priority:gint; timeout:Pgint; fds:PGPollFD; n_fds:gint):gint;cdecl;external gliblib name 'g_main_context_query';
+function g_main_context_check(context:PGMainContext; max_priority:gint; fds:PGPollFD; n_fds:gint):gint;cdecl;external gliblib name 'g_main_context_check';
+procedure g_main_context_dispatch(context:PGMainContext);cdecl;external gliblib name 'g_main_context_dispatch';
+procedure g_main_context_set_poll_func(context:PGMainContext; func:TGPollFunc);cdecl;external gliblib name 'g_main_context_set_poll_func';
+function g_main_context_get_poll_func(context:PGMainContext):TGPollFunc;cdecl;external gliblib name 'g_main_context_get_poll_func';
+
+{ Low level functions for use by source implementations }
+procedure g_main_context_add_poll(context:PGMainContext; fd:PGPollFD; priority:gint);cdecl;external gliblib name 'g_main_context_add_poll';
+procedure g_main_context_remove_poll(context:PGMainContext; fd:PGPollFD);cdecl;external gliblib name 'g_main_context_remove_poll';
+
+{ GMainLoop:  }
+function g_main_loop_new(context:PGMainContext; is_running:gboolean):PGMainLoop;cdecl;external gliblib name 'g_main_loop_new';
+procedure g_main_loop_run(loop:PGMainLoop);cdecl;external gliblib name 'g_main_loop_run';
+procedure g_main_loop_quit(loop:PGMainLoop);cdecl;external gliblib name 'g_main_loop_quit';
+function g_main_loop_ref(loop:PGMainLoop):PGMainLoop;cdecl;external gliblib name 'g_main_loop_ref';
+procedure g_main_loop_unref(loop:PGMainLoop);cdecl;external gliblib name 'g_main_loop_unref';
+function g_main_loop_is_running(loop:PGMainLoop):gboolean;cdecl;external gliblib name 'g_main_loop_is_running';
+function g_main_loop_get_context(loop:PGMainLoop):PGMainContext;cdecl;external gliblib name 'g_main_loop_get_context';
+
+{ GSource:  }
+function g_source_new(source_funcs:PGSourceFuncs; struct_size:guint):PGSource;cdecl;external gliblib name 'g_source_new';
+function g_source_ref(source:PGSource):PGSource;cdecl;external gliblib name 'g_source_ref';
+procedure g_source_unref(source:PGSource);cdecl;external gliblib name 'g_source_unref';
+function g_source_attach(source:PGSource; context:PGMainContext):guint;cdecl;external gliblib name 'g_source_attach';
+procedure g_source_destroy(source:PGSource);cdecl;external gliblib name 'g_source_destroy';
+procedure g_source_set_priority(source:PGSource; priority:gint);cdecl;external gliblib name 'g_source_set_priority';
+function g_source_get_priority(source:PGSource):gint;cdecl;external gliblib name 'g_source_get_priority';
+procedure g_source_set_can_recurse(source:PGSource; can_recurse:gboolean);cdecl;external gliblib name 'g_source_set_can_recurse';
+function g_source_get_can_recurse(source:PGSource):gboolean;cdecl;external gliblib name 'g_source_get_can_recurse';
+function g_source_get_id(source:PGSource):guint;cdecl;external gliblib name 'g_source_get_id';
+function g_source_get_context(source:PGSource):PGMainContext;cdecl;external gliblib name 'g_source_get_context';
+procedure g_source_set_callback(source:PGSource; func:TGSourceFunc; data:gpointer; notify:TGDestroyNotify);cdecl;external gliblib name 'g_source_set_callback';
+
+{ Used to implement g_source_connect_closure and internally }
+procedure g_source_set_callback_indirect(source:PGSource; callback_data:gpointer; callback_funcs:PGSourceCallbackFuncs);cdecl;external gliblib name 'g_source_set_callback_indirect';
+procedure g_source_add_poll(source:PGSource; fd:PGPollFD);cdecl;external gliblib name 'g_source_add_poll';
+procedure g_source_remove_poll(source:PGSource; fd:PGPollFD);cdecl;external gliblib name 'g_source_remove_poll';
+procedure g_source_get_current_time(source:PGSource; timeval:PGTimeVal);cdecl;external gliblib name 'g_source_get_current_time';
+
+{ void g_source_connect_closure (GSource         source,
+                                 GClosure        closure);
+ }
+
+{ Specific source types }
+function g_idle_source_new:PGSource;cdecl;external gliblib name 'g_idle_source_new';
+function g_timeout_source_new(interval:guint):PGSource;cdecl;external gliblib name 'g_timeout_source_new';
+
+{ Miscellaneous functions }
+procedure g_get_current_time(result:PGTimeVal);cdecl;external gliblib name 'g_get_current_time';
+
+{ ============== Compat main loop stuff ==================  }
+
+function g_main_new(is_running: gboolean): PGMainLoop;
+
+
+{ these functions are maped to their newer versions }
+procedure g_main_run        (loop:PGMainLoop);cdecl;external gliblib name 'g_main_loop_run';
+procedure g_main_quit       (loop:PGMainLoop);cdecl;external gliblib name 'g_main_loop_quit';
+procedure g_main_destroy    (loop:PGMainLoop);cdecl;external gliblib name 'g_main_loop_unref';
+function  g_main_is_running (loop:PGMainLoop):gboolean;cdecl;external gliblib name 'g_main_loop_is_running';
+
+
+{ Functions to manipulate the default main loop}
+function  g_main_iteration  (may_block: gboolean): gboolean;
+function  g_main_pending: gboolean;
+//             g_main_context_pending        (NULL)
+procedure g_main_set_poll_func(func:  TGPollFunc);
+//   g_main_context_set_poll_func (NULL, func)
+
+{ ======= end of Compat main loop stuff ==================  }
+
+{ Source manipulation by ID  }
+function g_source_remove(tag:guint):gboolean;cdecl;external gliblib name 'g_source_remove';
+function g_source_remove_by_user_data(user_data:gpointer):gboolean;cdecl;external gliblib name 'g_source_remove_by_user_data';
+function g_source_remove_by_funcs_user_data(funcs:PGSourceFuncs; user_data:gpointer):gboolean;cdecl;external gliblib name 'g_source_remove_by_funcs_user_data';
+
+{ Idles and timeouts  }
+function g_timeout_add_full(priority:gint; interval:guint; _function:TGSourceFunc; data:gpointer; notify:TGDestroyNotify):guint;cdecl;external gliblib name 'g_timeout_add_full';
+function g_timeout_add(interval:guint; _function:TGSourceFunc; data:gpointer):guint;cdecl;external gliblib name 'g_timeout_add';
+function g_idle_add(_function:TGSourceFunc; data:gpointer):guint;cdecl;external gliblib name 'g_idle_add';
+function g_idle_add_full(priority:gint; _function:TGSourceFunc; data:gpointer; notify:TGDestroyNotify):guint;cdecl;external gliblib name 'g_idle_add_full';
+function g_idle_remove_by_data(data:gpointer):gboolean;cdecl;external gliblib name 'g_idle_remove_by_data';
+
+{ Hook for GClosure / GSource integration. Don't touch  }
 // GLIB_VAR GSourceFuncs g_timeout_funcs;
 // GLIB_VAR GSourceFuncs g_idle_funcs;
 
 {$ifdef win32}
-    { This is used to add polling for Windows messages. GDK (GTK+) programs
-       should  not  use this.
-      }
-
-    procedure g_main_poll_win32_msg_add(priority:gint; fd:PGPollFD; hwnd:guint);cdecl;external gliblib name 'g_main_poll_win32_msg_add';
+procedure g_main_poll_win32_msg_add(priority:gint; fd:PGPollFD; hwnd:guint);cdecl;external gliblib name 'g_main_poll_win32_msg_add';
 {$endif}
 
-{$endif}
+{$ENDIF read_interface_rest}
+// included by glib2.pas
 

+ 84 - 111
packages/gtk2/src/glib/gmarkup.inc

@@ -1,111 +1,84 @@
-{*
- * gmarkup.inc
- *
- * depends on gerror.inc
- *}
-
-
-  { These three are primarily intended for specific GMarkupParser
-       implementations to set.
-      }
-  type
-
-     PGMarkupError = ^TGMarkupError;
-     TGMarkupError = (G_MARKUP_ERROR_BAD_UTF8,
-                      G_MARKUP_ERROR_EMPTY,
-                      G_MARKUP_ERROR_PARSE,
-                      G_MARKUP_ERROR_UNKNOWN_ELEMENT,
-                      G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE,
-                      G_MARKUP_ERROR_INVALID_CONTENT);
-
-
-  function G_MARKUP_ERROR : TGQuark;
-
-
-  function g_markup_error_quark:TGQuark;cdecl;external gliblib name 'g_markup_error_quark';
-
-  type
-     PGMarkupParseFlags = ^TGMarkupParseFlags;
-     TGMarkupParseFlags = integer;
-
-  const
-     { Hmm, can't think of any at the moment  }
-     G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG = 1 shl 0;
-
-  type
-     PGMarkupParseContext = ^TGMarkupParseContext;
-     TGMarkupParseContext = pointer;                // please correct me if it's wrong
-
-
-     PGMarkupParser = ^TGMarkupParser;
-     TGMarkupParser = record
-
-       { Called for open tags <foo bar="baz">  }
-          start_element : procedure (context          : PGMarkupParseContext;
-                                     element_name     : Pgchar;
-                                     attribute_names  : PPgchar;
-                                     attribute_values : PPgchar;
-                                     user_data        : gpointer; error:PPGError);cdecl;
-
-       { Called for close tags </foo>  }
-          end_element   : procedure (context          : PGMarkupParseContext;
-                                     element_name     : Pgchar;
-                                     user_data        : gpointer;
-                                     error            : PPGError); cdecl;
-
-       { Called for character data  }
-       { text is not nul-terminated  }
-          text          : procedure (context          : PGMarkupParseContext;
-                                     text             : Pgchar;
-                                     text_len         : gsize;
-                                     user_data        : gpointer;
-                                     error            : PPGError); cdecl;
-
-  { Called for strings that should be re-saved verbatim in this same
-       position, but are not otherwise interpretable.  At the moment
-       this includes comments and processing instructions.
-      }
-  { text is not nul-terminated.  }
-
-          passthrough   : procedure (context          : PGMarkupParseContext;
-                                     passthrough_text : Pgchar;
-                                     text_len         : gsize;
-                                     user_data        : gpointer;
-                                     error            : PPGError); cdecl;
-
-  { Called on error, including one set by other
-       methods in the vtable. The GError should not be freed.
-      }
-          error          : procedure (context         : PGMarkupParseContext;
-                                      error           : PGError;
-                                      user_data       : gpointer); cdecl;
-       end;
-
-
-
-  function  g_markup_parse_context_new (parser            : PGMarkupParser;
-                                        flags             : TGMarkupParseFlags;
-                                        user_data         : gpointer;
-                                        user_data_dnotify : TGDestroyNotify): PGMarkupParseContext;  cdecl;external gliblib name 'g_markup_parse_context_new';
-
-  procedure g_markup_parse_context_free(context           : PGMarkupParseContext);cdecl;external gliblib name 'g_markup_parse_context_free';
-
-  function  g_markup_parse_context_parse(context          : PGMarkupParseContext;
-                                         text             : Pgchar;
-                                         text_len         : gssize;
-                                         error            : PPGError):gboolean;cdecl;external gliblib name 'g_markup_parse_context_parse';
-
-  function  g_markup_parse_context_end_parse(context      : PGMarkupParseContext;
-                                             error        : PPGError):gboolean;cdecl;external gliblib name 'g_markup_parse_context_end_parse';
-
-  { For user-constructed error messages, has no precise semantics  }
-  procedure g_markup_parse_context_get_position(context     : PGMarkupParseContext;
-                                                line_number : Pgint;
-                                                char_number : Pgint);cdecl;external gliblib name 'g_markup_parse_context_get_position';
-
-  { useful when saving  }
-  function g_markup_escape_text (text   : Pgchar;
-                                 length : gssize):Pgchar;cdecl;external gliblib name 'g_markup_escape_text';
-
-
-
+// included by glib2.pas
+
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_types}
+  PGMarkupError = ^TGMarkupError;
+  TGMarkupError = (
+    G_MARKUP_ERROR_BAD_UTF8,
+    G_MARKUP_ERROR_EMPTY,
+    G_MARKUP_ERROR_PARSE,
+    G_MARKUP_ERROR_UNKNOWN_ELEMENT,
+    G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE,
+    G_MARKUP_ERROR_INVALID_CONTENT
+  );
+
+  PGMarkupParseFlags = ^TGMarkupParseFlags;
+  TGMarkupParseFlags = integer;
+
+  PGMarkupParseContext = ^TGMarkupParseContext;
+  TGMarkupParseContext = pointer;                // please correct me if it's wrong
+
+
+  PGMarkupParser = ^TGMarkupParser;
+  TGMarkupParser = record
+    start_element : procedure (context          : PGMarkupParseContext;
+                               element_name     : Pgchar;
+                               attribute_names  : PPgchar;
+                               attribute_values : PPgchar;
+                               user_data        : gpointer; error:PPGError);cdecl;
+    end_element   : procedure (context          : PGMarkupParseContext;
+                               element_name     : Pgchar;
+                               user_data        : gpointer;
+                               error            : PPGError); cdecl;
+    text          : procedure (context          : PGMarkupParseContext;
+                               text             : Pgchar;
+                               text_len         : gsize;
+                               user_data        : gpointer;
+                               error            : PPGError); cdecl;
+    passthrough   : procedure (context          : PGMarkupParseContext;
+                               passthrough_text : Pgchar;
+                               text_len         : gsize;
+                               user_data        : gpointer;
+                               error            : PPGError); cdecl;
+    error          : procedure (context         : PGMarkupParseContext;
+                                error           : PGError;
+                                user_data       : gpointer); cdecl;
+    end;
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_rest}
+function G_MARKUP_ERROR : TGQuark;
+
+function g_markup_error_quark:TGQuark;cdecl;external gliblib name 'g_markup_error_quark';
+
+const
+  G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG = 1 shl 0;
+
+
+function  g_markup_parse_context_new (parser            : PGMarkupParser;
+                                      flags             : TGMarkupParseFlags;
+                                      user_data         : gpointer;
+                                      user_data_dnotify : TGDestroyNotify): PGMarkupParseContext;  cdecl;external gliblib name 'g_markup_parse_context_new';
+
+procedure g_markup_parse_context_free(context           : PGMarkupParseContext);cdecl;external gliblib name 'g_markup_parse_context_free';
+function  g_markup_parse_context_parse(context          : PGMarkupParseContext;
+                                       text             : Pgchar;
+                                       text_len         : gssize;
+                                       error            : PPGError):gboolean;cdecl;external gliblib name 'g_markup_parse_context_parse';
+
+function  g_markup_parse_context_end_parse(context      : PGMarkupParseContext;
+                                           error        : PPGError):gboolean;cdecl;external gliblib name 'g_markup_parse_context_end_parse';
+procedure g_markup_parse_context_get_position(context     : PGMarkupParseContext;
+                                              line_number : Pgint;
+                                              char_number : Pgint);cdecl;external gliblib name 'g_markup_parse_context_get_position';
+function g_markup_escape_text (text   : Pgchar;
+                               length : gssize):Pgchar;cdecl;external gliblib name 'g_markup_escape_text';
+
+{$ENDIF read_interface_rest}
+// included by glib2.pas

+ 12 - 1
packages/gtk2/src/glib/gmarshal.inc

@@ -1,5 +1,16 @@
 // included by glib2.pas
 
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_types}
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_rest}
 procedure g_cclosure_marshal_VOID__VOID(closure:PGClosure; return_value:PGValue;
   n_param_values:GUInt; param_values:PGValue; invocation_hint:GPointer;
   marshal_data:GPointer);cdecl;external gobjectlib;
@@ -68,6 +79,6 @@ procedure g_cclosure_marshal_BOOL__FLAGS(closure:PGClosure;
   return_value:PGValue; n_param_values:GUInt; param_values:PGValue;
   invocation_hint:GPointer;
   marshal_data:GPointer);cdecl;external gliblib name 'g_cclosure_marshal_BOOLEAN__FLAGS';
-
+{$ENDIF read_interface_rest}
 // included by glib2.pas
 

+ 7 - 5
packages/gtk2/src/glib/gmem.inc

@@ -5,11 +5,7 @@
 
 //------------------------------------------------------------------------------
 
-{$IFDEF read_interface_rest}
-const
-   G_MEM_ALIGN = GLIB_SIZEOF_VOID_P;
-
-type
+{$IFDEF read_interface_types}
    PGMemVTable = ^TGMemVTable;
    TGMemVTable = record
         malloc : function (n_bytes:gsize):gpointer; cdecl;
@@ -22,7 +18,13 @@ type
 
    PGMemChunk = pointer; // internal structure of gmem.c
    PGAllocator = pointer; // internal structure of gmem.c
+{$ENDIF read_interface_types}
 
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_rest}
+const
+   G_MEM_ALIGN = GLIB_SIZEOF_VOID_P;
 
 { Memory allocation functions }
 

+ 62 - 92
packages/gtk2/src/glib/gmessages.inc

@@ -1,12 +1,22 @@
-{*
- * gmessages.inc
- *
- * depends on gtypes.inc
- *}
+// included by glib2.pas
 
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
 
-  { calculate a string size, guarranteed to fit format + args.
-  }
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_types}
+  PGLogLevelFlags = ^TGLogLevelFlags;
+  TGLogLevelFlags = longint;
+
+  TGLogFunc = procedure (log_domain:Pgchar; log_level:TGLogLevelFlags; TheMessage:Pgchar; user_data:gpointer);cdecl;
+
+  TGPrintFunc = procedure   (_string: pgchar);
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_rest}
 
 {$IFNDEF KYLIX}
   function g_printf_string_upper_bound(format:Pgchar; args:array of const):gsize;cdecl;external gliblib name 'g_printf_string_upper_bound';
@@ -14,47 +24,35 @@
   function g_printf_string_upper_bound(format:Pgchar):gsize;varargs;cdecl;external gliblib name 'g_printf_string_upper_bound';
 {$ENDIF}
 
-  { Log level shift offset for user defined
-     log levels (0-7 are used by GLib).
-    }
+{ Log level shift offset for user defined log levels (0-7 are used by GLib). }
 
-  const
-     G_LOG_LEVEL_USER_SHIFT = 8;
-  { Glib log levels and flags. }
+const
+   G_LOG_LEVEL_USER_SHIFT = 8;
+{ Glib log levels and flags. }
 
 
-  type
-
-     PGLogLevelFlags = ^TGLogLevelFlags;
-     TGLogLevelFlags = longint;
-
-  const
-    G_LOG_FLAG_RECURSION          = 1 shl 0;
-    G_LOG_FLAG_FATAL              = 1 shl 1;
-    G_LOG_LEVEL_ERROR             = 1 shl 2;
-    G_LOG_LEVEL_CRITICAL          = 1 shl 3;
-    G_LOG_LEVEL_WARNING           = 1 shl 4;
-    G_LOG_LEVEL_MESSAGE           = 1 shl 5;
-    G_LOG_LEVEL_INFO              = 1 shl 6;
-    G_LOG_LEVEL_DEBUG             = 1 shl 7;
-    G_LOG_LEVEL_MASK              = not 3;
+const
+  G_LOG_FLAG_RECURSION          = 1 shl 0;
+  G_LOG_FLAG_FATAL              = 1 shl 1;
+  G_LOG_LEVEL_ERROR             = 1 shl 2;
+  G_LOG_LEVEL_CRITICAL          = 1 shl 3;
+  G_LOG_LEVEL_WARNING           = 1 shl 4;
+  G_LOG_LEVEL_MESSAGE           = 1 shl 5;
+  G_LOG_LEVEL_INFO              = 1 shl 6;
+  G_LOG_LEVEL_DEBUG             = 1 shl 7;
+  G_LOG_LEVEL_MASK              = not 3;
 //  G_LOG_LEVEL_MASK              =  not (G_LOG_FLAG_RECURSION or G_LOG_FLAG_FATAL);
 
 
-  { GLib log levels that are considered fatal by default  }
-  const
-     G_LOG_FATAL_MASK = 5;
-
-  type
-     TGLogFunc = procedure (log_domain:Pgchar; log_level:TGLogLevelFlags; TheMessage:Pgchar; user_data:gpointer);cdecl;
-
-  { Logging mechanism }
-
-  function g_log_set_handler(log_domain:Pgchar; log_levels:TGLogLevelFlags; log_func:TGLogFunc; user_data:gpointer):guint;cdecl;external gliblib name 'g_log_set_handler';
+{ GLib log levels that are considered fatal by default  }
+const
+   G_LOG_FATAL_MASK = 5;
 
-  procedure g_log_remove_handler(log_domain:Pgchar; handler_id:guint);cdecl;external gliblib name 'g_log_remove_handler';
+{ Logging mechanism }
 
-  procedure g_log_default_handler(log_domain:Pgchar; log_level:TGLogLevelFlags; TheMessage:Pgchar; unused_data:gpointer);cdecl;external gliblib name 'g_log_default_handler';
+function g_log_set_handler(log_domain:Pgchar; log_levels:TGLogLevelFlags; log_func:TGLogFunc; user_data:gpointer):guint;cdecl;external gliblib name 'g_log_set_handler';
+procedure g_log_remove_handler(log_domain:Pgchar; handler_id:guint);cdecl;external gliblib name 'g_log_remove_handler';
+procedure g_log_default_handler(log_domain:Pgchar; log_level:TGLogLevelFlags; TheMessage:Pgchar; unused_data:gpointer);cdecl;external gliblib name 'g_log_default_handler';
 
 {$IFNDEF KYLIX}
   procedure g_log(log_domain:Pgchar; log_level:TGLogLevelFlags; format:Pgchar; args:array of const);cdecl;overload;external gliblib name 'g_log';
@@ -68,73 +66,45 @@
 {$ENDIF}
 
 
-  function g_log_set_fatal_mask(log_domain:Pgchar; fatal_mask:TGLogLevelFlags):TGLogLevelFlags;cdecl;external gliblib name 'g_log_set_fatal_mask';
+function g_log_set_fatal_mask(log_domain:Pgchar; fatal_mask:TGLogLevelFlags):TGLogLevelFlags;cdecl;external gliblib name 'g_log_set_fatal_mask';
+function g_log_set_always_fatal(fatal_mask:TGLogLevelFlags):TGLogLevelFlags;cdecl;external gliblib name 'g_log_set_always_fatal';
 
-  function g_log_set_always_fatal(fatal_mask:TGLogLevelFlags):TGLogLevelFlags;cdecl;external gliblib name 'g_log_set_always_fatal';
+{ internal  }
+procedure _g_log_fallback_handler(log_domain:Pgchar; log_level:TGLogLevelFlags; message:Pgchar; unused_data:gpointer);cdecl;external gliblib name '_g_log_fallback_handler';
 
-  { internal  }
-  procedure _g_log_fallback_handler(log_domain:Pgchar; log_level:TGLogLevelFlags; message:Pgchar; unused_data:gpointer);cdecl;external gliblib name '_g_log_fallback_handler';
+const
+  G_LOG_DOMAIN = nil;
 
-  const
-    G_LOG_DOMAIN = nil;
 
-//  or try this:
-//
-//  function G_LOG_DOMAIN : pgchar;
-//    begin
-//      G_LOG_DOMAIN :=  PGChar(0);
-//    end;
+procedure g_error    (format:Pgchar; args: array of const); overload;
+procedure g_error    (format:Pgchar); overload;
 
+procedure g_message  (format:Pgchar; args: array of const); overload;
+procedure g_message  (format:Pgchar); overload;
 
-  procedure g_error    (format:Pgchar; args: array of const); overload;
-  procedure g_error    (format:Pgchar); overload;
+procedure g_critical (format:Pgchar; args: array of const); overload;
+procedure g_critical (format:Pgchar); overload;
 
-  procedure g_message  (format:Pgchar; args: array of const); overload;
-  procedure g_message  (format:Pgchar); overload;
-
-  procedure g_critical (format:Pgchar; args: array of const); overload;
-  procedure g_critical (format:Pgchar); overload;
-
-  procedure g_warning  (format:Pgchar; args: array of const); overload;
-  procedure g_warning  (format:Pgchar); overload;
-
-    type
-      TGPrintFunc = procedure   (_string: pgchar);
+procedure g_warning  (format:Pgchar; args: array of const); overload;
+procedure g_warning  (format:Pgchar); overload;
 
 {$IFNDEF KYLIX}
-    procedure g_print(format:Pgchar; args:array of const);cdecl;overload;external gliblib name 'g_print';
-    procedure g_print(format:Pgchar);cdecl;overload;varargs;external gliblib name 'g_print';
+  procedure g_print(format:Pgchar; args:array of const);cdecl;overload;external gliblib name 'g_print';
+  procedure g_print(format:Pgchar);cdecl;overload;varargs;external gliblib name 'g_print';
 {$ELSE}
-    procedure g_print(format:Pgchar);varargs;cdecl;external gliblib name 'g_print';
+  procedure g_print(format:Pgchar);varargs;cdecl;external gliblib name 'g_print';
 {$ENDIF}
 
-    function g_set_print_handler(func:TGPrintFunc):TGPrintFunc;cdecl;external gliblib name 'g_set_print_handler';
-
+function g_set_print_handler(func:TGPrintFunc):TGPrintFunc;cdecl;external gliblib name 'g_set_print_handler';
 
 {$IFNDEF KYLIX}
-    procedure g_printerr(format:Pgchar; args:array of const);cdecl;overload;external gliblib name 'g_printerr';
-    procedure g_printerr(format:Pgchar);cdecl;overload;varargs;external gliblib name 'g_printerr';
+  procedure g_printerr(format:Pgchar; args:array of const);cdecl;overload;external gliblib name 'g_printerr';
+  procedure g_printerr(format:Pgchar);cdecl;overload;varargs;external gliblib name 'g_printerr';
 {$ELSE}
-    procedure g_printerr(format:Pgchar);varargs;cdecl;external gliblib name 'g_printerr';
+  procedure g_printerr(format:Pgchar);varargs;cdecl;external gliblib name 'g_printerr';
 {$ENDIF}
 
-    function g_set_printerr_handler(func:TGPrintFunc):TGPrintFunc;cdecl;external gliblib name 'g_set_printerr_handler';
-
-    { Provide macros for error handling. The "assert" macros will
-        exit on failure. The "return" macros will exit the current
-        function. Two different definitions are given for the macros
-        if G_DISABLE_ASSERT is not defined, in order to support gcc's
-        __PRETTY_FUNCTION__ capability.
-      }
-
-{ ????????? }
-
-// #define g_assert(expr)               G_STMT_START{ }G_STMT_END
-// #define g_assert_not_reached()       G_STMT_START{ }G_STMT_END
-
-
-// #define g_return_if_fail(expr)                       G_STMT_START{ }G_STMT_END
-// #define g_return_val_if_fail(expr,val)               G_STMT_START{ }G_STMT_END
-// #define g_return_if_reached()                        G_STMT_START{ return; }G_STMT_END
-// #define g_return_val_if_reached(val)         G_STMT_START{ return (val); }G_STMT_END
+function g_set_printerr_handler(func:TGPrintFunc):TGPrintFunc;cdecl;external gliblib name 'g_set_printerr_handler';
+{$ENDIF read_interface_rest}
+// included by glib2.pas
 

+ 23 - 31
packages/gtk2/src/glib/gmodule.inc

@@ -1,41 +1,33 @@
 // included by glib2.pas
 
-  type
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
 
-   PGModule = pointer;
-   TGModuleFlags =  Longint;
+//------------------------------------------------------------------------------
 
+{$IFDEF read_interface_types}
+ PGModule = pointer;
+ TGModuleFlags =  Longint;
 
-   TGModuleCheckInit = function (module:PGModule):Pgchar;cdecl;
-   TGModuleUnload = procedure (module:PGModule);cdecl;
+ TGModuleCheckInit = function (module:PGModule):Pgchar;cdecl;
+ TGModuleUnload = procedure (module:PGModule);cdecl;
+{$ENDIF read_interface_types}
 
+//------------------------------------------------------------------------------
 
-  Const
-    G_MODULE_BIND_LAZY = 1 shl 0;
-    G_MODULE_BIND_MASK = 1;
-
-
-  function  g_module_supported:gboolean;cdecl; external gmodulelib name 'g_module_supported';
-
-  function  g_module_open(file_name:Pgchar;
-                          flags:TGModuleFlags):PGModule;cdecl;external gmodulelib name 'g_module_open';
-
-  function  g_module_close(module:PGModule):gboolean;cdecl;external gmodulelib name 'g_module_close';
-
-  procedure g_module_make_resident(module:PGModule);cdecl;external gmodulelib name 'g_module_make_resident';
-
-  function  g_module_error: Pgchar;cdecl;external gmodulelib name 'g_module_error';
-
-  function  g_module_symbol(module:PGModule;
-                            symbol_name:Pgchar;
-                            symbol:Pgpointer):  gboolean;cdecl;external gmodulelib name 'g_module_symbol';
-
-  function  g_module_name(module:PGModule):Pgchar;cdecl;external gmodulelib name 'g_module_name';
-
-  function  g_module_build_path(directory:Pgchar;
-                                module_name:Pgchar):Pgchar;cdecl;external gmodulelib name 'g_module_build_path';
-
+{$IFDEF read_interface_rest}
+const
+  G_MODULE_BIND_LAZY = 1 shl 0;
+  G_MODULE_BIND_MASK = 1;
 
+function  g_module_supported:gboolean;cdecl; external gmodulelib name 'g_module_supported';
+function  g_module_open(file_name:Pgchar; flags:TGModuleFlags):PGModule;cdecl;external gmodulelib name 'g_module_open';
+function  g_module_close(module:PGModule):gboolean;cdecl;external gmodulelib name 'g_module_close';
+procedure g_module_make_resident(module:PGModule);cdecl;external gmodulelib name 'g_module_make_resident';
+function  g_module_error: Pgchar;cdecl;external gmodulelib name 'g_module_error';
+function  g_module_symbol(module:PGModule; symbol_name:Pgchar; symbol:Pgpointer):  gboolean;cdecl;external gmodulelib name 'g_module_symbol';
+function  g_module_name(module:PGModule):Pgchar;cdecl;external gmodulelib name 'g_module_name';
+function  g_module_build_path(directory:Pgchar; module_name:Pgchar):Pgchar;cdecl;external gmodulelib name 'g_module_build_path';
 
+{$ENDIF read_interface_rest}
 // included by glib2.pas
-

+ 92 - 134
packages/gtk2/src/glib/gnode.inc

@@ -1,134 +1,92 @@
-{*
- * gnode.inc
- *
- * depends on gmem.inc
- *}
-
-
-  type
-     PGNode = ^TGNode;
-     TGNode = record
-          data     : gpointer;
-          next     : PGNode;
-          prev     : PGNode;
-          parent   : PGNode;
-          children : PGNode;
-       end;
-
-  { Tree traverse flags  }
-
-     PGTraverseFlags = ^TGTraverseFlags;
-     TGTraverseFlags = gint;
-
-  const
-     G_TRAVERSE_LEAFS      = 1 shl 0;
-     G_TRAVERSE_NON_LEAFS  = 1 shl 1;
-     G_TRAVERSE_ALL        = G_TRAVERSE_LEAFS or G_TRAVERSE_NON_LEAFS;
-     G_TRAVERSE_MASK       = $03;
-
-    { Tree traverse orders  }
-    type
-
-       PGTraverseType = ^TGTraverseType;
-       TGTraverseType = (G_IN_ORDER,
-                         G_PRE_ORDER,
-                         G_POST_ORDER,
-                         G_LEVEL_ORDER);
-
-       TGNodeTraverseFunc = function (node:PGNode; data:gpointer):gboolean;cdecl;
-
-       TGNodeForeachFunc = procedure (node:PGNode; data:gpointer);cdecl;
-
-    { N-way tree implementation
-      }
-
-    function G_NODE_IS_ROOT (node: PGNode): boolean;
-
-    function G_NODE_IS_LEAF (node: PGNode): boolean;
-
-    procedure g_node_push_allocator(allocator:PGAllocator);cdecl;external gliblib name 'g_node_push_allocator';
-
-    procedure g_node_pop_allocator;cdecl;external gliblib name 'g_node_pop_allocator';
-
-    function  g_node_new(data:gpointer):PGNode;cdecl;external gliblib name 'g_node_new';
-
-    procedure g_node_destroy(root:PGNode);cdecl;external gliblib name 'g_node_destroy';
-
-    procedure g_node_unlink(node:PGNode);cdecl;external gliblib name 'g_node_unlink';
-
-    function  g_node_copy(node:PGNode):PGNode;cdecl;external gliblib name 'g_node_copy';
-
-    function  g_node_insert(parent:PGNode; position:gint; node:PGNode):PGNode;cdecl;external gliblib name 'g_node_insert';
-
-    function  g_node_insert_before(parent:PGNode; sibling:PGNode; node:PGNode):PGNode;cdecl;external gliblib name 'g_node_insert_before';
-
-    function  g_node_insert_after(parent:PGNode; sibling:PGNode; node:PGNode):PGNode;cdecl;external gliblib name 'g_node_insert_after';
-
-    function  g_node_prepend(parent:PGNode; node:PGNode):PGNode;cdecl;external gliblib name 'g_node_prepend';
-
-    function  g_node_n_nodes(root:PGNode; flags:TGTraverseFlags):guint;cdecl;external gliblib name 'g_node_n_nodes';
-
-    function  g_node_get_root(node:PGNode):PGNode;cdecl;external gliblib name 'g_node_get_root';
-
-    function  g_node_is_ancestor(node:PGNode; descendant:PGNode):gboolean;cdecl;external gliblib name 'g_node_is_ancestor';
-
-    function g_node_depth(node:PGNode):guint;cdecl;external gliblib name 'g_node_depth';
-
-    function g_node_find(root:PGNode; order:TGTraverseType; flags:TGTraverseFlags; data:gpointer):PGNode;cdecl;external gliblib name 'g_node_find';
-
-    { convenience macros  }
-    function  g_node_append (parent: PGNode; node: PGNode): PGNode;
-
-    function  g_node_insert_data (parent: PGNode; position: gint; data: gpointer): PGNode;
-
-    function  g_node_insert_data_before (parent: PGNode; sibling: PGNode; data: gpointer): PGNode;
-
-    function  g_node_prepend_data (parent: PGNode; data: gpointer): PGNode;
-
-    function  g_node_append_data (parent: PGNode; data: gpointer): PGNode;
-
-    { traversal function, assumes that `node' is root
-       (only traverses `node' and its subtree).
-       this function is just a high level interface to
-       low level traversal functions, optimized for speed.
-      }
-    function g_node_traverse (root      : PGNode;
-                              order     : TGTraverseType;
-                              flags     : TGTraverseFlags;
-                              max_depth : gint;
-                              func      : TGNodeTraverseFunc;
-                              data      : gpointer):guint;cdecl;external gliblib name 'g_node_traverse';
-
-     { return the maximum tree height starting with `node', this is an expensive
-       operation, since we need to visit all nodes. this could be shortened by
-       adding `guint height' to struct _GNode, but then again, this is not very
-       often needed, and would make g_node_insert() more time consuming.
-      }
-    function  g_node_max_height(root:PGNode):guint;cdecl;external gliblib name 'g_node_max_height';
-
-    procedure g_node_children_foreach(node:PGNode; flags:TGTraverseFlags; func:TGNodeForeachFunc; data:gpointer);cdecl;external gliblib name 'g_node_children_foreach';
-
-    procedure g_node_reverse_children(node:PGNode);cdecl;external gliblib name 'g_node_reverse_children';
-
-    function g_node_n_children(node:PGNode):guint;cdecl;external gliblib name 'g_node_n_children';
-
-    function g_node_nth_child(node:PGNode; n:guint):PGNode;cdecl;external gliblib name 'g_node_nth_child';
-
-    function g_node_last_child(node:PGNode):PGNode;cdecl;external gliblib name 'g_node_last_child';
-
-    function g_node_find_child(node:PGNode; flags:TGTraverseFlags; data:gpointer):PGNode;cdecl;external gliblib name 'g_node_find_child';
-
-    function g_node_child_position(node:PGNode; child:PGNode):gint;cdecl;external gliblib name 'g_node_child_position';
-
-    function g_node_child_index(node:PGNode; data:gpointer):gint;cdecl;external gliblib name 'g_node_child_index';
-
-    function g_node_first_sibling(node:PGNode):PGNode;cdecl;external gliblib name 'g_node_first_sibling';
-
-    function g_node_last_sibling(node:PGNode):PGNode;cdecl;external gliblib name 'g_node_last_sibling';
-
-    function g_node_prev_sibling (node : PGNode): PGNode;
-
-    function g_node_next_sibling (node : PGNode): PGNode;
-
-    function g_node_first_child (node : PGNode): PGNode;
-
+// included by glib2.pas
+
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_types}
+  PGNode = ^TGNode;
+  TGNode = record
+    data     : gpointer;
+    next     : PGNode;
+    prev     : PGNode;
+    parent   : PGNode;
+    children : PGNode;
+  end;
+
+  PGTraverseFlags = ^TGTraverseFlags;
+  TGTraverseFlags = gint;
+  
+  PGTraverseType = ^TGTraverseType;
+  TGTraverseType = (
+    G_IN_ORDER,
+    G_PRE_ORDER,
+    G_POST_ORDER,
+    G_LEVEL_ORDER
+  );
+
+  TGNodeTraverseFunc = function (node:PGNode; data:gpointer):gboolean;cdecl;
+  TGNodeForeachFunc = procedure (node:PGNode; data:gpointer);cdecl;
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_rest}
+const
+  G_TRAVERSE_LEAFS      = 1 shl 0;
+  G_TRAVERSE_NON_LEAFS  = 1 shl 1;
+  G_TRAVERSE_ALL        = G_TRAVERSE_LEAFS or G_TRAVERSE_NON_LEAFS;
+  G_TRAVERSE_MASK       = $03;
+
+{ N-way tree implementation }
+function G_NODE_IS_ROOT (node: PGNode): boolean;
+function G_NODE_IS_LEAF (node: PGNode): boolean;
+
+procedure g_node_push_allocator(allocator:PGAllocator);cdecl;external gliblib name 'g_node_push_allocator';
+procedure g_node_pop_allocator;cdecl;external gliblib name 'g_node_pop_allocator';
+function  g_node_new(data:gpointer):PGNode;cdecl;external gliblib name 'g_node_new';
+procedure g_node_destroy(root:PGNode);cdecl;external gliblib name 'g_node_destroy';
+procedure g_node_unlink(node:PGNode);cdecl;external gliblib name 'g_node_unlink';
+function  g_node_copy(node:PGNode):PGNode;cdecl;external gliblib name 'g_node_copy';
+function  g_node_insert(parent:PGNode; position:gint; node:PGNode):PGNode;cdecl;external gliblib name 'g_node_insert';
+function  g_node_insert_before(parent:PGNode; sibling:PGNode; node:PGNode):PGNode;cdecl;external gliblib name 'g_node_insert_before';
+function  g_node_insert_after(parent:PGNode; sibling:PGNode; node:PGNode):PGNode;cdecl;external gliblib name 'g_node_insert_after';
+function  g_node_prepend(parent:PGNode; node:PGNode):PGNode;cdecl;external gliblib name 'g_node_prepend';
+function  g_node_n_nodes(root:PGNode; flags:TGTraverseFlags):guint;cdecl;external gliblib name 'g_node_n_nodes';
+function  g_node_get_root(node:PGNode):PGNode;cdecl;external gliblib name 'g_node_get_root';
+function  g_node_is_ancestor(node:PGNode; descendant:PGNode):gboolean;cdecl;external gliblib name 'g_node_is_ancestor';
+function g_node_depth(node:PGNode):guint;cdecl;external gliblib name 'g_node_depth';
+function g_node_find(root:PGNode; order:TGTraverseType; flags:TGTraverseFlags; data:gpointer):PGNode;cdecl;external gliblib name 'g_node_find';
+
+{ convenience macros  }
+function  g_node_append (parent: PGNode; node: PGNode): PGNode;
+function  g_node_insert_data (parent: PGNode; position: gint; data: gpointer): PGNode;
+function  g_node_insert_data_before (parent: PGNode; sibling: PGNode; data: gpointer): PGNode;
+function  g_node_prepend_data (parent: PGNode; data: gpointer): PGNode;
+function  g_node_append_data (parent: PGNode; data: gpointer): PGNode;
+
+{ traversal function }
+function g_node_traverse (root      : PGNode;
+                          order     : TGTraverseType;
+                          flags     : TGTraverseFlags;
+                          max_depth : gint;
+                          func      : TGNodeTraverseFunc;
+                          data      : gpointer):guint;cdecl;external gliblib name 'g_node_traverse';
+
+function  g_node_max_height(root:PGNode):guint;cdecl;external gliblib name 'g_node_max_height';
+procedure g_node_children_foreach(node:PGNode; flags:TGTraverseFlags; func:TGNodeForeachFunc; data:gpointer);cdecl;external gliblib name 'g_node_children_foreach';
+procedure g_node_reverse_children(node:PGNode);cdecl;external gliblib name 'g_node_reverse_children';
+function g_node_n_children(node:PGNode):guint;cdecl;external gliblib name 'g_node_n_children';
+function g_node_nth_child(node:PGNode; n:guint):PGNode;cdecl;external gliblib name 'g_node_nth_child';
+function g_node_last_child(node:PGNode):PGNode;cdecl;external gliblib name 'g_node_last_child';
+function g_node_find_child(node:PGNode; flags:TGTraverseFlags; data:gpointer):PGNode;cdecl;external gliblib name 'g_node_find_child';
+function g_node_child_position(node:PGNode; child:PGNode):gint;cdecl;external gliblib name 'g_node_child_position';
+function g_node_child_index(node:PGNode; data:gpointer):gint;cdecl;external gliblib name 'g_node_child_index';
+function g_node_first_sibling(node:PGNode):PGNode;cdecl;external gliblib name 'g_node_first_sibling';
+function g_node_last_sibling(node:PGNode):PGNode;cdecl;external gliblib name 'g_node_last_sibling';
+function g_node_prev_sibling (node : PGNode): PGNode;
+function g_node_next_sibling (node : PGNode): PGNode;
+function g_node_first_child (node : PGNode): PGNode;
+{$ENDIF read_interface_rest}
+// included by glib2.pas

+ 14 - 6
packages/gtk2/src/glib/gobject.inc

@@ -1,8 +1,11 @@
 // included by glib2.pas
 
-{ --- typedefs & structures ---  }
-type
-{< private > }
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_types}
    PGObject = ^TGObject;
    TGObject = record
         g_type_instance : TGTypeInstance;
@@ -44,6 +47,13 @@ type
         value : PGValue;
      end;
 
+  G_FLAGS_TYPE = GType;
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_rest}
+
 { --- type macros ---  }
 
 function G_TYPE_IS_OBJECT(_type : GType) : boolean;
@@ -128,9 +138,7 @@ procedure G_OBJECT_WARN_INVALID_PSPEC(anObject: gpointer; pname: PGChar;
   property_id: gint; pspec: gpointer);
 procedure G_OBJECT_WARN_INVALID_PROPERTY_ID(anObject: gpointer;
   property_id: gint; pspec : gpointer);
-
-type
-  G_FLAGS_TYPE = GType;
+{$ENDIF read_interface_rest}
 
 // included by glib2.pas
 

+ 112 - 0
packages/gtk2/src/glib/goption.inc

@@ -0,0 +1,112 @@
+// included by glib2.pas
+
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_types}
+   PGOptionContext = ^TGOptionContext;
+   TGOptionContext = record 
+   end;
+
+   PGOptionGroup = ^TGOptionGroup;
+   TGOptionGroup = record
+   end;
+
+   PGOptionFlags = ^TGOptionFlags;
+   TGOptionFlags = (
+     G_OPTION_FLAG_HIDDEN = 1 shl 0,
+     G_OPTION_FLAG_IN_MAIN = 1 shl 1,
+     G_OPTION_FLAG_REVERSE = 1 shl 2,
+     G_OPTION_FLAG_NO_ARG = 1 shl 3,
+     G_OPTION_FLAG_FILENAME = 1 shl 4,
+     G_OPTION_FLAG_OPTIONAL_ARG = 1 shl 5,
+     G_OPTION_FLAG_NOALIAS = 1 shl 6
+   );
+
+   PGOptionArg = ^TGOptionArg;
+   TGOptionArg = (
+     G_OPTION_ARG_NONE,
+     G_OPTION_ARG_STRING,
+     G_OPTION_ARG_INT,
+     G_OPTION_ARG_CALLBACK,
+     G_OPTION_ARG_FILENAME,
+     G_OPTION_ARG_STRING_ARRAY,
+     G_OPTION_ARG_FILENAME_ARRAY,
+     G_OPTION_ARG_DOUBLE,
+     G_OPTION_ARG_INT64
+   );
+
+   PGOptionError = ^TGOptionError;
+   TGOptionError = (
+     G_OPTION_ERROR_UNKNOWN_OPTION,
+     G_OPTION_ERROR_BAD_VALUE,
+     G_OPTION_ERROR_FAILED
+   );
+
+   PGOptionEntry = ^TGOptionEntry;
+   TGOptionEntry = record
+        long_name : Pgchar;
+        short_name : gchar;
+        flags : gint;
+        arg : TGOptionArg;
+        arg_data : gpointer;
+        description : Pgchar;
+        arg_description : Pgchar;
+     end;
+
+   TGOptionArgFunc = function (option_name:Pgchar; value:Pgchar; data:gpointer; error:PPGError):gboolean;cdecl;
+   TGOptionParseFunc = function (context:PGOptionContext; group:PGOptionGroup; data:gpointer; error:PPGError):gboolean;cdecl;
+   TGOptionErrorFunc = procedure (context:PGOptionContext; group:PGOptionGroup; data:gpointer; error:PPGError);cdecl;
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_rest}
+const
+   G_OPTION_REMAINING = '';   
+
+function G_OPTION_ERROR : GType;
+
+function g_option_error_quark:TGQuark;cdecl;external gliblib;
+
+function g_option_context_new(parameter_string:Pgchar):PGOptionContext;cdecl;external gliblib;
+procedure g_option_context_set_summary(context:PGOptionContext; summary:Pgchar);cdecl;external gliblib;
+function g_option_context_get_summary(context:PGOptionContext):Pgchar;cdecl;external gliblib;
+procedure g_option_context_set_description(context:PGOptionContext; description:Pgchar);cdecl;external gliblib;
+function g_option_context_get_description(context:PGOptionContext):Pgchar;cdecl;external gliblib;
+procedure g_option_context_free(context:PGOptionContext);cdecl;external gliblib;
+procedure g_option_context_set_help_enabled(context:PGOptionContext; help_enabled:gboolean);cdecl;external gliblib;
+function g_option_context_get_help_enabled(context:PGOptionContext):gboolean;cdecl;external gliblib;
+procedure g_option_context_set_ignore_unknown_options(context:PGOptionContext; ignore_unknown:gboolean);cdecl;external gliblib;
+function g_option_context_get_ignore_unknown_options(context:PGOptionContext):gboolean;cdecl;external gliblib;
+procedure g_option_context_add_main_entries(context:PGOptionContext; entries:PGOptionEntry; translation_domain:Pgchar);cdecl;external gliblib;
+function g_option_context_parse(context:PGOptionContext; argc:Pgint; argv:PPPgchar; error:PPGError):gboolean;cdecl;external gliblib;
+procedure g_option_context_set_translate_func(context:PGOptionContext; func:TGTranslateFunc; data:gpointer; destroy_notify:TGDestroyNotify);cdecl;external gliblib;
+procedure g_option_context_set_translation_domain(context:PGOptionContext; domain:Pgchar);cdecl;external gliblib;
+procedure g_option_context_add_group(context:PGOptionContext; group:PGOptionGroup);cdecl;external gliblib;
+procedure g_option_context_set_main_group(context:PGOptionContext; group:PGOptionGroup);cdecl;external gliblib;
+function g_option_context_get_main_group(context:PGOptionContext):PGOptionGroup;cdecl;external gliblib;
+function g_option_context_get_help(context:PGOptionContext; main_help:gboolean; group:PGOptionGroup):Pgchar;cdecl;external gliblib;
+function g_option_group_new(name:Pgchar; description:Pgchar; help_description:Pgchar; user_data:gpointer; destroy:TGDestroyNotify):PGOptionGroup;cdecl;external gliblib;
+procedure g_option_group_set_parse_hooks(group:PGOptionGroup; pre_parse_func:TGOptionParseFunc; post_parse_func:TGOptionParseFunc);cdecl;external gliblib;
+procedure g_option_group_set_error_hook(group:PGOptionGroup; error_func:TGOptionErrorFunc);cdecl;external gliblib;
+procedure g_option_group_free(group:PGOptionGroup);cdecl;external gliblib;
+procedure g_option_group_add_entries(group:PGOptionGroup; entries:PGOptionEntry);cdecl;external gliblib;
+procedure g_option_group_set_translate_func(group:PGOptionGroup; func:TGTranslateFunc; data:gpointer; destroy_notify:TGDestroyNotify);cdecl;external gliblib;
+procedure g_option_group_set_translation_domain(group:PGOptionGroup; domain:Pgchar);cdecl;external gliblib;
+
+{$ENDIF read_interface_rest}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_implementation}
+function G_OPTION_ERROR : GType;
+begin
+  G_OPTION_ERROR:=g_option_error_quark;
+end;
+
+{$ENDIF read_implementation}
+// included by glib2.pas
+

+ 54 - 65
packages/gtk2/src/glib/gparam.inc

@@ -1,51 +1,64 @@
 // included by glib2.pas
 
 {$IFDEF read_forward_definitions}
-{ --- flags ---  }
-   PGParamFlags = ^TGParamFlags;
-   TGParamFlags = longint;
-
-{ --- typedefs & structures ---  }
-{ class using this property  }
-{< private > }
-{ sort-criteria  }
-   PGParamSpec = ^TGParamSpec;
-   PPGParamSpec = ^PGParamSpec;
-   TGParamSpec = record
-        g_type_instance : TGTypeInstance;
-        name : Pgchar;
-        flags : TGParamFlags;
-        value_type : GType;
-        owner_type : GType;
-        _nick : Pgchar;
-        _blurb : Pgchar;
-        qdata : PGData;
-        ref_count : guint;
-        param_id : guint;
-     end;
-
-{ GParam methods  }
-   PGParamSpecClass = ^TGParamSpecClass;
-   TGParamSpecClass = record
-        g_type_class : TGTypeClass;
-        value_type : GType;
-        finalize : procedure (pspec:PGParamSpec); cdecl;
-        value_set_default : procedure (pspec:PGParamSpec; value:PGValue); cdecl;
-        value_validate : function (pspec:PGParamSpec; value:PGValue):gboolean; cdecl;
-        values_cmp : function (pspec:PGParamSpec; value1:PGValue; value2:PGValue):gint; cdecl;
-        dummy : array[0..3] of gpointer;
-     end;
-
-{ auxillary structure for _setv() variants  }
-   PGParameter = ^TGParameter;
-   TGParameter = record
-        name : Pgchar;
-        value : TGValue;
-     end;
+  PGParamFlags = ^TGParamFlags;
+  TGParamFlags = longint;
+
+  PGParamSpec = ^TGParamSpec;
+  PPGParamSpec = ^PGParamSpec;
+
+  PGParamSpecClass = ^TGParamSpecClass;
+
+  PGParameter = ^TGParameter;
+
+  PGParamSpecTypeInfo = ^TGParamSpecTypeInfo;
 {$ENDIF read_forward_definitions}
 
 //------------------------------------------------------------------------------
 
+{$IFDEF read_interface_types}
+  TGParamSpec = record
+    g_type_instance : TGTypeInstance;
+    name : Pgchar;
+    flags : TGParamFlags;
+    value_type : GType;
+    owner_type : GType;
+    _nick : Pgchar;
+    _blurb : Pgchar;
+    qdata : PGData;
+    ref_count : guint;
+    param_id : guint;
+  end;
+
+  TGParamSpecClass = record
+    g_type_class : TGTypeClass;
+    value_type : GType;
+    finalize : procedure (pspec:PGParamSpec); cdecl;
+    value_set_default : procedure (pspec:PGParamSpec; value:PGValue); cdecl;
+    value_validate : function (pspec:PGParamSpec; value:PGValue):gboolean; cdecl;
+    values_cmp : function (pspec:PGParamSpec; value1:PGValue; value2:PGValue):gint; cdecl;
+    dummy : array[0..3] of gpointer;
+  end;
+
+  TGParameter = record
+    name : Pgchar;
+    value : TGValue;
+  end;
+
+  TGParamSpecTypeInfo = record
+    instance_size : guint16;
+    n_preallocs : guint16;
+    instance_init : procedure (pspec:PGParamSpec); cdecl;
+    value_type : GType;
+    finalize : procedure (pspec:PGParamSpec); cdecl;
+    value_set_default : procedure (pspec:PGParamSpec; value:PGValue); cdecl;
+    value_validate : function (pspec:PGParamSpec; value:PGValue):gboolean; cdecl;
+    values_cmp : function (pspec:PGParamSpec; value1:PGValue; value2:PGValue):gint; cdecl;
+  end;
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
+
 {$IFDEF read_interface_rest}
 
 { --- standard type macros ---  }
@@ -103,30 +116,6 @@ procedure g_value_set_param_take_ownership(value:PGValue; param:PGParamSpec); cd
 { --- convenience functions ---  }
 
 
-type
-{ type system portion  }
-{ obligatory  }
-{ optional  }
-{ optional  }
-{ class portion  }
-{ obligatory  }
-{ optional  }
-{ recommended  }
-{ optional  }
-{ recommended  }
-   PGParamSpecTypeInfo = ^TGParamSpecTypeInfo;
-   TGParamSpecTypeInfo = record
-        instance_size : guint16;
-        n_preallocs : guint16;
-        instance_init : procedure (pspec:PGParamSpec); cdecl;
-        value_type : GType;
-        finalize : procedure (pspec:PGParamSpec); cdecl;
-        value_set_default : procedure (pspec:PGParamSpec; value:PGValue); cdecl;
-        value_validate : function (pspec:PGParamSpec; value:PGValue):gboolean; cdecl;
-        values_cmp : function (pspec:PGParamSpec; value1:PGValue; value2:PGValue):gint; cdecl;
-     end;
-
-
 function g_param_type_register_static(name:Pgchar; pspec_info:PGParamSpecTypeInfo):GType; cdecl; external gliblib;
 { For registering builting types  }
 function _g_param_type_register_static_constant(name:Pgchar; pspec_info:PGParamSpecTypeInfo; opt_type:GType):GType; cdecl; external gliblib;

+ 17 - 20
packages/gtk2/src/glib/gpattern.inc

@@ -1,26 +1,23 @@
-{*
- * gpattern.inc
- *
- * depends on gtypes.inc
- *}
+// included by glib2.pas
 
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
 
+//------------------------------------------------------------------------------
 
-  type
-    PGPatternSpec = pointer;
-
-
-  function  g_pattern_spec_new(pattern:Pgchar):PGPatternSpec;cdecl;external gliblib name 'g_pattern_spec_new';
-
-  procedure g_pattern_spec_free(pspec:PGPatternSpec);cdecl;external gliblib name 'g_pattern_spec_free';
-
-  function  g_pattern_spec_equal(pspec1:PGPatternSpec; pspec2:PGPatternSpec):gboolean;cdecl;external gliblib name 'g_pattern_spec_equal';
-
-  function  g_pattern_match(pspec:PGPatternSpec; string_length:guint; _string:Pgchar; string_reversed:Pgchar):gboolean;cdecl;external gliblib name 'g_pattern_match';
-
-  function  g_pattern_match_string(pspec:PGPatternSpec; _string:Pgchar):gboolean;cdecl;external gliblib name 'g_pattern_match_string';
-
-  function  g_pattern_match_simple(pattern:Pgchar; _string:Pgchar):gboolean;cdecl;external gliblib name 'g_pattern_match_simple';
+{$IFDEF read_interface_types}
+  PGPatternSpec = pointer;
+{$ENDIF read_interface_types}
 
+//------------------------------------------------------------------------------
 
+{$IFDEF read_interface_rest}
+function  g_pattern_spec_new(pattern:Pgchar):PGPatternSpec;cdecl;external gliblib name 'g_pattern_spec_new';
+procedure g_pattern_spec_free(pspec:PGPatternSpec);cdecl;external gliblib name 'g_pattern_spec_free';
+function  g_pattern_spec_equal(pspec1:PGPatternSpec; pspec2:PGPatternSpec):gboolean;cdecl;external gliblib name 'g_pattern_spec_equal';
+function  g_pattern_match(pspec:PGPatternSpec; string_length:guint; _string:Pgchar; string_reversed:Pgchar):gboolean;cdecl;external gliblib name 'g_pattern_match';
+function  g_pattern_match_string(pspec:PGPatternSpec; _string:Pgchar):gboolean;cdecl;external gliblib name 'g_pattern_match_string';
+function  g_pattern_match_simple(pattern:Pgchar; _string:Pgchar):gboolean;cdecl;external gliblib name 'g_pattern_match_simple';
+{$ENDIF read_interface_rest}
+// included by glib2.pas
 

+ 18 - 16
packages/gtk2/src/glib/gprimes.inc

@@ -1,19 +1,21 @@
-{*
- * gprimes.inc
- *
- * depends on gtypes.h
- *}
-
-  { Prime numbers.}
-
-  { This function returns prime numbers spaced by approximately 1.5-2.0
-     and is for use in resizing data structures which prefer
-     prime-valued sizes.        The closest spaced prime function returns the
-     next largest prime, or the highest it knows about which is about
-     MAXINT/4.
-    }
-
-  function g_spaced_primes_closest(num:guint):guint;cdecl;external gliblib name 'g_spaced_primes_closest';
+// included by glib2.pas
+
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_types}
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_rest}
+function g_spaced_primes_closest(num:guint):guint;cdecl;external gliblib name 'g_spaced_primes_closest';
+{$ENDIF read_interface_rest}
+// included by glib2.pas
+
+
 
 
 

+ 22 - 12
packages/gtk2/src/glib/gqsort.inc

@@ -1,15 +1,25 @@
-{*
- * gqsort.inc
- *
- * depends on gtypes.inc
- *}
-
-
-  procedure g_qsort_with_data (pbase        : gconstpointer;
-                               total_elems  : gint;
-                               size         : gsize;
-                               compare_func : TGCompareDataFunc;
-                               user_data    : gpointer);cdecl;external gliblib name 'g_qsort_with_data';
+// included by glib2.pas
+
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_types}
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_rest}
+procedure g_qsort_with_data (pbase        : gconstpointer;
+                             total_elems  : gint;
+                             size         : gsize;
+                             compare_func : TGCompareDataFunc;
+                             user_data    : gpointer);cdecl;external gliblib name 'g_qsort_with_data';
+{$ENDIF read_interface_rest}
+// included by glib2.pas
+
+
 
 
 

+ 36 - 44
packages/gtk2/src/glib/gqueue.inc

@@ -1,44 +1,36 @@
-{*
- * gqueue.inc
- *
- * depends on glist.inc
- *}
-
-  type
-     PGQueue = ^TGQueue;
-     TGQueue = record
-          head   : PGList;
-          tail   : PGList;
-          length : guint;
-       end;
-
-  { Queues }
-
-  function  g_queue_new:PGQueue;cdecl;external gliblib name 'g_queue_new';
-
-  procedure g_queue_free(queue:PGQueue);cdecl;external gliblib name 'g_queue_free';
-
-  procedure g_queue_push_head(queue:PGQueue; data:gpointer);cdecl;external gliblib name 'g_queue_push_head';
-
-  procedure g_queue_push_tail(queue:PGQueue; data:gpointer);cdecl;external gliblib name 'g_queue_push_tail';
-
-  function  g_queue_pop_head(queue:PGQueue):gpointer;cdecl;external gliblib name 'g_queue_pop_head';
-
-  function  g_queue_pop_tail(queue:PGQueue):gpointer;cdecl;external gliblib name 'g_queue_pop_tail';
-
-  function  g_queue_is_empty(queue:PGQueue):gboolean;cdecl;external gliblib name 'g_queue_is_empty';
-
-  function  g_queue_peek_head(queue:PGQueue):gpointer;cdecl;external gliblib name 'g_queue_peek_head';
-
-  function  g_queue_peek_tail(queue:PGQueue):gpointer;cdecl;external gliblib name 'g_queue_peek_tail';
-
-  procedure g_queue_push_head_link(queue:PGQueue; link:PGList);cdecl;external gliblib name 'g_queue_push_head_link';
-
-  procedure g_queue_push_tail_link(queue:PGQueue; link:PGList);cdecl;external gliblib name 'g_queue_push_tail_link';
-
-  function  g_queue_pop_head_link(queue:PGQueue):PGList;cdecl;external gliblib name 'g_queue_pop_head_link';
-
-  function  g_queue_pop_tail_link(queue:PGQueue):PGList;cdecl;external gliblib name 'g_queue_pop_tail_link';
-
-
-
+// included by glib2.pas
+
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_types}
+  PGQueue = ^TGQueue;
+  TGQueue = record
+    head   : PGList;
+    tail   : PGList;
+    length : guint;
+  end;
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_rest}
+{ Queues }
+
+function  g_queue_new:PGQueue;cdecl;external gliblib name 'g_queue_new';
+procedure g_queue_free(queue:PGQueue);cdecl;external gliblib name 'g_queue_free';
+procedure g_queue_push_head(queue:PGQueue; data:gpointer);cdecl;external gliblib name 'g_queue_push_head';
+procedure g_queue_push_tail(queue:PGQueue; data:gpointer);cdecl;external gliblib name 'g_queue_push_tail';
+function  g_queue_pop_head(queue:PGQueue):gpointer;cdecl;external gliblib name 'g_queue_pop_head';
+function  g_queue_pop_tail(queue:PGQueue):gpointer;cdecl;external gliblib name 'g_queue_pop_tail';
+function  g_queue_is_empty(queue:PGQueue):gboolean;cdecl;external gliblib name 'g_queue_is_empty';
+function  g_queue_peek_head(queue:PGQueue):gpointer;cdecl;external gliblib name 'g_queue_peek_head';
+function  g_queue_peek_tail(queue:PGQueue):gpointer;cdecl;external gliblib name 'g_queue_peek_tail';
+procedure g_queue_push_head_link(queue:PGQueue; link:PGList);cdecl;external gliblib name 'g_queue_push_head_link';
+procedure g_queue_push_tail_link(queue:PGQueue; link:PGList);cdecl;external gliblib name 'g_queue_push_tail_link';
+function  g_queue_pop_head_link(queue:PGQueue):PGList;cdecl;external gliblib name 'g_queue_pop_head_link';
+function  g_queue_pop_tail_link(queue:PGQueue):PGList;cdecl;external gliblib name 'g_queue_pop_tail_link';
+{$ENDIF read_interface_rest}
+// included by glib2.pas

+ 31 - 50
packages/gtk2/src/glib/grand.inc

@@ -1,50 +1,31 @@
-{*
- * grand.inc
- *
- * depends on gtypes.inc
- *}
-
-
-
-  type
-    PGRand = pointer;   // check please
-
-  { GRand - a good and fast random number generator: Mersenne Twister
-     see http://www.math.keio.ac.jp/~matumoto/emt.html for more info.
-     The range functions return a value in the intervall [begin, end).
-     int          -> [0..2^32-1]
-     int_range    -> [begin..end-1]
-     double       -> [0..1)
-     double_range -> [begin..end)
-    }
-
-  function  g_rand_new_with_seed(seed:guint32):PGRand;cdecl;external gliblib name 'g_rand_new_with_seed';
-
-  function  g_rand_new:PGRand;cdecl;external gliblib name 'g_rand_new';
-
-  procedure g_rand_free(rand:PGRand);cdecl;external gliblib name 'g_rand_free';
-
-  procedure g_rand_set_seed(rand:PGRand; seed:guint32);cdecl;external gliblib name 'g_rand_set_seed';
-
-  function  g_rand_boolean(rand : PGRand) : gboolean;
-
-  function  g_rand_int(rand:PGRand):guint32;cdecl;external gliblib name 'g_rand_int';
-
-  function  g_rand_int_range(rand:PGRand; _begin:gint32; _end:gint32):gint32;cdecl;external gliblib name 'g_rand_int_range';
-
-  function  g_rand_double(rand:PGRand):gdouble;cdecl;external gliblib name 'g_rand_double';
-
-  function  g_rand_double_range(rand:PGRand; _begin:gdouble; _end:gdouble):gdouble;cdecl;external gliblib name 'g_rand_double_range';
-
-  procedure g_random_set_seed(seed:guint32);cdecl;external gliblib name 'g_random_set_seed';
-
-  function g_random_boolean : gboolean;
-
-  function g_random_int:guint32;cdecl;external gliblib name 'g_random_int';
-
-  function g_random_int_range(_begin:gint32; _end:gint32):gint32;cdecl;external gliblib name 'g_random_int_range';
-
-  function g_random_double:gdouble;cdecl;external gliblib name 'g_random_double';
-
-  function g_random_double_range(_begin:gdouble; _end:gdouble):gdouble;cdecl;external gliblib name 'g_random_double_range';
-
+// included by glib2.pas
+
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_types}
+  PGRand = pointer;   // check please
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_rest}
+function  g_rand_new_with_seed(seed:guint32):PGRand;cdecl;external gliblib name 'g_rand_new_with_seed';
+function  g_rand_new:PGRand;cdecl;external gliblib name 'g_rand_new';
+procedure g_rand_free(rand:PGRand);cdecl;external gliblib name 'g_rand_free';
+procedure g_rand_set_seed(rand:PGRand; seed:guint32);cdecl;external gliblib name 'g_rand_set_seed';
+function  g_rand_boolean(rand : PGRand) : gboolean;
+function  g_rand_int(rand:PGRand):guint32;cdecl;external gliblib name 'g_rand_int';
+function  g_rand_int_range(rand:PGRand; _begin:gint32; _end:gint32):gint32;cdecl;external gliblib name 'g_rand_int_range';
+function  g_rand_double(rand:PGRand):gdouble;cdecl;external gliblib name 'g_rand_double';
+function  g_rand_double_range(rand:PGRand; _begin:gdouble; _end:gdouble):gdouble;cdecl;external gliblib name 'g_rand_double_range';
+procedure g_random_set_seed(seed:guint32);cdecl;external gliblib name 'g_random_set_seed';
+function g_random_boolean : gboolean;
+function g_random_int:guint32;cdecl;external gliblib name 'g_random_int';
+function g_random_int_range(_begin:gint32; _end:gint32):gint32;cdecl;external gliblib name 'g_random_int_range';
+function g_random_double:gdouble;cdecl;external gliblib name 'g_random_double';
+function g_random_double_range(_begin:gdouble; _end:gdouble):gdouble;cdecl;external gliblib name 'g_random_double_range';
+{$ENDIF read_interface_rest}
+// included by glib2.pas

+ 30 - 56
packages/gtk2/src/glib/grel.inc

@@ -1,69 +1,43 @@
-{*
- * grel.inc
- *
- * depends on gtypes.inc
- *}
+// included by glib2.pas
 
-  type
-     PGTuples = ^TGTuples;
-     TGTuples = record
-          len : guint;
-       end;
-     PGRelation  = pointer;
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
 
-  { GRelation
+//------------------------------------------------------------------------------
 
-     Indexed Relations.  Imagine a really simple table in a
-     database.  Relations are not ordered.  This data type is meant for
-     maintaining a N-way mapping.
+{$IFDEF read_interface_types}
+  PGTuples = ^TGTuples;
+  TGTuples = record
+    len : guint;
+  end;
+  PGRelation  = pointer;
+{$ENDIF read_interface_types}
 
-     g_relation_new() creates a relation with FIELDS fields
-
-     g_relation_destroy() frees all resources
-     g_tuples_destroy() frees the result of g_relation_select()
-
-     g_relation_index() indexes relation FIELD with the provided
-       equality and hash functions.  this must be done before any
-       calls to insert are made.
-
-     g_relation_insert() inserts a new tuple.  you are expected to
-       provide the right number of fields.
-
-     g_relation_delete() deletes all relations with KEY in FIELD
-     g_relation_select() returns ...
-     g_relation_count() counts ...
-    }
-
-  function g_relation_new(fields:gint):PGRelation;cdecl;external gliblib name 'g_relation_new';
-
-  procedure g_relation_destroy(relation:PGRelation);cdecl;external gliblib name 'g_relation_destroy';
-
-  procedure g_relation_index(relation:PGRelation; field:gint; hash_func:TGHashFunc; key_equal_func:TGEqualFunc);cdecl;external gliblib name 'g_relation_index';
+//------------------------------------------------------------------------------
 
+{$IFDEF read_interface_rest}
+function g_relation_new(fields:gint):PGRelation;cdecl;external gliblib name 'g_relation_new';
+procedure g_relation_destroy(relation:PGRelation);cdecl;external gliblib name 'g_relation_destroy';
+procedure g_relation_index(relation:PGRelation; field:gint; hash_func:TGHashFunc; key_equal_func:TGEqualFunc);cdecl;external gliblib name 'g_relation_index';
 {$IFNDEF KYLIX}
-  procedure g_relation_insert(relation:PGRelation; args:array of const);cdecl;overload;external gliblib name 'g_relation_insert';
-  procedure g_relation_insert(relation:PGRelation);cdecl;overload;varargs;external gliblib name 'g_relation_insert';
+procedure g_relation_insert(relation:PGRelation; args:array of const);cdecl;overload;external gliblib name 'g_relation_insert';
+procedure g_relation_insert(relation:PGRelation);cdecl;overload;varargs;external gliblib name 'g_relation_insert';
 {$ELSE}
-  procedure g_relation_insert(relation:PGRelation);varargs;cdecl;external gliblib name 'g_relation_insert';
+procedure g_relation_insert(relation:PGRelation);varargs;cdecl;external gliblib name 'g_relation_insert';
 {$ENDIF}
-
-  function g_relation_delete(relation:PGRelation; key:gconstpointer; field:gint):gint;cdecl;external gliblib name 'g_relation_delete';
-
-  function g_relation_select(relation:PGRelation; key:gconstpointer; field:gint):PGTuples;cdecl;external gliblib name 'g_relation_select';
-
-  function g_relation_count(relation:PGRelation; key:gconstpointer; field:gint):gint;cdecl;external gliblib name 'g_relation_count';
-
+function g_relation_delete(relation:PGRelation; key:gconstpointer; field:gint):gint;cdecl;external gliblib name 'g_relation_delete';
+function g_relation_select(relation:PGRelation; key:gconstpointer; field:gint):PGTuples;cdecl;external gliblib name 'g_relation_select';
+function g_relation_count(relation:PGRelation; key:gconstpointer; field:gint):gint;cdecl;external gliblib name 'g_relation_count';
 {$IFNDEF KYLIX}
-  function g_relation_exists(relation:PGRelation; args:array of const):gboolean;cdecl;overload;external gliblib name 'g_relation_exists';
-  function g_relation_exists(relation:PGRelation):gboolean;cdecl;overload;varargs;external gliblib name 'g_relation_exists';
+function g_relation_exists(relation:PGRelation; args:array of const):gboolean;cdecl;overload;external gliblib name 'g_relation_exists';
+function g_relation_exists(relation:PGRelation):gboolean;cdecl;overload;varargs;external gliblib name 'g_relation_exists';
 {$ELSE}
-  function g_relation_exists(relation:PGRelation):gboolean;varargs;cdecl;external gliblib name 'g_relation_exists';
+function g_relation_exists(relation:PGRelation):gboolean;varargs;cdecl;external gliblib name 'g_relation_exists';
 {$ENDIF}
-
-  procedure g_relation_print(relation:PGRelation);cdecl;external gliblib name 'g_relation_print';
-
-  procedure g_tuples_destroy(tuples:PGTuples);cdecl;external gliblib name 'g_tuples_destroy';
-
-  function g_tuples_index(tuples:PGTuples; index:gint; field:gint):gpointer;cdecl;external gliblib name 'g_tuples_index';
+procedure g_relation_print(relation:PGRelation);cdecl;external gliblib name 'g_relation_print';
+procedure g_tuples_destroy(tuples:PGTuples);cdecl;external gliblib name 'g_tuples_destroy';
+function g_tuples_index(tuples:PGTuples; index:gint; field:gint):gpointer;cdecl;external gliblib name 'g_tuples_index';
+{$ENDIF read_interface_rest}
+// included by glib2.pas
 
 

+ 262 - 299
packages/gtk2/src/glib/gscanner.inc

@@ -1,118 +1,115 @@
-{*
- * gscanner.inc
- *
- * depends on ghash.inc
- *}
-
-
-  { GScanner: Flexible lexical scanner for general purpose.}
-
-  type
-
-     PGTokenType = ^TGTokenType;
-     TGTokenType = gint;
-
-   const
-     G_TOKEN_LEFT_PAREN          = 40;  // ASCII Code of '('
-     G_TOKEN_RIGHT_PAREN         = 41;  // ASCII Code of ')'
-     G_TOKEN_LEFT_CURLY          = 123; // ASCII Code of '{'
-     G_TOKEN_RIGHT_CURLY         = 125; // ASCII Code of '}'
-     G_TOKEN_LEFT_BRACE          = 91;  // ASCII Code of '['
-     G_TOKEN_RIGHT_BRACE         = 93;  // ASCII Code of ']'
-     G_TOKEN_EQUAL_SIGN          = 61;  // ASCII Code of '='
-     G_TOKEN_COMMA               = 44;  // ASCII Code of ','
-     G_TOKEN_NONE                = 256;
-     G_TOKEN_ERROR               = 257;
-     G_TOKEN_CHAR                = 258;
-     G_TOKEN_OCTAL               = 260;
-     G_TOKEN_INT                 = 261;
-     G_TOKEN_HEX                 = 262;
-     G_TOKEN_FLOAT               = 263;
-     G_TOKEN_STRING              = 264;
-     G_TOKEN_SYMBOL              = 265;
-     G_TOKEN_IDENTIFIER          = 266;
-     G_TOKEN_IDENTIFIER_NULL     = 267;
-     G_TOKEN_COMMENT_SINGLE      = 268;
-     G_TOKEN_COMMENT_MULTI       = 269;
-     G_TOKEN_LAST                = 270;
-
-   type
-     PGScanner = ^TGScanner;
-     PGScannerConfig = ^TGScannerConfig;
-
-     PGTokenValue = ^TGTokenValue;
-     TGTokenValue = record
-         case longint of
-            0 : ( v_symbol : gpointer );
-            1 : ( v_identifier : Pgchar );
-            2 : ( v_binary  : gulong );
-            3 : ( v_octal   : gulong );
-            4 : ( v_int     : gulong );
-            5 : ( v_float   : gdouble );
-            6 : ( v_hex     : gulong );
-            7 : ( v_string  : Pgchar );
-            8 : ( v_comment : Pgchar );
-            9 : ( v_char    : guchar );
-            10 : ( v_error  : guint );
-         end;
-
-     TGScannerMsgFunc = procedure (scanner:PGScanner; message:Pgchar; error:gboolean);cdecl;
-
-     TGScanner = record
-          user_data         : gpointer;          { unused fields  }
-          max_parse_errors  : guint;
-
-          parse_errors      : guint;             { g_scanner_error() increments this field  }
-
-          input_name        : Pgchar;            { name of input stream, featured by
-                                                   the default message handler  }
-
-          qdata             : PGData;            { quarked data  }
-
-          config            : PGScannerConfig;   { link into the scanner configuration  }
-
-          token             : TGTokenType;       { fields filled in after g_scanner_get_next_token()  }
-          value             : TGTokenValue;
-          line              : guint;
-          position          : guint;
-
-          next_token        : TGTokenType;       { fields filled in after g_scanner_peek_next_token()  }
-          next_value        : TGTokenValue;
-          next_line         : guint;
-          next_position     : guint;
-
-          symbol_table      : PGHashTable;       { to be considered private  }
-          input_fd          : gint;
-          text              : Pgchar;
-          text_end          : Pgchar;
-          buffer            : Pgchar;
-          scope_id          : guint;
-
-          msg_handler       : TGScannerMsgFunc;  { handler function for _warn and _error  }
-       end;
-
-       TGScannerConfig = record
-           { Character sets  }
-            cset_skip_characters   : Pgchar;        { default: " \t\n"  }
-
-            cset_identifier_first  : Pgchar;
-            cset_identifier_nth    : Pgchar;
-            cpair_comment_single   : Pgchar;        { default: "#\n"  }
-
-            flag0                  : longint;    { Boolean values to be adjusted "on the fly"
-                                                   to configure scanning behaviour. }
-            padding_dummy          : guint;
-         end;
-
-
-
-
-  { Character sets  }
-
-  const
-     G_CSET_A_2_Z_UCASE  = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';        // NOTE: renamed
-     G_CSET_a_2_z_lcase  = 'abcdefghijklmnopqrstuvwxyz';        //  dito
-     G_CSET_DIGITS = '0123456789';
+// included by glib2.pas
+
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_types}
+  PGTokenType = ^TGTokenType;
+  TGTokenType = gint;
+
+  PGScanner = ^TGScanner;
+  PGScannerConfig = ^TGScannerConfig;
+
+  PGTokenValue = ^TGTokenValue;
+  TGTokenValue = record
+    case longint of
+       0 : ( v_symbol : gpointer );
+       1 : ( v_identifier : Pgchar );
+       2 : ( v_binary  : gulong );
+       3 : ( v_octal   : gulong );
+       4 : ( v_int     : gulong );
+       5 : ( v_float   : gdouble );
+       6 : ( v_hex     : gulong );
+       7 : ( v_string  : Pgchar );
+       8 : ( v_comment : Pgchar );
+       9 : ( v_char    : guchar );
+       10 : ( v_error  : guint );
+    end;
+
+  TGScannerMsgFunc = procedure (scanner:PGScanner; message:Pgchar; error:gboolean);cdecl;
+
+  TGScanner = record
+    user_data         : gpointer;          { unused fields  }
+    max_parse_errors  : guint;
+
+    parse_errors      : guint;             { g_scanner_error() increments this field  }
+
+    input_name        : Pgchar;            { name of input stream, featured by
+                                             the default message handler  }
+
+    qdata             : PGData;            { quarked data  }
+
+    config            : PGScannerConfig;   { link into the scanner configuration  }
+
+    token             : TGTokenType;       { fields filled in after g_scanner_get_next_token()  }
+    value             : TGTokenValue;
+    line              : guint;
+    position          : guint;
+
+    next_token        : TGTokenType;       { fields filled in after g_scanner_peek_next_token()  }
+    next_value        : TGTokenValue;
+    next_line         : guint;
+    next_position     : guint;
+
+    symbol_table      : PGHashTable;       { to be considered private  }
+    input_fd          : gint;
+    text              : Pgchar;
+    text_end          : Pgchar;
+    buffer            : Pgchar;
+    scope_id          : guint;
+
+    msg_handler       : TGScannerMsgFunc;  { handler function for _warn and _error  }
+  end;
+
+  TGScannerConfig = record
+   { Character sets  }
+    cset_skip_characters   : Pgchar;        { default: " \t\n"  }
+
+    cset_identifier_first  : Pgchar;
+    cset_identifier_nth    : Pgchar;
+    cpair_comment_single   : Pgchar;        { default: "#\n"  }
+
+    flag0                  : longint;    { Boolean values to be adjusted "on the fly"
+                                           to configure scanning behaviour. }
+    padding_dummy          : guint;
+  end;
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_rest}
+const
+  G_TOKEN_LEFT_PAREN          = 40;  // ASCII Code of '('
+  G_TOKEN_RIGHT_PAREN         = 41;  // ASCII Code of ')'
+  G_TOKEN_LEFT_CURLY          = 123; // ASCII Code of '{'
+  G_TOKEN_RIGHT_CURLY         = 125; // ASCII Code of '}'
+  G_TOKEN_LEFT_BRACE          = 91;  // ASCII Code of '['
+  G_TOKEN_RIGHT_BRACE         = 93;  // ASCII Code of ']'
+  G_TOKEN_EQUAL_SIGN          = 61;  // ASCII Code of '='
+  G_TOKEN_COMMA               = 44;  // ASCII Code of ','
+  G_TOKEN_NONE                = 256;
+  G_TOKEN_ERROR               = 257;
+  G_TOKEN_CHAR                = 258;
+  G_TOKEN_OCTAL               = 260;
+  G_TOKEN_INT                 = 261;
+  G_TOKEN_HEX                 = 262;
+  G_TOKEN_FLOAT               = 263;
+  G_TOKEN_STRING              = 264;
+  G_TOKEN_SYMBOL              = 265;
+  G_TOKEN_IDENTIFIER          = 266;
+  G_TOKEN_IDENTIFIER_NULL     = 267;
+  G_TOKEN_COMMENT_SINGLE      = 268;
+  G_TOKEN_COMMENT_MULTI       = 269;
+  G_TOKEN_LAST                = 270;
+
+{ Character sets  }
+
+const
+  G_CSET_A_2_Z_UCASE  = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';        // NOTE: renamed
+  G_CSET_a_2_z_lcase  = 'abcdefghijklmnopqrstuvwxyz';        //  dito
+  G_CSET_DIGITS = '0123456789';
 {
 
   How to express an escape sequenced string in pascal???
@@ -137,198 +134,164 @@
 
 }
 
-
-    const
-       bm_TGScannerConfig_case_sensitive = $1;
-       bp_TGScannerConfig_case_sensitive = 0;
-       bm_TGScannerConfig_skip_comment_multi = $2;
-       bp_TGScannerConfig_skip_comment_multi = 1;
-       bm_TGScannerConfig_skip_comment_single = $4;
-       bp_TGScannerConfig_skip_comment_single = 2;
-       bm_TGScannerConfig_scan_comment_multi = $8;
-       bp_TGScannerConfig_scan_comment_multi = 3;
-       bm_TGScannerConfig_scan_identifier = $10;
-       bp_TGScannerConfig_scan_identifier = 4;
-       bm_TGScannerConfig_scan_identifier_1char = $20;
-       bp_TGScannerConfig_scan_identifier_1char = 5;
-       bm_TGScannerConfig_scan_identifier_NULL = $40;
-       bp_TGScannerConfig_scan_identifier_NULL = 6;
-       bm_TGScannerConfig_scan_symbols = $80;
-       bp_TGScannerConfig_scan_symbols = 7;
-       bm_TGScannerConfig_scan_binary = $100;
-       bp_TGScannerConfig_scan_binary = 8;
-       bm_TGScannerConfig_scan_octal = $200;
-       bp_TGScannerConfig_scan_octal = 9;
-       bm_TGScannerConfig_scan_float = $400;
-       bp_TGScannerConfig_scan_float = 10;
-       bm_TGScannerConfig_scan_hex = $800;
-       bp_TGScannerConfig_scan_hex = 11;
-       bm_TGScannerConfig_scan_hex_dollar = $1000;
-       bp_TGScannerConfig_scan_hex_dollar = 12;
-       bm_TGScannerConfig_scan_string_sq = $2000;
-       bp_TGScannerConfig_scan_string_sq = 13;
-       bm_TGScannerConfig_scan_string_dq = $4000;
-       bp_TGScannerConfig_scan_string_dq = 14;
-       bm_TGScannerConfig_numbers_2_int = $8000;
-       bp_TGScannerConfig_numbers_2_int = 15;
-       bm_TGScannerConfig_int_2_float = $10000;
-       bp_TGScannerConfig_int_2_float = 16;
-       bm_TGScannerConfig_identifier_2_string = $20000;
-       bp_TGScannerConfig_identifier_2_string = 17;
-       bm_TGScannerConfig_char_2_token = $40000;
-       bp_TGScannerConfig_char_2_token = 18;
-       bm_TGScannerConfig_symbol_2_token = $80000;
-       bp_TGScannerConfig_symbol_2_token = 19;
-       bm_TGScannerConfig_scope_0_fallback = $100000;
-       bp_TGScannerConfig_scope_0_fallback = 20;
-
-    { Should symbol lookup work case sensitive?  }
-    function TGScannerConfig_case_sensitive(var a : TGScannerConfig) : guint;
-    procedure TGScannerConfig_set_case_sensitive(var a : TGScannerConfig; __case_sensitive : guint);
-
-    { C-like comment  }
-    function TGScannerConfig_skip_comment_multi(var a : TGScannerConfig) : guint;
-    procedure TGScannerConfig_set_skip_comment_multi(var a : TGScannerConfig; __skip_comment_multi : guint);
-
-    { single line comment  }
-    function TGScannerConfig_skip_comment_single(var a : TGScannerConfig) : guint;
-    procedure TGScannerConfig_set_skip_comment_single(var a : TGScannerConfig; __skip_comment_single : guint);
-
-    { scan multi line comments?  }
-    function TGScannerConfig_scan_comment_multi(var a : TGScannerConfig) : guint;
-    procedure TGScannerConfig_set_scan_comment_multi(var a : TGScannerConfig; __scan_comment_multi : guint);
-
-    function TGScannerConfig_scan_identifier(var a : TGScannerConfig) : guint;
-    procedure TGScannerConfig_set_scan_identifier(var a : TGScannerConfig; __scan_identifier : guint);
-
-    function TGScannerConfig_scan_identifier_1char(var a : TGScannerConfig) : guint;
-    procedure TGScannerConfig_set_scan_identifier_1char(var a : TGScannerConfig; __scan_identifier_1char : guint);
-
-    function TGScannerConfig_scan_identifier_NULL(var a : TGScannerConfig) : guint;
-    procedure TGScannerConfig_set_scan_identifier_NULL(var a : TGScannerConfig; __scan_identifier_NULL : guint);
-
-    function TGScannerConfig_scan_symbols(var a : TGScannerConfig) : guint;
-    procedure TGScannerConfig_set_scan_symbols(var a : TGScannerConfig; __scan_symbols : guint);
-
-    function TGScannerConfig_scan_binary(var a : TGScannerConfig) : guint;
-    procedure TGScannerConfig_set_scan_binary(var a : TGScannerConfig; __scan_binary : guint);
-
-    function TGScannerConfig_scan_octal(var a : TGScannerConfig) : guint;
-    procedure TGScannerConfig_set_scan_octal(var a : TGScannerConfig; __scan_octal : guint);
-
-    function TGScannerConfig_scan_float(var a : TGScannerConfig) : guint;
-    procedure TGScannerConfig_set_scan_float(var a : TGScannerConfig; __scan_float : guint);
-
-    { `0x0ff0'  }
-    function TGScannerConfig_scan_hex(var a : TGScannerConfig) : guint;
-    procedure TGScannerConfig_set_scan_hex(var a : TGScannerConfig; __scan_hex : guint);
-
-    { `$0ff0'  }
-    function TGScannerConfig_scan_hex_dollar(var a : TGScannerConfig) : guint;
-    procedure TGScannerConfig_set_scan_hex_dollar(var a : TGScannerConfig; __scan_hex_dollar : guint);
-
-    { string: 'anything'  }
-    function TGScannerConfig_scan_string_sq(var a : TGScannerConfig) : guint;
-    procedure TGScannerConfig_set_scan_string_sq(var a : TGScannerConfig; __scan_string_sq : guint);
-
-    { string: "\\-escapes!\n"  }
-    function TGScannerConfig_scan_string_dq(var a : TGScannerConfig) : guint;
-    procedure TGScannerConfig_set_scan_string_dq(var a : TGScannerConfig; __scan_string_dq : guint);
-
-    { bin, octal, hex => int  }
-    function TGScannerConfig_numbers_2_int(var a : TGScannerConfig) : guint;
-    procedure TGScannerConfig_set_numbers_2_int(var a : TGScannerConfig; __numbers_2_int : guint);
-
-    { int => G_TOKEN_FLOAT?  }
-    function TGScannerConfig_int_2_float(var a : TGScannerConfig) : guint;
-    procedure TGScannerConfig_set_int_2_float(var a : TGScannerConfig; __int_2_float : guint);
-
-    function TGScannerConfig_identifier_2_string(var a : TGScannerConfig) : guint;
-    procedure TGScannerConfig_set_identifier_2_string(var a : TGScannerConfig; __identifier_2_string : guint);
-
-    { return G_TOKEN_CHAR?  }
-    function TGScannerConfig_char_2_token(var a : TGScannerConfig) : guint;
-    procedure TGScannerConfig_set_char_2_token(var a : TGScannerConfig; __char_2_token : guint);
-
-    function TGScannerConfig_symbol_2_token(var a : TGScannerConfig) : guint;
-    procedure TGScannerConfig_set_symbol_2_token(var a : TGScannerConfig; __symbol_2_token : guint);
-
-    { try scope 0 on lookups?  }
-    function TGScannerConfig_scope_0_fallback(var a : TGScannerConfig) : guint;
-    procedure TGScannerConfig_set_scope_0_fallback(var a : TGScannerConfig; __scope_0_fallback : guint);
-
-
-    function  g_scanner_new(config_templ:PGScannerConfig):PGScanner;cdecl;external gliblib name 'g_scanner_new';
-
-    procedure g_scanner_destroy(scanner:PGScanner);cdecl;external gliblib name 'g_scanner_destroy';
-
-    procedure g_scanner_input_file(scanner:PGScanner; input_fd:gint);cdecl;external gliblib name 'g_scanner_input_file';
-
-    procedure g_scanner_sync_file_offset(scanner:PGScanner);cdecl;external gliblib name 'g_scanner_sync_file_offset';
-
-    procedure g_scanner_input_text(scanner:PGScanner; text:Pgchar; text_len:guint);cdecl;external gliblib name 'g_scanner_input_text';
-
-    function  g_scanner_get_next_token(scanner:PGScanner):TGTokenType;cdecl;external gliblib name 'g_scanner_get_next_token';
-
-    function  g_scanner_peek_next_token(scanner:PGScanner):TGTokenType;cdecl;external gliblib name 'g_scanner_peek_next_token';
-
-    function  g_scanner_cur_token(scanner:PGScanner):TGTokenType;cdecl;external gliblib name 'g_scanner_cur_token';
-
-    function  g_scanner_cur_value(scanner:PGScanner):TGTokenValue;cdecl;external gliblib name 'g_scanner_cur_value';
-
-    function  g_scanner_cur_line(scanner:PGScanner):guint;cdecl;external gliblib name 'g_scanner_cur_line';
-
-    function  g_scanner_cur_position(scanner:PGScanner):guint;cdecl;external gliblib name 'g_scanner_cur_position';
-
-    function  g_scanner_eof(scanner:PGScanner):gboolean;cdecl;external gliblib name 'g_scanner_eof';
-
-    function  g_scanner_set_scope(scanner:PGScanner; scope_id:guint):guint;cdecl;external gliblib name 'g_scanner_set_scope';
-
-    procedure g_scanner_scope_add_symbol(scanner:PGScanner; scope_id:guint; symbol:Pgchar; value:gpointer);cdecl;external gliblib name 'g_scanner_scope_add_symbol';
-
-    procedure g_scanner_scope_remove_symbol(scanner:PGScanner; scope_id:guint; symbol:Pgchar);cdecl;external gliblib name 'g_scanner_scope_remove_symbol';
-
-    function  g_scanner_scope_lookup_symbol(scanner:PGScanner; scope_id:guint; symbol:Pgchar):gpointer;cdecl;external gliblib name 'g_scanner_scope_lookup_symbol';
-
-    procedure g_scanner_scope_foreach_symbol(scanner:PGScanner; scope_id:guint; func:TGHFunc; user_data:gpointer);cdecl;external gliblib name 'g_scanner_scope_foreach_symbol';
-
-    function g_scanner_lookup_symbol(scanner:PGScanner; symbol:Pgchar):gpointer;cdecl;external gliblib name 'g_scanner_lookup_symbol';
-
-    procedure g_scanner_unexp_token(scanner:PGScanner; expected_token:TGTokenType; identifier_spec:Pgchar; symbol_spec:Pgchar; symbol_name:Pgchar;
-                _message:Pgchar; is_error:gint);cdecl;external gliblib name 'g_scanner_unexp_token';
+const
+  bm_TGScannerConfig_case_sensitive = $1;
+  bp_TGScannerConfig_case_sensitive = 0;
+  bm_TGScannerConfig_skip_comment_multi = $2;
+  bp_TGScannerConfig_skip_comment_multi = 1;
+  bm_TGScannerConfig_skip_comment_single = $4;
+  bp_TGScannerConfig_skip_comment_single = 2;
+  bm_TGScannerConfig_scan_comment_multi = $8;
+  bp_TGScannerConfig_scan_comment_multi = 3;
+  bm_TGScannerConfig_scan_identifier = $10;
+  bp_TGScannerConfig_scan_identifier = 4;
+  bm_TGScannerConfig_scan_identifier_1char = $20;
+  bp_TGScannerConfig_scan_identifier_1char = 5;
+  bm_TGScannerConfig_scan_identifier_NULL = $40;
+  bp_TGScannerConfig_scan_identifier_NULL = 6;
+  bm_TGScannerConfig_scan_symbols = $80;
+  bp_TGScannerConfig_scan_symbols = 7;
+  bm_TGScannerConfig_scan_binary = $100;
+  bp_TGScannerConfig_scan_binary = 8;
+  bm_TGScannerConfig_scan_octal = $200;
+  bp_TGScannerConfig_scan_octal = 9;
+  bm_TGScannerConfig_scan_float = $400;
+  bp_TGScannerConfig_scan_float = 10;
+  bm_TGScannerConfig_scan_hex = $800;
+  bp_TGScannerConfig_scan_hex = 11;
+  bm_TGScannerConfig_scan_hex_dollar = $1000;
+  bp_TGScannerConfig_scan_hex_dollar = 12;
+  bm_TGScannerConfig_scan_string_sq = $2000;
+  bp_TGScannerConfig_scan_string_sq = 13;
+  bm_TGScannerConfig_scan_string_dq = $4000;
+  bp_TGScannerConfig_scan_string_dq = 14;
+  bm_TGScannerConfig_numbers_2_int = $8000;
+  bp_TGScannerConfig_numbers_2_int = 15;
+  bm_TGScannerConfig_int_2_float = $10000;
+  bp_TGScannerConfig_int_2_float = 16;
+  bm_TGScannerConfig_identifier_2_string = $20000;
+  bp_TGScannerConfig_identifier_2_string = 17;
+  bm_TGScannerConfig_char_2_token = $40000;
+  bp_TGScannerConfig_char_2_token = 18;
+  bm_TGScannerConfig_symbol_2_token = $80000;
+  bp_TGScannerConfig_symbol_2_token = 19;
+  bm_TGScannerConfig_scope_0_fallback = $100000;
+  bp_TGScannerConfig_scope_0_fallback = 20;
+
+{ Should symbol lookup work case sensitive?  }
+function TGScannerConfig_case_sensitive(var a : TGScannerConfig) : guint;
+procedure TGScannerConfig_set_case_sensitive(var a : TGScannerConfig; __case_sensitive : guint);
+
+{ C-like comment  }
+function TGScannerConfig_skip_comment_multi(var a : TGScannerConfig) : guint;
+procedure TGScannerConfig_set_skip_comment_multi(var a : TGScannerConfig; __skip_comment_multi : guint);
+
+{ single line comment  }
+function TGScannerConfig_skip_comment_single(var a : TGScannerConfig) : guint;
+procedure TGScannerConfig_set_skip_comment_single(var a : TGScannerConfig; __skip_comment_single : guint);
+
+{ scan multi line comments?  }
+function TGScannerConfig_scan_comment_multi(var a : TGScannerConfig) : guint;
+procedure TGScannerConfig_set_scan_comment_multi(var a : TGScannerConfig; __scan_comment_multi : guint);
+
+function TGScannerConfig_scan_identifier(var a : TGScannerConfig) : guint;
+procedure TGScannerConfig_set_scan_identifier(var a : TGScannerConfig; __scan_identifier : guint);
+
+function TGScannerConfig_scan_identifier_1char(var a : TGScannerConfig) : guint;
+procedure TGScannerConfig_set_scan_identifier_1char(var a : TGScannerConfig; __scan_identifier_1char : guint);
+
+function TGScannerConfig_scan_identifier_NULL(var a : TGScannerConfig) : guint;
+procedure TGScannerConfig_set_scan_identifier_NULL(var a : TGScannerConfig; __scan_identifier_NULL : guint);
+
+function TGScannerConfig_scan_symbols(var a : TGScannerConfig) : guint;
+procedure TGScannerConfig_set_scan_symbols(var a : TGScannerConfig; __scan_symbols : guint);
+
+function TGScannerConfig_scan_binary(var a : TGScannerConfig) : guint;
+procedure TGScannerConfig_set_scan_binary(var a : TGScannerConfig; __scan_binary : guint);
+
+function TGScannerConfig_scan_octal(var a : TGScannerConfig) : guint;
+procedure TGScannerConfig_set_scan_octal(var a : TGScannerConfig; __scan_octal : guint);
+
+function TGScannerConfig_scan_float(var a : TGScannerConfig) : guint;
+procedure TGScannerConfig_set_scan_float(var a : TGScannerConfig; __scan_float : guint);
+
+{ `0x0ff0'  }
+function TGScannerConfig_scan_hex(var a : TGScannerConfig) : guint;
+procedure TGScannerConfig_set_scan_hex(var a : TGScannerConfig; __scan_hex : guint);
+
+{ `$0ff0'  }
+function TGScannerConfig_scan_hex_dollar(var a : TGScannerConfig) : guint;
+procedure TGScannerConfig_set_scan_hex_dollar(var a : TGScannerConfig; __scan_hex_dollar : guint);
+
+{ string: 'anything'  }
+function TGScannerConfig_scan_string_sq(var a : TGScannerConfig) : guint;
+procedure TGScannerConfig_set_scan_string_sq(var a : TGScannerConfig; __scan_string_sq : guint);
+
+{ string: "\\-escapes!\n"  }
+function TGScannerConfig_scan_string_dq(var a : TGScannerConfig) : guint;
+procedure TGScannerConfig_set_scan_string_dq(var a : TGScannerConfig; __scan_string_dq : guint);
+
+{ bin, octal, hex => int  }
+function TGScannerConfig_numbers_2_int(var a : TGScannerConfig) : guint;
+procedure TGScannerConfig_set_numbers_2_int(var a : TGScannerConfig; __numbers_2_int : guint);
+
+{ int => G_TOKEN_FLOAT?  }
+function TGScannerConfig_int_2_float(var a : TGScannerConfig) : guint;
+procedure TGScannerConfig_set_int_2_float(var a : TGScannerConfig; __int_2_float : guint);
+
+function TGScannerConfig_identifier_2_string(var a : TGScannerConfig) : guint;
+procedure TGScannerConfig_set_identifier_2_string(var a : TGScannerConfig; __identifier_2_string : guint);
+
+{ return G_TOKEN_CHAR?  }
+function TGScannerConfig_char_2_token(var a : TGScannerConfig) : guint;
+procedure TGScannerConfig_set_char_2_token(var a : TGScannerConfig; __char_2_token : guint);
+
+function TGScannerConfig_symbol_2_token(var a : TGScannerConfig) : guint;
+procedure TGScannerConfig_set_symbol_2_token(var a : TGScannerConfig; __symbol_2_token : guint);
+
+{ try scope 0 on lookups?  }
+function TGScannerConfig_scope_0_fallback(var a : TGScannerConfig) : guint;
+procedure TGScannerConfig_set_scope_0_fallback(var a : TGScannerConfig; __scope_0_fallback : guint);
+
+
+function  g_scanner_new(config_templ:PGScannerConfig):PGScanner;cdecl;external gliblib name 'g_scanner_new';
+procedure g_scanner_destroy(scanner:PGScanner);cdecl;external gliblib name 'g_scanner_destroy';
+procedure g_scanner_input_file(scanner:PGScanner; input_fd:gint);cdecl;external gliblib name 'g_scanner_input_file';
+procedure g_scanner_sync_file_offset(scanner:PGScanner);cdecl;external gliblib name 'g_scanner_sync_file_offset';
+procedure g_scanner_input_text(scanner:PGScanner; text:Pgchar; text_len:guint);cdecl;external gliblib name 'g_scanner_input_text';
+function  g_scanner_get_next_token(scanner:PGScanner):TGTokenType;cdecl;external gliblib name 'g_scanner_get_next_token';
+function  g_scanner_peek_next_token(scanner:PGScanner):TGTokenType;cdecl;external gliblib name 'g_scanner_peek_next_token';
+function  g_scanner_cur_token(scanner:PGScanner):TGTokenType;cdecl;external gliblib name 'g_scanner_cur_token';
+function  g_scanner_cur_value(scanner:PGScanner):TGTokenValue;cdecl;external gliblib name 'g_scanner_cur_value';
+function  g_scanner_cur_line(scanner:PGScanner):guint;cdecl;external gliblib name 'g_scanner_cur_line';
+function  g_scanner_cur_position(scanner:PGScanner):guint;cdecl;external gliblib name 'g_scanner_cur_position';
+function  g_scanner_eof(scanner:PGScanner):gboolean;cdecl;external gliblib name 'g_scanner_eof';
+function  g_scanner_set_scope(scanner:PGScanner; scope_id:guint):guint;cdecl;external gliblib name 'g_scanner_set_scope';
+procedure g_scanner_scope_add_symbol(scanner:PGScanner; scope_id:guint; symbol:Pgchar; value:gpointer);cdecl;external gliblib name 'g_scanner_scope_add_symbol';
+procedure g_scanner_scope_remove_symbol(scanner:PGScanner; scope_id:guint; symbol:Pgchar);cdecl;external gliblib name 'g_scanner_scope_remove_symbol';
+function  g_scanner_scope_lookup_symbol(scanner:PGScanner; scope_id:guint; symbol:Pgchar):gpointer;cdecl;external gliblib name 'g_scanner_scope_lookup_symbol';
+procedure g_scanner_scope_foreach_symbol(scanner:PGScanner; scope_id:guint; func:TGHFunc; user_data:gpointer);cdecl;external gliblib name 'g_scanner_scope_foreach_symbol';
+function g_scanner_lookup_symbol(scanner:PGScanner; symbol:Pgchar):gpointer;cdecl;external gliblib name 'g_scanner_lookup_symbol';
+procedure g_scanner_unexp_token(scanner:PGScanner; expected_token:TGTokenType; identifier_spec:Pgchar; symbol_spec:Pgchar; symbol_name:Pgchar;
+            _message:Pgchar; is_error:gint);cdecl;external gliblib name 'g_scanner_unexp_token';
 
 
 {$IFNDEF KYLIX}
-    procedure g_scanner_error(scanner:PGScanner; format:Pgchar; args:array of const);cdecl;overload;external gliblib name 'g_scanner_error';
-    procedure g_scanner_error(scanner:PGScanner; format:Pgchar);cdecl;overload;varargs;external gliblib name 'g_scanner_error';
+procedure g_scanner_error(scanner:PGScanner; format:Pgchar; args:array of const);cdecl;overload;external gliblib name 'g_scanner_error';
+procedure g_scanner_error(scanner:PGScanner; format:Pgchar);cdecl;overload;varargs;external gliblib name 'g_scanner_error';
 
-    procedure g_scanner_warn(scanner:PGScanner; format:Pgchar; args:array of const);cdecl;overload;external gliblib name 'g_scanner_warn';
-    procedure g_scanner_warn(scanner:PGScanner; format:Pgchar);cdecl;overload;varargs;external gliblib name 'g_scanner_warn';
+procedure g_scanner_warn(scanner:PGScanner; format:Pgchar; args:array of const);cdecl;overload;external gliblib name 'g_scanner_warn';
+procedure g_scanner_warn(scanner:PGScanner; format:Pgchar);cdecl;overload;varargs;external gliblib name 'g_scanner_warn';
 {$ELSE}
-    procedure g_scanner_error(scanner:PGScanner; format:Pgchar);varargs;cdecl;external gliblib name 'g_scanner_error';
-    procedure g_scanner_warn(scanner:PGScanner; format:Pgchar);varargs;cdecl;external gliblib name 'g_scanner_warn';
+procedure g_scanner_error(scanner:PGScanner; format:Pgchar);varargs;cdecl;external gliblib name 'g_scanner_error';
+procedure g_scanner_warn(scanner:PGScanner; format:Pgchar);varargs;cdecl;external gliblib name 'g_scanner_warn';
 {$ENDIF}
 
 {$ifndef G_DISABLE_DEPRECATED}
-//    { keep downward source compatibility  }
-//    { #define         g_scanner_add_symbol( scanner, symbol, value )  G_STMT_START { \ }
-//    {   g_scanner_scope_add_symbol ((scanner), 0, (symbol), (value)); \ }
-//    { } G_STMT_END }
-//    { #define         g_scanner_remove_symbol( scanner, symbol )      G_STMT_START { \ }
-//    {  g_scanner_scope_remove_symbol ((scanner), 0, (symbol)); \ }
-//    { } G_STMT_END }
-//    { #define         g_scanner_foreach_symbol( scanner, func, data ) G_STMT_START { \ }
-//    {   g_scanner_scope_foreach_symbol ((scanner), 0, (func), (data)); \ }
-//    { } G_STMT_END }
-
-    { The following two functions are deprecated and will be removed in
-       the next major release. They do no good.  }
-
-
-    procedure g_scanner_freeze_symbol_table(scanner : PGScanner);
-
-    procedure g_scanner_thaw_symbol_table(scanner : PGScanner);
-
+procedure g_scanner_freeze_symbol_table(scanner : PGScanner);
+procedure g_scanner_thaw_symbol_table(scanner : PGScanner);
 {$endif} { G_DISABLE_DEPRECATED  }
 
+{$ENDIF read_interface_rest}
+// included by glib2.pas
 

+ 21 - 21
packages/gtk2/src/glib/gshell.inc

@@ -1,28 +1,28 @@
-{*
- * gshell.inc
- *
- * depends on gerror.inc
- *}
+// included by glib2.pas
 
-  function G_SHELL_ERROR : TGQuark;
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
 
+//------------------------------------------------------------------------------
 
+{$IFDEF read_interface_types}
+  PGShellError = ^TGShellError;
+  TGShellError = (
+    G_SHELL_ERROR_BAD_QUOTING,   { mismatched or otherwise mangled quoting  }
+    G_SHELL_ERROR_EMPTY_STRING,  { string to be parsed was empty  }
+    G_SHELL_ERROR_FAILED
+  );
+{$ENDIF read_interface_types}
 
+//------------------------------------------------------------------------------
 
+{$IFDEF read_interface_rest}
+function G_SHELL_ERROR : TGQuark;
 
-  type
-
-     PGShellError = ^TGShellError;
-     TGShellError = (G_SHELL_ERROR_BAD_QUOTING,   { mismatched or otherwise mangled quoting  }
-                     G_SHELL_ERROR_EMPTY_STRING,  { string to be parsed was empty  }
-                     G_SHELL_ERROR_FAILED);
-
-  function g_shell_error_quark:TGQuark;cdecl;external gliblib name 'g_shell_error_quark';
-
-  function g_shell_quote(unquoted_string:Pgchar):Pgchar;cdecl;external gliblib name 'g_shell_quote';
-
-  function g_shell_unquote(quoted_string:Pgchar; error:PPGError):Pgchar;cdecl;external gliblib name 'g_shell_unquote';
-
-  function g_shell_parse_argv(command_line:Pgchar; argcp:Pgint; argvp:PPPgchar; error:PPGError):gboolean;cdecl;external gliblib name 'g_shell_parse_argv';
-
+function g_shell_error_quark:TGQuark;cdecl;external gliblib name 'g_shell_error_quark';
+function g_shell_quote(unquoted_string:Pgchar):Pgchar;cdecl;external gliblib name 'g_shell_quote';
+function g_shell_unquote(quoted_string:Pgchar; error:PPGError):Pgchar;cdecl;external gliblib name 'g_shell_unquote';
+function g_shell_parse_argv(command_line:Pgchar; argcp:Pgint; argvp:PPPgchar; error:PPGError):gboolean;cdecl;external gliblib name 'g_shell_parse_argv';
 
+{$ENDIF read_interface_rest}
+// included by glib2.pas

+ 11 - 2
packages/gtk2/src/glib/gsignal.inc

@@ -1,7 +1,11 @@
 // included by glib2.pas
 
-{ --- typedefs ---  }
-type
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_types}
    PGSignalInvocationHint = ^TGSignalInvocationHint;
 
    PGSignalCMarshaller = ^TGSignalCMarshaller;
@@ -34,7 +38,11 @@ type
         n_params : guint;
         param_types : PGType;
      end;
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
 
+{$IFDEF read_interface_rest}
 
 const
    G_SIGNAL_RUN_FIRST = 1 shl 0;
@@ -146,5 +154,6 @@ procedure g_signal_handlers_unblock_by_func(instance: gpointer; func, data: gpoi
 procedure g_signal_handlers_destroy(instance:gpointer); cdecl; external gobjectlib;
 procedure _g_signals_destroy(itype:GType); cdecl; external gobjectlib;
 
+{$ENDIF read_interface_rest}
 // included by glib2.pas
 

+ 12 - 38
packages/gtk2/src/glib/gslist.inc

@@ -1,79 +1,53 @@
 // included by glib2.pas
 
 {$IFDEF read_forward_definitions}
-   PGSList = ^TGSList;
-   PPGSList = ^PGSList;
-   TGSList = record
-          data : gpointer;
-          next : PGSList;
-       end;
-
+  PGSList = ^TGSList;
+  PPGSList = ^PGSList;
 {$ENDIF read_forward_definitions}
 
 //------------------------------------------------------------------------------
 
+{$IFDEF read_interface_types}
+  TGSList = record
+    data : gpointer;
+    next : PGSList;
+  end;
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
+
 {$IFDEF read_interface_rest}
-{ Singly linked lists
-  }
 
+{ Singly linked lists }
 procedure g_slist_push_allocator(allocator:PGAllocator);cdecl;external gliblib name 'g_slist_push_allocator';
-
 procedure g_slist_pop_allocator;cdecl;external gliblib name 'g_slist_pop_allocator';
-
 function g_slist_alloc:PGSList;cdecl;external gliblib name 'g_slist_alloc';
-
 procedure g_slist_free(list:PGSList);cdecl;external gliblib name 'g_slist_free';
-
 procedure g_slist_free_1(list:PGSList);cdecl;external gliblib name 'g_slist_free_1';
-
 function g_slist_append(list:PGSList; data:gpointer):PGSList;cdecl;external gliblib name 'g_slist_append';
-
 function g_slist_prepend(list:PGSList; data:gpointer):PGSList;cdecl;external gliblib name 'g_slist_prepend';
-
 function g_slist_insert(list:PGSList; data:gpointer; position:gint):PGSList;cdecl;external gliblib name 'g_slist_insert';
-
 function g_slist_insert_sorted(list:PGSList; data:gpointer; func:TGCompareFunc):PGSList;cdecl;external gliblib name 'g_slist_insert_sorted';
-
 function g_slist_insert_before(slist:PGSList; sibling:PGSList; data:gpointer):PGSList;cdecl;external gliblib name 'g_slist_insert_before';
-
 function g_slist_concat(list1:PGSList; list2:PGSList):PGSList;cdecl;external gliblib name 'g_slist_concat';
-
 function g_slist_remove(list:PGSList; data:gconstpointer):PGSList;cdecl;external gliblib name 'g_slist_remove';
-
 function g_slist_remove_all(list:PGSList; data:gconstpointer):PGSList;cdecl;external gliblib name 'g_slist_remove_all';
-
 function g_slist_remove_link(list:PGSList; link:PGSList):PGSList;cdecl;external gliblib name 'g_slist_remove_link';
-
 function g_slist_delete_link(list:PGSList; link:PGSList):PGSList;cdecl;external gliblib name 'g_slist_delete_link';
-
 function g_slist_reverse(list:PGSList):PGSList;cdecl;external gliblib name 'g_slist_reverse';
-
 function g_slist_copy(list:PGSList):PGSList;cdecl;external gliblib name 'g_slist_copy';
-
 function g_slist_nth(list:PGSList; n:guint):PGSList;cdecl;external gliblib name 'g_slist_nth';
-
 function g_slist_find(list:PGSList; data:gconstpointer):PGSList;cdecl;external gliblib name 'g_slist_find';
-
 function g_slist_find_custom(list:PGSList; data:gconstpointer; func:TGCompareFunc):PGSList;cdecl;external gliblib name 'g_slist_find_custom';
-
 function g_slist_position(list:PGSList; llink:PGSList):gint;cdecl;external gliblib name 'g_slist_position';
-
 function g_slist_index(list:PGSList; data:gconstpointer):gint;cdecl;external gliblib name 'g_slist_index';
-
 function g_slist_last(list:PGSList):PGSList;cdecl;external gliblib name 'g_slist_last';
-
 function g_slist_length(list:PGSList):guint;cdecl;external gliblib name 'g_slist_length';
-
 procedure g_slist_foreach(list:PGSList; func:TGFunc; user_data:gpointer);cdecl;external gliblib name 'g_slist_foreach';
-
 function g_slist_sort(list:PGSList; compare_func:TGCompareFunc):PGSList;cdecl;external gliblib name 'g_slist_sort';
-
 function g_slist_sort_with_data(list:PGSList; compare_func:TGCompareDataFunc; user_data:gpointer):PGSList;cdecl;external gliblib name 'g_slist_sort_with_data';
-
 function g_slist_nth_data(list:PGSList; n:guint):gpointer;cdecl;external gliblib name 'g_slist_nth_data';
-
 function g_slist_next(slist : PGSList) : PGSList;
-
 {$ENDIF read_interface_rest}
 
 // included by glib2.pas

+ 24 - 43
packages/gtk2/src/glib/gsourceclosure.inc

@@ -1,56 +1,37 @@
-{ Pointers to basic pascal types, inserted by h2pas conversion program.}
-Type
-  PLongint  = ^Longint;
-  PSmallInt = ^SmallInt;
-  PByte     = ^Byte;
-  PWord     = ^Word;
-  PDWord    = ^DWord;
-  PDouble   = ^Double;
-
-{$PACKRECORDS C}
-
-{ GObject - GLib Type, Object, Parameter and Signal Library
-   Copyright (C) 2001 Red Hat, Inc.
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General
-   Public License along with this library; if not, write to the
-   Free Software Foundation, Inc., 59 Temple Place, Suite 330,
-   Boston, MA 02111-1307, USA.
-  }
-{$if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)}
-{$error "Only <glib-anObject.h> can be included directly."}
-{$endif}
-{$ifndef __G_SOURCECLOSURE_H__}
-{$include <gobject/gclosure.inc}
+// included by glib2.pas
 
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_types}
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_rest}
 procedure g_source_set_closure(source:PGSource; closure:PGClosure); cdecl; external gliblib;
 function g_io_channel_get_type:GType; cdecl; external gliblib;
 function g_io_condition_get_type:GType; cdecl; external gliblib;
-function G_TYPE_IO_CHANNEL : longint;
-    { return type might be wrong }
-function G_TYPE_IO_CONDITION : longint;
-    { return type might be wrong }
-
-{$endif}
-{ __G_SOURCECLOSURE_H__  }
-function G_TYPE_IO_CHANNEL : longint;
+
+function G_TYPE_IO_CHANNEL : GType;
+function G_TYPE_IO_CONDITION : GType;
+{$ENDIF read_interface_rest}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_implementation}
+function G_TYPE_IO_CHANNEL : GType;
 begin
    G_TYPE_IO_CHANNEL:=g_io_channel_get_type;
 end;
 
-function G_TYPE_IO_CONDITION : longint;
+function G_TYPE_IO_CONDITION : GType;
 begin
    G_TYPE_IO_CONDITION:=g_io_condition_get_type;
 end;
 
+{$ENDIF read_implementation}
+// included by glib2.pas
 

+ 65 - 75
packages/gtk2/src/glib/gspawn.inc

@@ -1,75 +1,65 @@
-{*
- * gspawn.inc
- *
- * depends on gerror.inc
- *}
-
-  { I'm not sure I remember our proposed naming convention here.  }
-
-  function G_SPAWN_ERROR : TGQuark;
-
-
-
-  type
-
-     PGSpawnError = ^TGSpawnError;
-     TGSpawnError = (G_SPAWN_ERROR_FORK,
-                     G_SPAWN_ERROR_READ,
-                     G_SPAWN_ERROR_CHDIR,
-                     G_SPAWN_ERROR_ACCES,
-                     G_SPAWN_ERROR_PERM,
-                     G_SPAWN_ERROR_2BIG,
-                     G_SPAWN_ERROR_NOEXEC,
-                     G_SPAWN_ERROR_NAMETOOLONG,
-                     G_SPAWN_ERROR_NOENT,
-                     G_SPAWN_ERROR_NOMEM,
-                     G_SPAWN_ERROR_NOTDIR,
-                     G_SPAWN_ERROR_LOOP,
-                     G_SPAWN_ERROR_TXTBUSY,
-                     G_SPAWN_ERROR_IO,
-                     G_SPAWN_ERROR_NFILE,
-                     G_SPAWN_ERROR_MFILE,
-                     G_SPAWN_ERROR_INVAL,
-                     G_SPAWN_ERROR_ISDIR,
-                     G_SPAWN_ERROR_LIBBAD,
-                     G_SPAWN_ERROR_FAILED);
-
-     TGSpawnChildSetupFunc = procedure (user_data:gpointer);cdecl;
-
-  { look for argv[0] in the path i.e. use execvp()  }
-  { Dump output to /dev/null  }
-
-     PGSpawnFlags = ^TGSpawnFlags;
-     TGSpawnFlags = integer;
-
-   const
-     G_SPAWN_LEAVE_DESCRIPTORS_OPEN = 1 shl 0;
-     G_SPAWN_DO_NOT_REAP_CHILD = 1 shl 1;
-     G_SPAWN_SEARCH_PATH = 1 shl 2;
-     G_SPAWN_STDOUT_TO_DEV_NULL = 1 shl 3;
-     G_SPAWN_STDERR_TO_DEV_NULL = 1 shl 4;
-     G_SPAWN_CHILD_INHERITS_STDIN = 1 shl 5;
-     G_SPAWN_FILE_AND_ARGV_ZERO = 1 shl 6;
-
-  function g_spawn_error_quark:TGQuark;cdecl;external gliblib name 'g_spawn_error_quark';
-
-  function g_spawn_async(working_directory:Pgchar; argv:PPgchar; envp:PPgchar; flags:TGSpawnFlags; child_setup:TGSpawnChildSetupFunc;
-             user_data:gpointer; child_pid:Pgint; error:PPGError):gboolean;cdecl;external gliblib name 'g_spawn_async';
-
-  { Opens pipes for non-NULL standard_output, standard_input, standard_error,
-     and returns the parent's end of the pipes.
-    }
-  function g_spawn_async_with_pipes(working_directory:Pgchar; argv:PPgchar; envp:PPgchar; flags:TGSpawnFlags; child_setup:TGSpawnChildSetupFunc;
-             user_data:gpointer; child_pid:Pgint; standard_input:Pgint; standard_output:Pgint; standard_error:Pgint;
-             error:PPGError):gboolean;cdecl;external gliblib name 'g_spawn_async_with_pipes';
-
-  { If standard_output or standard_error are non-NULL, the full
-     standard output or error of the command will be placed there.
-    }
-  function g_spawn_sync(working_directory:Pgchar; argv:PPgchar; envp:PPgchar; flags:TGSpawnFlags; child_setup:TGSpawnChildSetupFunc;
-             user_data:gpointer; standard_output:PPgchar; standard_error:PPgchar; exit_status:Pgint; error:PPGError):gboolean;cdecl;external gliblib name 'g_spawn_sync';
-
-  function g_spawn_command_line_sync(command_line:Pgchar; standard_output:PPgchar; standard_error:PPgchar; exit_status:Pgint; error:PPGError):gboolean;cdecl;external gliblib name 'g_spawn_command_line_sync';
-
-  function g_spawn_command_line_async(command_line:Pgchar; error:PPGError):gboolean;cdecl;external gliblib name 'g_spawn_command_line_async';
-
+// included by glib2.pas
+
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_types}
+  PGSpawnError = ^TGSpawnError;
+  TGSpawnError = (
+    G_SPAWN_ERROR_FORK,
+    G_SPAWN_ERROR_READ,
+    G_SPAWN_ERROR_CHDIR,
+    G_SPAWN_ERROR_ACCES,
+    G_SPAWN_ERROR_PERM,
+    G_SPAWN_ERROR_2BIG,
+    G_SPAWN_ERROR_NOEXEC,
+    G_SPAWN_ERROR_NAMETOOLONG,
+    G_SPAWN_ERROR_NOENT,
+    G_SPAWN_ERROR_NOMEM,
+    G_SPAWN_ERROR_NOTDIR,
+    G_SPAWN_ERROR_LOOP,
+    G_SPAWN_ERROR_TXTBUSY,
+    G_SPAWN_ERROR_IO,
+    G_SPAWN_ERROR_NFILE,
+    G_SPAWN_ERROR_MFILE,
+    G_SPAWN_ERROR_INVAL,
+    G_SPAWN_ERROR_ISDIR,
+    G_SPAWN_ERROR_LIBBAD,
+    G_SPAWN_ERROR_FAILED
+  );
+
+  TGSpawnChildSetupFunc = procedure (user_data:gpointer);cdecl;
+
+  PGSpawnFlags = ^TGSpawnFlags;
+  TGSpawnFlags = integer;
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_rest}
+const
+  G_SPAWN_LEAVE_DESCRIPTORS_OPEN = 1 shl 0;
+  G_SPAWN_DO_NOT_REAP_CHILD = 1 shl 1;
+  G_SPAWN_SEARCH_PATH = 1 shl 2;
+  G_SPAWN_STDOUT_TO_DEV_NULL = 1 shl 3;
+  G_SPAWN_STDERR_TO_DEV_NULL = 1 shl 4;
+  G_SPAWN_CHILD_INHERITS_STDIN = 1 shl 5;
+  G_SPAWN_FILE_AND_ARGV_ZERO = 1 shl 6;
+
+function g_spawn_error_quark:TGQuark;cdecl;external gliblib name 'g_spawn_error_quark';
+function g_spawn_async(working_directory:Pgchar; argv:PPgchar; envp:PPgchar; flags:TGSpawnFlags; child_setup:TGSpawnChildSetupFunc;
+           user_data:gpointer; child_pid:Pgint; error:PPGError):gboolean;cdecl;external gliblib name 'g_spawn_async';
+
+function g_spawn_async_with_pipes(working_directory:Pgchar; argv:PPgchar; envp:PPgchar; flags:TGSpawnFlags; child_setup:TGSpawnChildSetupFunc;
+           user_data:gpointer; child_pid:Pgint; standard_input:Pgint; standard_output:Pgint; standard_error:Pgint;
+           error:PPGError):gboolean;cdecl;external gliblib name 'g_spawn_async_with_pipes';
+
+function g_spawn_sync(working_directory:Pgchar; argv:PPgchar; envp:PPgchar; flags:TGSpawnFlags; child_setup:TGSpawnChildSetupFunc;
+           user_data:gpointer; standard_output:PPgchar; standard_error:PPgchar; exit_status:Pgint; error:PPGError):gboolean;cdecl;external gliblib name 'g_spawn_sync';
+
+function g_spawn_command_line_sync(command_line:Pgchar; standard_output:PPgchar; standard_error:PPgchar; exit_status:Pgint; error:PPGError):gboolean;cdecl;external gliblib name 'g_spawn_command_line_sync';
+function g_spawn_command_line_async(command_line:Pgchar; error:PPGError):gboolean;cdecl;external gliblib name 'g_spawn_command_line_async';
+{$ENDIF read_interface_rest}
+// included by glib2.pas

+ 13 - 6
packages/gtk2/src/glib/gstrfuncs.inc

@@ -1,10 +1,18 @@
 // included by glib2.pas
 
-{ Functions like the ones in <ctype.h> that are not affected by locale.  }
-type
-   PGAsciiType = ^TGAsciiType;
-   TGAsciiType = longint;
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
 
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_types}
+  PGAsciiType = ^TGAsciiType;
+  TGAsciiType = longint;
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_rest}
 const
    G_ASCII_ALNUM = 1 shl 0;
    G_ASCII_ALPHA = 1 shl 1;
@@ -151,7 +159,6 @@ function g_strjoinv(separator:Pgchar; str_array:PPgchar):Pgchar; cdecl; external
 procedure g_strfreev(str_array:PPgchar); cdecl; external gliblib;
 function g_strdupv(str_array:PPgchar):PPgchar; cdecl; external gliblib;
 function g_stpcpy(dest:Pgchar; src:Pchar):Pgchar; cdecl; external gliblib;
-
-
+{$ENDIF read_interface_rest}
 // included by glib2.pas
 

+ 24 - 55
packages/gtk2/src/glib/gstring.inc

@@ -1,78 +1,55 @@
-{*
- * gstring.inc
- *
- * depends on gtypes.inc, gunicode.inc
- *}
+// included by glib2.pas
 
-    type
-       PGString = ^TGString;
-       TGString = record
-            str : Pgchar;
-            len : gsize;
-            allocated_len : gsize;
-         end;
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
 
-       PGStringChunk = pointer; // structure not known
+//------------------------------------------------------------------------------
 
-    { String Chunks
-      }
+{$IFDEF read_interface_types}
+  PGString = ^TGString;
+  TGString = record
+    str : Pgchar;
+    len : gsize;
+    allocated_len : gsize;
+  end;
 
-    function g_string_chunk_new(size:gsize):PGStringChunk;cdecl;external gliblib name 'g_string_chunk_new';
+  PGStringChunk = pointer; // structure not known
+{$ENDIF read_interface_types}
 
-    procedure g_string_chunk_free(chunk:PGStringChunk);cdecl;external gliblib name 'g_string_chunk_free';
+//------------------------------------------------------------------------------
 
-    function g_string_chunk_insert(chunk:PGStringChunk; _string:Pgchar):Pgchar;cdecl;external gliblib name 'g_string_chunk_insert';
+{$IFDEF read_interface_rest}
+    { String Chunks }
 
+    function g_string_chunk_new(size:gsize):PGStringChunk;cdecl;external gliblib name 'g_string_chunk_new';
+    procedure g_string_chunk_free(chunk:PGStringChunk);cdecl;external gliblib name 'g_string_chunk_free';
+    function g_string_chunk_insert(chunk:PGStringChunk; _string:Pgchar):Pgchar;cdecl;external gliblib name 'g_string_chunk_insert';
     function g_string_chunk_insert_const(chunk:PGStringChunk; _string:Pgchar):Pgchar;cdecl;external gliblib name 'g_string_chunk_insert_const';
 
-    { Strings
-      }
+    { Strings }
     function g_string_new(init:Pgchar):PGString;cdecl;external gliblib name 'g_string_new';
-
     function g_string_new_len(init:Pgchar; len:gssize):PGString;cdecl;external gliblib name 'g_string_new_len';
-
     function g_string_sized_new(dfl_size:gsize):PGString;cdecl;external gliblib name 'g_string_sized_new';
-
     function g_string_free(_string:PGString; free_segment:gboolean):Pgchar;cdecl;external gliblib name 'g_string_free';
-
     function g_string_equal(v:PGString; v2:PGString):gboolean;cdecl;external gliblib name 'g_string_equal';
-
     function g_string_hash(str:PGString):guint;cdecl;external gliblib name 'g_string_hash';
-
     function g_string_assign(_string:PGString; rval:Pgchar):PGString;cdecl;external gliblib name 'g_string_assign';
-
     function g_string_truncate(_string:PGString; len:gsize):PGString;cdecl;external gliblib name 'g_string_truncate';
-
     function g_string_set_size(_string:PGString; len:gsize):PGString;cdecl;external gliblib name 'g_string_set_size';
-
     function g_string_insert_len(_string:PGString; pos:gssize; val:Pgchar; len:gssize):PGString;cdecl;external gliblib name 'g_string_insert_len';
-
     function g_string_append(_string:PGString; val:Pgchar):PGString;cdecl;external gliblib name 'g_string_append';
-
     function g_string_append_len(_string:PGString; val:Pgchar; len:gssize):PGString;cdecl;external gliblib name 'g_string_append_len';
-
     function g_string_append_c(_string:PGString; c:gchar):PGString;cdecl;external gliblib name 'g_string_append_c';
-
     function g_string_append_unichar(_string:PGString; wc:gunichar):PGString;cdecl;external gliblib name 'g_string_append_unichar';
-
     function g_string_prepend(_string:PGString; val:Pgchar):PGString;cdecl;external gliblib name 'g_string_prepend';
-
     function g_string_prepend_c(_string:PGString; c:gchar):PGString;cdecl;external gliblib name 'g_string_prepend_c';
-
     function g_string_prepend_unichar(_string:PGString; wc:gunichar):PGString;cdecl;external gliblib name 'g_string_prepend_unichar';
-
     function g_string_prepend_len(_string:PGString; val:Pgchar; len:gssize):PGString;cdecl;external gliblib name 'g_string_prepend_len';
-
     function g_string_insert(_string:PGString; pos:gssize; val:Pgchar):PGString;cdecl;external gliblib name 'g_string_insert';
-
     function g_string_insert_c(_string:PGString; pos:gssize; c:gchar):PGString;cdecl;external gliblib name 'g_string_insert_c';
-
     function g_string_insert_unichar(_string:PGString; pos:gssize; wc:gunichar):PGString;cdecl;external gliblib name 'g_string_insert_unichar';
-
     function g_string_erase(_string:PGString; pos:gssize; len:gssize):PGString;cdecl;external gliblib name 'g_string_erase';
-
     function g_string_ascii_down(_string:PGString):PGString;cdecl;external gliblib name 'g_string_ascii_down';
-
     function g_string_ascii_up(_string:PGString):PGString;cdecl;external gliblib name 'g_string_ascii_up';
 
 {$IFNDEF KYLIX}
@@ -88,18 +65,10 @@
 
 {DEPRECATED functions}
 
-    { The following two functions are deprecated and will be removed in
-       the next major release. They use the locale-specific tolower and
-       toupper, which is almost never the right thing.
-      }
-
-    function g_string_down(_string:PGString):PGString;cdecl;external gliblib name 'g_string_down';
-
-    function g_string_up(_string:PGString):PGString;cdecl;external gliblib name 'g_string_up';
-
-    { These aliases are included for compatibility.  }
+function g_string_down(_string:PGString):PGString;cdecl;external gliblib name 'g_string_down';
+function g_string_up(_string:PGString):PGString;cdecl;external gliblib name 'g_string_up';
 
+{$ENDIF read_interface_rest}
+// included by glib2.pas
 
-// #define    g_string_sprintf    g_string_printf;
-// #define    g_string_sprintfa   g_string_append_printf;
 

+ 148 - 230
packages/gtk2/src/glib/gthread.inc

@@ -1,74 +1,93 @@
-//{$ifndef __G_THREAD_H__}
-//{$define __G_THREAD_H__}
+// included by glib2.pas
 
-//{$include gerror.inc}
-// {$include gtypes.inc}
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
 
-{* GLib Thread support *}
+//------------------------------------------------------------------------------
 
+{$IFDEF read_interface_types}
+  PGThreadError = ^TGThreadError;
+  TGThreadError = ( G_THREAD_ERROR_AGAIN  { Resource temporarily unavailable  });
 
-  function  g_thread_error_quark :  TGQuark; cdecl; external gthreadlib name 'g_thread_error_quark';
+  TGThreadFunc = function (data:gpointer):gpointer;cdecl;
 
+  PGThreadPriority = ^TGThreadPriority;
+  TGThreadPriority = (G_THREAD_PRIORITY_LOW,
+                      G_THREAD_PRIORITY_NORMAL,
+                      G_THREAD_PRIORITY_HIGH,
+                      G_THREAD_PRIORITY_URGENT);
 
-  function G_THREAD_ERROR: TGQuark;
+  PGThread = ^TGThread;
+  TGThread = record
+               func : TGThreadFunc;
+               data : gpointer;
+               joinable : gboolean;
+               priority : TGThreadPriority;
+             end;
 
-
-
-
-  type
-    PGThreadError = ^TGThreadError;
-    TGThreadError = ( G_THREAD_ERROR_AGAIN  { Resource temporarily unavailable  });
-
-    TGThreadFunc = function (data:gpointer):gpointer;cdecl;
-
-    PGThreadPriority = ^TGThreadPriority;
-    TGThreadPriority = (G_THREAD_PRIORITY_LOW,
-                        G_THREAD_PRIORITY_NORMAL,
-                        G_THREAD_PRIORITY_HIGH,
-                        G_THREAD_PRIORITY_URGENT);
-
-    PGThread = ^TGThread;
-    TGThread = record
-                 func : TGThreadFunc;
-                 data : gpointer;
-                 joinable : gboolean;
-                 priority : TGThreadPriority;
-               end;
-
-    PPGMutex  = ^PGMutex;
-    PGMutex   = pointer; //       GMutex;
-    PGCond    = pointer; //       GCond;
-    PGPrivate = pointer; //       GPrivate;
+  PPGMutex  = ^PGMutex;
+  PGMutex   = pointer; //       GMutex;
+  PGCond    = pointer; //       GCond;
+  PGPrivate = pointer; //       GPrivate;
 
 //    typedef struct _GMutex* GStaticMutex;
-    PGStaticMutex = ^TGStaticMutex;
-    TGStaticMutex = PGMutex;
-
-    PGThreadFunctions = ^TGThreadFunctions;
-    TGThreadFunctions = record
-              mutex_new       : function :PGMutex; cdecl;
-              mutex_lock      : procedure (mutex:PGMutex); cdecl;
-              mutex_trylock   : function (mutex:PGMutex):gboolean; cdecl;
-              mutex_unlock    : procedure (mutex:PGMutex); cdecl;
-              mutex_free      : procedure (mutex:PGMutex); cdecl;
-              cond_new        : function :PGCond; cdecl;
-              cond_signal     : procedure (cond:PGCond); cdecl;
-              cond_broadcast  : procedure (cond:PGCond); cdecl;
-              cond_wait       : procedure (cond:PGCond; mutex:PGMutex); cdecl;
-              cond_timed_wait : function (cond:PGCond; mutex:PGMutex; end_time:PGTimeVal):gboolean; cdecl;
-              cond_free       : procedure (cond:PGCond); cdecl;
-              private_new     : function (dest:TGDestroyNotify):PGPrivate; cdecl;
-              private_get     : function (private_key:PGPrivate):gpointer; cdecl;
-              private_set     : procedure (private_key:PGPrivate; data:gpointer); cdecl;
-              thread_create   : procedure (func:TGThreadFunc; data:gpointer; stack_size:gulong; joinable:gboolean; bound:gboolean;
-                                           priority:TGThreadPriority; thread:gpointer; error:PPGError); cdecl;
-              thread_yield    : procedure ; cdecl;
-              thread_join     : procedure (thread:gpointer); cdecl;
-              thread_exit     : procedure ; cdecl;
-              thread_set_priority : procedure (thread:gpointer; priority:TGThreadPriority); cdecl;
-              thread_self         : procedure (thread:gpointer); cdecl;
-              thread_equal        : function (thread1:gpointer; thread2:gpointer):gboolean; cdecl;
-           end;
+  PGStaticMutex = ^TGStaticMutex;
+  TGStaticMutex = PGMutex;
+
+  PGThreadFunctions = ^TGThreadFunctions;
+  TGThreadFunctions = record
+            mutex_new       : function :PGMutex; cdecl;
+            mutex_lock      : procedure (mutex:PGMutex); cdecl;
+            mutex_trylock   : function (mutex:PGMutex):gboolean; cdecl;
+            mutex_unlock    : procedure (mutex:PGMutex); cdecl;
+            mutex_free      : procedure (mutex:PGMutex); cdecl;
+            cond_new        : function :PGCond; cdecl;
+            cond_signal     : procedure (cond:PGCond); cdecl;
+            cond_broadcast  : procedure (cond:PGCond); cdecl;
+            cond_wait       : procedure (cond:PGCond; mutex:PGMutex); cdecl;
+            cond_timed_wait : function (cond:PGCond; mutex:PGMutex; end_time:PGTimeVal):gboolean; cdecl;
+            cond_free       : procedure (cond:PGCond); cdecl;
+            private_new     : function (dest:TGDestroyNotify):PGPrivate; cdecl;
+            private_get     : function (private_key:PGPrivate):gpointer; cdecl;
+            private_set     : procedure (private_key:PGPrivate; data:gpointer); cdecl;
+            thread_create   : procedure (func:TGThreadFunc; data:gpointer; stack_size:gulong; joinable:gboolean; bound:gboolean;
+                                         priority:TGThreadPriority; thread:gpointer; error:PPGError); cdecl;
+            thread_yield    : procedure ; cdecl;
+            thread_join     : procedure (thread:gpointer); cdecl;
+            thread_exit     : procedure ; cdecl;
+            thread_set_priority : procedure (thread:gpointer; priority:TGThreadPriority); cdecl;
+            thread_self         : procedure (thread:gpointer); cdecl;
+            thread_equal        : function (thread1:gpointer; thread2:gpointer):gboolean; cdecl;
+         end;
+
+  PGStaticPrivate = ^TGStaticPrivate;
+  TGStaticPrivate = record
+                      index : guint;
+                    end;
+  PGStaticRecMutex = ^TGStaticRecMutex;
+  TGStaticRecMutex = record
+          mutex : TGStaticMutex;
+          depth : guint;
+          owner : TGSystemThread;      // defined in glibconfig.inc
+       end;
+
+  PGStaticRWLock = ^TGStaticRWLock;
+  TGStaticRWLock = record
+         mutex         : TGStaticMutex;
+         read_cond     : PGCond;
+         write_cond    : PGCond;
+         read_counter  : guint;
+         write         : gboolean;
+         want_to_read  : guint;
+         want_to_write : guint;
+      end;
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_rest}
+function  g_thread_error_quark :  TGQuark; cdecl; external gthreadlib name 'g_thread_error_quark';
+function G_THREAD_ERROR: TGQuark;
 
 
 {$IFNDEF KYLIX}
@@ -85,194 +104,93 @@
 {$ENDIF}
 
 
-{ initializes the mutex/cond/private implementation for glib, might
-  only be called once, and must not be called directly or indirectly
-  from another glib-function, e.g. as a callback.
-}
-
-  procedure g_thread_init(vtable:PGThreadFunctions);cdecl;external gthreadlib name 'g_thread_init';
-
-{ Errorcheck mutexes. If you define G_ERRORCHECK_MUTEXES, then all
-  mutexes will check for re-locking and re-unlocking  }
-
-{ Initialize thread system with errorcheck mutexes. vtable must be
-  NULL. Do not call directly. Use #define G_ERRORCHECK_MUTEXES
-  instead.
-}
-  procedure g_thread_init_with_errorcheck_mutexes(vtable:PGThreadFunctions);cdecl;external gthreadlib name 'g_thread_init_with_errorcheck_mutexes';
+procedure g_thread_init(vtable:PGThreadFunctions);cdecl;external gthreadlib name 'g_thread_init';
+procedure g_thread_init_with_errorcheck_mutexes(vtable:PGThreadFunctions);cdecl;external gthreadlib name 'g_thread_init_with_errorcheck_mutexes';
 
 { A random number to recognize debug calls to g_mutex_...  }
 
-  const
-    G_MUTEX_DEBUG_MAGIC = $f8e18ad7;
-
-
-{ internal function for fallback static mutex implementation  }
-  function g_static_mutex_get_mutex_impl(mutex:PPGMutex):PGMutex;cdecl;external gthreadlib name 'g_static_mutex_get_mutex_impl';
-
-
-{ shorthands for conditional and unconditional function calls  }
-
-  function  g_thread_supported: gboolean;
-
-  procedure g_mutex_lock     (mutex: PGMutex);
-
-  function  g_mutex_trylock  (mutex: PGMutex):gboolean;
-
-  procedure g_mutex_unlock   (mutex: PGMutex);
-
-  procedure g_mutex_free     (mutex: PGMutex);
-
-  procedure g_cond_wait      (cond: PGCond; mutex: PGMutex);
-
-  function g_cond_timed_wait (cond: PGCond;
-                              mutex: PGMutex;
-                              end_time: PGTimeVal):gboolean;
-
-  function  g_mutex_new : PGMutex;
-  function  g_cond_new  : PGCond;
-
-  procedure g_cond_signal    (cond: PGCond);
-  procedure g_cond_broadcast (cond: PGCond);
-  procedure g_cond_free      (cond: PGCond);
-  function  g_private_new    (dest: TGDestroyNotify): PGPrivate;
-  function  g_private_get    (private_key: PGPrivate): gpointer;
-  procedure g_private_set    (var private_key: PGPrivate; data: gpointer);
-
-  procedure g_thread_yield;
-
+const
+  G_MUTEX_DEBUG_MAGIC = $f8e18ad7;
 
-  function g_thread_create      (func: TGThreadFunc;
-                                 data: gpointer;
-                                 joinable: gboolean;
-                                 error: PPGError): PGThread;
 
-  function g_thread_create_full (func : TGThreadFunc;
-                                 data : gpointer;
-                                 stack_size: gulong;
-                                 joinable, bound: gboolean;
-                                 priority : TGThreadPriority;
-                                 error    : ppGError): PGThread; cdecl; external gthreadlib name 'g_thread_create_full';
+function g_static_mutex_get_mutex_impl(mutex:PPGMutex):PGMutex;cdecl;external gthreadlib name 'g_static_mutex_get_mutex_impl';
 
+function  g_thread_supported: gboolean;
+procedure g_mutex_lock     (mutex: PGMutex);
+function  g_mutex_trylock  (mutex: PGMutex):gboolean;
+procedure g_mutex_unlock   (mutex: PGMutex);
+procedure g_mutex_free     (mutex: PGMutex);
+procedure g_cond_wait      (cond: PGCond; mutex: PGMutex);
+function g_cond_timed_wait (cond: PGCond;
+                            mutex: PGMutex;
+                            end_time: PGTimeVal):gboolean;
 
-  function g_thread_self:PGThread;cdecl;external gthreadlib name 'g_thread_self';
+function  g_mutex_new : PGMutex;
+function  g_cond_new  : PGCond;
 
-  procedure g_thread_exit(retval:gpointer);cdecl;external gthreadlib name 'g_thread_exit';
+procedure g_cond_signal    (cond: PGCond);
+procedure g_cond_broadcast (cond: PGCond);
+procedure g_cond_free      (cond: PGCond);
+function  g_private_new    (dest: TGDestroyNotify): PGPrivate;
+function  g_private_get    (private_key: PGPrivate): gpointer;
+procedure g_private_set    (var private_key: PGPrivate; data: gpointer);
 
-  function g_thread_join(thread:PGThread):gpointer;cdecl;external gthreadlib name 'g_thread_join';
+procedure g_thread_yield;
 
-  procedure g_thread_set_priority(thread:PGThread; priority:TGThreadPriority);cdecl;external gthreadlib name 'g_thread_set_priority';
 
-{ GStaticMutexes can be statically initialized with the value
-  G_STATIC_MUTEX_INIT, and then they can directly be used, that is
-  much easier, than having to explicitly allocate the mutex before
-  use
-}
-
-  procedure g_static_mutex_lock   (mutex: PGStaticMutex);
-
-  function  g_static_mutex_trylock (mutex: PGStaticMutex): gboolean;
-
-  procedure g_static_mutex_unlock (mutex: PGStaticMutex);
-
-
-  procedure g_static_mutex_free(mutex:PGStaticMutex);cdecl;external gthreadlib name 'g_static_mutex_free';
-
-
-  type
-    PGStaticPrivate = ^TGStaticPrivate;
-    TGStaticPrivate = record
-                        index : guint;
-                      end;
-
-  const
-    nG_STATIC_PRIVATE_INIT = 0;       //renamed because of conflict with function_name
-
-  procedure g_static_private_init(private_key:PGStaticPrivate);cdecl;external gthreadlib name 'g_static_private_init';
-
-  function g_static_private_get(private_key:PGStaticPrivate):gpointer;cdecl;external gthreadlib name 'g_static_private_get';
-
-  procedure g_static_private_set(private_key:PGStaticPrivate; data:gpointer; notify:TGDestroyNotify);cdecl;external gthreadlib name 'g_static_private_set';
-
-  procedure g_static_private_free(private_key:PGStaticPrivate);cdecl;external gthreadlib name 'g_static_private_free';
-
-  type
-    PGStaticRecMutex = ^TGStaticRecMutex;
-    TGStaticRecMutex = record
-            mutex : TGStaticMutex;
-            depth : guint;
-            owner : TGSystemThread;      // defined in glibconfig.inc
-         end;
-
-  const
-    nG_STATIC_MUTEX_INIT     = nil;      // from glibconfig.h
-    nG_STATIC_REC_MUTEX_INIT = nG_STATIC_MUTEX_INIT;
-
-
-  procedure g_static_rec_mutex_init(mutex:PGStaticRecMutex);cdecl;external gthreadlib name 'g_static_rec_mutex_init';
-
-  procedure g_static_rec_mutex_lock(mutex:PGStaticRecMutex);cdecl;external gthreadlib name 'g_static_rec_mutex_lock';
-
-  function g_static_rec_mutex_trylock(mutex:PGStaticRecMutex):gboolean;cdecl;external gthreadlib name 'g_static_rec_mutex_trylock';
-
-  procedure g_static_rec_mutex_unlock(mutex:PGStaticRecMutex);cdecl;external gthreadlib name 'g_static_rec_mutex_unlock';
-
-  procedure g_static_rec_mutex_lock_full(mutex:PGStaticRecMutex; depth:guint);cdecl;external gthreadlib name 'g_static_rec_mutex_lock_full';
-
-  function g_static_rec_mutex_unlock_full(mutex:PGStaticRecMutex):guint;cdecl;external gthreadlib name 'g_static_rec_mutex_unlock_full';
-
-  procedure g_static_rec_mutex_free(mutex:PGStaticRecMutex);cdecl;external gthreadlib name 'g_static_rec_mutex_free';
-
-
-  type
-     PGStaticRWLock = ^TGStaticRWLock;
-     TGStaticRWLock = record
-            mutex         : TGStaticMutex;
-            read_cond     : PGCond;
-            write_cond    : PGCond;
-            read_counter  : guint;
-            write         : gboolean;
-            want_to_read  : guint;
-            want_to_write : guint;
-         end;
+function g_thread_create      (func: TGThreadFunc;
+                               data: gpointer;
+                               joinable: gboolean;
+                               error: PPGError): PGThread;
 
-{* i can't translate this macro. any ideas???
- *
- * #define G_STATIC_RW_LOCK_INIT  G_STATIC_MUTEX_INIT, NULL, NULL, 0, FALSE, 0, 0
- *}
+function g_thread_create_full (func : TGThreadFunc;
+                               data : gpointer;
+                               stack_size: gulong;
+                               joinable, bound: gboolean;
+                               priority : TGThreadPriority;
+                               error    : ppGError): PGThread; cdecl; external gthreadlib name 'g_thread_create_full';
 
-    procedure g_static_rw_lock_init(lock:PGStaticRWLock);cdecl;external gthreadlib name 'g_static_rw_lock_init';
 
-    procedure g_static_rw_lock_reader_lock(lock:PGStaticRWLock);cdecl;external gthreadlib name 'g_static_rw_lock_reader_lock';
+function g_thread_self:PGThread;cdecl;external gthreadlib name 'g_thread_self';
+procedure g_thread_exit(retval:gpointer);cdecl;external gthreadlib name 'g_thread_exit';
+function g_thread_join(thread:PGThread):gpointer;cdecl;external gthreadlib name 'g_thread_join';
+procedure g_thread_set_priority(thread:PGThread; priority:TGThreadPriority);cdecl;external gthreadlib name 'g_thread_set_priority';
 
-    function g_static_rw_lock_reader_trylock(lock:PGStaticRWLock):gboolean;cdecl;external gthreadlib name 'g_static_rw_lock_reader_trylock';
+procedure g_static_mutex_lock   (mutex: PGStaticMutex);
+function  g_static_mutex_trylock (mutex: PGStaticMutex): gboolean;
+procedure g_static_mutex_unlock (mutex: PGStaticMutex);
+procedure g_static_mutex_free(mutex:PGStaticMutex);cdecl;external gthreadlib name 'g_static_mutex_free';
 
-    procedure g_static_rw_lock_reader_unlock(lock:PGStaticRWLock);cdecl;external gthreadlib name 'g_static_rw_lock_reader_unlock';
+const
+  nG_STATIC_PRIVATE_INIT = 0;       //renamed because of conflict with function_name
 
-    procedure g_static_rw_lock_writer_lock(lock:PGStaticRWLock);cdecl;external gthreadlib name 'g_static_rw_lock_writer_lock';
+procedure g_static_private_init(private_key:PGStaticPrivate);cdecl;external gthreadlib name 'g_static_private_init';
+function g_static_private_get(private_key:PGStaticPrivate):gpointer;cdecl;external gthreadlib name 'g_static_private_get';
+procedure g_static_private_set(private_key:PGStaticPrivate; data:gpointer; notify:TGDestroyNotify);cdecl;external gthreadlib name 'g_static_private_set';
+procedure g_static_private_free(private_key:PGStaticPrivate);cdecl;external gthreadlib name 'g_static_private_free';
 
-    function g_static_rw_lock_writer_trylock(lock:PGStaticRWLock):gboolean;cdecl;external gthreadlib name 'g_static_rw_lock_writer_trylock';
+const
+  nG_STATIC_MUTEX_INIT     = nil;      // from glibconfig.h
+  nG_STATIC_REC_MUTEX_INIT = nG_STATIC_MUTEX_INIT;
 
-    procedure g_static_rw_lock_writer_unlock(lock:PGStaticRWLock);cdecl;external gthreadlib name 'g_static_rw_lock_writer_unlock';
 
-    procedure g_static_rw_lock_free(lock:PGStaticRWLock);cdecl;external gthreadlib name 'g_static_rw_lock_free';
+procedure g_static_rec_mutex_init(mutex:PGStaticRecMutex);cdecl;external gthreadlib name 'g_static_rec_mutex_init';
+procedure g_static_rec_mutex_lock(mutex:PGStaticRecMutex);cdecl;external gthreadlib name 'g_static_rec_mutex_lock';
+function g_static_rec_mutex_trylock(mutex:PGStaticRecMutex):gboolean;cdecl;external gthreadlib name 'g_static_rec_mutex_trylock';
+procedure g_static_rec_mutex_unlock(mutex:PGStaticRecMutex);cdecl;external gthreadlib name 'g_static_rec_mutex_unlock';
+procedure g_static_rec_mutex_lock_full(mutex:PGStaticRecMutex; depth:guint);cdecl;external gthreadlib name 'g_static_rec_mutex_lock_full';
+function g_static_rec_mutex_unlock_full(mutex:PGStaticRecMutex):guint;cdecl;external gthreadlib name 'g_static_rec_mutex_unlock_full';
+procedure g_static_rec_mutex_free(mutex:PGStaticRecMutex);cdecl;external gthreadlib name 'g_static_rec_mutex_free';
 
-{ these are some convenience macros that expand to nothing if GLib
-  was configured with --disable-threads. for using StaticMutexes,
-  you define them with G_LOCK_DEFINE_STATIC (name) or G_LOCK_DEFINE (name)
-  if you need to export the mutex. With G_LOCK_EXTERN (name) you can
-  declare such an globally defined lock. name is a unique identifier
-  for the protected varibale or code portion. locking, testing and
-  unlocking of such mutexes can be done with G_LOCK(), G_UNLOCK() and
-  G_TRYLOCK() respectively.
-}
-    procedure glib_dummy_decl;cdecl;external gthreadlib name 'glib_dummy_decl';
 
-{ anyone an idea???
-    #define G_LOCK_NAME(name)               g__ ## name ## _lock
-    #define G_LOCK(name) g_static_mutex_lock       (&G_LOCK_NAME (name))
-    #define G_UNLOCK(name) g_static_mutex_unlock   (&G_LOCK_NAME (name))
-    #define G_TRYLOCK(name) g_static_mutex_trylock (&G_LOCK_NAME (name))
-}
+procedure g_static_rw_lock_init(lock:PGStaticRWLock);cdecl;external gthreadlib name 'g_static_rw_lock_init';
+procedure g_static_rw_lock_reader_lock(lock:PGStaticRWLock);cdecl;external gthreadlib name 'g_static_rw_lock_reader_lock';
+function g_static_rw_lock_reader_trylock(lock:PGStaticRWLock):gboolean;cdecl;external gthreadlib name 'g_static_rw_lock_reader_trylock';
+procedure g_static_rw_lock_reader_unlock(lock:PGStaticRWLock);cdecl;external gthreadlib name 'g_static_rw_lock_reader_unlock';
+procedure g_static_rw_lock_writer_lock(lock:PGStaticRWLock);cdecl;external gthreadlib name 'g_static_rw_lock_writer_lock';
+function g_static_rw_lock_writer_trylock(lock:PGStaticRWLock):gboolean;cdecl;external gthreadlib name 'g_static_rw_lock_writer_trylock';
+procedure g_static_rw_lock_writer_unlock(lock:PGStaticRWLock);cdecl;external gthreadlib name 'g_static_rw_lock_writer_unlock';
+procedure g_static_rw_lock_free(lock:PGStaticRWLock);cdecl;external gthreadlib name 'g_static_rw_lock_free';
 
-//{$endif}
+{$ENDIF read_interface_rest}
+// included by glib2.pas

+ 16 - 39
packages/gtk2/src/glib/gthreadpool.inc

@@ -1,57 +1,34 @@
 // included by glib2.pas
 
-type
-{ Thread Pools }
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
 
-{ The real GThreadPool is bigger, so you may only create a thread
-   pool with the constructor function  }
-   PGThreadPool = ^TGThreadPool;
-   TGThreadPool = record
-        func : TGFunc;
-        user_data : gpointer;
-        exclusive : gboolean;
-     end;
+//------------------------------------------------------------------------------
 
-{ Get a thread pool with the function func, at most max_threads may
-   run at a time (max_threads == -1 means no limit), exclusive == TRUE
-   means, that the threads shouldn't be shared and that they will be
-   prestarted (otherwise they are started as needed) user_data is the
-   2nd argument to the func  }
-function g_thread_pool_new(func:TGFunc; user_data:gpointer; max_threads:gint; exclusive:gboolean; error:PPGError):PGThreadPool; cdecl; external gliblib;
+{$IFDEF read_interface_types}
+  PGThreadPool = ^TGThreadPool;
+  TGThreadPool = record
+    func : TGFunc;
+    user_data : gpointer;
+    exclusive : gboolean;
+  end;
+{$ENDIF read_interface_types}
 
-{ Push new data into the thread pool. This task is assigned to a thread later
-   (when the maximal number of threads is reached for that pool) or now
-   (otherwise). If necessary a new thread will be started. The function
-   returns immediatly  }
-procedure g_thread_pool_push(pool:PGThreadPool; data:gpointer; error:PPGError); cdecl; external gliblib;
+//------------------------------------------------------------------------------
 
-{ Set the number of threads, which can run concurrently for that pool, -1
-   means no limit. 0 means has the effect, that the pool won't process
-   requests until the limit is set higher again  }
+{$IFDEF read_interface_rest}
+function g_thread_pool_new(func:TGFunc; user_data:gpointer; max_threads:gint; exclusive:gboolean; error:PPGError):PGThreadPool; cdecl; external gliblib;
+procedure g_thread_pool_push(pool:PGThreadPool; data:gpointer; error:PPGError); cdecl; external gliblib;
 procedure g_thread_pool_set_max_threads(pool:PGThreadPool; max_threads:gint; error:PPGError); cdecl; external gliblib;
 function g_thread_pool_get_max_threads(pool:PGThreadPool):gint; cdecl; external gliblib;
-
-{ Get the number of threads assigned to that pool. This number doesn't
-   necessarily represent the number of working threads in that pool  }
 function g_thread_pool_get_num_threads(pool:PGThreadPool):guint; cdecl; external gliblib;
-
-{ Get the number of unprocessed items in the pool  }
 function g_thread_pool_unprocessed(pool:PGThreadPool):guint; cdecl; external gliblib;
-
-{ Free the pool, immediate means, that all unprocessed items in the queue
-   wont be processed, wait means, that the function doesn't return immediatly,
-   but after all threads in the pool are ready processing items. immediate
-   does however not mean, that threads are killed.  }
 procedure g_thread_pool_free(pool:PGThreadPool; immediate:gboolean; wait:gboolean); cdecl; external gliblib;
-
-{ Set the maximal number of unused threads before threads will be stopped by
-   GLib, -1 means no limit  }
 procedure g_thread_pool_set_max_unused_threads(max_threads:gint); cdecl; external gliblib;
 function g_thread_pool_get_max_unused_threads:gint; cdecl; external gliblib;
 function g_thread_pool_get_num_unused_threads:guint; cdecl; external gliblib;
-
-{ Stop all currently unused threads, but leave the limit untouched  }
 procedure g_thread_pool_stop_unused_threads; cdecl; external gliblib;
+{$ENDIF read_interface_rest}
 
 // included by glib2.pas
 

+ 11 - 4
packages/gtk2/src/glib/gtimer.inc

@@ -1,12 +1,19 @@
 // included by glib2.pas
 
-{ Timer }
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
 
-type
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_types}
   PGTimer = pointer;
+{$ENDIF read_interface_types}
 
-{ microseconds per second  }
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_rest}
 
+{ microseconds per second  }
 const
    G_USEC_PER_SEC = 1000000;
 
@@ -18,6 +25,6 @@ procedure g_timer_reset(timer:PGTimer); cdecl; external gliblib;
 function g_timer_elapsed(timer:PGTimer; microseconds:Pgulong):gdouble; cdecl; external gliblib;
 procedure g_usleep(microseconds:gulong); cdecl; external gliblib;
 procedure g_time_val_add(time:PGTimeVal; microseconds:glong); cdecl; external gliblib;
-
+{$ENDIF read_interface_rest}
 // included by glib2.pas
 

+ 12 - 1
packages/gtk2/src/glib/gtree.inc

@@ -1,8 +1,18 @@
 // included by glib2.pas
-type
+
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_types}
    PGTree = pointer;
    TGTraverseFunc = function (key:gpointer; value:gpointer; data:gpointer):gboolean; cdecl;
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
 
+{$IFDEF read_interface_rest}
 { Balanced binary trees }
 
 function g_tree_new(key_compare_func:TGCompareFunc):PGTree; cdecl; external gliblib;
@@ -26,5 +36,6 @@ function g_tree_search(tree:PGTree; search_func:TGCompareFunc; user_data:gconstp
 function g_tree_height(tree:PGTree):gint; cdecl; external gliblib;
 function g_tree_nnodes(tree:PGTree):gint; cdecl; external gliblib;
 
+{$ENDIF read_interface_rest}
 // included by glib2.pas
 

+ 76 - 99
packages/gtk2/src/glib/gtype.inc

@@ -1,40 +1,98 @@
 // included by glib2.pas
 
 {$IFDEF read_forward_definitions}
-{ Typedefs }
    PGType = ^GType;
    GType = gulong;
 
-{ Basic Type Structures }
-{< private > }
    PGTypeClass = ^TGTypeClass;
    TGTypeClass = record
-        g_type : GType;
-     end;
+     g_type : GType;
+   end;
 
-{< private > }
    PGTypeInstance = ^TGTypeInstance;
    TGTypeInstance = record
-        g_class : PGTypeClass;
-     end;
+     g_class : PGTypeClass;
+   end;
 
-{< private > }
-{ iface type  }
    PGTypeInterface = ^TGTypeInterface;
    TGTypeInterface = record
-        g_type : GType;
-        g_instance_type : GType;
-     end;
+     g_type : GType;
+     g_instance_type : GType;
+   end;
 
    PGTypeQuery = ^TGTypeQuery;
    TGTypeQuery = record
-        _type : GType;
-        type_name : Pgchar;
-        class_size : guint;
-        instance_size : guint;
-     end;
+     _type : GType;
+     type_name : Pgchar;
+     class_size : guint;
+     instance_size : guint;
+   end;
 {$ENDIF read_forward_definitions}
 
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_types}
+
+   PGTypeDebugFlags = ^TGTypeDebugFlags;
+   TGTypeDebugFlags = longint;
+
+   TGBaseInitFunc = procedure (g_class:gpointer); cdecl;
+   TGBaseFinalizeFunc = procedure (g_class:gpointer); cdecl;
+   TGClassInitFunc = procedure (g_class:gpointer; class_data:gpointer); cdecl;
+   TGClassFinalizeFunc = procedure (g_class:gpointer; class_data:gpointer); cdecl;
+   TGInstanceInitFunc = procedure (instance:PGTypeInstance; g_class:gpointer); cdecl;
+   TGInterfaceInitFunc = procedure (g_iface:gpointer; iface_data:gpointer); cdecl;
+   TGInterfaceFinalizeFunc = procedure (g_iface:gpointer; iface_data:gpointer); cdecl;
+   TGTypeClassCacheFunc = function (cache_data:gpointer; g_class:PGTypeClass):gboolean; cdecl;
+   TGTranslateFunc = function (str:Pgchar;data:gpointer):Pgchar; cdecl;
+
+   PGTypeFundamentalFlags = ^TGTypeFundamentalFlags;
+   TGTypeFundamentalFlags = longint;
+
+   PGTypeFlags = ^TGTypeFlags;
+   TGTypeFlags = longint;
+
+   PGTypeValueTable = ^TGTypeValueTable;
+   TGTypeValueTable = record
+        value_init : procedure (value:PGValue); cdecl;
+        value_free : procedure (value:PGValue); cdecl;
+        value_copy : procedure (src_value:PGValue; dest_value:PGValue); cdecl;
+        value_peek_pointer : function (value:PGValue):gpointer; cdecl;
+        collect_format : Pgchar;
+        collect_value : function (value:PGValue; n_collect_values:guint; collect_values:PGTypeCValue; collect_flags:guint):Pgchar; cdecl;
+        lcopy_format : Pgchar;
+        lcopy_value : function (value:PGValue; n_collect_values:guint; collect_values:PGTypeCValue; collect_flags:guint):Pgchar; cdecl;
+     end;
+
+
+   PGTypeInfo = ^TGTypeInfo;
+   TGTypeInfo = record
+        class_size : guint16;
+        base_init : TGBaseInitFunc;
+        base_finalize : TGBaseFinalizeFunc;
+        class_init : TGClassInitFunc;
+        class_finalize : TGClassFinalizeFunc;
+        class_data : gconstpointer;
+        instance_size : guint16;
+        n_preallocs : guint16;
+        instance_init : TGInstanceInitFunc;
+        value_table : PGTypeValueTable;
+     end;
+
+   PGTypeFundamentalInfo = ^TGTypeFundamentalInfo;
+   TGTypeFundamentalInfo = record
+        type_flags : TGTypeFundamentalFlags;
+     end;
+
+   PGInterfaceInfo = ^TGInterfaceInfo;
+   TGInterfaceInfo = record
+        interface_init : TGInterfaceInitFunc;
+        interface_finalize : TGInterfaceFinalizeFunc;
+        interface_data : gpointer;
+     end;
+{$ENDIF read_interface_types}
+
 //------------------------------------------------------------------------------
 
 {$IFDEF read_interface_rest}
@@ -76,7 +134,6 @@ const
 
 function G_TYPE_MAKE_FUNDAMENTAL(x : longint) : GType;
 
-
 const
    G_TYPE_RESERVED_GLIB_FIRST = 21;
    G_TYPE_RESERVED_GLIB_LAST = 31;
@@ -117,10 +174,6 @@ function G_TYPE_FROM_INTERFACE(g_iface : Pointer) : GType;
 
 { debug flags for g_type_init_with_debug_flags()  }
 {< skip > }
-type
-   PGTypeDebugFlags = ^TGTypeDebugFlags;
-   TGTypeDebugFlags = longint;
-
 const
    G_TYPE_DEBUG_NONE = 0;
    G_TYPE_DEBUG_OBJECTS = 1 shl 0;
@@ -154,92 +207,16 @@ function g_type_get_qdata(_type:GType; quark:TGQuark):gpointer; cdecl; external
 procedure g_type_query(_type:GType; query:PGTypeQuery); cdecl; external gobjectlib;
 
 
-{ --- type registration ---  }
-type
-   TGBaseInitFunc = procedure (g_class:gpointer); cdecl;
-
-   TGBaseFinalizeFunc = procedure (g_class:gpointer); cdecl;
-
-   TGClassInitFunc = procedure (g_class:gpointer; class_data:gpointer); cdecl;
-
-   TGClassFinalizeFunc = procedure (g_class:gpointer; class_data:gpointer); cdecl;
-
-   TGInstanceInitFunc = procedure (instance:PGTypeInstance; g_class:gpointer); cdecl;
-
-   TGInterfaceInitFunc = procedure (g_iface:gpointer; iface_data:gpointer); cdecl;
-
-   TGInterfaceFinalizeFunc = procedure (g_iface:gpointer; iface_data:gpointer); cdecl;
-
-   TGTypeClassCacheFunc = function (cache_data:gpointer; g_class:PGTypeClass):gboolean; cdecl;
-
-{< skip > }
-
-   PGTypeFundamentalFlags = ^TGTypeFundamentalFlags;
-   TGTypeFundamentalFlags = longint;
-
 const
    G_TYPE_FLAG_CLASSED        = 1 shl 0;
    G_TYPE_FLAG_INSTANTIATABLE = 1 shl 1;
    G_TYPE_FLAG_DERIVABLE      = 1 shl 2;
    G_TYPE_FLAG_DEEP_DERIVABLE = 1 shl 3;
 
-
-{< skip > }
-type
-   PGTypeFlags = ^TGTypeFlags;
-   TGTypeFlags = longint;
-
 const
    G_TYPE_FLAG_ABSTRACT = 1 shl 4;
    G_TYPE_FLAG_VALUE_ABSTRACT = 1 shl 5;
 
-type
-{ interface types, classed types, instantiated types  }
-
-{ varargs functionality (optional)  }
-   PGTypeValueTable = ^TGTypeValueTable;
-   TGTypeValueTable = record
-        value_init : procedure (value:PGValue); cdecl;
-        value_free : procedure (value:PGValue); cdecl;
-        value_copy : procedure (src_value:PGValue; dest_value:PGValue); cdecl;
-        value_peek_pointer : function (value:PGValue):gpointer; cdecl;
-        collect_format : Pgchar;
-        collect_value : function (value:PGValue; n_collect_values:guint; collect_values:PGTypeCValue; collect_flags:guint):Pgchar; cdecl;
-        lcopy_format : Pgchar;
-        lcopy_value : function (value:PGValue; n_collect_values:guint; collect_values:PGTypeCValue; collect_flags:guint):Pgchar; cdecl;
-     end;
-
-
-{ classed types, instantiated types  }
-{ instantiated types  }
-{ value handling  }
-   PGTypeInfo = ^TGTypeInfo;
-   TGTypeInfo = record
-        class_size : guint16;
-        base_init : TGBaseInitFunc;
-        base_finalize : TGBaseFinalizeFunc;
-        class_init : TGClassInitFunc;
-        class_finalize : TGClassFinalizeFunc;
-        class_data : gconstpointer;
-        instance_size : guint16;
-        n_preallocs : guint16;
-        instance_init : TGInstanceInitFunc;
-        value_table : PGTypeValueTable;
-     end;
-
-   PGTypeFundamentalInfo = ^TGTypeFundamentalInfo;
-   TGTypeFundamentalInfo = record
-        type_flags : TGTypeFundamentalFlags;
-     end;
-
-   PGInterfaceInfo = ^TGInterfaceInfo;
-   TGInterfaceInfo = record
-        interface_init : TGInterfaceInitFunc;
-        interface_finalize : TGInterfaceFinalizeFunc;
-        interface_data : gpointer;
-     end;
-
-
 function g_type_register_static(parent_type:GType; type_name:Pgchar; info:PGTypeInfo; flags:TGTypeFlags):GType; cdecl; external gobjectlib;
 function g_type_register_dynamic(parent_type:GType; type_name:Pgchar; plugin:PGTypePlugin; flags:TGTypeFlags):GType; cdecl; external gobjectlib;
 function g_type_register_fundamental(type_id:GType; type_name:Pgchar; info:PGTypeInfo; finfo:PGTypeFundamentalInfo; flags:TGTypeFlags):GType; cdecl; external gobjectlib;

+ 6 - 3
packages/gtk2/src/glib/gtypeplugin.inc

@@ -3,11 +3,10 @@
 {$IFDEF read_forward_definitions}
 {$ENDIF read_forward_definitions}
 
+
 //------------------------------------------------------------------------------
 
-{$IFDEF read_interface_rest}
-{ --- typedefs & structures ---  }
-type
+{$IFDEF read_interface_types}
    TGTypePluginUse = procedure (plugin:PGTypePlugin); cdecl;
 
    TGTypePluginUnuse = procedure (plugin:PGTypePlugin); cdecl;
@@ -23,7 +22,11 @@ type
         complete_type_info : TGTypePluginCompleteTypeInfo;
         complete_interface_info : TGTypePluginCompleteInterfaceInfo;
      end;
+{$ENDIF read_interface_types}
 
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_rest}
 function G_TYPE_TYPE_PLUGIN : GType;
 function G_TYPE_PLUGIN(inst : Pointer) : PGTypePlugin;
 function G_TYPE_PLUGIN_CLASS(vtable : Pointer) : PGTypePluginClass;

+ 89 - 89
packages/gtk2/src/glib/gunicode.inc

@@ -1,88 +1,91 @@
-{*
- * gunicode.inc
- *
- * depends on gerror.inc, gtypes.inc
- *}
-
-
-    type
-       Pgunichar  = ^gunichar;
-       gunichar   = guint32;
-
-       Pgunichar2 = ^gunichar2;
-       gunichar2 = guint16;
-
-    { These are the possible character classifications.
-       See http://www.unicode.org/Public/UNIDATA/UnicodeData.html
-      }
-
-       PGUnicodeType = ^TGUnicodeType;
-       TGUnicodeType = (G_UNICODE_CONTROL,
-                        G_UNICODE_FORMAT,
-                        G_UNICODE_UNASSIGNED,
-                        G_UNICODE_PRIVATE_USE,
-                        G_UNICODE_SURROGATE,
-                        G_UNICODE_LOWERCASE_LETTER,
-                        G_UNICODE_MODIFIER_LETTER,
-                        G_UNICODE_OTHER_LETTER,
-                        G_UNICODE_TITLECASE_LETTER,
-                        G_UNICODE_UPPERCASE_LETTER,
-                        G_UNICODE_COMBINING_MARK,
-                        G_UNICODE_ENCLOSING_MARK,
-                        G_UNICODE_NON_SPACING_MARK,
-                        G_UNICODE_DECIMAL_NUMBER,
-                        G_UNICODE_LETTER_NUMBER,
-                        G_UNICODE_OTHER_NUMBER,
-                        G_UNICODE_CONNECT_PUNCTUATION,
-                        G_UNICODE_DASH_PUNCTUATION,
-                        G_UNICODE_CLOSE_PUNCTUATION,
-                        G_UNICODE_FINAL_PUNCTUATION,
-                        G_UNICODE_INITIAL_PUNCTUATION,
-                        G_UNICODE_OTHER_PUNCTUATION,
-                        G_UNICODE_OPEN_PUNCTUATION,
-                        G_UNICODE_CURRENCY_SYMBOL,
-                        G_UNICODE_MODIFIER_SYMBOL,
-                        G_UNICODE_MATH_SYMBOL,
-                        G_UNICODE_OTHER_SYMBOL,
-                        G_UNICODE_LINE_SEPARATOR,
-                        G_UNICODE_PARAGRAPH_SEPARATOR,
-                        G_UNICODE_SPACE_SEPARATOR);
-
-    { These are the possible line break classifications.
-       See http://www.unicode.org/unicode/reports/tr14/
-      }
-
-       PGUnicodeBreakType = ^TGUnicodeBreakType;
-       TGUnicodeBreakType = (G_UNICODE_BREAK_MANDATORY,
-                             G_UNICODE_BREAK_CARRIAGE_RETURN,
-                             G_UNICODE_BREAK_LINE_FEED,
-                             G_UNICODE_BREAK_COMBINING_MARK,
-                             G_UNICODE_BREAK_SURROGATE,
-                             G_UNICODE_BREAK_ZERO_WIDTH_SPACE,
-                             G_UNICODE_BREAK_INSEPARABLE,
-                             G_UNICODE_BREAK_NON_BREAKING_GLUE,
-                             G_UNICODE_BREAK_CONTINGENT,
-                             G_UNICODE_BREAK_SPACE,
-                             G_UNICODE_BREAK_AFTER,
-                             G_UNICODE_BREAK_BEFORE,
-                             G_UNICODE_BREAK_BEFORE_AND_AFTER,
-                             G_UNICODE_BREAK_HYPHEN,
-                             G_UNICODE_BREAK_NON_STARTER,
-                             G_UNICODE_BREAK_OPEN_PUNCTUATION,
-                             G_UNICODE_BREAK_CLOSE_PUNCTUATION,
-                             G_UNICODE_BREAK_QUOTATION,
-                             G_UNICODE_BREAK_EXCLAMATION,
-                             G_UNICODE_BREAK_IDEOGRAPHIC,
-                             G_UNICODE_BREAK_NUMERIC,
-                             G_UNICODE_BREAK_INFIX_SEPARATOR,
-                             G_UNICODE_BREAK_SYMBOL,
-                             G_UNICODE_BREAK_ALPHABETIC,
-                             G_UNICODE_BREAK_PREFIX,
-                             G_UNICODE_BREAK_POSTFIX,
-                             G_UNICODE_BREAK_COMPLEX_CONTEXT,
-                             G_UNICODE_BREAK_AMBIGUOUS,
-                             G_UNICODE_BREAK_UNKNOWN);
-
+// included by glib2.pas
+
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_types}
+   Pgunichar  = ^gunichar;
+   gunichar   = guint32;
+
+   Pgunichar2 = ^gunichar2;
+   gunichar2 = guint16;
+
+   PGUnicodeType = ^TGUnicodeType;
+   TGUnicodeType = (
+     G_UNICODE_CONTROL,
+     G_UNICODE_FORMAT,
+     G_UNICODE_UNASSIGNED,
+     G_UNICODE_PRIVATE_USE,
+     G_UNICODE_SURROGATE,
+     G_UNICODE_LOWERCASE_LETTER,
+     G_UNICODE_MODIFIER_LETTER,
+     G_UNICODE_OTHER_LETTER,
+     G_UNICODE_TITLECASE_LETTER,
+     G_UNICODE_UPPERCASE_LETTER,
+     G_UNICODE_COMBINING_MARK,
+     G_UNICODE_ENCLOSING_MARK,
+     G_UNICODE_NON_SPACING_MARK,
+     G_UNICODE_DECIMAL_NUMBER,
+     G_UNICODE_LETTER_NUMBER,
+     G_UNICODE_OTHER_NUMBER,
+     G_UNICODE_CONNECT_PUNCTUATION,
+     G_UNICODE_DASH_PUNCTUATION,
+     G_UNICODE_CLOSE_PUNCTUATION,
+     G_UNICODE_FINAL_PUNCTUATION,
+     G_UNICODE_INITIAL_PUNCTUATION,
+     G_UNICODE_OTHER_PUNCTUATION,
+     G_UNICODE_OPEN_PUNCTUATION,
+     G_UNICODE_CURRENCY_SYMBOL,
+     G_UNICODE_MODIFIER_SYMBOL,
+     G_UNICODE_MATH_SYMBOL,
+     G_UNICODE_OTHER_SYMBOL,
+     G_UNICODE_LINE_SEPARATOR,
+     G_UNICODE_PARAGRAPH_SEPARATOR,
+     G_UNICODE_SPACE_SEPARATOR
+   );
+
+   PGUnicodeBreakType = ^TGUnicodeBreakType;
+   TGUnicodeBreakType = (
+     G_UNICODE_BREAK_MANDATORY,
+     G_UNICODE_BREAK_CARRIAGE_RETURN,
+     G_UNICODE_BREAK_LINE_FEED,
+     G_UNICODE_BREAK_COMBINING_MARK,
+     G_UNICODE_BREAK_SURROGATE,
+     G_UNICODE_BREAK_ZERO_WIDTH_SPACE,
+     G_UNICODE_BREAK_INSEPARABLE,
+     G_UNICODE_BREAK_NON_BREAKING_GLUE,
+     G_UNICODE_BREAK_CONTINGENT,
+     G_UNICODE_BREAK_SPACE,
+     G_UNICODE_BREAK_AFTER,
+     G_UNICODE_BREAK_BEFORE,
+     G_UNICODE_BREAK_BEFORE_AND_AFTER,
+     G_UNICODE_BREAK_HYPHEN,
+     G_UNICODE_BREAK_NON_STARTER,
+     G_UNICODE_BREAK_OPEN_PUNCTUATION,
+     G_UNICODE_BREAK_CLOSE_PUNCTUATION,
+     G_UNICODE_BREAK_QUOTATION,
+     G_UNICODE_BREAK_EXCLAMATION,
+     G_UNICODE_BREAK_IDEOGRAPHIC,
+     G_UNICODE_BREAK_NUMERIC,
+     G_UNICODE_BREAK_INFIX_SEPARATOR,
+     G_UNICODE_BREAK_SYMBOL,
+     G_UNICODE_BREAK_ALPHABETIC,
+     G_UNICODE_BREAK_PREFIX,
+     G_UNICODE_BREAK_POSTFIX,
+     G_UNICODE_BREAK_COMPLEX_CONTEXT,
+     G_UNICODE_BREAK_AMBIGUOUS,
+     G_UNICODE_BREAK_UNKNOWN
+   );
+
+   PGNormalizeMode = ^TGNormalizeMode;
+   TGNormalizeMode = gint;
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_rest}
     { Returns TRUE if current locale uses UTF-8 charset.  If CHARSET is
        not null, sets  CHARSET to the name of the current locale's
        charset.  This value is statically allocated, and should be copied
@@ -221,10 +224,6 @@
     function g_utf8_casefold(str:Pgchar; len:gssize):Pgchar;cdecl;external gliblib name 'g_utf8_casefold';
 
 
-    type
-
-       PGNormalizeMode = ^TGNormalizeMode;
-       TGNormalizeMode = gint;
     const G_NORMALIZE_DEFAULT         = 0;
           G_NORMALIZE_NFD             = G_NORMALIZE_DEFAULT;
           G_NORMALIZE_DEFAULT_COMPOSE = 1;
@@ -239,3 +238,4 @@
     function g_utf8_collate(str1:Pgchar; str2:Pgchar):gint;cdecl;external gliblib name 'g_utf8_collate';
 
     function g_utf8_collate_key(str:Pgchar; len:gssize):Pgchar;cdecl;external gliblib name 'g_utf8_collate_key';
+{$ENDIF read_interface_rest}

+ 13 - 5
packages/gtk2/src/glib/gutils.inc

@@ -1,9 +1,16 @@
-{*
- * gutils.inc
- *
- * depends on gtypes.inc
- *}
+// included by glib2.pas
 
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_types}
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_rest}
 {$ifdef WIN32}
 
   { On native Win32, directory separator is the backslash, and search path
@@ -160,3 +167,4 @@
 
     function GLIB_CHECK_VERSION (major, minor, micro: guint):boolean;
 {$ENDIF}
+{$ENDIF read_interface_rest}

+ 21 - 18
packages/gtk2/src/glib/gvalue.inc

@@ -1,28 +1,31 @@
 // included by glib2.pas
 
 {$IFDEF read_forward_definitions}
-{< private > }
-{ public for GTypeValueTable methods  }
-   PGValue = ^TGValue;
-   TGValue = record
-        g_type : GType;
-        data : array[0..1] of record
-            case longint of
-               0 : ( v_int : gint );
-               1 : ( v_uint : guint );
-               2 : ( v_long : glong );
-               3 : ( v_ulong : gulong );
-               4 : ( v_int64 : gint64 );
-               5 : ( v_uint64 : guint64 );
-               6 : ( v_float : gfloat );
-               7 : ( v_double : gdouble );
-               8 : ( v_pointer : gpointer );
-            end;
-     end;
+  PGValue = ^TGValue;
 {$ENDIF read_forward_definitions}
 
 //------------------------------------------------------------------------------
 
+{$IFDEF read_interface_types}
+  TGValue = record
+       g_type : GType;
+       data : array[0..1] of record
+           case longint of
+              0 : ( v_int : gint );
+              1 : ( v_uint : guint );
+              2 : ( v_long : glong );
+              3 : ( v_ulong : gulong );
+              4 : ( v_int64 : gint64 );
+              5 : ( v_uint64 : guint64 );
+              6 : ( v_float : gfloat );
+              7 : ( v_double : gdouble );
+              8 : ( v_pointer : gpointer );
+           end;
+    end;
+{$ENDIF read_interface_types}
+
+//------------------------------------------------------------------------------
+
 {$IFDEF read_interface_rest}
 
 

+ 9 - 23
packages/gtk2/src/glib/gvaluearray.inc

@@ -1,37 +1,22 @@
+// included by glib2.pas
 
-{ GObject - GLib Type, Object, Parameter and Signal Library
-   Copyright (C) 2001 Red Hat, Inc.
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
 
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
+//------------------------------------------------------------------------------
 
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General
-   Public License along with this library; if not, write to the
-   Free Software Foundation, Inc., 59 Temple Place, Suite 330,
-   Boston, MA 02111-1307, USA.
-
-   gvaluearray.h: GLib array type holding GValues
-  }
-
-{ --- typedefs & structs ---  }
-type
-{< private > }
+{$IFDEF read_interface_types}
    PGValueArray = ^TGValueArray;
    TGValueArray = record
         n_values : guint;
         values : PGValue;
         n_prealloced : guint;
      end;
+{$ENDIF read_interface_types}
 
-{ --- prototypes ---  }
+//------------------------------------------------------------------------------
 
+{$IFDEF read_interface_rest}
 function g_value_array_get_nth(value_array:PGValueArray; index:guint):PGValue; cdecl; external gobjectlib;
 function g_value_array_new(n_prealloced:guint):PGValueArray; cdecl; external gobjectlib;
 procedure g_value_array_free(value_array:PGValueArray); cdecl; external gobjectlib;
@@ -47,3 +32,4 @@ function g_value_array_remove(value_array:PGValueArray; index:guint):PGValueArra
 function g_value_array_sort(value_array:PGValueArray; compare_func:TGCompareFunc):PGValueArray; cdecl; external gobjectlib;
 function g_value_array_sort_with_data(value_array:PGValueArray; compare_func:TGCompareDataFunc; user_data:gpointer):PGValueArray; cdecl; external gobjectlib;
 
+{$ENDIF read_interface_rest}

+ 7 - 3
packages/gtk2/src/glib/gvaluecollector.inc

@@ -1,9 +1,13 @@
 // included by glib2.pas
 
 {$IFDEF read_forward_definitions}
-{ vararg union holding actuall values collected
-  }
    PGTypeCValue = ^TGTypeCValue;
+{$ENDIF read_forward_definitions}
+
+
+//------------------------------------------------------------------------------
+
+{$IFDEF read_interface_types}
    TGTypeCValue = record
        case longint of
           0 : ( v_int : gint );
@@ -12,7 +16,7 @@
           3 : ( v_double : gdouble );
           4 : ( v_pointer : gpointer );
        end;
-{$ENDIF read_forward_definitions}
+{$ENDIF read_interface_types}
 
 //------------------------------------------------------------------------------
 

+ 12 - 23
packages/gtk2/src/glib/gvaluetypes.inc

@@ -1,25 +1,18 @@
-{ GObject - GLib Type, Object, Parameter and Signal Library
-   Copyright (C) 1997-1999, 2000-2001 Tim Janik and Red Hat, Inc.
+// included by glib2.pas
 
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
 
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
+//------------------------------------------------------------------------------
 
-   You should have received a copy of the GNU Lesser General
-   Public License along with this library; if not, write to the
-   Free Software Foundation, Inc., 59 Temple Place, Suite 330,
-   Boston, MA 02111-1307, USA.
-
-   gvaluetypes.h: GLib default values
-  }
+{$IFDEF read_interface_types}
+   Pgchararray = ^Tgchararray;
+   Tgchararray = gchar;
+{$ENDIF read_interface_types}
 
+//------------------------------------------------------------------------------
 
+{$IFDEF read_interface_rest}
 { --- type macros ---  }
 
 function G_VALUE_HOLDS_CHAR(value : PGValue) : boolean;
@@ -102,10 +95,6 @@ function g_strdup_value_contents(value:PGValue):Pgchar; cdecl; external gobjectl
 { --- marshaller specific ---  }
 procedure g_value_set_string_take_ownership(value:PGValue; v_string:Pgchar); cdecl; external gobjectlib;
 { humpf, need a C representable type name for G_TYPE_STRING  }
-type
-
-   Pgchararray = ^Tgchararray;
-   Tgchararray = gchar;
-
-
 
+{$ENDIF read_interface_rest}
+// included by glib2.pas

+ 31 - 35
packages/gtk2/src/glib/gwin32.inc

@@ -1,48 +1,44 @@
-{*
- *  gwin32.inc
- *
- *  depends on gtypes.inc
- *}
+// included by glib2.pas
 
-{$ifdef WIN32}
+{$IFDEF read_forward_definitions}
+{$ENDIF read_forward_definitions}
 
-{ Windows emulation stubs for common Unix functions
-}
-
-    const
-      MAXPATHLEN = 1024;
-
-    type
+//------------------------------------------------------------------------------
 
-       Ppid_t = ^Tpid_t;
-       Tpid_t = longint;
+{$IFDEF read_interface_types}
+  Ppid_t = ^Tpid_t;
+  Tpid_t = longint;
+{$ENDIF read_interface_types}
 
-    { For some POSIX functions that are not provided by the MS runtime,
-       we provide emulators in glib, which are prefixed with g_win32_.
-      }
-    function ftruncate(f:gint; size:guint):gint;cdecl;external gliblib name 'g_win32_ftruncate';
+//------------------------------------------------------------------------------
 
-    function g_win32_ftruncate(f:gint; size:guint):gint;cdecl;external gliblib name 'g_win32_ftruncate';
+{$IFDEF read_interface_rest}
+const
+  MAXPATHLEN = 1024;
 
-    { The MS setlocale uses locale names of the form "English_United
-       States.1252" etc. We want the Unixish standard form "en", "zh_TW"
-       etc. This function gets the current thread locale from Windows and
-       returns it as a string of the above form for use in forming file
-       names etc. The returned string should be deallocated with g_free().
-      }
+{ For some POSIX functions that are not provided by the MS runtime,
+  we provide emulators in glib, which are prefixed with g_win32_. }
 
-    function g_win32_getlocale:Pgchar;cdecl;external gliblib name 'g_win32_getlocale';
+function ftruncate(f:gint; size:guint):gint;cdecl;external gliblib name 'g_win32_ftruncate';
 
-    { Translate a Win32 error code (as returned by GetLastError()) into
-       the corresponding message. The returned string should be deallocated
-       with g_free().
-      }
-    function g_win32_error_message(error:gint):Pgchar;cdecl;external gliblib name 'g_win32_error_message';
+function g_win32_ftruncate(f:gint; size:guint):gint;cdecl;external gliblib name 'g_win32_ftruncate';
 
-    function g_win32_get_package_installation_directory(package:Pgchar; dll_name:Pgchar):Pgchar;cdecl;external gliblib name 'g_win32_get_package_installation_directory';
+{ The MS setlocale uses locale names of the form "English_United
+   States.1252" etc. We want the Unixish standard form "en", "zh_TW"
+   etc. This function gets the current thread locale from Windows and
+   returns it as a string of the above form for use in forming file
+   names etc. The returned string should be deallocated with g_free().
+}
 
-    function g_win32_get_package_installation_subdirectory(package:Pgchar; dll_name:Pgchar; subdir:Pgchar):Pgchar;cdecl;external gliblib name 'g_win32_get_package_installation_subdirectory';
+function g_win32_getlocale:Pgchar;cdecl;external gliblib name 'g_win32_getlocale';
 
+{ Translate a Win32 error code (as returned by GetLastError()) into
+   the corresponding message. The returned string should be deallocated
+   with g_free().
+}
 
+function g_win32_error_message(error:gint):Pgchar;cdecl;external gliblib name 'g_win32_error_message';
+function g_win32_get_package_installation_directory(package:Pgchar; dll_name:Pgchar):Pgchar;cdecl;external gliblib name 'g_win32_get_package_installation_directory';
+function g_win32_get_package_installation_subdirectory(package:Pgchar; dll_name:Pgchar; subdir:Pgchar):Pgchar;cdecl;external gliblib name 'g_win32_get_package_installation_subdirectory';
 
-{$endif}
+{$ENDIF read_interface_rest}