libglade2.pas 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. {
  2. libglade - a library for building interfaces from XML files at runtime
  3. Copyright (C) 1998-2002 James Henstridge <[email protected]>
  4. glade.h: the main include file for libglade.
  5. This library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Library General Public
  7. License as published by the Free Software Foundation; either
  8. version 2 of the License, or (at your option) any later version.
  9. This library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. Library General Public License for more details.
  13. You should have received a copy of the GNU Library General Public
  14. License along with this library; if not, write to the
  15. Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  16. Boston, MA 02111-1307, USA.
  17. }
  18. unit libglade2; // keep unit name lowercase for kylix
  19. {$IFDEF FPC}
  20. {$mode objfpc}
  21. {$ENDIF}
  22. {$IFDEF VER140}
  23. {$DEFINE KYLIX}
  24. {$ENDIF}
  25. interface
  26. uses
  27. glib2, gtk2;
  28. const
  29. {$ifdef win32}
  30. {$define gtkwin}
  31. LibGladeLib = 'libglade-2.0.dll';
  32. {$IFDEF FPC}
  33. {$smartlink on}
  34. {$ENDIF}
  35. {$else}
  36. LibGladeLib = 'libglade-2.0.so';
  37. {$endif}
  38. {$IFNDEF KYLIX}
  39. {$PACKRECORDS C}
  40. {$ELSE}
  41. {$ALIGN 4}
  42. {$WEAKPACKAGEUNIT}
  43. {$WARNINGS OFF}
  44. {$ENDIF}
  45. { Pointers to basic pascal types, inserted by h2pas conversion program.}
  46. Type
  47. PLongint = ^Longint;
  48. PSmallInt = ^SmallInt;
  49. PByte = ^Byte;
  50. PWord = ^Word;
  51. PDWord = ^DWord;
  52. PDouble = ^Double;
  53. {$include glade-init.inc}
  54. {$include glade-xml.inc}
  55. { don't include glade-build.h -- it is only for widget set definitions }
  56. implementation
  57. // glade-init.inc --------------------------------------------------------------
  58. procedure glade_gnome_init;
  59. begin
  60. glade_init;
  61. end;
  62. procedure glade_bonobo_init;
  63. begin
  64. glade_init;
  65. end;
  66. // glade-xml.inc ---------------------------------------------------------------
  67. function glade_xml_new_with_domain(fname:Pchar; root:Pchar;
  68. domain:Pchar):PGladeXML;
  69. begin
  70. glade_xml_new_with_domain:=glade_xml_new(fname,root,domain);
  71. end;
  72. function glade_xml_new_from_memory(buffer:Pchar; size:longint; root:Pchar;
  73. domain:Pchar):PGladeXML;
  74. begin
  75. glade_xml_new_from_memory:=glade_xml_new_from_buffer(buffer,size,root,domain);
  76. end;
  77. function GLADE_TYPE_XML : GType;
  78. begin
  79. GLADE_TYPE_XML:=glade_xml_get_type;
  80. end;
  81. function GLADE_XML(obj: pointer) : PGladeXML;
  82. begin
  83. GLADE_XML:=PGladeXML(G_TYPE_CHECK_INSTANCE_CAST(obj,GLADE_TYPE_XML));
  84. end;
  85. function GLADE_XML_CLASS(klass: pointer) : PGladeXMLClass;
  86. begin
  87. GLADE_XML_CLASS:=PGladeXMLClass(G_TYPE_CHECK_CLASS_CAST(klass,GLADE_TYPE_XML));
  88. end;
  89. function GLADE_IS_XML(obj: pointer) : gboolean;
  90. begin
  91. GLADE_IS_XML:=G_TYPE_CHECK_INSTANCE_TYPE(obj,GLADE_TYPE_XML);
  92. end;
  93. function GLADE_IS_XML_CLASS(klass: pointer) : gboolean;
  94. begin
  95. GLADE_IS_XML_CLASS:=G_TYPE_CHECK_CLASS_TYPE(klass,GLADE_TYPE_XML);
  96. end;
  97. function GLADE_XML_GET_CLASS(obj: pointer) : PGladeXMLClass;
  98. begin
  99. GLADE_XML_GET_CLASS:=PGladeXMLClass(G_TYPE_INSTANCE_GET_CLASS(obj,GLADE_TYPE_XML));
  100. end;
  101. end.