Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[r20]: cbrpager-maemo / branches / MAEMO_0_9_20 / src / garchivereader.h Maximize Restore History

Download this file

garchivereader.h    99 lines (78 with data), 3.4 kB

 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
* garchivereader.h - routines to abstract archive reading logic
*
* Copyright (C) 2008 Benoit Goudreault-Emond (bgoudreaultemond@gmail.com)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#ifndef __G_ARCHIVE_READER_H__
#define __G_ARCHIVE_READER_H__
#include <glib-object.h>
#include <gdk/gdk.h>
#include <stdio.h>
#include "support.h"
G_BEGIN_DECLS
#define G_TYPE_ARCHIVE_READER (g_archive_reader_get_type())
#define G_ARCHIVE_READER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), G_TYPE_ARCHIVE_READER, GArchiveReader))
#define G_ARCHIVE_READER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_ARCHIVE_READER, GArchiveReaderClass))
#define G_IS_ARCHIVE_READER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), G_TYPE_ARCHIVE_READER))
#define G_IS_ARCHIVE_READER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_ARCHIVE_READER))
#define G_ARCHIVE_READER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_INTERFACE((obj), G_TYPE_ARCHIVE_READER, GArchiveReaderClass))
typedef struct _GArchiveReader GArchiveReader;
typedef struct _GArchiveReaderClass GArchiveReaderClass;
typedef struct {
int offs, /* Offset to the signature */
len, /* Signature length */
fn_offs;
char *sign; /* Signature to compare to */
} magic_sign;
typedef enum {
SORT_ASCII,
SORT_CASE_INSENSITIVE,
SORT_NATURAL
} SortStrategy;
struct _GArchiveReaderClass
{
GTypeInterface parent;
int (*register_path) (GArchiveReader* reader,
const gchar* path);
GArray* (*get_file_list) (GArchiveReader* reader);
GdkPixbuf* (*get_page) (GArchiveReader* reader,
int page_number,
gdouble* w,
gdouble* h);
gchar* (*get_last_error) (GArchiveReader* reader);
void (*set_sort_strategy) (GArchiveReader* reader,
SortStrategy strategy);
};
GType g_archive_reader_get_type (void) G_GNUC_CONST;
/* methods */
int g_archive_reader_register_path(GArchiveReader* reader,
const gchar* path);
GArray* g_archive_reader_get_file_list(GArchiveReader* reader);
GdkPixbuf* g_archive_reader_get_page (GArchiveReader* reader,
int page_number,
gdouble* w,
gdouble* h);
void g_archive_reader_set_sort_strategy(GArchiveReader* reader,
SortStrategy strategy);
gchar* g_archive_reader_get_last_error(GArchiveReader* reader);
/* utility routine, placed here for lack of a better place */
int g_archive_reader_check_magic(const gchar* path,
const magic_sign* magic);
GCompareFunc g_archive_reader_translate_strategy(SortStrategy strategy);
G_END_DECLS
#endif