1 /*
2 * This file is part of EvinceD.
3 * EvinceD is based on GtkD.
4 *
5 * EvinceD is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License
7 * as published by the Free Software Foundation; either version 3
8 * of the License, or (at your option) any later version, with
9 * some exceptions, please read the COPYING file.
10 *
11 * EvinceD is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with EvinceD; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
19 */20 21 // generated automatically - do not change22 // find conversion definition on APILookup.txt23 24 25 moduleevince.document.Media;
26 27 privateimportevince.document.Page;
28 privateimportevince.document.c.functions;
29 publicimportevince.document.c.types;
30 privateimportglib.ConstructionException;
31 privateimportglib.Str;
32 privateimportgobject.ObjectG;
33 34 35 /** */36 publicclassMedia : ObjectG37 {
38 /** the main Gtk struct */39 protectedEvMedia* evMedia;
40 41 /** Get the main Gtk struct */42 publicEvMedia* getMediaStruct(booltransferOwnership = false)
43 {
44 if (transferOwnership)
45 ownedRef = false;
46 returnevMedia;
47 }
48 49 /** the main Gtk struct as a void* */50 protectedoverridevoid* getStruct()
51 {
52 returncast(void*)evMedia;
53 }
54 55 /**
56 * Sets our main struct and passes it to the parent class.
57 */58 publicthis (EvMedia* evMedia, boolownedRef = false)
59 {
60 this.evMedia = evMedia;
61 super(cast(GObject*)evMedia, ownedRef);
62 }
63 64 65 /** */66 publicstaticGTypegetType()
67 {
68 returnev_media_get_type();
69 }
70 71 /** */72 publicthis(Pagepage, stringuri)
73 {
74 auto__p = ev_media_new_for_uri((pageisnull) ? null : page.getPageStruct(), Str.toStringz(uri));
75 76 if(__pisnull)
77 {
78 thrownewConstructionException("null returned by new_for_uri");
79 }
80 81 this(cast(EvMedia*) __p, true);
82 }
83 84 /** */85 publicuintgetPageIndex()
86 {
87 returnev_media_get_page_index(evMedia);
88 }
89 90 /** */91 publicboolgetShowControls()
92 {
93 returnev_media_get_show_controls(evMedia) != 0;
94 }
95 96 /** */97 publicstringgetUri()
98 {
99 returnStr.toString(ev_media_get_uri(evMedia));
100 }
101 102 /** */103 publicvoidsetShowControls(boolshowControls)
104 {
105 ev_media_set_show_controls(evMedia, showControls);
106 }
107 }