| 1 |
/* |
|---|
| 2 |
* This file is part of gtkD. |
|---|
| 3 |
* |
|---|
| 4 |
* gtkD is free software; you can redistribute it and/or modify |
|---|
| 5 |
* it under the terms of the GNU Lesser General Public License |
|---|
| 6 |
* as published by the Free Software Foundation; either version 3 |
|---|
| 7 |
* of the License, or (at your option) any later version, with |
|---|
| 8 |
* some exceptions, please read the COPYING file. |
|---|
| 9 |
* |
|---|
| 10 |
* gtkD is distributed in the hope that it will be useful, |
|---|
| 11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 13 |
* GNU Lesser General Public License for more details. |
|---|
| 14 |
* |
|---|
| 15 |
* You should have received a copy of the GNU Lesser General Public License |
|---|
| 16 |
* along with gtkD; if not, write to the Free Software |
|---|
| 17 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA |
|---|
| 18 |
*/ |
|---|
| 19 |
|
|---|
| 20 |
// generated automatically - do not change |
|---|
| 21 |
// find conversion definition on APILookup.txt |
|---|
| 22 |
// implement new conversion functionalities on the wrap.utils pakage |
|---|
| 23 |
|
|---|
| 24 |
/* |
|---|
| 25 |
* Conversion parameters: |
|---|
| 26 |
* inFile = GZlibCompressor.html |
|---|
| 27 |
* outPack = gio |
|---|
| 28 |
* outFile = ZlibCompressor |
|---|
| 29 |
* strct = GZlibCompressor |
|---|
| 30 |
* realStrct= |
|---|
| 31 |
* ctorStrct= |
|---|
| 32 |
* clss = ZlibCompressor |
|---|
| 33 |
* interf = |
|---|
| 34 |
* class Code: Yes |
|---|
| 35 |
* interface Code: No |
|---|
| 36 |
* template for: |
|---|
| 37 |
* extend = |
|---|
| 38 |
* implements: |
|---|
| 39 |
* - ConverterIF |
|---|
| 40 |
* prefixes: |
|---|
| 41 |
* - g_zlib_compressor_ |
|---|
| 42 |
* omit structs: |
|---|
| 43 |
* omit prefixes: |
|---|
| 44 |
* omit code: |
|---|
| 45 |
* omit signals: |
|---|
| 46 |
* imports: |
|---|
| 47 |
* - gio.FileInfo |
|---|
| 48 |
* - gio.ConverterT |
|---|
| 49 |
* - gio.ConverterIF |
|---|
| 50 |
* structWrap: |
|---|
| 51 |
* - GFileInfo* -> FileInfo |
|---|
| 52 |
* module aliases: |
|---|
| 53 |
* local aliases: |
|---|
| 54 |
* overrides: |
|---|
| 55 |
*/ |
|---|
| 56 |
|
|---|
| 57 |
module gio.ZlibCompressor; |
|---|
| 58 |
|
|---|
| 59 |
public import gtkc.giotypes; |
|---|
| 60 |
|
|---|
| 61 |
private import gtkc.gio; |
|---|
| 62 |
private import glib.ConstructionException; |
|---|
| 63 |
|
|---|
| 64 |
|
|---|
| 65 |
private import gio.FileInfo; |
|---|
| 66 |
private import gio.ConverterT; |
|---|
| 67 |
private import gio.ConverterIF; |
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 |
private import gobject.ObjectG; |
|---|
| 72 |
|
|---|
| 73 |
/** |
|---|
| 74 |
* Description |
|---|
| 75 |
* GZlibCompressor is an implementation of GConverter that |
|---|
| 76 |
* compresses data using zlib. |
|---|
| 77 |
*/ |
|---|
| 78 |
public class ZlibCompressor : ObjectG, ConverterIF |
|---|
| 79 |
{ |
|---|
| 80 |
|
|---|
| 81 |
/** the main Gtk struct */ |
|---|
| 82 |
protected GZlibCompressor* gZlibCompressor; |
|---|
| 83 |
|
|---|
| 84 |
|
|---|
| 85 |
public GZlibCompressor* getZlibCompressorStruct() |
|---|
| 86 |
{ |
|---|
| 87 |
return gZlibCompressor; |
|---|
| 88 |
} |
|---|
| 89 |
|
|---|
| 90 |
|
|---|
| 91 |
/** the main Gtk struct as a void* */ |
|---|
| 92 |
protected override void* getStruct() |
|---|
| 93 |
{ |
|---|
| 94 |
return cast(void*)gZlibCompressor; |
|---|
| 95 |
} |
|---|
| 96 |
|
|---|
| 97 |
/** |
|---|
| 98 |
* Sets our main struct and passes it to the parent class |
|---|
| 99 |
*/ |
|---|
| 100 |
public this (GZlibCompressor* gZlibCompressor) |
|---|
| 101 |
{ |
|---|
| 102 |
if(gZlibCompressor is null) |
|---|
| 103 |
{ |
|---|
| 104 |
this = null; |
|---|
| 105 |
return; |
|---|
| 106 |
} |
|---|
| 107 |
//Check if there already is a D object for this gtk struct |
|---|
| 108 |
void* ptr = getDObject(cast(GObject*)gZlibCompressor); |
|---|
| 109 |
if( ptr !is null ) |
|---|
| 110 |
{ |
|---|
| 111 |
this = cast(ZlibCompressor)ptr; |
|---|
| 112 |
return; |
|---|
| 113 |
} |
|---|
| 114 |
super(cast(GObject*)gZlibCompressor); |
|---|
| 115 |
this.gZlibCompressor = gZlibCompressor; |
|---|
| 116 |
} |
|---|
| 117 |
|
|---|
| 118 |
protected override void setStruct(GObject* obj) |
|---|
| 119 |
{ |
|---|
| 120 |
super.setStruct(obj); |
|---|
| 121 |
gZlibCompressor = cast(GZlibCompressor*)obj; |
|---|
| 122 |
} |
|---|
| 123 |
|
|---|
| 124 |
// add the Converter capabilities |
|---|
| 125 |
mixin ConverterT!(GZlibCompressor); |
|---|
| 126 |
|
|---|
| 127 |
/** |
|---|
| 128 |
*/ |
|---|
| 129 |
|
|---|
| 130 |
/** |
|---|
| 131 |
* Creates a new GZlibCompressor. |
|---|
| 132 |
* Since 2.24 |
|---|
| 133 |
* Params: |
|---|
| 134 |
* format = The format to use for the compressed data |
|---|
| 135 |
* level = compression level (0-9), -1 for default |
|---|
| 136 |
* Throws: ConstructionException GTK+ fails to create the object. |
|---|
| 137 |
*/ |
|---|
| 138 |
public this (GZlibCompressorFormat format, int level) |
|---|
| 139 |
{ |
|---|
| 140 |
// GZlibCompressor * g_zlib_compressor_new (GZlibCompressorFormat format, int level); |
|---|
| 141 |
auto p = g_zlib_compressor_new(format, level); |
|---|
| 142 |
if(p is null) |
|---|
| 143 |
{ |
|---|
| 144 |
throw new ConstructionException("null returned by g_zlib_compressor_new(format, level)"); |
|---|
| 145 |
} |
|---|
| 146 |
this(cast(GZlibCompressor*) p); |
|---|
| 147 |
} |
|---|
| 148 |
|
|---|
| 149 |
/** |
|---|
| 150 |
* Returns the "file-info" property. |
|---|
| 151 |
* Since 2.26 |
|---|
| 152 |
* Returns: a GFileInfo, or NULL. [transfer none] |
|---|
| 153 |
*/ |
|---|
| 154 |
public FileInfo getFileInfo() |
|---|
| 155 |
{ |
|---|
| 156 |
// GFileInfo * g_zlib_compressor_get_file_info (GZlibCompressor *compressor); |
|---|
| 157 |
auto p = g_zlib_compressor_get_file_info(gZlibCompressor); |
|---|
| 158 |
if(p is null) |
|---|
| 159 |
{ |
|---|
| 160 |
return null; |
|---|
| 161 |
} |
|---|
| 162 |
return new FileInfo(cast(GFileInfo*) p); |
|---|
| 163 |
} |
|---|
| 164 |
|
|---|
| 165 |
/** |
|---|
| 166 |
* Sets file_info in compressor. If non-NULL, and compressor's |
|---|
| 167 |
* "format" property is G_ZLIB_COMPRESSOR_FORMAT_GZIP, |
|---|
| 168 |
* it will be used to set the file name and modification time in |
|---|
| 169 |
* the GZIP header of the compressed data. |
|---|
| 170 |
* Note: it is an error to call this function while a compression is in |
|---|
| 171 |
* progress; it may only be called immediately after creation of compressor, |
|---|
| 172 |
* or after resetting it with g_converter_reset(). |
|---|
| 173 |
* Since 2.26 |
|---|
| 174 |
* Params: |
|---|
| 175 |
* fileInfo = a GFileInfo. [allow-none] |
|---|
| 176 |
*/ |
|---|
| 177 |
public void setFileInfo(FileInfo fileInfo) |
|---|
| 178 |
{ |
|---|
| 179 |
// void g_zlib_compressor_set_file_info (GZlibCompressor *compressor, GFileInfo *file_info); |
|---|
| 180 |
g_zlib_compressor_set_file_info(gZlibCompressor, (fileInfo is null) ? null : fileInfo.getFileInfoStruct()); |
|---|
| 181 |
} |
|---|
| 182 |
} |
|---|