atkstreamablecontent.inc 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // included by atk.pp
  2. {$IFDEF read_forward_definitions}
  3. {$ENDIF read_forward_definitions}
  4. //------------------------------------------------------------------------------
  5. {$IFDEF read_interface_types}
  6. { Get the number of mime types supported by this anObject }
  7. { Gets the specified mime type supported by this anObject.
  8. The mime types are 0-based so the first mime type is
  9. at index 0, the second at index 1 and so on.
  10. This assumes that the strings for the mime types are stored in the
  11. AtkStreamableContent. Alternatively the could be removed
  12. and the caller would be responsible for calling g_free() on the
  13. returned value.
  14. }
  15. {
  16. Is one possible implementation for this method that it constructs the
  17. content appropriate for the mime type and then creates a temporary
  18. file containing the content, opens the file and then calls
  19. g_io_channel_unix_new_fd().
  20. }
  21. PAtkStreamableContentIface = ^TAtkStreamableContentIface;
  22. TAtkStreamableContentIface = record
  23. parent : TGTypeInterface;
  24. get_n_mime_types : function (streamable:PAtkStreamableContent):gint; cdecl;
  25. get_mime_type : function (streamable:PAtkStreamableContent; i:gint):Pgchar; cdecl;
  26. get_stream : function (streamable:PAtkStreamableContent; mime_type:Pgchar):PGIOChannel; cdecl;
  27. pad1 : TAtkFunction;
  28. pad2 : TAtkFunction;
  29. pad3 : TAtkFunction;
  30. pad4 : TAtkFunction;
  31. end;
  32. {$ENDIF read_interface_types}
  33. //------------------------------------------------------------------------------
  34. {$IFDEF read_interface_rest}
  35. function ATK_TYPE_STREAMABLE_CONTENT : GType;
  36. function ATK_IS_STREAMABLE_CONTENT(obj: pointer) : boolean;
  37. function ATK_STREAMABLE_CONTENT(obj: pointer) : PAtkStreamableContent;
  38. function ATK_STREAMABLE_CONTENT_GET_IFACE(obj: pointer) : PAtkStreamableContentIface;
  39. function atk_streamable_content_get_type:GType; cdecl; external atklib;
  40. function atk_streamable_content_get_n_mime_types(streamable:PAtkStreamableContent):gint; cdecl; external atklib;
  41. function atk_streamable_content_get_mime_type(streamable:PAtkStreamableContent; i:gint):Pgchar; cdecl; external atklib;
  42. function atk_streamable_content_get_stream(streamable:PAtkStreamableContent; mime_type:Pgchar):PGIOChannel; cdecl; external atklib;
  43. {$ENDIF read_interface_rest}
  44. //------------------------------------------------------------------------------
  45. {$IFDEF read_implementation}
  46. function ATK_TYPE_STREAMABLE_CONTENT : GType;
  47. begin
  48. ATK_TYPE_STREAMABLE_CONTENT:=atk_streamable_content_get_type;
  49. end;
  50. function ATK_IS_STREAMABLE_CONTENT(obj: pointer) : boolean;
  51. begin
  52. ATK_IS_STREAMABLE_CONTENT:=G_TYPE_CHECK_INSTANCE_TYPE(obj,ATK_TYPE_STREAMABLE_CONTENT);
  53. end;
  54. function ATK_STREAMABLE_CONTENT(obj: pointer) : PAtkStreamableContent;
  55. begin
  56. ATK_STREAMABLE_CONTENT:=PAtkStreamableContent(G_TYPE_CHECK_INSTANCE_CAST(obj,ATK_TYPE_STREAMABLE_CONTENT));
  57. end;
  58. function ATK_STREAMABLE_CONTENT_GET_IFACE(obj: pointer) : PAtkStreamableContentIface;
  59. begin
  60. ATK_STREAMABLE_CONTENT_GET_IFACE:=PAtkStreamableContentIface(G_TYPE_INSTANCE_GET_INTERFACE(obj,ATK_TYPE_STREAMABLE_CONTENT));
  61. end;
  62. {$ENDIF read_implementation}