~ubuntu-branches/ubuntu/vivid/rawstudio/vivid

« back to all changes in this revision

Viewing changes to librawstudio/rs-output.h

  • Committer: Bazaar Package Importer
  • Author(s): Bernd Zeimetz
  • Date: 2011-07-28 17:36:32 UTC
  • mfrom: (2.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20110728173632-5czluz9ye3c83zc5
Tags: 2.0-1
* [3750b2cf] Merge commit 'upstream/2.0'
* [63637468] Removing Patch, not necessary anymore.
* [2fb580dc] Add new build-dependencies.
* [c57d953b] Run dh_autoreconf due to patches in configure.in
* [13febe39] Add patch to remove the libssl requirement.
* [5ae773fe] Replace libjpeg62-dev by libjpeg8-dev :)
* [1969d755] Don't build static libraries.
* [7cfe0a2e] Add a patch to fix the plugin directory path.
  As plugins are shared libraries, they need to go into /usr/lib,
  not into /usr/share.
  Thanks to Andrew McMillan
* [c1d0d9dd] Don't install .la files for all plugins and libraries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * * Copyright (C) 2006-2011 Anders Brander <anders@brander.dk>, 
 
3
 * * Anders Kvist <akv@lnxbx.dk> and Klaus Post <klauspost@gmail.com>
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or
 
6
 * modify it under the terms of the GNU General Public License
 
7
 * as published by the Free Software Foundation; either version 2
 
8
 * of the License, or (at your option) any later version.
 
9
 *
 
10
 * This program 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 General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program; if not, write to the Free Software
 
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
18
 */
 
19
 
 
20
#ifndef RS_OUTPUT_H
 
21
#define RS_OUTPUT_H
 
22
 
 
23
#include "rawstudio.h"
 
24
#include <glib-object.h>
 
25
 
 
26
G_BEGIN_DECLS
 
27
 
 
28
/**
 
29
 * Convenience macro to define generic output module
 
30
 */
 
31
#define RS_DEFINE_OUTPUT(type_name, TypeName) \
 
32
static GType type_name##_get_type (GTypeModule *module); \
 
33
static void type_name##_class_init(TypeName##Class *klass); \
 
34
static void type_name##_init(TypeName *output); \
 
35
static GType type_name##_type = 0; \
 
36
static GType \
 
37
type_name##_get_type(GTypeModule *module) \
 
38
{ \
 
39
        if (!type_name##_type) \
 
40
        { \
 
41
                static const GTypeInfo output_info = \
 
42
                { \
 
43
                        sizeof (TypeName##Class), \
 
44
                        (GBaseInitFunc) NULL, \
 
45
                        (GBaseFinalizeFunc) NULL, \
 
46
                        (GClassInitFunc) type_name##_class_init, \
 
47
                        NULL, \
 
48
                        NULL, \
 
49
                        sizeof (TypeName), \
 
50
                        0, \
 
51
                        (GInstanceInitFunc) type_name##_init \
 
52
                }; \
 
53
 \
 
54
                type_name##_type = g_type_module_register_type( \
 
55
                        module, \
 
56
                        RS_TYPE_OUTPUT, \
 
57
                        #TypeName, \
 
58
                        &output_info, \
 
59
                        0); \
 
60
        } \
 
61
        return type_name##_type; \
 
62
}
 
63
 
 
64
#define RS_TYPE_OUTPUT rs_output_get_type()
 
65
#define RS_OUTPUT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RS_TYPE_OUTPUT, RSOutput))
 
66
#define RS_OUTPUT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RS_TYPE_OUTPUT, RSOutputClass))
 
67
#define RS_IS_OUTPUT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RS_TYPE_OUTPUT))
 
68
#define RS_IS_OUTPUT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RS_TYPE_OUTPUT))
 
69
#define RS_OUTPUT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RS_TYPE_OUTPUT, RSOutputClass))
 
70
 
 
71
#define RS_OUTPUT_NAME(output) (((output)) ? g_type_name(G_TYPE_FROM_CLASS(RS_OUTPUT_GET_CLASS ((output)))) : "(nil)")
 
72
 
 
73
typedef struct _RSOutput RSOutput;
 
74
typedef struct _RSOutputClass RSOutputClass;
 
75
 
 
76
struct _RSOutput {
 
77
        GObject parent;
 
78
};
 
79
 
 
80
struct _RSOutputClass {
 
81
        GObjectClass parent_class;
 
82
        gchar *extension;
 
83
        gchar *display_name;
 
84
        gboolean (*execute)(RSOutput *output, RSFilter *filter);
 
85
};
 
86
 
 
87
GType rs_output_get_type(void) G_GNUC_CONST;
 
88
 
 
89
/**
 
90
 * Instantiate a new RSOutput type
 
91
 * @param identifier A string representing a type, for example "RSJpegfile"
 
92
 * @return A new RSOutput or NULL on failure
 
93
 */
 
94
extern RSOutput *
 
95
rs_output_new(const gchar *identifier);
 
96
 
 
97
/**
 
98
 * Get a filename extension as announced by a RSOutput module
 
99
 * @param output A RSOutput
 
100
 * @return A proposed filename extension excluding the ., this should not be freed.
 
101
 */
 
102
const gchar *
 
103
rs_output_get_extension(RSOutput *output);
 
104
 
 
105
/**
 
106
 * Actually execute the saver
 
107
 * @param output A RSOutput
 
108
 * @param filter A RSFilter to get image data from
 
109
 * @return TRUE on success, FALSE on error
 
110
 */
 
111
extern gboolean
 
112
rs_output_execute(RSOutput *output, RSFilter *filter);
 
113
 
 
114
/**
 
115
 * Load parameters from config for a RSOutput
 
116
 * @param output A RSOutput
 
117
 * @param conf_prefix The prefix to prepend on config-keys.
 
118
 */
 
119
void
 
120
rs_output_set_from_conf(RSOutput *output, const gchar *conf_prefix);
 
121
 
 
122
/**
 
123
 * Build a GtkWidget that can edit parameters of a RSOutput
 
124
 * @param output A RSOutput
 
125
 * @param conf_prefix If this is non-NULL, the value will be saved in config,
 
126
 *                    and reloaded next time.
 
127
 * @return A new GtkWidget representing all parameters of output
 
128
 */
 
129
extern GtkWidget *
 
130
rs_output_get_parameter_widget(RSOutput *output, const gchar *conf_prefix);
 
131
 
 
132
G_END_DECLS
 
133
 
 
134
#endif /* RS_OUTPUT_H */