summaryrefslogtreecommitdiff
path: root/packages/gtk2/src/atk/atkstreamablecontent.inc
blob: c6c899dabf9a26c449afdc97886d1336d785512c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// included by atk.pp

{$IFDEF read_forward_definitions}
{$ENDIF read_forward_definitions}

//------------------------------------------------------------------------------

{$IFDEF read_interface_types}
{  Get the number of mime types supported by this anObject }
{  Gets the specified mime type supported by this anObject.
   The mime types are 0-based so the first mime type is
   at index 0, the second at index 1 and so on.

   This assumes that the strings for the mime types are stored in the
   AtkStreamableContent. Alternatively the  could be removed
   and the caller would be responsible for calling g_free() on the
   returned value.
    }
{
   Is one possible implementation for this method that it constructs the
   content appropriate for the mime type and then creates a temporary
   file containing the content, opens the file and then calls
   g_io_channel_unix_new_fd().
    }
   PAtkStreamableContentIface = ^TAtkStreamableContentIface;
   TAtkStreamableContentIface = record
        parent : TGTypeInterface;
        get_n_mime_types : function (streamable:PAtkStreamableContent):gint; cdecl;
        get_mime_type : function (streamable:PAtkStreamableContent; i:gint):Pgchar; cdecl;
        get_stream : function (streamable:PAtkStreamableContent; mime_type:Pgchar):PGIOChannel; cdecl;
        pad1 : TAtkFunction;
        pad2 : TAtkFunction;
        pad3 : TAtkFunction;
        pad4 : TAtkFunction;
     end;

{$ENDIF read_interface_types}

//------------------------------------------------------------------------------

{$IFDEF read_interface_rest}
function ATK_TYPE_STREAMABLE_CONTENT : GType;
function ATK_IS_STREAMABLE_CONTENT(obj: pointer) : boolean;
function ATK_STREAMABLE_CONTENT(obj: pointer) : PAtkStreamableContent;
function ATK_STREAMABLE_CONTENT_GET_IFACE(obj: pointer) : PAtkStreamableContentIface;


function atk_streamable_content_get_type:GType; cdecl; external atklib;
function atk_streamable_content_get_n_mime_types(streamable:PAtkStreamableContent):gint; cdecl; external atklib;
function atk_streamable_content_get_mime_type(streamable:PAtkStreamableContent; i:gint):Pgchar; cdecl; external atklib;
function atk_streamable_content_get_stream(streamable:PAtkStreamableContent; mime_type:Pgchar):PGIOChannel; cdecl; external atklib;
{$ENDIF read_interface_rest}

//------------------------------------------------------------------------------

{$IFDEF read_implementation}
function ATK_TYPE_STREAMABLE_CONTENT : GType;
begin
   ATK_TYPE_STREAMABLE_CONTENT:=atk_streamable_content_get_type;
end;

function ATK_IS_STREAMABLE_CONTENT(obj: pointer) : boolean;
begin
   ATK_IS_STREAMABLE_CONTENT:=G_TYPE_CHECK_INSTANCE_TYPE(obj,ATK_TYPE_STREAMABLE_CONTENT);
end;

function ATK_STREAMABLE_CONTENT(obj: pointer) : PAtkStreamableContent;
begin
   ATK_STREAMABLE_CONTENT:=PAtkStreamableContent(G_TYPE_CHECK_INSTANCE_CAST(obj,ATK_TYPE_STREAMABLE_CONTENT));
end;

function ATK_STREAMABLE_CONTENT_GET_IFACE(obj: pointer) : PAtkStreamableContentIface;
begin
   ATK_STREAMABLE_CONTENT_GET_IFACE:=PAtkStreamableContentIface(G_TYPE_INSTANCE_GET_INTERFACE(obj,ATK_TYPE_STREAMABLE_CONTENT));
end;

{$ENDIF read_implementation}