Pārlūkot izejas kodu

* updated ptc c_api

git-svn-id: trunk@16143 -
nickysn 15 gadi atpakaļ
vecāks
revīzija
e97106b8cc
58 mainītis faili ar 3143 papildinājumiem un 2374 dzēšanām
  1. 29 29
      .gitattributes
  2. 0 140
      packages/ptc/src/c_api/area.inc
  3. 0 15
      packages/ptc/src/c_api/aread.inc
  4. 161 0
      packages/ptc/src/c_api/capi_area.inc
  5. 47 0
      packages/ptc/src/c_api/capi_aread.inc
  6. 76 0
      packages/ptc/src/c_api/capi_clear.inc
  7. 41 0
      packages/ptc/src/c_api/capi_cleard.inc
  8. 62 0
      packages/ptc/src/c_api/capi_clipper.inc
  9. 37 0
      packages/ptc/src/c_api/capi_clipperd.inc
  10. 196 0
      packages/ptc/src/c_api/capi_color.inc
  11. 50 0
      packages/ptc/src/c_api/capi_colord.inc
  12. 488 0
      packages/ptc/src/c_api/capi_console.inc
  13. 115 0
      packages/ptc/src/c_api/capi_consoled.inc
  14. 100 0
      packages/ptc/src/c_api/capi_copy.inc
  15. 48 0
      packages/ptc/src/c_api/capi_copyd.inc
  16. 120 0
      packages/ptc/src/c_api/capi_error.inc
  17. 47 0
      packages/ptc/src/c_api/capi_errord.inc
  18. 55 0
      packages/ptc/src/c_api/capi_except.inc
  19. 34 0
      packages/ptc/src/c_api/capi_exceptd.inc
  20. 209 0
      packages/ptc/src/c_api/capi_format.inc
  21. 51 0
      packages/ptc/src/c_api/capi_formatd.inc
  22. 46 0
      packages/ptc/src/c_api/capi_index.inc
  23. 131 0
      packages/ptc/src/c_api/capi_key.inc
  24. 40 8
      packages/ptc/src/c_api/capi_keyd.inc
  25. 144 0
      packages/ptc/src/c_api/capi_mode.inc
  26. 48 0
      packages/ptc/src/c_api/capi_moded.inc
  27. 149 0
      packages/ptc/src/c_api/capi_palette.inc
  28. 53 0
      packages/ptc/src/c_api/capi_paletted.inc
  29. 293 0
      packages/ptc/src/c_api/capi_surface.inc
  30. 74 0
      packages/ptc/src/c_api/capi_surfaced.inc
  31. 148 0
      packages/ptc/src/c_api/capi_timer.inc
  32. 51 0
      packages/ptc/src/c_api/capi_timerd.inc
  33. 0 48
      packages/ptc/src/c_api/clear.inc
  34. 0 9
      packages/ptc/src/c_api/cleard.inc
  35. 0 33
      packages/ptc/src/c_api/clipper.inc
  36. 0 5
      packages/ptc/src/c_api/clipperd.inc
  37. 0 177
      packages/ptc/src/c_api/color.inc
  38. 0 18
      packages/ptc/src/c_api/colord.inc
  39. 0 497
      packages/ptc/src/c_api/console.inc
  40. 0 83
      packages/ptc/src/c_api/consoled.inc
  41. 0 74
      packages/ptc/src/c_api/copy.inc
  42. 0 16
      packages/ptc/src/c_api/copyd.inc
  43. 0 96
      packages/ptc/src/c_api/error.inc
  44. 0 15
      packages/ptc/src/c_api/errord.inc
  45. 0 23
      packages/ptc/src/c_api/except.inc
  46. 0 2
      packages/ptc/src/c_api/exceptd.inc
  47. 0 191
      packages/ptc/src/c_api/format.inc
  48. 0 19
      packages/ptc/src/c_api/formatd.inc
  49. 0 14
      packages/ptc/src/c_api/index.inc
  50. 0 107
      packages/ptc/src/c_api/key.inc
  51. 0 121
      packages/ptc/src/c_api/mode.inc
  52. 0 16
      packages/ptc/src/c_api/moded.inc
  53. 0 126
      packages/ptc/src/c_api/palette.inc
  54. 0 21
      packages/ptc/src/c_api/paletted.inc
  55. 0 284
      packages/ptc/src/c_api/surface.inc
  56. 0 42
      packages/ptc/src/c_api/surfaced.inc
  57. 0 126
      packages/ptc/src/c_api/timer.inc
  58. 0 19
      packages/ptc/src/c_api/timerd.inc

+ 29 - 29
.gitattributes

@@ -5058,35 +5058,35 @@ packages/ptc/examples/tunnel.pp svneol=native#text/plain
 packages/ptc/examples/tunnel3d.pp svneol=native#text/plain
 packages/ptc/examples/tunnel3d.pp svneol=native#text/plain
 packages/ptc/examples/tunnel3d.raw -text svneol=unset#raw/binary
 packages/ptc/examples/tunnel3d.raw -text svneol=unset#raw/binary
 packages/ptc/fpmake_disabled.pp svneol=native#text/plain
 packages/ptc/fpmake_disabled.pp svneol=native#text/plain
-packages/ptc/src/c_api/area.inc svneol=native#text/plain
-packages/ptc/src/c_api/aread.inc svneol=native#text/plain
-packages/ptc/src/c_api/clear.inc svneol=native#text/plain
-packages/ptc/src/c_api/cleard.inc svneol=native#text/plain
-packages/ptc/src/c_api/clipper.inc svneol=native#text/plain
-packages/ptc/src/c_api/clipperd.inc svneol=native#text/plain
-packages/ptc/src/c_api/color.inc svneol=native#text/plain
-packages/ptc/src/c_api/colord.inc svneol=native#text/plain
-packages/ptc/src/c_api/console.inc svneol=native#text/plain
-packages/ptc/src/c_api/consoled.inc svneol=native#text/plain
-packages/ptc/src/c_api/copy.inc svneol=native#text/plain
-packages/ptc/src/c_api/copyd.inc svneol=native#text/plain
-packages/ptc/src/c_api/error.inc svneol=native#text/plain
-packages/ptc/src/c_api/errord.inc svneol=native#text/plain
-packages/ptc/src/c_api/except.inc svneol=native#text/plain
-packages/ptc/src/c_api/exceptd.inc svneol=native#text/plain
-packages/ptc/src/c_api/format.inc svneol=native#text/plain
-packages/ptc/src/c_api/formatd.inc svneol=native#text/plain
-packages/ptc/src/c_api/index.inc svneol=native#text/plain
-packages/ptc/src/c_api/key.inc svneol=native#text/plain
-packages/ptc/src/c_api/keyd.inc svneol=native#text/plain
-packages/ptc/src/c_api/mode.inc svneol=native#text/plain
-packages/ptc/src/c_api/moded.inc svneol=native#text/plain
-packages/ptc/src/c_api/palette.inc svneol=native#text/plain
-packages/ptc/src/c_api/paletted.inc svneol=native#text/plain
-packages/ptc/src/c_api/surface.inc svneol=native#text/plain
-packages/ptc/src/c_api/surfaced.inc svneol=native#text/plain
-packages/ptc/src/c_api/timer.inc svneol=native#text/plain
-packages/ptc/src/c_api/timerd.inc svneol=native#text/plain
+packages/ptc/src/c_api/capi_area.inc svneol=native#text/plain
+packages/ptc/src/c_api/capi_aread.inc svneol=native#text/plain
+packages/ptc/src/c_api/capi_clear.inc svneol=native#text/plain
+packages/ptc/src/c_api/capi_cleard.inc svneol=native#text/plain
+packages/ptc/src/c_api/capi_clipper.inc svneol=native#text/plain
+packages/ptc/src/c_api/capi_clipperd.inc svneol=native#text/plain
+packages/ptc/src/c_api/capi_color.inc svneol=native#text/plain
+packages/ptc/src/c_api/capi_colord.inc svneol=native#text/plain
+packages/ptc/src/c_api/capi_console.inc svneol=native#text/plain
+packages/ptc/src/c_api/capi_consoled.inc svneol=native#text/plain
+packages/ptc/src/c_api/capi_copy.inc svneol=native#text/plain
+packages/ptc/src/c_api/capi_copyd.inc svneol=native#text/plain
+packages/ptc/src/c_api/capi_error.inc svneol=native#text/plain
+packages/ptc/src/c_api/capi_errord.inc svneol=native#text/plain
+packages/ptc/src/c_api/capi_except.inc svneol=native#text/plain
+packages/ptc/src/c_api/capi_exceptd.inc svneol=native#text/plain
+packages/ptc/src/c_api/capi_format.inc svneol=native#text/plain
+packages/ptc/src/c_api/capi_formatd.inc svneol=native#text/plain
+packages/ptc/src/c_api/capi_index.inc svneol=native#text/plain
+packages/ptc/src/c_api/capi_key.inc svneol=native#text/plain
+packages/ptc/src/c_api/capi_keyd.inc svneol=native#text/plain
+packages/ptc/src/c_api/capi_mode.inc svneol=native#text/plain
+packages/ptc/src/c_api/capi_moded.inc svneol=native#text/plain
+packages/ptc/src/c_api/capi_palette.inc svneol=native#text/plain
+packages/ptc/src/c_api/capi_paletted.inc svneol=native#text/plain
+packages/ptc/src/c_api/capi_surface.inc svneol=native#text/plain
+packages/ptc/src/c_api/capi_surfaced.inc svneol=native#text/plain
+packages/ptc/src/c_api/capi_timer.inc svneol=native#text/plain
+packages/ptc/src/c_api/capi_timerd.inc svneol=native#text/plain
 packages/ptc/src/core/aread.inc svneol=native#text/plain
 packages/ptc/src/core/aread.inc svneol=native#text/plain
 packages/ptc/src/core/areai.inc svneol=native#text/plain
 packages/ptc/src/core/areai.inc svneol=native#text/plain
 packages/ptc/src/core/baseconsoled.inc svneol=native#text/plain
 packages/ptc/src/core/baseconsoled.inc svneol=native#text/plain

+ 0 - 140
packages/ptc/src/c_api/area.inc

@@ -1,140 +0,0 @@
-Function ptc_area_create(left, top, right, bottom : Integer) : TPTC_AREA;
-
-Begin
-  Try
-    ptc_area_create := TPTC_AREA(TPTCArea.Create(left, top, right, bottom));
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_area_create := Nil;
-    End;
-  End;
-End;
-
-Procedure ptc_area_destroy(obj : TPTC_AREA);
-
-Begin
-  If obj = Nil Then
-    Exit;
-  Try
-    TPTCArea(obj).Destroy;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-    End;
-  End;
-End;
-
-Function ptc_area_left(obj : TPTC_AREA) : Integer;
-
-Begin
-  Try
-    ptc_area_left := TPTCArea(obj).left;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_area_left := 0;
-    End;
-  End;
-End;
-
-Function ptc_area_top(obj : TPTC_AREA) : Integer;
-
-Begin
-  Try
-    ptc_area_top := TPTCArea(obj).top;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_area_top := 0;
-    End;
-  End;
-End;
-
-Function ptc_area_right(obj : TPTC_AREA) : Integer;
-
-Begin
-  Try
-    ptc_area_right := TPTCArea(obj).right;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_area_right := 0;
-    End;
-  End;
-End;
-
-Function ptc_area_bottom(obj : TPTC_AREA) : Integer;
-
-Begin
-  Try
-    ptc_area_bottom := TPTCArea(obj).bottom;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_area_bottom := 0;
-    End;
-  End;
-End;
-
-Function ptc_area_width(obj : TPTC_AREA) : Integer;
-
-Begin
-  Try
-    ptc_area_width := TPTCArea(obj).width;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_area_width := 0;
-    End;
-  End;
-End;
-
-Function ptc_area_height(obj : TPTC_AREA) : Integer;
-
-Begin
-  Try
-    ptc_area_height := TPTCArea(obj).height;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_area_height := 0;
-    End;
-  End;
-End;
-
-Procedure ptc_area_assign(obj, area : TPTC_AREA);
-
-Begin
-  Try
-    TPTCArea(obj).ASSign(TPTCArea(area));
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-    End;
-  End;
-End;
-
-Function ptc_area_equals(obj, area : TPTC_AREA) : Boolean;
-
-Begin
-  Try
-    ptc_area_equals := TPTCArea(obj).Equals(TPTCArea(area));
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_area_equals := False;
-    End;
-  End;
-End;
-

+ 0 - 15
packages/ptc/src/c_api/aread.inc

@@ -1,15 +0,0 @@
-{ setup }
-Function ptc_area_create(left, top, right, bottom : Integer) : TPTC_AREA;
-Procedure ptc_area_destroy(obj : TPTC_AREA);
-
-{ data access }
-Function ptc_area_left(obj : TPTC_AREA) : Integer;
-Function ptc_area_top(obj : TPTC_AREA) : Integer;
-Function ptc_area_right(obj : TPTC_AREA) : Integer;
-Function ptc_area_bottom(obj : TPTC_AREA) : Integer;
-Function ptc_area_width(obj : TPTC_AREA) : Integer;
-Function ptc_area_height(obj : TPTC_AREA) : Integer;
-
-{ operators }
-Procedure ptc_area_assign(obj, area : TPTC_AREA);
-Function ptc_area_equals(obj, area : TPTC_AREA) : Boolean;

+ 161 - 0
packages/ptc/src/c_api/capi_area.inc

@@ -0,0 +1,161 @@
+{
+    Free Pascal port of the OpenPTC C++ library.
+    Copyright (C) 2001-2010  Nikolay Nikolov ([email protected])
+    Original C++ version by Glenn Fiedler ([email protected])
+
+    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.1 of the License, or (at your option) any later version
+    with the following modification:
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,and
+    to copy and distribute the resulting executable under terms of your choice,
+    provided that you also meet, for each linked independent module, the terms
+    and conditions of the license of that module. An independent module is a
+    module which is not derived from or based on this library. If you modify
+    this library, you may extend this exception to your version of the library,
+    but you are not obligated to do so. If you do not wish to do so, delete this
+    exception statement from your 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
+}
+
+function ptc_area_create(left, top, right, bottom: Integer): TPTC_AREA;
+begin
+  try
+    ptc_area_create := TPTC_AREA(TPTCArea.Create(left, top, right, bottom));
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_area_create := nil;
+    end;
+  end;
+end;
+
+procedure ptc_area_destroy(obj: TPTC_AREA);
+begin
+  if obj = nil then
+    exit;
+  try
+    TPTCArea(obj).Destroy;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+    end;
+  end;
+end;
+
+function ptc_area_left(obj: TPTC_AREA): Integer;
+begin
+  try
+    ptc_area_left := TPTCArea(obj).left;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_area_left := 0;
+    end;
+  end;
+end;
+
+function ptc_area_top(obj: TPTC_AREA): Integer;
+begin
+  try
+    ptc_area_top := TPTCArea(obj).top;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_area_top := 0;
+    end;
+  end;
+end;
+
+function ptc_area_right(obj: TPTC_AREA): Integer;
+begin
+  try
+    ptc_area_right := TPTCArea(obj).right;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_area_right := 0;
+    end;
+  end;
+end;
+
+function ptc_area_bottom(obj: TPTC_AREA): Integer;
+begin
+  try
+    ptc_area_bottom := TPTCArea(obj).bottom;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_area_bottom := 0;
+    end;
+  end;
+end;
+
+function ptc_area_width(obj: TPTC_AREA): Integer;
+begin
+  try
+    ptc_area_width := TPTCArea(obj).width;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_area_width := 0;
+    end;
+  end;
+end;
+
+function ptc_area_height(obj: TPTC_AREA): Integer;
+begin
+  try
+    ptc_area_height := TPTCArea(obj).height;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_area_height := 0;
+    end;
+  end;
+end;
+
+procedure ptc_area_assign(obj, area: TPTC_AREA);
+begin
+  try
+    TPTCArea(obj).Assign(TPTCArea(area));
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+    end;
+  end;
+end;
+
+function ptc_area_equals(obj, area: TPTC_AREA): Boolean;
+begin
+  try
+    ptc_area_equals := TPTCArea(obj).Equals(TPTCArea(area));
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_area_equals := False;
+    end;
+  end;
+end;

+ 47 - 0
packages/ptc/src/c_api/capi_aread.inc

@@ -0,0 +1,47 @@
+{
+    Free Pascal port of the OpenPTC C++ library.
+    Copyright (C) 2001-2010  Nikolay Nikolov ([email protected])
+    Original C++ version by Glenn Fiedler ([email protected])
+
+    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.1 of the License, or (at your option) any later version
+    with the following modification:
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,and
+    to copy and distribute the resulting executable under terms of your choice,
+    provided that you also meet, for each linked independent module, the terms
+    and conditions of the license of that module. An independent module is a
+    module which is not derived from or based on this library. If you modify
+    this library, you may extend this exception to your version of the library,
+    but you are not obligated to do so. If you do not wish to do so, delete this
+    exception statement from your 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
+}
+
+{ setup }
+function ptc_area_create(left, top, right, bottom: Integer): TPTC_AREA;
+procedure ptc_area_destroy(obj: TPTC_AREA);
+
+{ data access }
+function ptc_area_left(obj: TPTC_AREA): Integer;
+function ptc_area_top(obj: TPTC_AREA): Integer;
+function ptc_area_right(obj: TPTC_AREA): Integer;
+function ptc_area_bottom(obj: TPTC_AREA): Integer;
+function ptc_area_width(obj: TPTC_AREA): Integer;
+function ptc_area_height(obj: TPTC_AREA): Integer;
+
+{ operators }
+procedure ptc_area_assign(obj, area: TPTC_AREA);
+function ptc_area_equals(obj, area: TPTC_AREA): Boolean;

+ 76 - 0
packages/ptc/src/c_api/capi_clear.inc

@@ -0,0 +1,76 @@
+{
+    Free Pascal port of the OpenPTC C++ library.
+    Copyright (C) 2001-2010  Nikolay Nikolov ([email protected])
+    Original C++ version by Glenn Fiedler ([email protected])
+
+    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.1 of the License, or (at your option) any later version
+    with the following modification:
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,and
+    to copy and distribute the resulting executable under terms of your choice,
+    provided that you also meet, for each linked independent module, the terms
+    and conditions of the license of that module. An independent module is a
+    module which is not derived from or based on this library. If you modify
+    this library, you may extend this exception to your version of the library,
+    but you are not obligated to do so. If you do not wish to do so, delete this
+    exception statement from your 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
+}
+
+function ptc_clear_create: TPTC_CLEAR;
+begin
+  try
+    ptc_clear_create := TPTC_CLEAR(TPTCClear.Create);
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_clear_create := nil;
+    end;
+  end;
+end;
+
+procedure ptc_clear_destroy(obj: TPTC_CLEAR);
+begin
+  if obj = nil then
+    exit;
+  try
+    TPTCClear(obj).Destroy;
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_clear_request(obj: TPTC_CLEAR; format: TPTC_FORMAT);
+begin
+  try
+    TPTCClear(obj).request(TPTCFormat(format));
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_clear_clear(obj: TPTC_CLEAR; pixels: Pointer; x, y, width, height, pitch: Integer; color: TPTC_COLOR);
+begin
+  try
+    TPTCClear(obj).clear(pixels, x, y, width, height, pitch, TPTCColor(color));
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;

+ 41 - 0
packages/ptc/src/c_api/capi_cleard.inc

@@ -0,0 +1,41 @@
+{
+    Free Pascal port of the OpenPTC C++ library.
+    Copyright (C) 2001-2010  Nikolay Nikolov ([email protected])
+    Original C++ version by Glenn Fiedler ([email protected])
+
+    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.1 of the License, or (at your option) any later version
+    with the following modification:
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,and
+    to copy and distribute the resulting executable under terms of your choice,
+    provided that you also meet, for each linked independent module, the terms
+    and conditions of the license of that module. An independent module is a
+    module which is not derived from or based on this library. If you modify
+    this library, you may extend this exception to your version of the library,
+    but you are not obligated to do so. If you do not wish to do so, delete this
+    exception statement from your 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
+}
+
+{ setup }
+function ptc_clear_create: TPTC_CLEAR;
+procedure ptc_clear_destroy(obj: TPTC_CLEAR);
+
+{ request clear }
+procedure ptc_clear_request(obj: TPTC_CLEAR; format: TPTC_FORMAT);
+
+{ clear pixels }
+procedure ptc_clear_clear(obj: TPTC_CLEAR; pixels: Pointer; x, y, width, height, pitch: Integer; color: TPTC_COLOR);

+ 62 - 0
packages/ptc/src/c_api/capi_clipper.inc

@@ -0,0 +1,62 @@
+{
+    Free Pascal port of the OpenPTC C++ library.
+    Copyright (C) 2001-2010  Nikolay Nikolov ([email protected])
+    Original C++ version by Glenn Fiedler ([email protected])
+
+    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.1 of the License, or (at your option) any later version
+    with the following modification:
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,and
+    to copy and distribute the resulting executable under terms of your choice,
+    provided that you also meet, for each linked independent module, the terms
+    and conditions of the license of that module. An independent module is a
+    module which is not derived from or based on this library. If you modify
+    this library, you may extend this exception to your version of the library,
+    but you are not obligated to do so. If you do not wish to do so, delete this
+    exception statement from your 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
+}
+
+procedure ptc_clipper_clip(area, clip, clipped: TPTC_AREA);
+var
+  tmp: TPTCArea;
+begin
+  try
+    tmp := TPTCClipper.clip(TPTCArea(area), TPTCArea(clip));
+    try
+      TPTCArea(clipped).Assign(tmp);
+    finally
+      tmp.Destroy;
+    end;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+    end;
+  end;
+end;
+
+procedure ptc_clipper_clip_complex(source, clip_source, clipped_source, destination, clip_destination, clipped_destination: TPTC_AREA);
+begin
+  try
+    TPTCClipper.clip(TPTCArea(source), TPTCArea(clip_source), TPTCArea(clipped_source), TPTCArea(destination), TPTCArea(clip_destination), TPTCArea(clipped_destination));
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+    end;
+  end;
+end;

+ 37 - 0
packages/ptc/src/c_api/capi_clipperd.inc

@@ -0,0 +1,37 @@
+{
+    Free Pascal port of the OpenPTC C++ library.
+    Copyright (C) 2001-2010  Nikolay Nikolov ([email protected])
+    Original C++ version by Glenn Fiedler ([email protected])
+
+    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.1 of the License, or (at your option) any later version
+    with the following modification:
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,and
+    to copy and distribute the resulting executable under terms of your choice,
+    provided that you also meet, for each linked independent module, the terms
+    and conditions of the license of that module. An independent module is a
+    module which is not derived from or based on this library. If you modify
+    this library, you may extend this exception to your version of the library,
+    but you are not obligated to do so. If you do not wish to do so, delete this
+    exception statement from your 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
+}
+
+{ clip a single area against clip area }
+procedure ptc_clipper_clip(area, clip, clipped: TPTC_AREA);
+
+{ clip source and destination areas against source and destination clip areas }
+procedure ptc_clipper_clip_complex(source, clip_source, clipped_source, destination, clip_destination, clipped_destination: TPTC_AREA);

+ 196 - 0
packages/ptc/src/c_api/capi_color.inc

@@ -0,0 +1,196 @@
+{
+    Free Pascal port of the OpenPTC C++ library.
+    Copyright (C) 2001-2010  Nikolay Nikolov ([email protected])
+    Original C++ version by Glenn Fiedler ([email protected])
+
+    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.1 of the License, or (at your option) any later version
+    with the following modification:
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,and
+    to copy and distribute the resulting executable under terms of your choice,
+    provided that you also meet, for each linked independent module, the terms
+    and conditions of the license of that module. An independent module is a
+    module which is not derived from or based on this library. If you modify
+    this library, you may extend this exception to your version of the library,
+    but you are not obligated to do so. If you do not wish to do so, delete this
+    exception statement from your 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
+}
+
+function ptc_color_create: TPTC_COLOR;
+begin
+  try
+    ptc_color_create := TPTC_COLOR(TPTCColor.Create);
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_color_create := nil;
+    end;
+  end;
+end;
+
+function ptc_color_create_indexed(index: Integer): TPTC_COLOR;
+begin
+  try
+    ptc_color_create_indexed := TPTC_COLOR(TPTCColor.Create(index));
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_color_create_indexed := nil;
+    end;
+  end;
+end;
+
+function ptc_color_create_direct(r, g, b, a: Single): TPTC_COLOR;
+begin
+  try
+    ptc_color_create_direct := TPTC_COLOR(TPTCColor.Create(r, g, b, a));
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_color_create_direct := nil;
+    end;
+  end;
+end;
+
+procedure ptc_color_destroy(obj: TPTC_COLOR);
+begin
+  if obj = nil then
+    exit;
+  try
+    TPTCColor(obj).Destroy;
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+function ptc_color_index(obj: TPTC_COLOR): Integer;
+begin
+  try
+    ptc_color_index := TPTCColor(obj).index;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_color_index := 0;
+    end;
+  end;
+end;
+
+function ptc_color_r(obj: TPTC_COLOR): Single;
+begin
+  try
+    ptc_color_r := TPTCColor(obj).r;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_color_r := 0;
+    end;
+  end;
+end;
+
+function ptc_color_g(obj: TPTC_COLOR): Single;
+begin
+  try
+    ptc_color_g := TPTCColor(obj).g;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_color_g := 0;
+    end;
+  end;
+end;
+
+function ptc_color_b(obj: TPTC_COLOR): Single;
+begin
+  try
+    ptc_color_b := TPTCColor(obj).b;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_color_b := 0;
+    end;
+  end;
+end;
+
+function ptc_color_a(obj: TPTC_COLOR): Single;
+begin
+  try
+    ptc_color_a := TPTCColor(obj).a;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_color_a := 0;
+    end;
+  end;
+end;
+
+function ptc_color_direct(obj: TPTC_COLOR): Boolean;
+begin
+  try
+    ptc_color_direct := TPTCColor(obj).direct;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_color_direct := False;
+    end;
+  end;
+end;
+
+function ptc_color_indexed(obj: TPTC_COLOR): Boolean;
+begin
+  try
+    ptc_color_indexed := TPTCColor(obj).indexed;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_color_indexed := False;
+    end;
+  end;
+end;
+
+procedure ptc_color_assign(obj, color: TPTC_COLOR);
+begin
+  try
+    TPTCColor(obj).Assign(TPTCColor(color));
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+function ptc_color_equals(obj, color: TPTC_COLOR): Boolean;
+begin
+  try
+    ptc_color_equals := TPTCColor(obj).Equals(TPTCColor(color));
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_color_equals := False;
+    end;
+  end;
+end;

+ 50 - 0
packages/ptc/src/c_api/capi_colord.inc

@@ -0,0 +1,50 @@
+{
+    Free Pascal port of the OpenPTC C++ library.
+    Copyright (C) 2001-2010  Nikolay Nikolov ([email protected])
+    Original C++ version by Glenn Fiedler ([email protected])
+
+    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.1 of the License, or (at your option) any later version
+    with the following modification:
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,and
+    to copy and distribute the resulting executable under terms of your choice,
+    provided that you also meet, for each linked independent module, the terms
+    and conditions of the license of that module. An independent module is a
+    module which is not derived from or based on this library. If you modify
+    this library, you may extend this exception to your version of the library,
+    but you are not obligated to do so. If you do not wish to do so, delete this
+    exception statement from your 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
+}
+
+{ setup }
+function ptc_color_create: TPTC_COLOR;
+function ptc_color_create_indexed(index: Integer): TPTC_COLOR;
+function ptc_color_create_direct(r, g, b, a: Single): TPTC_COLOR;
+procedure ptc_color_destroy(obj: TPTC_COLOR);
+
+{ data access }
+function ptc_color_index(obj: TPTC_COLOR): Integer;
+function ptc_color_r(obj: TPTC_COLOR): Single;
+function ptc_color_g(obj: TPTC_COLOR): Single;
+function ptc_color_b(obj: TPTC_COLOR): Single;
+function ptc_color_a(obj: TPTC_COLOR): Single;
+function ptc_color_direct(obj: TPTC_COLOR): Boolean;
+function ptc_color_indexed(obj: TPTC_COLOR): Boolean;
+
+{ operators }
+procedure ptc_color_assign(obj, color: TPTC_COLOR);
+function ptc_color_equals(obj, color: TPTC_COLOR): Boolean;

+ 488 - 0
packages/ptc/src/c_api/capi_console.inc

@@ -0,0 +1,488 @@
+{
+    Free Pascal port of the OpenPTC C++ library.
+    Copyright (C) 2001-2010  Nikolay Nikolov ([email protected])
+    Original C++ version by Glenn Fiedler ([email protected])
+
+    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.1 of the License, or (at your option) any later version
+    with the following modification:
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,and
+    to copy and distribute the resulting executable under terms of your choice,
+    provided that you also meet, for each linked independent module, the terms
+    and conditions of the license of that module. An independent module is a
+    module which is not derived from or based on this library. If you modify
+    this library, you may extend this exception to your version of the library,
+    but you are not obligated to do so. If you do not wish to do so, delete this
+    exception statement from your 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
+}
+
+function ptc_console_create: TPTC_CONSOLE;
+begin
+  try
+    ptc_console_create := TPTC_CONSOLE(TPTCConsole.Create);
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_console_create := nil;
+    end;
+  end;
+end;
+
+procedure ptc_console_destroy(obj: TPTC_CONSOLE);
+begin
+  if obj = nil then
+    exit;
+  try
+    TPTCBaseConsole(obj).Destroy;
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_console_configure(obj: TPTC_CONSOLE; _file: String);
+begin
+  try
+    TPTCBaseConsole(obj).configure(_file);
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+function ptc_console_option(obj: TPTC_CONSOLE; _option: String): Boolean;
+begin
+  try
+    ptc_console_option := TPTCBaseConsole(obj).option(_option);
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_console_option := False;
+    end;
+  end;
+end;
+
+function ptc_console_mode(obj: TPTC_CONSOLE; index: Integer): TPTC_MODE;
+begin
+  try
+    ptc_console_mode := TPTC_MODE(TPTCBaseConsole(obj).modes[index]);
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_console_mode := nil;
+    end;
+  end;
+end;
+
+procedure ptc_console_open(obj: TPTC_CONSOLE; title: string; pages: Integer);
+begin
+  try
+    TPTCBaseConsole(obj).open(title, pages);
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_console_open_format(obj: TPTC_CONSOLE; title: string; format: TPTC_FORMAT; pages: Integer);
+begin
+  try
+    TPTCBaseConsole(obj).open(title, TPTCFormat(format), pages);
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_console_open_resolution(obj: TPTC_CONSOLE; title: string; width, height: Integer; format: TPTC_FORMAT; pages: Integer);
+begin
+  try
+    TPTCBaseConsole(obj).open(title, width, height, TPTCFormat(format), pages);
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_console_open_mode(obj: TPTC_CONSOLE; title: string; mode: TPTC_MODE; pages: Integer);
+begin
+  try
+    TPTCBaseConsole(obj).open(title, TPTCMode(mode), pages);
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_console_close(obj: TPTC_CONSOLE);
+begin
+  try
+    TPTCBaseConsole(obj).close;
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_console_flush(obj: TPTC_CONSOLE);
+begin
+  try
+    TPTCBaseConsole(obj).flush;
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_console_finish(obj: TPTC_CONSOLE);
+begin
+  try
+    TPTCBaseConsole(obj).finish;
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_console_update(obj: TPTC_CONSOLE);
+begin
+  try
+    TPTCBaseConsole(obj).update;
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_console_update_area(obj: TPTC_CONSOLE; area: TPTC_AREA);
+begin
+  try
+    TPTCBaseConsole(obj).update(TPTCArea(area));
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+function ptc_console_key(obj: TPTC_CONSOLE): Boolean;
+begin
+  try
+    ptc_console_key := TPTCBaseConsole(obj).key;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_console_key := False;
+    end;
+  end;
+end;
+
+procedure ptc_console_read(obj: TPTC_CONSOLE; key: TPTC_KEY);
+var
+  tmp: TPTCKeyEvent;
+begin
+  try
+    tmp := TPTCBaseConsole(obj).read;
+    try
+      TPTCKeyEvent(key).Assign(tmp);
+    finally
+      tmp.Destroy;
+    end;
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_console_copy(obj: TPTC_CONSOLE; surface: TPTC_SURFACE);
+begin
+  try
+    TPTCBaseConsole(obj).copy(TPTCBaseSurface(surface));
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_console_copy_area(obj: TPTC_CONSOLE; surface: TPTC_SURFACE; source, destination: TPTC_AREA);
+begin
+  try
+    TPTCBaseConsole(obj).copy(TPTCBaseSurface(surface), TPTCArea(source), TPTCArea(destination));
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+function ptc_console_lock(obj: TPTC_CONSOLE): Pointer;
+begin
+  try
+    ptc_console_lock := TPTCBaseConsole(obj).lock;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_console_lock := nil;
+    end;
+  end;
+end;
+
+procedure ptc_console_unlock(obj: TPTC_CONSOLE);
+begin
+  try
+    TPTCBaseConsole(obj).unlock;
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_console_load(obj: TPTC_CONSOLE; pixels: Pointer; width, height, pitch: Integer; format: TPTC_FORMAT; palette: TPTC_PALETTE);
+begin
+  try
+    TPTCBaseConsole(obj).load(pixels, width, height, pitch, TPTCFormat(format), TPTCPalette(palette));
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_console_load_area(obj: TPTC_CONSOLE; pixels: Pointer; width, height, pitch: Integer; format: TPTC_FORMAT; palette: TPTC_PALETTE; source, destination: TPTC_AREA);
+begin
+  try
+    TPTCBaseConsole(obj).load(pixels, width, height, pitch, TPTCFormat(format), TPTCPalette(palette), TPTCArea(source), TPTCArea(destination));
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_console_save(obj: TPTC_CONSOLE; pixels: Pointer; width, height, pitch: Integer; format: TPTC_FORMAT; palette: TPTC_PALETTE);
+begin
+  try
+    TPTCBaseConsole(obj).save(pixels, width, height, pitch, TPTCFormat(format), TPTCPalette(palette));
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_console_save_area(obj: TPTC_CONSOLE; pixels: Pointer; width, height, pitch: Integer; format: TPTC_FORMAT; palette: TPTC_PALETTE; source, destination: TPTC_AREA);
+begin
+  try
+    TPTCBaseConsole(obj).save(pixels, width, height, pitch, TPTCFormat(format), TPTCPalette(palette), TPTCArea(source), TPTCArea(destination));
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_console_clear(obj: TPTC_CONSOLE);
+begin
+  try
+    TPTCBaseConsole(obj).clear;
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_console_clear_color(obj: TPTC_CONSOLE; color: TPTC_COLOR);
+begin
+  try
+    TPTCBaseConsole(obj).clear(TPTCColor(color));
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_console_clear_color_area(obj: TPTC_CONSOLE; color: TPTC_COLOR; area: TPTC_AREA);
+begin
+  try
+    TPTCBaseConsole(obj).clear(TPTCColor(color), TPTCArea(area));
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_console_palette_set(obj: TPTC_CONSOLE; palette: TPTC_PALETTE);
+begin
+  try
+    TPTCBaseConsole(obj).palette(TPTCPalette(palette));
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+function ptc_console_palette_get(obj: TPTC_CONSOLE): TPTC_PALETTE;
+begin
+  try
+    ptc_console_palette_get := TPTC_PALETTE(TPTCBaseConsole(obj).palette);
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_console_palette_get := nil;
+    end;
+  end;
+end;
+
+procedure ptc_console_clip_set(obj: TPTC_CONSOLE; area: TPTC_AREA);
+begin
+  try
+    TPTCBaseConsole(obj).clip(TPTCArea(area));
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+function ptc_console_width(obj: TPTC_CONSOLE): Integer;
+begin
+  try
+    ptc_console_width := TPTCBaseConsole(obj).width;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_console_width := 0;
+    end;
+  end;
+end;
+
+function ptc_console_height(obj: TPTC_CONSOLE): Integer;
+begin
+  try
+    ptc_console_height := TPTCBaseConsole(obj).height;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_console_height := 0;
+    end;
+  end;
+end;
+
+function ptc_console_pages(obj: TPTC_CONSOLE): Integer;
+begin
+  try
+    ptc_console_pages := TPTCBaseConsole(obj).pages;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_console_pages := 0;
+    end;
+  end;
+end;
+
+function ptc_console_pitch(obj: TPTC_CONSOLE): Integer;
+begin
+  try
+    ptc_console_pitch := TPTCBaseConsole(obj).pitch;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_console_pitch := 0;
+    end;
+  end;
+end;
+
+function ptc_console_area(obj: TPTC_CONSOLE): TPTC_AREA;
+begin
+  try
+    ptc_console_area := TPTC_AREA(TPTCBaseConsole(obj).area);
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_console_area := nil;
+    end;
+  end;
+end;
+
+function ptc_console_clip(obj: TPTC_CONSOLE): TPTC_AREA;
+begin
+  try
+    ptc_console_clip := TPTC_AREA(TPTCBaseConsole(obj).clip);
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_console_clip := nil;
+    end;
+  end;
+end;
+
+function ptc_console_format(obj: TPTC_CONSOLE): TPTC_FORMAT;
+begin
+  try
+    ptc_console_format := TPTC_FORMAT(TPTCBaseConsole(obj).format);
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_console_format := nil;
+    end;
+  end;
+end;
+
+function ptc_console_name(obj: TPTC_CONSOLE): string;
+begin
+  try
+    ptc_console_name := TPTCBaseConsole(obj).name;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_console_name := '';
+    end;
+  end;
+end;
+
+function ptc_console_title(obj: TPTC_CONSOLE): string;
+begin
+  try
+    ptc_console_title := TPTCBaseConsole(obj).title;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_console_title := '';
+    end;
+  end;
+end;
+
+function ptc_console_information(obj: TPTC_CONSOLE): string;
+begin
+  try
+    ptc_console_information := TPTCBaseConsole(obj).information;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_console_information := '';
+    end;
+  end;
+end;

+ 115 - 0
packages/ptc/src/c_api/capi_consoled.inc

@@ -0,0 +1,115 @@
+{
+    Free Pascal port of the OpenPTC C++ library.
+    Copyright (C) 2001-2010  Nikolay Nikolov ([email protected])
+    Original C++ version by Glenn Fiedler ([email protected])
+
+    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.1 of the License, or (at your option) any later version
+    with the following modification:
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,and
+    to copy and distribute the resulting executable under terms of your choice,
+    provided that you also meet, for each linked independent module, the terms
+    and conditions of the license of that module. An independent module is a
+    module which is not derived from or based on this library. If you modify
+    this library, you may extend this exception to your version of the library,
+    but you are not obligated to do so. If you do not wish to do so, delete this
+    exception statement from your 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
+}
+
+{ setup }
+function ptc_console_create: TPTC_CONSOLE;
+procedure ptc_console_destroy(obj: TPTC_CONSOLE);
+
+{ console configuration }
+procedure ptc_console_configure(obj: TPTC_CONSOLE; _file: String);
+
+{ console option string }
+function ptc_console_option(obj: TPTC_CONSOLE; _option: String): Boolean;
+
+{ console modes }
+function ptc_console_mode(obj: TPTC_CONSOLE; index: Integer): TPTC_MODE;
+
+{ console management }
+procedure ptc_console_open(obj: TPTC_CONSOLE; title: string; pages: Integer);
+procedure ptc_console_open_format(obj: TPTC_CONSOLE; title: string; format: TPTC_FORMAT; pages: Integer);
+procedure ptc_console_open_resolution(obj: TPTC_CONSOLE; title: string; width, height: Integer; format: TPTC_FORMAT; pages: Integer);
+procedure ptc_console_open_mode(obj: TPTC_CONSOLE; title: string; mode: TPTC_MODE; pages: Integer);
+procedure ptc_console_close(obj: TPTC_CONSOLE);
+
+{ synchronization }
+procedure ptc_console_flush(obj: TPTC_CONSOLE);
+procedure ptc_console_finish(obj: TPTC_CONSOLE);
+procedure ptc_console_update(obj: TPTC_CONSOLE);
+procedure ptc_console_update_area(obj: TPTC_CONSOLE; area: TPTC_AREA);
+
+{ keyboard input }
+function ptc_console_key(obj: TPTC_CONSOLE): Boolean;
+procedure ptc_console_read(obj: TPTC_CONSOLE; key: TPTC_KEY);
+
+{ copy to surface }
+procedure ptc_console_copy(obj: TPTC_CONSOLE; surface: TPTC_SURFACE);
+procedure ptc_console_copy_area(obj: TPTC_CONSOLE; surface: TPTC_SURFACE; source, destination: TPTC_AREA);
+
+{ memory access }
+function ptc_console_lock(obj: TPTC_CONSOLE): Pointer;
+procedure ptc_console_unlock(obj: TPTC_CONSOLE);
+
+{ load pixels to console }
+procedure ptc_console_load(obj: TPTC_CONSOLE; pixels: Pointer; width, height, pitch: Integer; format: TPTC_FORMAT; palette: TPTC_PALETTE);
+procedure ptc_console_load_area(obj: TPTC_CONSOLE; pixels: Pointer; width, height, pitch: Integer; format: TPTC_FORMAT; palette: TPTC_PALETTE; source, destination: TPTC_AREA);
+
+{ save console pixels }
+procedure ptc_console_save(obj: TPTC_CONSOLE; pixels: Pointer; width, height, pitch: Integer; format: TPTC_FORMAT; palette: TPTC_PALETTE);
+procedure ptc_console_save_area(obj: TPTC_CONSOLE; pixels: Pointer; width, height, pitch: Integer; format: TPTC_FORMAT; palette: TPTC_PALETTE; source, destination: TPTC_AREA);
+
+{ clear console }
+procedure ptc_console_clear(obj: TPTC_CONSOLE);
+procedure ptc_console_clear_color(obj: TPTC_CONSOLE; color: TPTC_COLOR);
+procedure ptc_console_clear_color_area(obj: TPTC_CONSOLE; color: TPTC_COLOR; area: TPTC_AREA);
+
+{ console palette }
+procedure ptc_console_palette_set(obj: TPTC_CONSOLE; palette: TPTC_PALETTE);
+function ptc_console_palette_get(obj: TPTC_CONSOLE): TPTC_PALETTE;
+
+{ console clip area }
+procedure ptc_console_clip_set(obj: TPTC_CONSOLE; area: TPTC_AREA);
+
+{ data access }
+function ptc_console_width(obj: TPTC_CONSOLE): Integer;
+function ptc_console_height(obj: TPTC_CONSOLE): Integer;
+function ptc_console_pages(obj: TPTC_CONSOLE): Integer;
+function ptc_console_pitch(obj: TPTC_CONSOLE): Integer;
+function ptc_console_area(obj: TPTC_CONSOLE): TPTC_AREA;
+function ptc_console_clip(obj: TPTC_CONSOLE): TPTC_AREA;
+function ptc_console_format(obj: TPTC_CONSOLE): TPTC_FORMAT;
+function ptc_console_name(obj: TPTC_CONSOLE): string;
+function ptc_console_title(obj: TPTC_CONSOLE): string;
+function ptc_console_information(obj: TPTC_CONSOLE): string;
+
+{ extension functions }
+{#ifdef __PTC_WIN32_EXTENSIONS__
+CAPI void PTCAPI ptc_console_open_window(PTC_CONSOLE object,HWND window,int pages);
+CAPI void PTCAPI ptc_console_open_window_format(PTC_CONSOLE object,HWND window,PTC_FORMAT format,int pages);
+CAPI void PTCAPI ptc_console_open_window_resolution(PTC_CONSOLE object,HWND window,int width,int height,PTC_FORMAT format,int pages);
+CAPI void PTCAPI ptc_console_open_window_mode(PTC_CONSOLE object,HWND window,PTC_MODE mode,int pages);
+CAPI HWND PTCAPI ptc_console_window(PTC_CONSOLE object);
+CAPI LPDIRECTDRAW PTCAPI ptc_console_lpDD(PTC_CONSOLE object);
+CAPI LPDIRECTDRAW2 PTCAPI ptc_console_lpDD2(PTC_CONSOLE object);
+CAPI LPDIRECTDRAWSURFACE PTCAPI ptc_console_lpDDS(PTC_CONSOLE object);
+CAPI LPDIRECTDRAWSURFACE PTCAPI ptc_console_lpDDS_primary(PTC_CONSOLE object);
+CAPI LPDIRECTDRAWSURFACE PTCAPI ptc_console_lpDDS_secondary(PTC_CONSOLE object);
+#endif}

+ 100 - 0
packages/ptc/src/c_api/capi_copy.inc

@@ -0,0 +1,100 @@
+{
+    Free Pascal port of the OpenPTC C++ library.
+    Copyright (C) 2001-2010  Nikolay Nikolov ([email protected])
+    Original C++ version by Glenn Fiedler ([email protected])
+
+    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.1 of the License, or (at your option) any later version
+    with the following modification:
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,and
+    to copy and distribute the resulting executable under terms of your choice,
+    provided that you also meet, for each linked independent module, the terms
+    and conditions of the license of that module. An independent module is a
+    module which is not derived from or based on this library. If you modify
+    this library, you may extend this exception to your version of the library,
+    but you are not obligated to do so. If you do not wish to do so, delete this
+    exception statement from your 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
+}
+
+function ptc_copy_create: TPTC_COPY;
+begin
+  try
+    ptc_copy_create := TPTC_COPY(TPTCCopy.Create);
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_copy_create := nil;
+    end;
+  end;
+end;
+
+procedure ptc_copy_destroy(obj: TPTC_COPY);
+begin
+  if obj = nil then
+    exit;
+  try
+    TPTCCopy(obj).Destroy;
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_copy_request(obj: TPTC_COPY; source, destination: TPTC_FORMAT);
+begin
+  try
+    TPTCCopy(obj).request(TPTCFormat(source), TPTCFormat(destination));
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_copy_palette(obj: TPTC_COPY; source, destination: TPTC_PALETTE);
+begin
+  try
+    TPTCCopy(obj).palette(TPTCPalette(source), TPTCPalette(destination));
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_copy_copy(obj: TPTC_COPY; source_pixels: Pointer; source_x, source_y, source_width, source_height, source_pitch: Integer;
+                        destination_pixels: Pointer; destination_x, destination_y, destination_width, destination_height, destination_pitch: Integer);
+begin
+  try
+    TPTCCopy(obj).copy(source_pixels, source_x, source_y, source_width, source_height, source_pitch, destination_pixels, destination_x, destination_y, destination_width, destination_height, destination_pitch);
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+function ptc_copy_option(obj: TPTC_COPY; option: String): Boolean;
+begin
+  try
+    TPTCCopy(obj).option(option);
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_copy_option := False;
+    end;
+  end;
+end;

+ 48 - 0
packages/ptc/src/c_api/capi_copyd.inc

@@ -0,0 +1,48 @@
+{
+    Free Pascal port of the OpenPTC C++ library.
+    Copyright (C) 2001-2010  Nikolay Nikolov ([email protected])
+    Original C++ version by Glenn Fiedler ([email protected])
+
+    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.1 of the License, or (at your option) any later version
+    with the following modification:
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,and
+    to copy and distribute the resulting executable under terms of your choice,
+    provided that you also meet, for each linked independent module, the terms
+    and conditions of the license of that module. An independent module is a
+    module which is not derived from or based on this library. If you modify
+    this library, you may extend this exception to your version of the library,
+    but you are not obligated to do so. If you do not wish to do so, delete this
+    exception statement from your 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
+}
+
+{ setup }
+function ptc_copy_create: TPTC_COPY;
+procedure ptc_copy_destroy(obj: TPTC_COPY);
+
+{ set source and destination formats }
+procedure ptc_copy_request(obj: TPTC_COPY; source, destination: TPTC_FORMAT);
+
+{ set source and destination palettes }
+procedure ptc_copy_palette(obj: TPTC_COPY; source, destination: TPTC_PALETTE);
+
+{ copy pixels }
+procedure ptc_copy_copy(obj: TPTC_COPY; source_pixels: Pointer; source_x, source_y, source_width, source_height, source_pitch: Integer;
+                        destination_pixels: Pointer; destination_x, destination_y, destination_width, destination_height, destination_pitch: Integer);
+
+{ copy option string }
+function ptc_copy_option(obj: TPTC_COPY; option: String): Boolean;

+ 120 - 0
packages/ptc/src/c_api/capi_error.inc

@@ -0,0 +1,120 @@
+{
+    Free Pascal port of the OpenPTC C++ library.
+    Copyright (C) 2001-2010  Nikolay Nikolov ([email protected])
+    Original C++ version by Glenn Fiedler ([email protected])
+
+    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.1 of the License, or (at your option) any later version
+    with the following modification:
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,and
+    to copy and distribute the resulting executable under terms of your choice,
+    provided that you also meet, for each linked independent module, the terms
+    and conditions of the license of that module. An independent module is a
+    module which is not derived from or based on this library. If you modify
+    this library, you may extend this exception to your version of the library,
+    but you are not obligated to do so. If you do not wish to do so, delete this
+    exception statement from your 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
+}
+
+function ptc_error_create(message: string): TPTC_ERROR;
+begin
+  try
+    ptc_error_create := TPTC_ERROR(TPTCError.Create(message));
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_error_create := nil;
+    end;
+  end;
+end;
+
+function ptc_error_create_composite(message: string; error: TPTC_ERROR): TPTC_ERROR;
+begin
+  try
+    ptc_error_create_composite := TPTC_ERROR(TPTCError.Create(message, TPTCError(error)));
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_error_create_composite := nil;
+    end;
+  end;
+end;
+
+procedure ptc_error_destroy(obj: TPTC_ERROR);
+begin
+  if obj = nil then
+    exit;
+  try
+    TPTCError(obj).Destroy;
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_error_report(obj: TPTC_ERROR);
+begin
+  try
+    TPTCError(obj).report;
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+function ptc_error_message(obj: TPTC_ERROR): string;
+begin
+  try
+    ptc_error_message := TPTCError(obj).message;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_error_message := '';
+    end;
+  end;
+end;
+
+procedure ptc_error_assign(obj, error: TPTC_ERROR);
+begin
+  try
+    TPTCError(obj).Assign(TPTCError(error));
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+function ptc_error_equals(obj, error: TPTC_ERROR): Boolean;
+begin
+  try
+    ptc_error_equals := TPTCError(obj).Equals(TPTCError(error));
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_error_equals := False;
+    end;
+  end;
+end;
+
+procedure ptc_error_handler(handler: TPTC_ERROR_HANDLER);
+begin
+  ptc_exception_handler(handler);
+end;

+ 47 - 0
packages/ptc/src/c_api/capi_errord.inc

@@ -0,0 +1,47 @@
+{
+    Free Pascal port of the OpenPTC C++ library.
+    Copyright (C) 2001-2010  Nikolay Nikolov ([email protected])
+    Original C++ version by Glenn Fiedler ([email protected])
+
+    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.1 of the License, or (at your option) any later version
+    with the following modification:
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,and
+    to copy and distribute the resulting executable under terms of your choice,
+    provided that you also meet, for each linked independent module, the terms
+    and conditions of the license of that module. An independent module is a
+    module which is not derived from or based on this library. If you modify
+    this library, you may extend this exception to your version of the library,
+    but you are not obligated to do so. If you do not wish to do so, delete this
+    exception statement from your 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
+}
+
+type
+  TPTC_ERROR_HANDLER = procedure(error: TPTC_ERROR);
+
+function ptc_error_create(message: string): TPTC_ERROR;
+function ptc_error_create_composite(message: string; error: TPTC_ERROR): TPTC_ERROR;
+procedure ptc_error_destroy(obj: TPTC_ERROR);
+
+procedure ptc_error_report(obj: TPTC_ERROR);
+
+function ptc_error_message(obj: TPTC_ERROR): string;
+
+procedure ptc_error_assign(obj, error: TPTC_ERROR);
+function ptc_error_equals(obj, error: TPTC_ERROR): Boolean;
+
+procedure ptc_error_handler(handler: TPTC_ERROR_HANDLER);

+ 55 - 0
packages/ptc/src/c_api/capi_except.inc

@@ -0,0 +1,55 @@
+{
+    Free Pascal port of the OpenPTC C++ library.
+    Copyright (C) 2001-2010  Nikolay Nikolov ([email protected])
+    Original C++ version by Glenn Fiedler ([email protected])
+
+    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.1 of the License, or (at your option) any later version
+    with the following modification:
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,and
+    to copy and distribute the resulting executable under terms of your choice,
+    provided that you also meet, for each linked independent module, the terms
+    and conditions of the license of that module. An independent module is a
+    module which is not derived from or based on this library. If you modify
+    this library, you may extend this exception to your version of the library,
+    but you are not obligated to do so. If you do not wish to do so, delete this
+    exception statement from your 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
+}
+
+var
+  ptc_error_handler_function: TPTC_ERROR_HANDLER;
+
+procedure ptc_error_handler_default(error: TPTC_ERROR);
+
+begin
+  TPTCError(error).report;
+end;
+
+procedure ptc_exception_handler(handler: TPTC_ERROR_HANDLER);
+
+begin
+  if handler = nil then
+    ptc_error_handler_function := @ptc_error_handler_default
+  else
+    ptc_error_handler_function := handler;
+end;
+
+procedure ptc_exception_handle(error: TPTCError);
+
+begin
+  ptc_error_handler_function(TPTC_ERROR(error));
+end;

+ 34 - 0
packages/ptc/src/c_api/capi_exceptd.inc

@@ -0,0 +1,34 @@
+{
+    Free Pascal port of the OpenPTC C++ library.
+    Copyright (C) 2001-2010  Nikolay Nikolov ([email protected])
+    Original C++ version by Glenn Fiedler ([email protected])
+
+    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.1 of the License, or (at your option) any later version
+    with the following modification:
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,and
+    to copy and distribute the resulting executable under terms of your choice,
+    provided that you also meet, for each linked independent module, the terms
+    and conditions of the license of that module. An independent module is a
+    module which is not derived from or based on this library. If you modify
+    this library, you may extend this exception to your version of the library,
+    but you are not obligated to do so. If you do not wish to do so, delete this
+    exception statement from your 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
+}
+
+procedure ptc_exception_handler(handler: TPTC_ERROR_HANDLER);
+procedure ptc_exception_handle(error: TPTCError);

+ 209 - 0
packages/ptc/src/c_api/capi_format.inc

@@ -0,0 +1,209 @@
+{
+    Free Pascal port of the OpenPTC C++ library.
+    Copyright (C) 2001-2010  Nikolay Nikolov ([email protected])
+    Original C++ version by Glenn Fiedler ([email protected])
+
+    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.1 of the License, or (at your option) any later version
+    with the following modification:
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,and
+    to copy and distribute the resulting executable under terms of your choice,
+    provided that you also meet, for each linked independent module, the terms
+    and conditions of the license of that module. An independent module is a
+    module which is not derived from or based on this library. If you modify
+    this library, you may extend this exception to your version of the library,
+    but you are not obligated to do so. If you do not wish to do so, delete this
+    exception statement from your 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
+}
+
+function ptc_format_create: TPTC_FORMAT;
+begin
+  try
+    ptc_format_create := TPTC_FORMAT(TPTCFormat.Create);
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_format_create := nil;
+    end;
+  end;
+end;
+
+function ptc_format_create_indexed(bits: Integer): TPTC_FORMAT;
+begin
+  try
+    ptc_format_create_indexed := TPTC_FORMAT(TPTCFormat.Create(bits));
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_format_create_indexed := nil;
+    end;
+  end;
+end;
+
+function ptc_format_create_direct(bits: Integer; r, g, b, a: int32): TPTC_FORMAT;
+begin
+  try
+    ptc_format_create_direct := TPTC_FORMAT(TPTCFormat.Create(bits, r, g, b, a));
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_format_create_direct := nil;
+    end;
+  end;
+end;
+
+procedure ptc_format_destroy(obj: TPTC_FORMAT);
+begin
+  if obj = nil then
+    exit;
+  try
+    TPTCFormat(obj).Destroy;
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+function ptc_format_r(obj: TPTC_FORMAT): int32;
+begin
+  try
+    ptc_format_r := TPTCFormat(obj).r;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_format_r := 0;
+    end;
+  end;
+end;
+
+function ptc_format_g(obj: TPTC_FORMAT): int32;
+begin
+  try
+    ptc_format_g := TPTCFormat(obj).g;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_format_g := 0;
+    end;
+  end;
+end;
+
+function ptc_format_b(obj: TPTC_FORMAT): int32;
+begin
+  try
+    ptc_format_b := TPTCFormat(obj).b;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_format_b := 0;
+    end;
+  end;
+end;
+
+function ptc_format_a(obj: TPTC_FORMAT): int32;
+begin
+  try
+    ptc_format_a := TPTCFormat(obj).a;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_format_a := 0;
+    end;
+  end;
+end;
+
+function ptc_format_bits(obj: TPTC_FORMAT): Integer;
+begin
+  try
+    ptc_format_bits := TPTCFormat(obj).bits;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_format_bits := 0;
+    end;
+  end;
+end;
+
+function ptc_format_bytes(obj: TPTC_FORMAT): Integer;
+begin
+  try
+    ptc_format_bytes := TPTCFormat(obj).bytes;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_format_bytes := 0;
+    end;
+  end;
+end;
+
+function ptc_format_direct(obj: TPTC_FORMAT): Boolean;
+begin
+  try
+    ptc_format_direct := TPTCFormat(obj).direct;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_format_direct := False;
+    end;
+  end;
+end;
+
+function ptc_format_indexed(obj: TPTC_FORMAT): Boolean;
+begin
+  try
+    ptc_format_indexed := TPTCFormat(obj).indexed;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_format_indexed := False;
+    end;
+  end;
+end;
+
+procedure ptc_format_assign(obj, format: TPTC_FORMAT);
+begin
+  try
+    TPTCFormat(obj).Assign(TPTCFormat(format));
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+function ptc_format_equals(obj, format: TPTC_FORMAT): Boolean;
+begin
+  try
+    ptc_format_equals := TPTCFormat(obj).Equals(TPTCFormat(format));
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_format_equals := False;
+    end;
+  end;
+end;

+ 51 - 0
packages/ptc/src/c_api/capi_formatd.inc

@@ -0,0 +1,51 @@
+{
+    Free Pascal port of the OpenPTC C++ library.
+    Copyright (C) 2001-2010  Nikolay Nikolov ([email protected])
+    Original C++ version by Glenn Fiedler ([email protected])
+
+    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.1 of the License, or (at your option) any later version
+    with the following modification:
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,and
+    to copy and distribute the resulting executable under terms of your choice,
+    provided that you also meet, for each linked independent module, the terms
+    and conditions of the license of that module. An independent module is a
+    module which is not derived from or based on this library. If you modify
+    this library, you may extend this exception to your version of the library,
+    but you are not obligated to do so. If you do not wish to do so, delete this
+    exception statement from your 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
+}
+
+{ setup }
+function ptc_format_create: TPTC_FORMAT;
+function ptc_format_create_indexed(bits: Integer): TPTC_FORMAT;
+function ptc_format_create_direct(bits: Integer; r, g, b, a: int32): TPTC_FORMAT;
+procedure ptc_format_destroy(obj: TPTC_FORMAT);
+
+{ data access }
+function ptc_format_r(obj: TPTC_FORMAT): int32;
+function ptc_format_g(obj: TPTC_FORMAT): int32;
+function ptc_format_b(obj: TPTC_FORMAT): int32;
+function ptc_format_a(obj: TPTC_FORMAT): int32;
+function ptc_format_bits(obj: TPTC_FORMAT): Integer;
+function ptc_format_bytes(obj: TPTC_FORMAT): Integer;
+function ptc_format_direct(obj: TPTC_FORMAT): Boolean;
+function ptc_format_indexed(obj: TPTC_FORMAT): Boolean;
+
+{ operators }
+procedure ptc_format_assign(obj, format: TPTC_FORMAT);
+function ptc_format_equals(obj, format: TPTC_FORMAT): Boolean;

+ 46 - 0
packages/ptc/src/c_api/capi_index.inc

@@ -0,0 +1,46 @@
+{
+    Free Pascal port of the OpenPTC C++ library.
+    Copyright (C) 2001-2010  Nikolay Nikolov ([email protected])
+    Original C++ version by Glenn Fiedler ([email protected])
+
+    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.1 of the License, or (at your option) any later version
+    with the following modification:
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,and
+    to copy and distribute the resulting executable under terms of your choice,
+    provided that you also meet, for each linked independent module, the terms
+    and conditions of the license of that module. An independent module is a
+    module which is not derived from or based on this library. If you modify
+    this library, you may extend this exception to your version of the library,
+    but you are not obligated to do so. If you do not wish to do so, delete this
+    exception statement from your 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
+}
+
+type
+  { object handles }
+  TPTC_KEY     = Pointer; { equivalent to Object Pascal TPTCKeyEvent    }
+  TPTC_AREA    = Pointer; { equivalent to Object Pascal TPTCArea        }
+  TPTC_MODE    = Pointer; { equivalent to Object Pascal TPTCMode        }
+  TPTC_COPY    = Pointer; { equivalent to Object Pascal TPTCCopy        }
+  TPTC_CLEAR   = Pointer; { equivalent to Object Pascal TPTCClear       }
+  TPTC_TIMER   = Pointer; { equivalent to Object Pascal TPTCTimer       }
+  TPTC_ERROR   = Pointer; { equivalent to Object Pascal TPTCError       }
+  TPTC_COLOR   = Pointer; { equivalent to Object Pascal TPTCColor       }
+  TPTC_FORMAT  = Pointer; { equivalent to Object Pascal TPTCFormat      }
+  TPTC_PALETTE = Pointer; { equivalent to Object Pascal TPTCPalette     }
+  TPTC_SURFACE = Pointer; { equivalent to Object Pascal TPTCBaseSurface }
+  TPTC_CONSOLE = Pointer; { equivalent to Object Pascal TPTCBaseConsole }

+ 131 - 0
packages/ptc/src/c_api/capi_key.inc

@@ -0,0 +1,131 @@
+{
+    Free Pascal port of the OpenPTC C++ library.
+    Copyright (C) 2001-2010  Nikolay Nikolov ([email protected])
+    Original C++ version by Glenn Fiedler ([email protected])
+
+    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.1 of the License, or (at your option) any later version
+    with the following modification:
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,and
+    to copy and distribute the resulting executable under terms of your choice,
+    provided that you also meet, for each linked independent module, the terms
+    and conditions of the license of that module. An independent module is a
+    module which is not derived from or based on this library. If you modify
+    this library, you may extend this exception to your version of the library,
+    but you are not obligated to do so. If you do not wish to do so, delete this
+    exception statement from your 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
+}
+
+function ptc_key_create(code: Integer; alt, shift, control: Boolean): TPTC_KEY;
+begin
+  try
+    ptc_key_create := TPTC_KEY(TPTCKeyEvent.Create(code, alt, shift, control));
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_key_create := nil;
+    end;
+  end;
+end;
+
+procedure ptc_key_destroy(obj: TPTC_KEY);
+begin
+  if obj = nil then
+    exit;
+  try
+    TPTCKeyEvent(obj).Destroy;
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+function ptc_key_code(obj: TPTC_KEY): Integer;
+begin
+  try
+    ptc_key_code := Integer(TPTCKeyEvent(obj).code);
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_key_code := 0;
+    end;
+  end;
+end;
+
+function ptc_key_alt(obj: TPTC_KEY): Boolean;
+begin
+  try
+    ptc_key_alt := TPTCKeyEvent(obj).alt;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_key_alt := False;
+    end;
+  end;
+end;
+
+function ptc_key_shift(obj: TPTC_KEY): Boolean;
+begin
+  try
+    ptc_key_shift := TPTCKeyEvent(obj).shift;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_key_shift := False;
+    end;
+  end;
+end;
+
+function ptc_key_control(obj: TPTC_KEY): Boolean;
+begin
+  try
+    ptc_key_control := TPTCKeyEvent(obj).control;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_key_control := False;
+    end;
+  end;
+end;
+
+procedure ptc_key_assign(obj: TPTC_KEY; key: TPTC_KEY);
+begin
+  try
+    TPTCKeyEvent(obj).Assign(TPTCKeyEvent(key));
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+function ptc_key_equals(obj: TPTC_KEY; key: TPTC_KEY): Boolean;
+begin
+  try
+    ptc_key_equals := TPTCKeyEvent(obj).Equals(TPTCKeyEvent(key));
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_key_equals := False;
+    end;
+  end;
+end;

+ 40 - 8
packages/ptc/src/c_api/keyd.inc → packages/ptc/src/c_api/capi_keyd.inc

@@ -1,18 +1,50 @@
+{
+    Free Pascal port of the OpenPTC C++ library.
+    Copyright (C) 2001-2010  Nikolay Nikolov ([email protected])
+    Original C++ version by Glenn Fiedler ([email protected])
+
+    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.1 of the License, or (at your option) any later version
+    with the following modification:
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,and
+    to copy and distribute the resulting executable under terms of your choice,
+    provided that you also meet, for each linked independent module, the terms
+    and conditions of the license of that module. An independent module is a
+    module which is not derived from or based on this library. If you modify
+    this library, you may extend this exception to your version of the library,
+    but you are not obligated to do so. If you do not wish to do so, delete this
+    exception statement from your 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
+}
+
 { setup }
 { setup }
-Function ptc_key_create(code : Integer; alt, shift, control : Boolean) : TPTC_KEY;
-Procedure ptc_key_destroy(obj : TPTC_KEY);
+function ptc_key_create(code: Integer; alt, shift, control: Boolean): TPTC_KEY;
+procedure ptc_key_destroy(obj: TPTC_KEY);
 
 
 { key code }
 { key code }
-Function ptc_key_code(obj : TPTC_KEY) : Integer;
+function ptc_key_code(obj: TPTC_KEY): Integer;
 
 
 { modifiers }
 { modifiers }
-Function ptc_key_alt(obj : TPTC_KEY) : Boolean;
-Function ptc_key_shift(obj : TPTC_KEY) : Boolean;
-Function ptc_key_control(obj : TPTC_KEY) : Boolean;
+function ptc_key_alt(obj: TPTC_KEY): Boolean;
+function ptc_key_shift(obj: TPTC_KEY): Boolean;
+function ptc_key_control(obj: TPTC_KEY): Boolean;
 
 
 { operators }
 { operators }
-Procedure ptc_key_assign(obj : TPTC_KEY; key : TPTC_KEY);
-Function ptc_key_equals(obj : TPTC_KEY; key : TPTC_KEY) : Boolean;
+procedure ptc_key_assign(obj: TPTC_KEY; key: TPTC_KEY);
+function ptc_key_equals(obj: TPTC_KEY; key: TPTC_KEY): Boolean;
 
 
 { key codes }
 { key codes }
 {#define PTC_KEY_ENTER            '\n'
 {#define PTC_KEY_ENTER            '\n'

+ 144 - 0
packages/ptc/src/c_api/capi_mode.inc

@@ -0,0 +1,144 @@
+{
+    Free Pascal port of the OpenPTC C++ library.
+    Copyright (C) 2001-2010  Nikolay Nikolov ([email protected])
+    Original C++ version by Glenn Fiedler ([email protected])
+
+    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.1 of the License, or (at your option) any later version
+    with the following modification:
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,and
+    to copy and distribute the resulting executable under terms of your choice,
+    provided that you also meet, for each linked independent module, the terms
+    and conditions of the license of that module. An independent module is a
+    module which is not derived from or based on this library. If you modify
+    this library, you may extend this exception to your version of the library,
+    but you are not obligated to do so. If you do not wish to do so, delete this
+    exception statement from your 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
+}
+
+function ptc_mode_create(width, height: Integer; format: TPTC_FORMAT): TPTC_MODE;
+begin
+  try
+    ptc_mode_create := TPTC_MODE(TPTCMode.Create(width, height, TPTCFormat(format)));
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_mode_create := nil;
+    end;
+  end;
+end;
+
+function ptc_mode_create_invalid: TPTC_MODE;
+begin
+  try
+    ptc_mode_create_invalid := TPTC_MODE(TPTCMode.Create);
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_mode_create_invalid := nil;
+    end;
+  end;
+end;
+
+procedure ptc_mode_destroy(obj: TPTC_MODE);
+begin
+  if obj = nil then
+    exit;
+  try
+    TPTCMode(obj).Destroy;
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+function ptc_mode_valid(obj: TPTC_MODE): Boolean;
+begin
+  try
+    ptc_mode_valid := TPTCMode(obj).valid;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_mode_valid := False;
+    end;
+  end;
+end;
+
+function ptc_mode_width(obj: TPTC_MODE): Integer;
+begin
+  try
+    ptc_mode_width := TPTCMode(obj).width;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_mode_width := 0;
+    end;
+  end;
+end;
+
+function ptc_mode_height(obj: TPTC_MODE): Integer;
+begin
+  try
+    ptc_mode_height := TPTCMode(obj).height;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_mode_height := 0;
+    end;
+  end;
+end;
+
+function ptc_mode_format(obj: TPTC_MODE): TPTC_FORMAT;
+begin
+  try
+    ptc_mode_format := TPTC_FORMAT(TPTCMode(obj).format);
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_mode_format := nil;
+    end;
+  end;
+end;
+
+procedure ptc_mode_assign(obj, mode: TPTC_MODE);
+begin
+  try
+    TPTCMode(obj).Assign(TPTCMode(mode));
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+function ptc_mode_equals(obj, mode: TPTC_MODE): Boolean;
+begin
+  try
+    ptc_mode_equals := TPTCMode(obj).Equals(TPTCMode(mode));
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_mode_equals := False;
+    end;
+  end;
+end;

+ 48 - 0
packages/ptc/src/c_api/capi_moded.inc

@@ -0,0 +1,48 @@
+{
+    Free Pascal port of the OpenPTC C++ library.
+    Copyright (C) 2001-2010  Nikolay Nikolov ([email protected])
+    Original C++ version by Glenn Fiedler ([email protected])
+
+    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.1 of the License, or (at your option) any later version
+    with the following modification:
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,and
+    to copy and distribute the resulting executable under terms of your choice,
+    provided that you also meet, for each linked independent module, the terms
+    and conditions of the license of that module. An independent module is a
+    module which is not derived from or based on this library. If you modify
+    this library, you may extend this exception to your version of the library,
+    but you are not obligated to do so. If you do not wish to do so, delete this
+    exception statement from your 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
+}
+
+{ setup }
+function ptc_mode_create(width, height: Integer; format: TPTC_FORMAT): TPTC_MODE;
+function ptc_mode_create_invalid: TPTC_MODE;
+procedure ptc_mode_destroy(obj: TPTC_MODE);
+
+{ valid mode flag }
+function ptc_mode_valid(obj: TPTC_MODE): Boolean;
+
+{ data access }
+function ptc_mode_width(obj: TPTC_MODE): Integer;
+function ptc_mode_height(obj: TPTC_MODE): Integer;
+function ptc_mode_format(obj: TPTC_MODE): TPTC_FORMAT;
+
+{ operators }
+procedure ptc_mode_assign(obj, mode: TPTC_MODE);
+function ptc_mode_equals(obj, mode: TPTC_MODE): Boolean;

+ 149 - 0
packages/ptc/src/c_api/capi_palette.inc

@@ -0,0 +1,149 @@
+{
+    Free Pascal port of the OpenPTC C++ library.
+    Copyright (C) 2001-2010  Nikolay Nikolov ([email protected])
+    Original C++ version by Glenn Fiedler ([email protected])
+
+    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.1 of the License, or (at your option) any later version
+    with the following modification:
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,and
+    to copy and distribute the resulting executable under terms of your choice,
+    provided that you also meet, for each linked independent module, the terms
+    and conditions of the license of that module. An independent module is a
+    module which is not derived from or based on this library. If you modify
+    this library, you may extend this exception to your version of the library,
+    but you are not obligated to do so. If you do not wish to do so, delete this
+    exception statement from your 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
+}
+
+function ptc_palette_create: TPTC_PALETTE;
+begin
+  try
+    ptc_palette_create := TPTC_PALETTE(TPTCPalette.Create);
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_palette_create := nil;
+    end;
+  end;
+end;
+
+{function ptc_palette_create_data(data: Pint32): TPTC_PALETTE;
+
+begin
+  try
+    ptc_palette_create_data := TPTC_PALETTE(TPTCPalette.Create(data));
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_palette_create_data := nil;
+    end;
+  end;
+End;}
+
+procedure ptc_palette_destroy(obj: TPTC_PALETTE);
+begin
+  if obj = nil then
+    exit;
+  try
+    TPTCPalette(obj).Destroy;
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+function ptc_palette_lock(obj: TPTC_PALETTE): Pint32;
+begin
+  try
+    ptc_palette_lock := TPTCPalette(obj).lock;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_palette_lock := nil;
+    end;
+  end;
+end;
+
+procedure ptc_palette_unlock(obj: TPTC_PALETTE);
+begin
+  try
+    TPTCPalette(obj).unlock;
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_palette_load(obj: TPTC_PALETTE; data: Pint32);
+begin
+  try
+    TPTCPalette(obj).load(data);
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_palette_save(obj: TPTC_PALETTE; data: Pint32);
+begin
+  try
+    TPTCPalette(obj).save(data);
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+function ptc_palette_data(obj: TPTC_PALETTE): Pint32;
+begin
+  try
+    ptc_palette_data := TPTCPalette(obj).data;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_palette_data := nil;
+    end;
+  end;
+end;
+
+procedure ptc_palette_assign(obj, palette: TPTC_PALETTE);
+begin
+  try
+    TPTCPalette(obj).Assign(TPTCPalette(palette));
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+function ptc_palette_equals(obj, palette: TPTC_PALETTE): Boolean;
+begin
+  try
+    ptc_palette_equals := TPTCPalette(obj).Equals(TPTCPalette(palette));
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_palette_equals := False;
+    end;
+  end;
+end;

+ 53 - 0
packages/ptc/src/c_api/capi_paletted.inc

@@ -0,0 +1,53 @@
+{
+    Free Pascal port of the OpenPTC C++ library.
+    Copyright (C) 2001-2010  Nikolay Nikolov ([email protected])
+    Original C++ version by Glenn Fiedler ([email protected])
+
+    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.1 of the License, or (at your option) any later version
+    with the following modification:
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,and
+    to copy and distribute the resulting executable under terms of your choice,
+    provided that you also meet, for each linked independent module, the terms
+    and conditions of the license of that module. An independent module is a
+    module which is not derived from or based on this library. If you modify
+    this library, you may extend this exception to your version of the library,
+    but you are not obligated to do so. If you do not wish to do so, delete this
+    exception statement from your 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
+}
+
+{ setup }
+function ptc_palette_create: TPTC_PALETTE;
+{function ptc_palette_create_data(data: Pint32): TPTC_PALETTE;}
+procedure ptc_palette_destroy(obj: TPTC_PALETTE);
+
+{ memory access }
+function ptc_palette_lock(obj: TPTC_PALETTE): Pint32;
+procedure ptc_palette_unlock(obj: TPTC_PALETTE);
+
+{ load palette data }
+procedure ptc_palette_load(obj: TPTC_PALETTE; data: Pint32);
+
+{ save palette data }
+procedure ptc_palette_save(obj: TPTC_PALETTE; data: Pint32);
+
+{ get palette data }
+function ptc_palette_data(obj: TPTC_PALETTE): Pint32;
+
+{ operators }
+procedure ptc_palette_assign(obj, palette: TPTC_PALETTE);
+function ptc_palette_equals(obj, palette: TPTC_PALETTE): Boolean;

+ 293 - 0
packages/ptc/src/c_api/capi_surface.inc

@@ -0,0 +1,293 @@
+{
+    Free Pascal port of the OpenPTC C++ library.
+    Copyright (C) 2001-2010  Nikolay Nikolov ([email protected])
+    Original C++ version by Glenn Fiedler ([email protected])
+
+    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.1 of the License, or (at your option) any later version
+    with the following modification:
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,and
+    to copy and distribute the resulting executable under terms of your choice,
+    provided that you also meet, for each linked independent module, the terms
+    and conditions of the license of that module. An independent module is a
+    module which is not derived from or based on this library. If you modify
+    this library, you may extend this exception to your version of the library,
+    but you are not obligated to do so. If you do not wish to do so, delete this
+    exception statement from your 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
+}
+
+function ptc_surface_create(width, height: Integer; format: TPTC_FORMAT): TPTC_SURFACE;
+begin
+  try
+    ptc_surface_create := TPTC_SURFACE(TPTCSurface.Create(width, height, TPTCFormat(format)));
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_surface_create := nil;
+    end;
+  end;
+end;
+
+procedure ptc_surface_destroy(obj: TPTC_SURFACE);
+begin
+  if obj = nil then
+    exit;
+  try
+    TPTCBaseSurface(obj).Destroy;
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_surface_copy(obj: TPTC_SURFACE; surface: TPTC_SURFACE);
+begin
+  try
+    TPTCBaseSurface(obj).copy(TPTCBaseSurface(surface));
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_surface_copy_area(obj: TPTC_SURFACE; surface: TPTC_SURFACE; source, destination: TPTC_AREA);
+begin
+  try
+    TPTCBaseSurface(obj).copy(TPTCBaseSurface(surface), TPTCArea(source), TPTCArea(destination));
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+function ptc_surface_lock(obj: TPTC_SURFACE): Pointer;
+begin
+  try
+    ptc_surface_lock := TPTCBaseSurface(obj).lock;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_surface_lock := nil;
+    end;
+  end;
+end;
+
+procedure ptc_surface_unlock(obj: TPTC_SURFACE);
+begin
+  try
+    TPTCBaseSurface(obj).unlock;
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_surface_load(obj: TPTC_SURFACE; pixels: Pointer; width, height, pitch: Integer; format: TPTC_FORMAT; palette: TPTC_PALETTE);
+begin
+  try
+    TPTCBaseSurface(obj).load(pixels, width, height, pitch, TPTCFormat(format), TPTCPalette(palette));
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_surface_load_area(obj: TPTC_SURFACE; pixels: Pointer; width, height, pitch: Integer; format: TPTC_FORMAT; palette: TPTC_PALETTE; source, destination: TPTC_AREA);
+begin
+  try
+    TPTCBaseSurface(obj).load(pixels, width, height, pitch, TPTCFormat(format), TPTCPalette(palette), TPTCArea(source), TPTCArea(destination));
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_surface_save(obj: TPTC_SURFACE; pixels: Pointer; width, height, pitch: Integer; format: TPTC_FORMAT; palette: TPTC_PALETTE);
+begin
+  try
+    TPTCBaseSurface(obj).save(pixels, width, height, pitch, TPTCFormat(format), TPTCPalette(palette));
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_surface_save_area(obj: TPTC_SURFACE; pixels: Pointer; width, height, pitch: Integer; format: TPTC_FORMAT; palette: TPTC_PALETTE; source, destination: TPTC_AREA);
+begin
+  try
+    TPTCBaseSurface(obj).save(pixels, width, height, pitch, TPTCFormat(format), TPTCPalette(palette), TPTCArea(source), TPTCArea(destination));
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_surface_clear(obj: TPTC_SURFACE);
+begin
+  try
+    TPTCBaseSurface(obj).clear;
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_surface_clear_color(obj: TPTC_SURFACE; color: TPTC_COLOR);
+begin
+  try
+    TPTCBaseSurface(obj).clear(TPTCColor(color));
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_surface_clear_color_area(obj: TPTC_SURFACE; color: TPTC_COLOR; area: TPTC_AREA);
+begin
+  try
+    TPTCBaseSurface(obj).clear(TPTCColor(color), TPTCArea(area));
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_surface_palette_set(obj: TPTC_SURFACE; palette: TPTC_PALETTE);
+begin
+  try
+    TPTCBaseSurface(obj).palette(TPTCPalette(palette));
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+function ptc_surface_palette_get(obj: TPTC_SURFACE): TPTC_PALETTE;
+begin
+  try
+    ptc_surface_palette_get := TPTC_PALETTE(TPTCBaseSurface(obj).palette);
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_surface_palette_get := nil;
+    end;
+  end;
+end;
+
+procedure ptc_surface_clip_set(obj: TPTC_SURFACE; area: TPTC_AREA);
+begin
+  try
+    TPTCBaseSurface(obj).clip(TPTCArea(area));
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+function ptc_surface_width(obj: TPTC_SURFACE): Integer;
+begin
+  try
+    ptc_surface_width := TPTCBaseSurface(obj).width;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_surface_width := 0;
+    end;
+  end;
+end;
+
+function ptc_surface_height(obj: TPTC_SURFACE): Integer;
+begin
+  try
+    ptc_surface_height := TPTCBaseSurface(obj).height;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_surface_height := 0;
+    end;
+  end;
+end;
+
+function ptc_surface_pitch(obj: TPTC_SURFACE): Integer;
+begin
+  try
+    ptc_surface_pitch := TPTCBaseSurface(obj).pitch;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_surface_pitch := 0;
+    end;
+  end;
+end;
+
+function ptc_surface_area(obj: TPTC_SURFACE): TPTC_AREA;
+begin
+  try
+    ptc_surface_area := TPTC_AREA(TPTCBaseSurface(obj).area);
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_surface_area := nil;
+    end;
+  end;
+end;
+
+function ptc_surface_clip(obj: TPTC_SURFACE): TPTC_AREA;
+begin
+  try
+    ptc_surface_clip := TPTC_AREA(TPTCBaseSurface(obj).clip);
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_surface_clip := nil;
+    end;
+  end;
+end;
+
+function ptc_surface_format(obj: TPTC_SURFACE): TPTC_FORMAT;
+begin
+  try
+    ptc_surface_format := TPTC_FORMAT(TPTCBaseSurface(obj).format);
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_surface_format := nil;
+    end;
+  end;
+end;
+
+function ptc_surface_option(obj: TPTC_SURFACE; _option: string): Boolean;
+begin
+  try
+    ptc_surface_option := TPTCBaseSurface(obj).option(_option);
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_surface_option := False;
+    end;
+  end;
+end;

+ 74 - 0
packages/ptc/src/c_api/capi_surfaced.inc

@@ -0,0 +1,74 @@
+{
+    Free Pascal port of the OpenPTC C++ library.
+    Copyright (C) 2001-2010  Nikolay Nikolov ([email protected])
+    Original C++ version by Glenn Fiedler ([email protected])
+
+    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.1 of the License, or (at your option) any later version
+    with the following modification:
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,and
+    to copy and distribute the resulting executable under terms of your choice,
+    provided that you also meet, for each linked independent module, the terms
+    and conditions of the license of that module. An independent module is a
+    module which is not derived from or based on this library. If you modify
+    this library, you may extend this exception to your version of the library,
+    but you are not obligated to do so. If you do not wish to do so, delete this
+    exception statement from your 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
+}
+
+{ setup }
+function ptc_surface_create(width, height: Integer; format: TPTC_FORMAT): TPTC_SURFACE;
+procedure ptc_surface_destroy(obj: TPTC_SURFACE);
+
+{ copy to surface }
+procedure ptc_surface_copy(obj: TPTC_SURFACE; surface: TPTC_SURFACE);
+procedure ptc_surface_copy_area(obj: TPTC_SURFACE; surface: TPTC_SURFACE; source, destination: TPTC_AREA);
+
+{ memory access }
+function ptc_surface_lock(obj: TPTC_SURFACE): Pointer;
+procedure ptc_surface_unlock(obj: TPTC_SURFACE);
+
+{ load pixels to surface }
+procedure ptc_surface_load(obj: TPTC_SURFACE; pixels: Pointer; width, height, pitch: Integer; format: TPTC_FORMAT; palette: TPTC_PALETTE);
+procedure ptc_surface_load_area(obj: TPTC_SURFACE; pixels: Pointer; width, height, pitch: Integer; format: TPTC_FORMAT; palette: TPTC_PALETTE; source, destination: TPTC_AREA);
+
+{ save surface pixels }
+procedure ptc_surface_save(obj: TPTC_SURFACE; pixels: Pointer; width, height, pitch: Integer; format: TPTC_FORMAT; palette: TPTC_PALETTE);
+procedure ptc_surface_save_area(obj: TPTC_SURFACE; pixels: Pointer; width, height, pitch: Integer; format: TPTC_FORMAT; palette: TPTC_PALETTE; source, destination: TPTC_AREA);
+
+{ clear surface }
+procedure ptc_surface_clear(obj: TPTC_SURFACE);
+procedure ptc_surface_clear_color(obj: TPTC_SURFACE; color: TPTC_COLOR);
+procedure ptc_surface_clear_color_area(obj: TPTC_SURFACE; color: TPTC_COLOR; area: TPTC_AREA);
+
+{ surface palette }
+procedure ptc_surface_palette_set(obj: TPTC_SURFACE; palette: TPTC_PALETTE);
+function ptc_surface_palette_get(obj: TPTC_SURFACE): TPTC_PALETTE;
+
+{ surface clip area }
+procedure ptc_surface_clip_set(obj: TPTC_SURFACE; area: TPTC_AREA);
+
+{ data access }
+function ptc_surface_width(obj: TPTC_SURFACE): Integer;
+function ptc_surface_height(obj: TPTC_SURFACE): Integer;
+function ptc_surface_pitch(obj: TPTC_SURFACE): Integer;
+function ptc_surface_area(obj: TPTC_SURFACE): TPTC_AREA;
+function ptc_surface_clip(obj: TPTC_SURFACE): TPTC_AREA;
+function ptc_surface_format(obj: TPTC_SURFACE): TPTC_FORMAT;
+
+{ surface option string }
+function ptc_surface_option(obj: TPTC_SURFACE; _option: string): Boolean;

+ 148 - 0
packages/ptc/src/c_api/capi_timer.inc

@@ -0,0 +1,148 @@
+{
+    Free Pascal port of the OpenPTC C++ library.
+    Copyright (C) 2001-2010  Nikolay Nikolov ([email protected])
+    Original C++ version by Glenn Fiedler ([email protected])
+
+    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.1 of the License, or (at your option) any later version
+    with the following modification:
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,and
+    to copy and distribute the resulting executable under terms of your choice,
+    provided that you also meet, for each linked independent module, the terms
+    and conditions of the license of that module. An independent module is a
+    module which is not derived from or based on this library. If you modify
+    this library, you may extend this exception to your version of the library,
+    but you are not obligated to do so. If you do not wish to do so, delete this
+    exception statement from your 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
+}
+
+function ptc_timer_create: TPTC_TIMER;
+begin
+  try
+    ptc_timer_create := TPTC_TIMER(TPTCTimer.Create);
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_timer_create := nil;
+    end;
+  end;
+end;
+
+procedure ptc_timer_destroy(obj: TPTC_TIMER);
+begin
+  if obj = nil then
+    exit;
+  try
+    TPTCTimer(obj).Destroy;
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_timer_set(obj: TPTC_TIMER; time: Double);
+begin
+  try
+    TPTCTimer(obj).settime(time);
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_timer_start(obj: TPTC_TIMER);
+begin
+  try
+    TPTCTimer(obj).start;
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+procedure ptc_timer_stop(obj: TPTC_TIMER);
+begin
+  try
+    TPTCTimer(obj).stop;
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+function ptc_timer_time(obj: TPTC_TIMER): Double;
+begin
+  try
+    ptc_timer_time := TPTCTimer(obj).time;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_timer_time := 0;
+    end;
+  end;
+end;
+
+function ptc_timer_delta(obj: TPTC_TIMER): Double;
+begin
+  try
+    ptc_timer_delta := TPTCTimer(obj).delta;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_timer_delta := 0;
+    end;
+  end;
+end;
+
+function ptc_timer_resolution(obj: TPTC_TIMER): Double;
+begin
+  try
+    ptc_timer_resolution := TPTCTimer(obj).resolution;
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_timer_resolution := 0;
+    end;
+  end;
+end;
+
+procedure ptc_timer_assign(obj, timer: TPTC_TIMER);
+begin
+  try
+    TPTCTimer(obj).Assign(TPTCTimer(timer));
+  except
+    on error: TPTCError do
+      ptc_exception_handle(error);
+  end;
+end;
+
+function ptc_timer_equals(obj, timer: TPTC_TIMER): Boolean;
+begin
+  try
+    ptc_timer_equals := TPTCTimer(obj).equals(TPTCTimer(timer));
+  except
+    on error: TPTCError do
+    begin
+      ptc_exception_handle(error);
+      ptc_timer_equals := False;
+    end;
+  end;
+end;

+ 51 - 0
packages/ptc/src/c_api/capi_timerd.inc

@@ -0,0 +1,51 @@
+{
+    Free Pascal port of the OpenPTC C++ library.
+    Copyright (C) 2001-2010  Nikolay Nikolov ([email protected])
+    Original C++ version by Glenn Fiedler ([email protected])
+
+    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.1 of the License, or (at your option) any later version
+    with the following modification:
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,and
+    to copy and distribute the resulting executable under terms of your choice,
+    provided that you also meet, for each linked independent module, the terms
+    and conditions of the license of that module. An independent module is a
+    module which is not derived from or based on this library. If you modify
+    this library, you may extend this exception to your version of the library,
+    but you are not obligated to do so. If you do not wish to do so, delete this
+    exception statement from your 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
+}
+
+{ setup }
+function ptc_timer_create: TPTC_TIMER;
+procedure ptc_timer_destroy(obj: TPTC_TIMER);
+
+{ set time }
+procedure ptc_timer_set(obj: TPTC_TIMER; time: Double);
+
+{ control }
+procedure ptc_timer_start(obj: TPTC_TIMER);
+procedure ptc_timer_stop(obj: TPTC_TIMER);
+
+{ time data }
+function ptc_timer_time(obj: TPTC_TIMER): Double;
+function ptc_timer_delta(obj: TPTC_TIMER): Double;
+function ptc_timer_resolution(obj: TPTC_TIMER): Double;
+
+{ operators }
+procedure ptc_timer_assign(obj, timer: TPTC_TIMER);
+function ptc_timer_equals(obj, timer: TPTC_TIMER): Boolean;

+ 0 - 48
packages/ptc/src/c_api/clear.inc

@@ -1,48 +0,0 @@
-Function ptc_clear_create : TPTC_CLEAR;
-
-Begin
-  Try
-    ptc_clear_create := TPTC_CLEAR(TPTCClear.Create);
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_clear_create := Nil;
-    End;
-  End;
-End;
-
-Procedure ptc_clear_destroy(obj : TPTC_CLEAR);
-
-Begin
-  If obj = Nil Then
-    Exit;
-  Try
-    TPTCClear(obj).Destroy;
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_clear_request(obj : TPTC_CLEAR; format : TPTC_FORMAT);
-
-Begin
-  Try
-    TPTCClear(obj).request(TPTCFormat(format));
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_clear_clear(obj : TPTC_CLEAR; pixels : Pointer; x, y, width, height, pitch : Integer; color : TPTC_COLOR);
-
-Begin
-  Try
-    TPTCClear(obj).clear(pixels, x, y, width, height, pitch, TPTCColor(color));
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;

+ 0 - 9
packages/ptc/src/c_api/cleard.inc

@@ -1,9 +0,0 @@
-{ setup }
-Function ptc_clear_create : TPTC_CLEAR;
-Procedure ptc_clear_destroy(obj : TPTC_CLEAR);
-
-{ request clear }
-Procedure ptc_clear_request(obj : TPTC_CLEAR; format : TPTC_FORMAT);
-
-{ clear pixels }
-Procedure ptc_clear_clear(obj : TPTC_CLEAR; pixels : Pointer; x, y, width, height, pitch : Integer; color : TPTC_COLOR);

+ 0 - 33
packages/ptc/src/c_api/clipper.inc

@@ -1,33 +0,0 @@
-Procedure ptc_clipper_clip(area, clip, clipped : TPTC_AREA);
-
-Var
-  tmp : TPTCArea;
-
-Begin
-  Try
-    tmp := TPTCClipper.clip(TPTCArea(area), TPTCArea(clip));
-    Try
-      TPTCArea(clipped).ASSign(tmp);
-    Finally
-      tmp.Destroy;
-    End;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-    End;
-  End;
-End;
-
-Procedure ptc_clipper_clip_complex(source, clip_source, clipped_source, destination, clip_destination, clipped_destination : TPTC_AREA);
-
-Begin
-  Try
-    TPTCClipper.clip(TPTCArea(source), TPTCArea(clip_source), TPTCArea(clipped_source), TPTCArea(destination), TPTCArea(clip_destination), TPTCArea(clipped_destination));
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-    End;
-  End;
-End;

+ 0 - 5
packages/ptc/src/c_api/clipperd.inc

@@ -1,5 +0,0 @@
-{ clip a single area against clip area }
-Procedure ptc_clipper_clip(area, clip, clipped : TPTC_AREA);
-
-{ clip source and destination areas against source and destination clip areas }
-Procedure ptc_clipper_clip_complex(source, clip_source, clipped_source, destination, clip_destination, clipped_destination : TPTC_AREA);

+ 0 - 177
packages/ptc/src/c_api/color.inc

@@ -1,177 +0,0 @@
-Function ptc_color_create : TPTC_COLOR;
-
-Begin
-  Try
-    ptc_color_create := TPTC_COLOR(TPTCColor.Create);
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_color_create := Nil;
-    End;
-  End;
-End;
-
-Function ptc_color_create_indexed(index : Integer) : TPTC_COLOR;
-
-Begin
-  Try
-    ptc_color_create_indexed := TPTC_COLOR(TPTCColor.Create(index));
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_color_create_indexed := Nil;
-    End;
-  End;
-End;
-
-Function ptc_color_create_direct(r, g, b, a : Single) : TPTC_COLOR;
-
-Begin
-  Try
-    ptc_color_create_direct := TPTC_COLOR(TPTCColor.Create(r, g, b, a));
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_color_create_direct := Nil;
-    End;
-  End;
-End;
-
-Procedure ptc_color_destroy(obj : TPTC_COLOR);
-
-Begin
-  If obj = Nil Then
-    Exit;
-  Try
-    TPTCColor(obj).Destroy;
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Function ptc_color_index(obj : TPTC_COLOR) : Integer;
-
-Begin
-  Try
-    ptc_color_index := TPTCColor(obj).index;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_color_index := 0;
-    End;
-  End;
-End;
-
-Function ptc_color_r(obj : TPTC_COLOR) : Single;
-
-Begin
-  Try
-    ptc_color_r := TPTCColor(obj).r;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_color_r := 0;
-    End;
-  End;
-End;
-
-Function ptc_color_g(obj : TPTC_COLOR) : Single;
-
-Begin
-  Try
-    ptc_color_g := TPTCColor(obj).g;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_color_g := 0;
-    End;
-  End;
-End;
-
-Function ptc_color_b(obj : TPTC_COLOR) : Single;
-
-Begin
-  Try
-    ptc_color_b := TPTCColor(obj).b;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_color_b := 0;
-    End;
-  End;
-End;
-
-Function ptc_color_a(obj : TPTC_COLOR) : Single;
-
-Begin
-  Try
-    ptc_color_a := TPTCColor(obj).a;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_color_a := 0;
-    End;
-  End;
-End;
-
-Function ptc_color_direct(obj : TPTC_COLOR) : Boolean;
-
-Begin
-  Try
-    ptc_color_direct := TPTCColor(obj).direct;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_color_direct := False;
-    End;
-  End;
-End;
-
-Function ptc_color_indexed(obj : TPTC_COLOR) : Boolean;
-
-Begin
-  Try
-    ptc_color_indexed := TPTCColor(obj).indexed;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_color_indexed := False;
-    End;
-  End;
-End;
-
-Procedure ptc_color_assign(obj, color : TPTC_COLOR);
-
-Begin
-  Try
-    TPTCColor(obj).ASSign(TPTCColor(color));
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Function ptc_color_equals(obj, color : TPTC_COLOR) : Boolean;
-
-Begin
-  Try
-    ptc_color_equals := TPTCColor(obj).Equals(TPTCColor(color));
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_color_equals := False;
-    End;
-  End;
-End;

+ 0 - 18
packages/ptc/src/c_api/colord.inc

@@ -1,18 +0,0 @@
-{ setup }
-Function ptc_color_create : TPTC_COLOR;
-Function ptc_color_create_indexed(index : Integer) : TPTC_COLOR;
-Function ptc_color_create_direct(r, g, b, a : Single) : TPTC_COLOR;
-Procedure ptc_color_destroy(obj : TPTC_COLOR);
-
-{ data access }
-Function ptc_color_index(obj : TPTC_COLOR) : Integer;
-Function ptc_color_r(obj : TPTC_COLOR) : Single;
-Function ptc_color_g(obj : TPTC_COLOR) : Single;
-Function ptc_color_b(obj : TPTC_COLOR) : Single;
-Function ptc_color_a(obj : TPTC_COLOR) : Single;
-Function ptc_color_direct(obj : TPTC_COLOR) : Boolean;
-Function ptc_color_indexed(obj : TPTC_COLOR) : Boolean;
-
-{ operators }
-Procedure ptc_color_assign(obj, color : TPTC_COLOR);
-Function ptc_color_equals(obj, color : TPTC_COLOR) : Boolean;

+ 0 - 497
packages/ptc/src/c_api/console.inc

@@ -1,497 +0,0 @@
-Function ptc_console_create : TPTC_CONSOLE;
-
-Begin
-  Try
-    ptc_console_create := TPTC_CONSOLE(TPTCConsole.Create);
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_console_create := Nil;
-    End;
-  End;
-End;
-
-Procedure ptc_console_destroy(obj : TPTC_CONSOLE);
-
-Begin
-  If obj = Nil Then
-    Exit;
-  Try
-    TPTCBaseConsole(obj).Destroy;
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_console_configure(obj : TPTC_CONSOLE; _file : String);
-
-Begin
-  Try
-    TPTCBaseConsole(obj).configure(_file);
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Function ptc_console_option(obj : TPTC_CONSOLE; _option : String) : Boolean;
-
-Begin
-  Try
-    ptc_console_option := TPTCBaseConsole(obj).option(_option);
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_console_option := False;
-    End;
-  End;
-End;
-
-Function ptc_console_mode(obj : TPTC_CONSOLE; index : Integer) : TPTC_MODE;
-
-Begin
-  Try
-    ptc_console_mode := TPTC_MODE(TPTCBaseConsole(obj).modes[index]);
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_console_mode := Nil;
-    End;
-  End;
-End;
-
-Procedure ptc_console_open(obj : TPTC_CONSOLE; title : String; pages : Integer);
-
-Begin
-  Try
-    TPTCBaseConsole(obj).open(title, pages);
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_console_open_format(obj : TPTC_CONSOLE; title : String; format : TPTC_FORMAT; pages : Integer);
-
-Begin
-  Try
-    TPTCBaseConsole(obj).open(title, TPTCFormat(format), pages);
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_console_open_resolution(obj : TPTC_CONSOLE; title : String; width, height : Integer; format : TPTC_FORMAT; pages : Integer);
-
-Begin
-  Try
-    TPTCBaseConsole(obj).open(title, width, height, TPTCFormat(format), pages);
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_console_open_mode(obj : TPTC_CONSOLE; title : String; mode : TPTC_MODE; pages : Integer);
-
-Begin
-  Try
-    TPTCBaseConsole(obj).open(title, TPTCMode(mode), pages);
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_console_close(obj : TPTC_CONSOLE);
-
-Begin
-  Try
-    TPTCBaseConsole(obj).close;
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_console_flush(obj : TPTC_CONSOLE);
-
-Begin
-  Try
-    TPTCBaseConsole(obj).flush;
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_console_finish(obj : TPTC_CONSOLE);
-
-Begin
-  Try
-    TPTCBaseConsole(obj).finish;
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_console_update(obj : TPTC_CONSOLE);
-
-Begin
-  Try
-    TPTCBaseConsole(obj).update;
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_console_update_area(obj : TPTC_CONSOLE; area : TPTC_AREA);
-
-Begin
-  Try
-    TPTCBaseConsole(obj).update(TPTCArea(area));
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Function ptc_console_key(obj : TPTC_CONSOLE) : Boolean;
-
-Begin
-  Try
-    ptc_console_key := TPTCBaseConsole(obj).key;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_console_key := False;
-    End;
-  End;
-End;
-
-Procedure ptc_console_read(obj : TPTC_CONSOLE; key : TPTC_KEY);
-
-Var
-  tmp : TPTCKey;
-
-Begin
-  Try
-    tmp := TPTCBaseConsole(obj).read;
-    Try
-      TPTCKey(key).ASSign(tmp);
-    Finally
-      tmp.Destroy;
-    End;
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_console_copy(obj : TPTC_CONSOLE; surface : TPTC_SURFACE);
-
-Begin
-  Try
-    TPTCBaseConsole(obj).copy(TPTCBaseSurface(surface));
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_console_copy_area(obj : TPTC_CONSOLE; surface : TPTC_SURFACE; source, destination : TPTC_AREA);
-
-Begin
-  Try
-    TPTCBaseConsole(obj).copy(TPTCBaseSurface(surface), TPTCArea(source), TPTCArea(destination));
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Function ptc_console_lock(obj : TPTC_CONSOLE) : Pointer;
-
-Begin
-  Try
-    ptc_console_lock := TPTCBaseConsole(obj).lock;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_console_lock := Nil;
-    End;
-  End;
-End;
-
-Procedure ptc_console_unlock(obj : TPTC_CONSOLE);
-
-Begin
-  Try
-    TPTCBaseConsole(obj).unlock;
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_console_load(obj : TPTC_CONSOLE; pixels : Pointer; width, height, pitch : Integer; format : TPTC_FORMAT; palette : TPTC_PALETTE);
-
-Begin
-  Try
-    TPTCBaseConsole(obj).load(pixels, width, height, pitch, TPTCFormat(format), TPTCPalette(palette));
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_console_load_area(obj : TPTC_CONSOLE; pixels : Pointer; width, height, pitch : Integer; format : TPTC_FORMAT; palette : TPTC_PALETTE; source, destination : TPTC_AREA);
-
-Begin
-  Try
-    TPTCBaseConsole(obj).load(pixels, width, height, pitch, TPTCFormat(format), TPTCPalette(palette), TPTCArea(source), TPTCArea(destination));
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_console_save(obj : TPTC_CONSOLE; pixels : Pointer; width, height, pitch : Integer; format : TPTC_FORMAT; palette : TPTC_PALETTE);
-
-Begin
-  Try
-    TPTCBaseConsole(obj).save(pixels, width, height, pitch, TPTCFormat(format), TPTCPalette(palette));
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_console_save_area(obj : TPTC_CONSOLE; pixels : Pointer; width, height, pitch : Integer; format : TPTC_FORMAT; palette : TPTC_PALETTE; source, destination : TPTC_AREA);
-
-Begin
-  Try
-    TPTCBaseConsole(obj).save(pixels, width, height, pitch, TPTCFormat(format), TPTCPalette(palette), TPTCArea(source), TPTCArea(destination));
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_console_clear(obj : TPTC_CONSOLE);
-
-Begin
-  Try
-    TPTCBaseConsole(obj).clear;
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_console_clear_color(obj : TPTC_CONSOLE; color : TPTC_COLOR);
-
-Begin
-  Try
-    TPTCBaseConsole(obj).clear(TPTCColor(color));
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_console_clear_color_area(obj : TPTC_CONSOLE; color : TPTC_COLOR; area : TPTC_AREA);
-
-Begin
-  Try
-    TPTCBaseConsole(obj).clear(TPTCColor(color), TPTCArea(area));
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_console_palette_set(obj : TPTC_CONSOLE; palette : TPTC_PALETTE);
-
-Begin
-  Try
-    TPTCBaseConsole(obj).palette(TPTCPalette(palette));
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Function ptc_console_palette_get(obj : TPTC_CONSOLE) : TPTC_PALETTE;
-
-Begin
-  Try
-    ptc_console_palette_get := TPTC_PALETTE(TPTCBaseConsole(obj).palette);
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_console_palette_get := Nil;
-    End;
-  End;
-End;
-
-Procedure ptc_console_clip_set(obj : TPTC_CONSOLE; area : TPTC_AREA);
-
-Begin
-  Try
-    TPTCBaseConsole(obj).clip(TPTCArea(area));
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Function ptc_console_width(obj : TPTC_CONSOLE) : Integer;
-
-Begin
-  Try
-    ptc_console_width := TPTCBaseConsole(obj).width;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_console_width := 0;
-    End;
-  End;
-End;
-
-Function ptc_console_height(obj : TPTC_CONSOLE) : Integer;
-
-Begin
-  Try
-    ptc_console_height := TPTCBaseConsole(obj).height;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_console_height := 0;
-    End;
-  End;
-End;
-
-Function ptc_console_pages(obj : TPTC_CONSOLE) : Integer;
-
-Begin
-  Try
-    ptc_console_pages := TPTCBaseConsole(obj).pages;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_console_pages := 0;
-    End;
-  End;
-End;
-
-Function ptc_console_pitch(obj : TPTC_CONSOLE) : Integer;
-
-Begin
-  Try
-    ptc_console_pitch := TPTCBaseConsole(obj).pitch;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_console_pitch := 0;
-    End;
-  End;
-End;
-
-Function ptc_console_area(obj : TPTC_CONSOLE) : TPTC_AREA;
-
-Begin
-  Try
-    ptc_console_area := TPTC_AREA(TPTCBaseConsole(obj).area);
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_console_area := Nil;
-    End;
-  End;
-End;
-
-Function ptc_console_clip(obj : TPTC_CONSOLE) : TPTC_AREA;
-
-Begin
-  Try
-    ptc_console_clip := TPTC_AREA(TPTCBaseConsole(obj).clip);
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_console_clip := Nil;
-    End;
-  End;
-End;
-
-Function ptc_console_format(obj : TPTC_CONSOLE) : TPTC_FORMAT;
-
-Begin
-  Try
-    ptc_console_format := TPTC_FORMAT(TPTCBaseConsole(obj).format);
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_console_format := Nil;
-    End;
-  End;
-End;
-
-Function ptc_console_name(obj : TPTC_CONSOLE) : String;
-
-Begin
-  Try
-    ptc_console_name := TPTCBaseConsole(obj).name;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_console_name := '';
-    End;
-  End;
-End;
-
-Function ptc_console_title(obj : TPTC_CONSOLE) : String;
-
-Begin
-  Try
-    ptc_console_title := TPTCBaseConsole(obj).title;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_console_title := '';
-    End;
-  End;
-End;
-
-Function ptc_console_information(obj : TPTC_CONSOLE) : String;
-
-Begin
-  Try
-    ptc_console_information := TPTCBaseConsole(obj).information;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_console_information := '';
-    End;
-  End;
-End;

+ 0 - 83
packages/ptc/src/c_api/consoled.inc

@@ -1,83 +0,0 @@
-{ setup }
-Function ptc_console_create : TPTC_CONSOLE;
-Procedure ptc_console_destroy(obj : TPTC_CONSOLE);
-
-{ console configuration }
-Procedure ptc_console_configure(obj : TPTC_CONSOLE; _file : String);
-
-{ console option string }
-Function ptc_console_option(obj : TPTC_CONSOLE; _option : String) : Boolean;
-
-{ console modes }
-Function ptc_console_mode(obj : TPTC_CONSOLE; index : Integer) : TPTC_MODE;
-
-{ console management }
-Procedure ptc_console_open(obj : TPTC_CONSOLE; title : String; pages : Integer);
-Procedure ptc_console_open_format(obj : TPTC_CONSOLE; title : String; format : TPTC_FORMAT; pages : Integer);
-Procedure ptc_console_open_resolution(obj : TPTC_CONSOLE; title : String; width, height : Integer; format : TPTC_FORMAT; pages : Integer);
-Procedure ptc_console_open_mode(obj : TPTC_CONSOLE; title : String; mode : TPTC_MODE; pages : Integer);
-Procedure ptc_console_close(obj : TPTC_CONSOLE);
-
-{ synchronization }
-Procedure ptc_console_flush(obj : TPTC_CONSOLE);
-Procedure ptc_console_finish(obj : TPTC_CONSOLE);
-Procedure ptc_console_update(obj : TPTC_CONSOLE);
-Procedure ptc_console_update_area(obj : TPTC_CONSOLE; area : TPTC_AREA);
-
-{ keyboard input }
-Function ptc_console_key(obj : TPTC_CONSOLE) : Boolean;
-Procedure ptc_console_read(obj : TPTC_CONSOLE; key : TPTC_KEY);
-
-{ copy to surface }
-Procedure ptc_console_copy(obj : TPTC_CONSOLE; surface : TPTC_SURFACE);
-Procedure ptc_console_copy_area(obj : TPTC_CONSOLE; surface : TPTC_SURFACE; source, destination : TPTC_AREA);
-
-{ memory access }
-Function ptc_console_lock(obj : TPTC_CONSOLE) : Pointer;
-Procedure ptc_console_unlock(obj : TPTC_CONSOLE);
-
-{ load pixels to console }
-Procedure ptc_console_load(obj : TPTC_CONSOLE; pixels : Pointer; width, height, pitch : Integer; format : TPTC_FORMAT; palette : TPTC_PALETTE);
-Procedure ptc_console_load_area(obj : TPTC_CONSOLE; pixels : Pointer; width, height, pitch : Integer; format : TPTC_FORMAT; palette : TPTC_PALETTE; source, destination : TPTC_AREA);
-
-{ save console pixels }
-Procedure ptc_console_save(obj : TPTC_CONSOLE; pixels : Pointer; width, height, pitch : Integer; format : TPTC_FORMAT; palette : TPTC_PALETTE);
-Procedure ptc_console_save_area(obj : TPTC_CONSOLE; pixels : Pointer; width, height, pitch : Integer; format : TPTC_FORMAT; palette : TPTC_PALETTE; source, destination : TPTC_AREA);
-
-{ clear console }
-Procedure ptc_console_clear(obj : TPTC_CONSOLE);
-Procedure ptc_console_clear_color(obj : TPTC_CONSOLE; color : TPTC_COLOR);
-Procedure ptc_console_clear_color_area(obj : TPTC_CONSOLE; color : TPTC_COLOR; area : TPTC_AREA);
-
-{ console palette }
-Procedure ptc_console_palette_set(obj : TPTC_CONSOLE; palette : TPTC_PALETTE);
-Function ptc_console_palette_get(obj : TPTC_CONSOLE) : TPTC_PALETTE;
-
-{ console clip area }
-Procedure ptc_console_clip_set(obj : TPTC_CONSOLE; area : TPTC_AREA);
-
-{ data access }
-Function ptc_console_width(obj : TPTC_CONSOLE) : Integer;
-Function ptc_console_height(obj : TPTC_CONSOLE) : Integer;
-Function ptc_console_pages(obj : TPTC_CONSOLE) : Integer;
-Function ptc_console_pitch(obj : TPTC_CONSOLE) : Integer;
-Function ptc_console_area(obj : TPTC_CONSOLE) : TPTC_AREA;
-Function ptc_console_clip(obj : TPTC_CONSOLE) : TPTC_AREA;
-Function ptc_console_format(obj : TPTC_CONSOLE) : TPTC_FORMAT;
-Function ptc_console_name(obj : TPTC_CONSOLE) : String;
-Function ptc_console_title(obj : TPTC_CONSOLE) : String;
-Function ptc_console_information(obj : TPTC_CONSOLE) : String;
-
-{ extension functions }
-{#ifdef __PTC_WIN32_EXTENSIONS__
-CAPI void PTCAPI ptc_console_open_window(PTC_CONSOLE object,HWND window,int pages);
-CAPI void PTCAPI ptc_console_open_window_format(PTC_CONSOLE object,HWND window,PTC_FORMAT format,int pages);
-CAPI void PTCAPI ptc_console_open_window_resolution(PTC_CONSOLE object,HWND window,int width,int height,PTC_FORMAT format,int pages);
-CAPI void PTCAPI ptc_console_open_window_mode(PTC_CONSOLE object,HWND window,PTC_MODE mode,int pages);
-CAPI HWND PTCAPI ptc_console_window(PTC_CONSOLE object);
-CAPI LPDIRECTDRAW PTCAPI ptc_console_lpDD(PTC_CONSOLE object);
-CAPI LPDIRECTDRAW2 PTCAPI ptc_console_lpDD2(PTC_CONSOLE object);
-CAPI LPDIRECTDRAWSURFACE PTCAPI ptc_console_lpDDS(PTC_CONSOLE object);
-CAPI LPDIRECTDRAWSURFACE PTCAPI ptc_console_lpDDS_primary(PTC_CONSOLE object);
-CAPI LPDIRECTDRAWSURFACE PTCAPI ptc_console_lpDDS_secondary(PTC_CONSOLE object);
-#endif}

+ 0 - 74
packages/ptc/src/c_api/copy.inc

@@ -1,74 +0,0 @@
-Function ptc_copy_create : TPTC_COPY;
-
-Begin
-  Try
-    ptc_copy_create := TPTC_COPY(TPTCCopy.Create);
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_copy_create := Nil;
-    End;
-  End;
-End;
-
-Procedure ptc_copy_destroy(obj : TPTC_COPY);
-
-Begin
-  If obj = Nil Then
-    Exit;
-  Try
-    TPTCCopy(obj).Destroy;
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_copy_request(obj : TPTC_COPY; source, destination : TPTC_FORMAT);
-
-Begin
-  Try
-    TPTCCopy(obj).request(TPTCFormat(source), TPTCFormat(destination));
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_copy_palette(obj : TPTC_COPY; source, destination : TPTC_PALETTE);
-
-Begin
-  Try
-    TPTCCopy(obj).palette(TPTCPalette(source), TPTCPalette(destination));
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_copy_copy(obj : TPTC_COPY; source_pixels : Pointer; source_x, source_y, source_width, source_height, source_pitch : Integer;
-                        destination_pixels : Pointer; destination_x, destination_y, destination_width, destination_height, destination_pitch : Integer);
-
-Begin
-  Try
-    TPTCCopy(obj).copy(source_pixels, source_x, source_y, source_width, source_height, source_pitch, destination_pixels, destination_x, destination_y, destination_width, destination_height, destination_pitch);
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Function ptc_copy_option(obj : TPTC_COPY; option : String) : Boolean;
-
-Begin
-  Try
-    TPTCCopy(obj).option(option);
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_copy_option := False;
-    End;
-  End;
-End;

+ 0 - 16
packages/ptc/src/c_api/copyd.inc

@@ -1,16 +0,0 @@
-{ setup }
-Function ptc_copy_create : TPTC_COPY;
-Procedure ptc_copy_destroy(obj : TPTC_COPY);
-
-{ set source and destination formats }
-Procedure ptc_copy_request(obj : TPTC_COPY; source, destination : TPTC_FORMAT);
-
-{ set source and destination palettes }
-Procedure ptc_copy_palette(obj : TPTC_COPY; source, destination : TPTC_PALETTE);
-
-{ copy pixels }
-Procedure ptc_copy_copy(obj : TPTC_COPY; source_pixels : Pointer; source_x, source_y, source_width, source_height, source_pitch : Integer;
-                        destination_pixels : Pointer; destination_x, destination_y, destination_width, destination_height, destination_pitch : Integer);
-
-{ copy option string }
-Function ptc_copy_option(obj : TPTC_COPY; option : String) : Boolean;

+ 0 - 96
packages/ptc/src/c_api/error.inc

@@ -1,96 +0,0 @@
-Function ptc_error_create(message : String) : TPTC_ERROR;
-
-Begin
-  Try
-    ptc_error_create := TPTC_ERROR(TPTCError.Create(message));
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_error_create := Nil;
-    End;
-  End;
-End;
-
-Function ptc_error_create_composite(message : String; error : TPTC_ERROR) : TPTC_ERROR;
-
-Begin
-  Try
-    ptc_error_create_composite := TPTC_ERROR(TPTCError.Create(message, TPTCError(error)));
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_error_create_composite := Nil;
-    End;
-  End;
-End;
-
-Procedure ptc_error_destroy(obj : TPTC_ERROR);
-
-Begin
-  If obj = Nil Then
-    Exit;
-  Try
-    TPTCError(obj).Destroy;
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_error_report(obj : TPTC_ERROR);
-
-Begin
-  Try
-    TPTCError(obj).report;
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Function ptc_error_message(obj : TPTC_ERROR) : String;
-
-Begin
-  Try
-    ptc_error_message := TPTCError(obj).message;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_error_message := '';
-    End;
-  End;
-End;
-
-Procedure ptc_error_assign(obj, error : TPTC_ERROR);
-
-Begin
-  Try
-    TPTCError(obj).ASSign(TPTCError(error));
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Function ptc_error_equals(obj, error : TPTC_ERROR) : Boolean;
-
-Begin
-  Try
-    ptc_error_equals := TPTCError(obj).Equals(TPTCError(error));
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_error_equals := False;
-    End;
-  End;
-End;
-
-Procedure ptc_error_handler(handler : TPTC_ERROR_HANDLER);
-
-Begin
-  ptc_exception_handler(handler);
-End;

+ 0 - 15
packages/ptc/src/c_api/errord.inc

@@ -1,15 +0,0 @@
-Type
-  TPTC_ERROR_HANDLER = Procedure(error : TPTC_ERROR);
-
-Function ptc_error_create(message : String) : TPTC_ERROR;
-Function ptc_error_create_composite(message : String; error : TPTC_ERROR) : TPTC_ERROR;
-Procedure ptc_error_destroy(obj : TPTC_ERROR);
-
-Procedure ptc_error_report(obj : TPTC_ERROR);
-
-Function ptc_error_message(obj : TPTC_ERROR) : String;
-
-Procedure ptc_error_assign(obj, error : TPTC_ERROR);
-Function ptc_error_equals(obj, error : TPTC_ERROR) : Boolean;
-
-Procedure ptc_error_handler(handler : TPTC_ERROR_HANDLER);

+ 0 - 23
packages/ptc/src/c_api/except.inc

@@ -1,23 +0,0 @@
-Var
-  ptc_error_handler_function : TPTC_ERROR_HANDLER;
-
-Procedure ptc_error_handler_default(error : TPTC_ERROR);
-
-Begin
-  TPTCError(error).report;
-End;
-
-Procedure ptc_exception_handler(handler : TPTC_ERROR_HANDLER);
-
-Begin
-  If handler = Nil Then
-    ptc_error_handler_function := @ptc_error_handler_default
-  Else
-    ptc_error_handler_function := handler;
-End;
-
-Procedure ptc_exception_handle(error : TPTCError);
-
-Begin
-  ptc_error_handler_function(TPTC_ERROR(error));
-End;

+ 0 - 2
packages/ptc/src/c_api/exceptd.inc

@@ -1,2 +0,0 @@
-Procedure ptc_exception_handler(handler : TPTC_ERROR_HANDLER);
-Procedure ptc_exception_handle(error : TPTCError);

+ 0 - 191
packages/ptc/src/c_api/format.inc

@@ -1,191 +0,0 @@
-Function ptc_format_create : TPTC_FORMAT;
-
-Begin
-  Try
-    ptc_format_create := TPTC_FORMAT(TPTCFormat.Create);
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_format_create := Nil;
-    End;
-  End;
-End;
-
-Function ptc_format_create_indexed(bits : Integer) : TPTC_FORMAT;
-
-Begin
-  Try
-    ptc_format_create_indexed := TPTC_FORMAT(TPTCFormat.Create(bits));
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_format_create_indexed := Nil;
-    End;
-  End;
-End;
-
-Function ptc_format_create_direct(bits : Integer; r, g, b, a : int32) : TPTC_FORMAT;
-
-Begin
-  Try
-    ptc_format_create_direct := TPTC_FORMAT(TPTCFormat.Create(bits, r, g, b, a));
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_format_create_direct := Nil;
-    End;
-  End;
-End;
-
-Procedure ptc_format_destroy(obj : TPTC_FORMAT);
-
-Begin
-  If obj = Nil Then
-    Exit;
-  Try
-    TPTCFormat(obj).Destroy;
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Function ptc_format_r(obj : TPTC_FORMAT) : int32;
-
-Begin
-  Try
-    ptc_format_r := TPTCFormat(obj).r;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_format_r := 0;
-    End;
-  End;
-End;
-
-Function ptc_format_g(obj : TPTC_FORMAT) : int32;
-
-Begin
-  Try
-    ptc_format_g := TPTCFormat(obj).g;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_format_g := 0;
-    End;
-  End;
-End;
-
-Function ptc_format_b(obj : TPTC_FORMAT) : int32;
-
-Begin
-  Try
-    ptc_format_b := TPTCFormat(obj).b;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_format_b := 0;
-    End;
-  End;
-End;
-
-Function ptc_format_a(obj : TPTC_FORMAT) : int32;
-
-Begin
-  Try
-    ptc_format_a := TPTCFormat(obj).a;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_format_a := 0;
-    End;
-  End;
-End;
-
-Function ptc_format_bits(obj : TPTC_FORMAT) : Integer;
-
-Begin
-  Try
-    ptc_format_bits := TPTCFormat(obj).bits;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_format_bits := 0;
-    End;
-  End;
-End;
-
-Function ptc_format_bytes(obj : TPTC_FORMAT) : Integer;
-
-Begin
-  Try
-    ptc_format_bytes := TPTCFormat(obj).bytes;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_format_bytes := 0;
-    End;
-  End;
-End;
-
-Function ptc_format_direct(obj : TPTC_FORMAT) : Boolean;
-
-Begin
-  Try
-    ptc_format_direct := TPTCFormat(obj).direct;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_format_direct := False;
-    End;
-  End;
-End;
-
-Function ptc_format_indexed(obj : TPTC_FORMAT) : Boolean;
-
-Begin
-  Try
-    ptc_format_indexed := TPTCFormat(obj).indexed;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_format_indexed := False;
-    End;
-  End;
-End;
-
-Procedure ptc_format_assign(obj, format : TPTC_FORMAT);
-
-Begin
-  Try
-    TPTCFormat(obj).ASSign(TPTCFormat(format));
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Function ptc_format_equals(obj, format : TPTC_FORMAT) : Boolean;
-
-Begin
-  Try
-    ptc_format_equals := TPTCFormat(obj).Equals(TPTCFormat(format));
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_format_equals := False;
-    End;
-  End;
-End;

+ 0 - 19
packages/ptc/src/c_api/formatd.inc

@@ -1,19 +0,0 @@
-{ setup }
-Function ptc_format_create : TPTC_FORMAT;
-Function ptc_format_create_indexed(bits : Integer) : TPTC_FORMAT;
-Function ptc_format_create_direct(bits : Integer; r, g, b, a : int32) : TPTC_FORMAT;
-Procedure ptc_format_destroy(obj : TPTC_FORMAT);
-
-{ data access }
-Function ptc_format_r(obj : TPTC_FORMAT) : int32;
-Function ptc_format_g(obj : TPTC_FORMAT) : int32;
-Function ptc_format_b(obj : TPTC_FORMAT) : int32;
-Function ptc_format_a(obj : TPTC_FORMAT) : int32;
-Function ptc_format_bits(obj : TPTC_FORMAT) : Integer;
-Function ptc_format_bytes(obj : TPTC_FORMAT) : Integer;
-Function ptc_format_direct(obj : TPTC_FORMAT) : Boolean;
-Function ptc_format_indexed(obj : TPTC_FORMAT) : Boolean;
-
-{ operators }
-Procedure ptc_format_assign(obj, format : TPTC_FORMAT);
-Function ptc_format_equals(obj, format : TPTC_FORMAT) : Boolean;

+ 0 - 14
packages/ptc/src/c_api/index.inc

@@ -1,14 +0,0 @@
-Type
-  { object handles }
-  TPTC_KEY     = Pointer; { equivalent to Object Pascal TPTCKey         }
-  TPTC_AREA    = Pointer; { equivalent to Object Pascal TPTCArea        }
-  TPTC_MODE    = Pointer; { equivalent to Object Pascal TPTCMode        }
-  TPTC_COPY    = Pointer; { equivalent to Object Pascal TPTCCopy        }
-  TPTC_CLEAR   = Pointer; { equivalent to Object Pascal TPTCClear       }
-  TPTC_TIMER   = Pointer; { equivalent to Object Pascal TPTCTimer       }
-  TPTC_ERROR   = Pointer; { equivalent to Object Pascal TPTCError       }
-  TPTC_COLOR   = Pointer; { equivalent to Object Pascal TPTCColor       }
-  TPTC_FORMAT  = Pointer; { equivalent to Object Pascal TPTCFormat      }
-  TPTC_PALETTE = Pointer; { equivalent to Object Pascal TPTCPalette     }
-  TPTC_SURFACE = Pointer; { equivalent to Object Pascal TPTCBaseSurface }
-  TPTC_CONSOLE = Pointer; { equivalent to Object Pascal TPTCBaseConsole }

+ 0 - 107
packages/ptc/src/c_api/key.inc

@@ -1,107 +0,0 @@
-Function ptc_key_create(code : Integer; alt, shift, control : Boolean) : TPTC_KEY;
-
-Begin
-  Try
-    ptc_key_create := TPTC_KEY(TPTCKey.Create(code, alt, shift, control));
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_key_create := Nil;
-    End;
-  End;
-End;
-
-Procedure ptc_key_destroy(obj : TPTC_KEY);
-
-Begin
-  If obj = Nil Then
-    Exit;
-  Try
-    TPTCKey(obj).Destroy;
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Function ptc_key_code(obj : TPTC_KEY) : Integer;
-
-Begin
-  Try
-    ptc_key_code := Integer(TPTCKey(obj).code);
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_key_code := 0;
-    End;
-  End;
-End;
-
-Function ptc_key_alt(obj : TPTC_KEY) : Boolean;
-
-Begin
-  Try
-    ptc_key_alt := TPTCKey(obj).alt;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_key_alt := False;
-    End;
-  End;
-End;
-
-Function ptc_key_shift(obj : TPTC_KEY) : Boolean;
-
-Begin
-  Try
-    ptc_key_shift := TPTCKey(obj).shift;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_key_shift := False;
-    End;
-  End;
-End;
-
-Function ptc_key_control(obj : TPTC_KEY) : Boolean;
-
-Begin
-  Try
-    ptc_key_control := TPTCKey(obj).control;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_key_control := False;
-    End;
-  End;
-End;
-
-Procedure ptc_key_assign(obj : TPTC_KEY; key : TPTC_KEY);
-
-Begin
-  Try
-    TPTCKey(obj).ASSign(TPTCKey(key));
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Function ptc_key_equals(obj : TPTC_KEY; key : TPTC_KEY) : Boolean;
-
-Begin
-  Try
-    ptc_key_equals := TPTCKey(obj).Equals(TPTCKey(key));
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_key_equals := False;
-    End;
-  End;
-End;

+ 0 - 121
packages/ptc/src/c_api/mode.inc

@@ -1,121 +0,0 @@
-Function ptc_mode_create(width, height : Integer; format : TPTC_FORMAT) : TPTC_MODE;
-
-Begin
-  Try
-    ptc_mode_create := TPTC_MODE(TPTCMode.Create(width, height, TPTCFormat(format)));
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_mode_create := Nil;
-    End;
-  End;
-End;
-
-Function ptc_mode_create_invalid : TPTC_MODE;
-
-Begin
-  Try
-    ptc_mode_create_invalid := TPTC_MODE(TPTCMode.Create);
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_mode_create_invalid := Nil;
-    End;
-  End;
-End;
-
-Procedure ptc_mode_destroy(obj : TPTC_MODE);
-
-Begin
-  If obj = Nil Then
-    Exit;
-  Try
-    TPTCMode(obj).Destroy;
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Function ptc_mode_valid(obj : TPTC_MODE) : Boolean;
-
-Begin
-  Try
-    ptc_mode_valid := TPTCMode(obj).valid;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_mode_valid := False;
-    End;
-  End;
-End;
-
-Function ptc_mode_width(obj : TPTC_MODE) : Integer;
-
-Begin
-  Try
-    ptc_mode_width := TPTCMode(obj).width;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_mode_width := 0;
-    End;
-  End;
-End;
-
-Function ptc_mode_height(obj : TPTC_MODE) : Integer;
-
-Begin
-  Try
-    ptc_mode_height := TPTCMode(obj).height;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_mode_height := 0;
-    End;
-  End;
-End;
-
-Function ptc_mode_format(obj : TPTC_MODE) : TPTC_FORMAT;
-
-Begin
-  Try
-    ptc_mode_format := TPTC_FORMAT(TPTCMode(obj).format);
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_mode_format := Nil;
-    End;
-  End;
-End;
-
-Procedure ptc_mode_assign(obj, mode : TPTC_MODE);
-
-Begin
-  Try
-    TPTCMode(obj).ASSign(TPTCMode(mode));
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Function ptc_mode_equals(obj, mode : TPTC_MODE) : Boolean;
-
-Begin
-  Try
-    ptc_mode_equals := TPTCMode(obj).Equals(TPTCMode(mode));
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_mode_equals := False;
-    End;
-  End;
-End;

+ 0 - 16
packages/ptc/src/c_api/moded.inc

@@ -1,16 +0,0 @@
-{ setup }
-Function ptc_mode_create(width, height : Integer; format : TPTC_FORMAT) : TPTC_MODE;
-Function ptc_mode_create_invalid : TPTC_MODE;
-Procedure ptc_mode_destroy(obj : TPTC_MODE);
-
-{ valid mode flag }
-Function ptc_mode_valid(obj : TPTC_MODE) : Boolean;
-
-{ data access }
-Function ptc_mode_width(obj : TPTC_MODE) : Integer;
-Function ptc_mode_height(obj : TPTC_MODE) : Integer;
-Function ptc_mode_format(obj : TPTC_MODE) : TPTC_FORMAT;
-
-{ operators }
-Procedure ptc_mode_assign(obj, mode : TPTC_MODE);
-Function ptc_mode_equals(obj, mode : TPTC_MODE) : Boolean;

+ 0 - 126
packages/ptc/src/c_api/palette.inc

@@ -1,126 +0,0 @@
-Function ptc_palette_create : TPTC_PALETTE;
-
-Begin
-  Try
-    ptc_palette_create := TPTC_PALETTE(TPTCPalette.Create);
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_palette_create := Nil;
-    End;
-  End;
-End;
-
-{Function ptc_palette_create_data(data : Pint32) : TPTC_PALETTE;
-
-Begin
-  Try
-    ptc_palette_create_data := TPTC_PALETTE(TPTCPalette.Create(data));
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_palette_create_data := Nil;
-    End;
-  End;
-End;}
-
-Procedure ptc_palette_destroy(obj : TPTC_PALETTE);
-
-Begin
-  If obj = Nil Then
-    Exit;
-  Try
-    TPTCPalette(obj).Destroy;
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Function ptc_palette_lock(obj : TPTC_PALETTE) : Pint32;
-
-Begin
-  Try
-    ptc_palette_lock := TPTCPalette(obj).lock;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_palette_lock := Nil;
-    End;
-  End;
-End;
-
-Procedure ptc_palette_unlock(obj : TPTC_PALETTE);
-
-Begin
-  Try
-    TPTCPalette(obj).unlock;
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_palette_load(obj : TPTC_PALETTE; data : Pint32);
-
-Begin
-  Try
-    TPTCPalette(obj).load(data);
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_palette_save(obj : TPTC_PALETTE; data : Pint32);
-
-Begin
-  Try
-    TPTCPalette(obj).save(data);
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Function ptc_palette_data(obj : TPTC_PALETTE) : Pint32;
-
-Begin
-  Try
-    ptc_palette_data := TPTCPalette(obj).data;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_palette_data := Nil;
-    End;
-  End;
-End;
-
-Procedure ptc_palette_assign(obj, palette : TPTC_PALETTE);
-
-Begin
-  Try
-    TPTCPalette(obj).ASSign(TPTCPalette(palette));
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Function ptc_palette_equals(obj, palette : TPTC_PALETTE) : Boolean;
-
-Begin
-  Try
-    ptc_palette_equals := TPTCPalette(obj).Equals(TPTCPalette(palette));
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_palette_equals := False;
-    End;
-  End;
-End;

+ 0 - 21
packages/ptc/src/c_api/paletted.inc

@@ -1,21 +0,0 @@
-{ setup }
-Function ptc_palette_create : TPTC_PALETTE;
-{Function ptc_palette_create_data(data : Pint32) : TPTC_PALETTE;}
-Procedure ptc_palette_destroy(obj : TPTC_PALETTE);
-
-{ memory access }
-Function ptc_palette_lock(obj : TPTC_PALETTE) : Pint32;
-Procedure ptc_palette_unlock(obj : TPTC_PALETTE);
-
-{ load palette data }
-Procedure ptc_palette_load(obj : TPTC_PALETTE; data : Pint32);
-
-{ save palette data }
-Procedure ptc_palette_save(obj : TPTC_PALETTE; data : Pint32);
-
-{ get palette data }
-Function ptc_palette_data(obj : TPTC_PALETTE) : Pint32;
-
-{ operators }
-Procedure ptc_palette_assign(obj, palette : TPTC_PALETTE);
-Function ptc_palette_equals(obj, palette : TPTC_PALETTE) : Boolean;

+ 0 - 284
packages/ptc/src/c_api/surface.inc

@@ -1,284 +0,0 @@
-Function ptc_surface_create(width, height : Integer; format : TPTC_FORMAT) : TPTC_SURFACE;
-
-Begin
-  Try
-    ptc_surface_create := TPTC_SURFACE(TPTCSurface.Create(width, height, TPTCFormat(format)));
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_surface_create := Nil;
-    End;
-  End;
-End;
-
-Procedure ptc_surface_destroy(obj : TPTC_SURFACE);
-
-Begin
-  If obj = Nil Then
-    Exit;
-  Try
-    TPTCBaseSurface(obj).Destroy;
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_surface_copy(obj : TPTC_SURFACE; surface : TPTC_SURFACE);
-
-Begin
-  Try
-    TPTCBaseSurface(obj).copy(TPTCBaseSurface(surface));
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_surface_copy_area(obj : TPTC_SURFACE; surface : TPTC_SURFACE; source, destination : TPTC_AREA);
-
-Begin
-  Try
-    TPTCBaseSurface(obj).copy(TPTCBaseSurface(surface), TPTCArea(source), TPTCArea(destination));
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Function ptc_surface_lock(obj : TPTC_SURFACE) : Pointer;
-
-Begin
-  Try
-    ptc_surface_lock := TPTCBaseSurface(obj).lock;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_surface_lock := Nil;
-    End;
-  End;
-End;
-
-Procedure ptc_surface_unlock(obj : TPTC_SURFACE);
-
-Begin
-  Try
-    TPTCBaseSurface(obj).unlock;
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_surface_load(obj : TPTC_SURFACE; pixels : Pointer; width, height, pitch : Integer; format : TPTC_FORMAT; palette : TPTC_PALETTE);
-
-Begin
-  Try
-    TPTCBaseSurface(obj).load(pixels, width, height, pitch, TPTCFormat(format), TPTCPalette(palette));
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_surface_load_area(obj : TPTC_SURFACE; pixels : Pointer; width, height, pitch : Integer; format : TPTC_FORMAT; palette : TPTC_PALETTE; source, destination : TPTC_AREA);
-
-Begin
-  Try
-    TPTCBaseSurface(obj).load(pixels, width, height, pitch, TPTCFormat(format), TPTCPalette(palette), TPTCArea(source), TPTCArea(destination));
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_surface_save(obj : TPTC_SURFACE; pixels : Pointer; width, height, pitch : Integer; format : TPTC_FORMAT; palette : TPTC_PALETTE);
-
-Begin
-  Try
-    TPTCBaseSurface(obj).save(pixels, width, height, pitch, TPTCFormat(format), TPTCPalette(palette));
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_surface_save_area(obj : TPTC_SURFACE; pixels : Pointer; width, height, pitch : Integer; format : TPTC_FORMAT; palette : TPTC_PALETTE; source, destination : TPTC_AREA);
-
-Begin
-  Try
-    TPTCBaseSurface(obj).save(pixels, width, height, pitch, TPTCFormat(format), TPTCPalette(palette), TPTCArea(source), TPTCArea(destination));
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_surface_clear(obj : TPTC_SURFACE);
-
-Begin
-  Try
-    TPTCBaseSurface(obj).clear;
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_surface_clear_color(obj : TPTC_SURFACE; color : TPTC_COLOR);
-
-Begin
-  Try
-    TPTCBaseSurface(obj).clear(TPTCColor(color));
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_surface_clear_color_area(obj : TPTC_SURFACE; color : TPTC_COLOR; area : TPTC_AREA);
-
-Begin
-  Try
-    TPTCBaseSurface(obj).clear(TPTCColor(color), TPTCArea(area));
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_surface_palette_set(obj : TPTC_SURFACE; palette : TPTC_PALETTE);
-
-Begin
-  Try
-    TPTCBaseSurface(obj).palette(TPTCPalette(palette));
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Function ptc_surface_palette_get(obj : TPTC_SURFACE) : TPTC_PALETTE;
-
-Begin
-  Try
-    ptc_surface_palette_get := TPTC_PALETTE(TPTCBaseSurface(obj).palette);
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_surface_palette_get := Nil;
-    End;
-  End;
-End;
-
-Procedure ptc_surface_clip_set(obj : TPTC_SURFACE; area : TPTC_AREA);
-
-Begin
-  Try
-    TPTCBaseSurface(obj).clip(TPTCArea(area));
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Function ptc_surface_width(obj : TPTC_SURFACE) : Integer;
-
-Begin
-  Try
-    ptc_surface_width := TPTCBaseSurface(obj).width;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_surface_width := 0;
-    End;
-  End;
-End;
-
-Function ptc_surface_height(obj : TPTC_SURFACE) : Integer;
-
-Begin
-  Try
-    ptc_surface_height := TPTCBaseSurface(obj).height;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_surface_height := 0;
-    End;
-  End;
-End;
-
-Function ptc_surface_pitch(obj : TPTC_SURFACE) : Integer;
-
-Begin
-  Try
-    ptc_surface_pitch := TPTCBaseSurface(obj).pitch;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_surface_pitch := 0;
-    End;
-  End;
-End;
-
-Function ptc_surface_area(obj : TPTC_SURFACE) : TPTC_AREA;
-
-Begin
-  Try
-    ptc_surface_area := TPTC_AREA(TPTCBaseSurface(obj).area);
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_surface_area := Nil;
-    End;
-  End;
-End;
-
-Function ptc_surface_clip(obj : TPTC_SURFACE) : TPTC_AREA;
-
-Begin
-  Try
-    ptc_surface_clip := TPTC_AREA(TPTCBaseSurface(obj).clip);
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_surface_clip := Nil;
-    End;
-  End;
-End;
-
-Function ptc_surface_format(obj : TPTC_SURFACE) : TPTC_FORMAT;
-
-Begin
-  Try
-    ptc_surface_format := TPTC_FORMAT(TPTCBaseSurface(obj).format);
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_surface_format := Nil;
-    End;
-  End;
-End;
-
-Function ptc_surface_option(obj : TPTC_SURFACE; _option : String) : Boolean;
-
-Begin
-  Try
-    ptc_surface_option := TPTCBaseSurface(obj).option(_option);
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_surface_option := False;
-    End;
-  End;
-End;

+ 0 - 42
packages/ptc/src/c_api/surfaced.inc

@@ -1,42 +0,0 @@
-{ setup }
-Function ptc_surface_create(width, height : Integer; format : TPTC_FORMAT) : TPTC_SURFACE;
-Procedure ptc_surface_destroy(obj : TPTC_SURFACE);
-
-{ copy to surface }
-Procedure ptc_surface_copy(obj : TPTC_SURFACE; surface : TPTC_SURFACE);
-Procedure ptc_surface_copy_area(obj : TPTC_SURFACE; surface : TPTC_SURFACE; source, destination : TPTC_AREA);
-
-{ memory access }
-Function ptc_surface_lock(obj : TPTC_SURFACE) : Pointer;
-Procedure ptc_surface_unlock(obj : TPTC_SURFACE);
-
-{ load pixels to surface }
-Procedure ptc_surface_load(obj : TPTC_SURFACE; pixels : Pointer; width, height, pitch : Integer; format : TPTC_FORMAT; palette : TPTC_PALETTE);
-Procedure ptc_surface_load_area(obj : TPTC_SURFACE; pixels : Pointer; width, height, pitch : Integer; format : TPTC_FORMAT; palette : TPTC_PALETTE; source, destination : TPTC_AREA);
-
-{ save surface pixels }
-Procedure ptc_surface_save(obj : TPTC_SURFACE; pixels : Pointer; width, height, pitch : Integer; format : TPTC_FORMAT; palette : TPTC_PALETTE);
-Procedure ptc_surface_save_area(obj : TPTC_SURFACE; pixels : Pointer; width, height, pitch : Integer; format : TPTC_FORMAT; palette : TPTC_PALETTE; source, destination : TPTC_AREA);
-
-{ clear surface }
-Procedure ptc_surface_clear(obj : TPTC_SURFACE);
-Procedure ptc_surface_clear_color(obj : TPTC_SURFACE; color : TPTC_COLOR);
-Procedure ptc_surface_clear_color_area(obj : TPTC_SURFACE; color : TPTC_COLOR; area : TPTC_AREA);
-
-{ surface palette }
-Procedure ptc_surface_palette_set(obj : TPTC_SURFACE; palette : TPTC_PALETTE);
-Function ptc_surface_palette_get(obj : TPTC_SURFACE) : TPTC_PALETTE;
-
-{ surface clip area }
-Procedure ptc_surface_clip_set(obj : TPTC_SURFACE; area : TPTC_AREA);
-
-{ data access }
-Function ptc_surface_width(obj : TPTC_SURFACE) : Integer;
-Function ptc_surface_height(obj : TPTC_SURFACE) : Integer;
-Function ptc_surface_pitch(obj : TPTC_SURFACE) : Integer;
-Function ptc_surface_area(obj : TPTC_SURFACE) : TPTC_AREA;
-Function ptc_surface_clip(obj : TPTC_SURFACE) : TPTC_AREA;
-Function ptc_surface_format(obj : TPTC_SURFACE) : TPTC_FORMAT;
-
-{ surface option string }
-Function ptc_surface_option(obj : TPTC_SURFACE; _option : String) : Boolean;

+ 0 - 126
packages/ptc/src/c_api/timer.inc

@@ -1,126 +0,0 @@
-Function ptc_timer_create : TPTC_TIMER;
-
-Begin
-  Try
-    ptc_timer_create := TPTC_TIMER(TPTCTimer.Create);
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_timer_create := Nil;
-    End;
-  End;
-End;
-
-Procedure ptc_timer_destroy(obj : TPTC_TIMER);
-
-Begin
-  If obj = Nil Then
-    Exit;
-  Try
-    TPTCTimer(obj).Destroy;
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_timer_set(obj : TPTC_TIMER; time : Double);
-
-Begin
-  Try
-    TPTCTimer(obj).settime(time);
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_timer_start(obj : TPTC_TIMER);
-
-Begin
-  Try
-    TPTCTimer(obj).start;
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Procedure ptc_timer_stop(obj : TPTC_TIMER);
-
-Begin
-  Try
-    TPTCTimer(obj).stop;
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Function ptc_timer_time(obj : TPTC_TIMER) : Double;
-
-Begin
-  Try
-    ptc_timer_time := TPTCTimer(obj).time;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_timer_time := 0;
-    End;
-  End;
-End;
-
-Function ptc_timer_delta(obj : TPTC_TIMER) : Double;
-
-Begin
-  Try
-    ptc_timer_delta := TPTCTimer(obj).delta;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_timer_delta := 0;
-    End;
-  End;
-End;
-
-Function ptc_timer_resolution(obj : TPTC_TIMER) : Double;
-
-Begin
-  Try
-    ptc_timer_resolution := TPTCTimer(obj).resolution;
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_timer_resolution := 0;
-    End;
-  End;
-End;
-
-Procedure ptc_timer_assign(obj, timer : TPTC_TIMER);
-
-Begin
-  Try
-    TPTCTimer(obj).ASSign(TPTCTimer(timer));
-  Except
-    On error : TPTCError Do
-      ptc_exception_handle(error);
-  End;
-End;
-
-Function ptc_timer_equals(obj, timer : TPTC_TIMER) : Boolean;
-
-Begin
-  Try
-    ptc_timer_equals := TPTCTimer(obj).equals(TPTCTimer(timer));
-  Except
-    On error : TPTCError Do
-    Begin
-      ptc_exception_handle(error);
-      ptc_timer_equals := False;
-    End;
-  End;
-End;

+ 0 - 19
packages/ptc/src/c_api/timerd.inc

@@ -1,19 +0,0 @@
-{ setup }
-Function ptc_timer_create : TPTC_TIMER;
-Procedure ptc_timer_destroy(obj : TPTC_TIMER);
-
-{ set time }
-Procedure ptc_timer_set(obj : TPTC_TIMER; time : Double);
-
-{ control }
-Procedure ptc_timer_start(obj : TPTC_TIMER);
-Procedure ptc_timer_stop(obj : TPTC_TIMER);
-
-{ time data }
-Function ptc_timer_time(obj : TPTC_TIMER) : Double;
-Function ptc_timer_delta(obj : TPTC_TIMER) : Double;
-Function ptc_timer_resolution(obj : TPTC_TIMER) : Double;
-
-{ operators }
-Procedure ptc_timer_assign(obj, timer : TPTC_TIMER);
-Function ptc_timer_equals(obj, timer : TPTC_TIMER) : Boolean;