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

« back to all changes in this revision

Viewing changes to librawstudio/rs-io.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
#include <rawstudio.h>
 
21
 
 
22
#ifndef RS_IO_H
 
23
#define RS_IO_H
 
24
 
 
25
/**
 
26
 * Add a RSIoJob to be executed later
 
27
 * @param job A RSIoJob. This will be unreffed upon completion
 
28
 * @param idle_class A user defined variable, this can be used with rs_io_idle_cancel_class() to cancel a batch of queued reads
 
29
 * @param priority Lower value means higher priority
 
30
 * @param user_data A pointer to pass to the callback
 
31
 */
 
32
void
 
33
rs_io_idle_add_job(RSIoJob *job, gint idle_class, gint priority, gpointer user_data);
 
34
 
 
35
/**
 
36
 * Prefetch a file
 
37
 * @param path Absolute path to a file to prefetch
 
38
 * @param idle_class A user defined variable, this can be used with rs_io_idle_cancel_class() to cancel a batch of queued reads
 
39
 * @return A pointer to a RSIoJob, this can be used with rs_io_idle_cancel()
 
40
 */
 
41
const RSIoJob *
 
42
rs_io_idle_prefetch_file(const gchar *path, gint idle_class);
 
43
 
 
44
/**
 
45
 * Load metadata belonging to a photo
 
46
 * @param path Absolute path to a photo
 
47
 * @param idle_class A user defined variable, this can be used with rs_io_idle_cancel_class() to cancel a batch of queued reads
 
48
 * @param callback A callback to call when the data is ready or NULL
 
49
 * @param user_data Data to pass to the callback
 
50
 * @return A pointer to a RSIoJob, this can be used with rs_io_idle_cancel()
 
51
 */
 
52
const RSIoJob *
 
53
rs_io_idle_read_metadata(const gchar *path, gint idle_class, RSGotMetadataCB callback, gpointer user_data);
 
54
 
 
55
/**
 
56
 * Compute a "Rawstudio checksum" of a file
 
57
 * @param path Absolute path to a file
 
58
 * @param idle_class A user defined variable, this can be used with rs_io_idle_cancel_class() to cancel a batch of queued reads
 
59
 * @param callback A callback to call when the data is ready or NULL
 
60
 * @param user_data Data to pass to the callback
 
61
 * @return A pointer to a RSIoJob, this can be used with rs_io_idle_cancel()
 
62
 */
 
63
const RSIoJob *
 
64
rs_io_idle_read_checksum(const gchar *path, gint idle_class, RSGotChecksumCB callback, gpointer user_data);
 
65
 
 
66
/**
 
67
 * Restore tags of a new directory or add tags to a photo
 
68
 * @param filename Absolute path to a file to tags to
 
69
 * @param tag_id The id of the tag to add.
 
70
 * @param auto_tag Is the tag an automatically generated tag
 
71
 * @param idle_class A user defined variable, this can be used with rs_io_idle_cancel_class() to cancel a batch of queued reads
 
72
 * @return A pointer to a RSIoJob, this can be used with rs_io_idle_cancel()
 
73
 */
 
74
const RSIoJob *
 
75
rs_io_idle_add_tag(const gchar *filename, gint tag_id, gboolean auto_tag, gint idle_class);
 
76
 
 
77
/**
 
78
 * Restore tags of a new directory
 
79
 * @param path Absolute path to a directory to restore tags to
 
80
 * @param idle_class A user defined variable, this can be used with rs_io_idle_cancel_class() to cancel a batch of queued reads
 
81
 * @return A pointer to a RSIoJob, this can be used with rs_io_idle_cancel()
 
82
 */
 
83
const RSIoJob *
 
84
rs_io_idle_restore_tags(const gchar *path, gint idle_class);
 
85
 
 
86
/**
 
87
 * Cancel a complete class of idle requests
 
88
 * @param idle_class The class identifier
 
89
 */
 
90
void
 
91
rs_io_idle_cancel_class(gint idle_class);
 
92
 
 
93
/**
 
94
 * Cancel a idle request
 
95
 * @param request_id A request_id as returned by rs_io_idle_read_complete_file()
 
96
 */
 
97
void
 
98
rs_io_idle_cancel(RSIoJob *job);
 
99
 
 
100
/**
 
101
 * Pause the worker threads
 
102
 */
 
103
void
 
104
rs_io_idle_pause(void);
 
105
 
 
106
/**
 
107
 * Unpause the worker threads
 
108
 */
 
109
void
 
110
rs_io_idle_unpause(void);
 
111
 
 
112
/**
 
113
 * Aquire the IO lock
 
114
 */
 
115
void
 
116
rs_io_lock(void);
 
117
 
 
118
/**
 
119
 * Release the IO lock
 
120
 */
 
121
void
 
122
rs_io_unlock(void);
 
123
 
 
124
/**
 
125
 * Returns the number of jobs left
 
126
 */
 
127
gint
 
128
rs_io_get_jobs_left(void);
 
129
 
 
130
#endif /* RS_IO_H */