libglade2.pas 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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-0.dll';
  32. {$IFDEF FPC}
  33. {$ifndef NO_SMART_LINK}
  34. {$smartlink on}
  35. {$endif}
  36. {$ENDIF}
  37. {$else}
  38. LibGladeLib = 'libglade-2.0.so';
  39. {$endif}
  40. {$IFNDEF KYLIX}
  41. {$PACKRECORDS C}
  42. {$ELSE}
  43. {$ALIGN 4}
  44. {$WEAKPACKAGEUNIT}
  45. {$WARNINGS OFF}
  46. {$ENDIF}
  47. { Pointers to basic pascal types, inserted by h2pas conversion program.}
  48. Type
  49. PLongint = ^Longint;
  50. PSmallInt = ^SmallInt;
  51. PByte = ^Byte;
  52. PWord = ^Word;
  53. PDWord = ^DWord;
  54. PDouble = ^Double;
  55. {$include glade-init.inc}
  56. {$include glade-xml.inc}
  57. { don't include glade-build.h -- it is only for widget set definitions }
  58. implementation
  59. // glade-init.inc --------------------------------------------------------------
  60. procedure glade_gnome_init;
  61. begin
  62. glade_init;
  63. end;
  64. procedure glade_bonobo_init;
  65. begin
  66. glade_init;
  67. end;
  68. // glade-xml.inc ---------------------------------------------------------------
  69. function glade_xml_new_with_domain(fname:Pchar; root:Pchar;
  70. domain:Pchar):PGladeXML;
  71. begin
  72. glade_xml_new_with_domain:=glade_xml_new(fname,root,domain);
  73. end;
  74. function glade_xml_new_from_memory(buffer:Pchar; size:longint; root:Pchar;
  75. domain:Pchar):PGladeXML;
  76. begin
  77. glade_xml_new_from_memory:=glade_xml_new_from_buffer(buffer,size,root,domain);
  78. end;
  79. function GLADE_TYPE_XML : GType;
  80. begin
  81. GLADE_TYPE_XML:=glade_xml_get_type;
  82. end;
  83. function GLADE_XML(obj: pointer) : PGladeXML;
  84. begin
  85. GLADE_XML:=PGladeXML(G_TYPE_CHECK_INSTANCE_CAST(obj,GLADE_TYPE_XML));
  86. end;
  87. function GLADE_XML_CLASS(klass: pointer) : PGladeXMLClass;
  88. begin
  89. GLADE_XML_CLASS:=PGladeXMLClass(G_TYPE_CHECK_CLASS_CAST(klass,GLADE_TYPE_XML));
  90. end;
  91. function GLADE_IS_XML(obj: pointer) : gboolean;
  92. begin
  93. GLADE_IS_XML:=G_TYPE_CHECK_INSTANCE_TYPE(obj,GLADE_TYPE_XML);
  94. end;
  95. function GLADE_IS_XML_CLASS(klass: pointer) : gboolean;
  96. begin
  97. GLADE_IS_XML_CLASS:=G_TYPE_CHECK_CLASS_TYPE(klass,GLADE_TYPE_XML);
  98. end;
  99. function GLADE_XML_GET_CLASS(obj: pointer) : PGladeXMLClass;
  100. begin
  101. GLADE_XML_GET_CLASS:=PGladeXMLClass(G_TYPE_INSTANCE_GET_CLASS(obj,GLADE_TYPE_XML));
  102. end;
  103. end.