~ubuntu-branches/debian/sid/f-spot/sid

« back to all changes in this revision

Viewing changes to lib/libgphoto2-sharp/Camera.cs

  • Committer: Bazaar Package Importer
  • Author(s): Iain Lane
  • Date: 2010-05-24 10:35:57 UTC
  • mfrom: (2.4.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20100524103557-1j0i8f66caybci2n
* New upstream release 0.7.0
 + First release of the unstable 0.7 development series. Massive changes.
 + Reparenting and detaching support (Anton Keks) (Closes: #559745)
 + A new Mallard-based documentation (Harold Schreckengost)
 + No longer embeds flickrnet, uses distribution copy (Iain Lane)
 + Adoption of a large amount of Hyena functionality (Paul Lange, Peter
   Goetz)
 + No longer embeds gnome-keyring-sharp
 + Completely rewritten import, much faster and less memory hungry (Ruben
   Vermeersch) (Closes: #559080, #492658, #341790, #357811, #426017) (LP:
   #412091)
 + No longer use gphoto2-sharp, now uses gvfs which is less crash-pron
   (Ruben Vermeersch)
 + Fix Facebook support (Ruben Vermeersch)
 + Modernized unit tests
 + Revamped build (Mike Gemünde)
 + Much improved duplicate detection (much faster too) (Ruben Vermeersch)
 + Mouse selection in Iconview (Vincent Pomey)
 + Image panning support using middle mouse button (Wojciech Dzierżanowski)
 + Timeline slider now restricted to the size of the window (Iain Churcher)
 + Over 100 bugs closed (http://bit.ly/cyVjnD)
   - No more warnings about schema defaults (Closes: #584215) (LP: #586132)
* debian/control: Clean up build deps to match configure checks
* debian/rules: Don't run dh_makeshilbs as we don't ship any shared
  libraries. There are some private ones though, which get picked up and
  result in a useless postinst/postrm call to ldconfig. Thanks, lintian.
* debian/patches/debian_fix-distclean.patch,
  debian/patches/debian_fix_f-spot.exe.config.patch,
  debian/patches/debian_link-system-flickrnet.patch,
  debian/patches/debian_link-system-gnome-keyring.patch,
  debian/patches/debian_disable-unit-tests,
  debian/patches/git_transition_duration.patch,
  debian/patches/ubuntu_fix_folder_export_hang.patch:
  Clean up obsolete patches which are no longer necessary 
* debian/patches/*: Temporarily disable patches which originated from Ubuntu
  and no longer apply cleanly. We will get these back in a future upstream
  development release.
* debian/patches/*: Refresh to apply cleanly 
* debian/rules: Add new include dir to autoreconf call to pick up f-spot
  macros 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Camera.cs
3
 
 *
4
 
 * Author(s):
5
 
 *      Ewen Cheslack-Postava <echeslack@gmail.com>
6
 
 *      Larry Ewing <lewing@novell.com>
7
 
 *      Stephane Delcroix <stephane@delcroix.org>
8
 
 *
9
 
 * Copyright (c) 2005-2009 Novell, Inc.
10
 
 *
11
 
 * This is open source software. See COPYING for details.
12
 
 */
13
 
using System;
14
 
using System.Runtime.InteropServices;
15
 
 
16
 
namespace GPhoto2
17
 
{
18
 
 
19
 
        public class Camera : GPObject 
20
 
        {
21
 
                [DllImport ("libgphoto2.so")]
22
 
                internal static extern ErrorCode gp_camera_new (out IntPtr handle);
23
 
                [DllImport ("libgphoto2.so")]
24
 
                internal static extern ErrorCode gp_camera_unref (HandleRef camera);
25
 
 
26
 
                public Camera () : base (gp_camera_unref)
27
 
                {
28
 
                        IntPtr native;
29
 
                        Error.CheckError (gp_camera_new (out native));
30
 
                        this.handle = new HandleRef (this, native);
31
 
                }
32
 
 
33
 
#region Preparing initilization
34
 
                [DllImport ("libgphoto2.so")]
35
 
                internal static extern ErrorCode gp_camera_set_abilities (HandleRef camera, CameraAbilities abilities);
36
 
 
37
 
                [DllImport ("libgphoto2.so")]
38
 
                internal unsafe static extern ErrorCode gp_camera_get_abilities (HandleRef camera, out CameraAbilities abilities);
39
 
 
40
 
                public CameraAbilities Abilities {
41
 
                        get {
42
 
                                CameraAbilities abilities;
43
 
                                Error.CheckError (gp_camera_get_abilities(this.Handle, out abilities));
44
 
                                return abilities;
45
 
                        }
46
 
                        set { Error.CheckError (gp_camera_set_abilities(this.Handle, value)); }
47
 
                }
48
 
 
49
 
                [DllImport ("libgphoto2.so")]
50
 
                internal unsafe static extern ErrorCode gp_camera_set_port_info (HandleRef camera, PortInfo info);
51
 
 
52
 
                [DllImport ("libgphoto2.so")]
53
 
                internal static extern ErrorCode gp_camera_get_port_info (HandleRef camera, out PortInfo info);
54
 
 
55
 
                public PortInfo PortInfo {
56
 
                        get {
57
 
                                PortInfo portinfo;
58
 
                                Error.CheckError (gp_camera_get_port_info (this.Handle, out portinfo));
59
 
                                return portinfo;        
60
 
                        }
61
 
                        set { Error.CheckError (gp_camera_set_port_info (this.Handle, value)); }
62
 
                }
63
 
#endregion
64
 
 
65
 
#region Speed, do not use, camera driver pick the optimal one
66
 
                [DllImport ("libgphoto2.so")]
67
 
                internal static extern ErrorCode gp_camera_get_port_speed (HandleRef camera);
68
 
 
69
 
                [DllImport ("libgphoto2.so")]
70
 
                internal static extern ErrorCode gp_camera_set_port_speed (HandleRef camera, int speed);
71
 
 
72
 
                public int PortSpeed {
73
 
                        get { return Error.CheckError (gp_camera_get_port_speed (this.Handle)); }
74
 
                        set { Error.CheckError (gp_camera_set_port_speed (this.Handle, value)); }
75
 
                }
76
 
#endregion
77
 
 
78
 
#region Initialization
79
 
                [DllImport ("libgphoto2.so")]
80
 
                internal static extern ErrorCode gp_camera_init (HandleRef camera, HandleRef context);
81
 
 
82
 
                public void Init (Context context)
83
 
                {
84
 
                        Error.CheckError (gp_camera_init (Handle, context.Handle));
85
 
                }
86
 
                
87
 
                [DllImport ("libgphoto2.so")]
88
 
                internal static extern ErrorCode gp_camera_exit (HandleRef camera, HandleRef context);
89
 
                
90
 
                public void Exit (Context context)
91
 
                {
92
 
                        Error.CheckError (gp_camera_exit (Handle, context.Handle));
93
 
                }
94
 
#endregion
95
 
 
96
 
#region Operations on camera
97
 
                [DllImport ("libgphoto2.so")]
98
 
                internal static extern ErrorCode gp_camera_get_summary (HandleRef camera, out CameraText summary, HandleRef context);
99
 
                
100
 
                public CameraText GetSummary (Context context)
101
 
                {
102
 
                        CameraText summary;
103
 
                        Error.CheckError (Camera.gp_camera_get_summary(this.Handle, out summary, context.Handle));
104
 
 
105
 
                        return summary;
106
 
                }
107
 
                
108
 
                [DllImport ("libgphoto2.so")]
109
 
                internal static extern ErrorCode gp_camera_get_about (HandleRef camera, out CameraText about, HandleRef context);
110
 
 
111
 
                public CameraText GetAbout (Context context)
112
 
                {
113
 
                        CameraText about;
114
 
                        Error.CheckError (gp_camera_get_about(this.Handle, out about, context.Handle));
115
 
 
116
 
                        return about;
117
 
                }
118
 
 
119
 
                [DllImport ("libgphoto2.so")]
120
 
                internal static extern ErrorCode gp_camera_get_manual (HandleRef camera, out CameraText manual, HandleRef context);
121
 
                
122
 
                public CameraText GetManual (Context context)
123
 
                {
124
 
                        CameraText manual;
125
 
                        unsafe
126
 
                        {
127
 
                                Error.CheckError (gp_camera_get_manual(this.Handle, out manual, context.Handle));
128
 
                        }
129
 
                        return manual;
130
 
                }
131
 
 
132
 
                [DllImport ("libgphoto2.so")]
133
 
                internal static extern ErrorCode gp_camera_capture (HandleRef camera, CameraCaptureType type, out CameraFilePath path, HandleRef context);
134
 
                
135
 
                public CameraFilePath Capture (CameraCaptureType type, Context context)
136
 
                {
137
 
                        CameraFilePath path;
138
 
                        Error.CheckError (gp_camera_capture (this.Handle, type, out path, context.Handle));
139
 
 
140
 
                        return path;
141
 
                }
142
 
                
143
 
                [DllImport ("libgphoto2.so")]
144
 
                internal unsafe static extern ErrorCode gp_camera_capture_preview (HandleRef camera, HandleRef file, HandleRef context);
145
 
                
146
 
                public void CapturePreview (CameraFile dest, Context context)
147
 
                {
148
 
                        Error.CheckError (gp_camera_capture_preview (this.Handle, dest.Handle, context.Handle));
149
 
                }
150
 
#endregion
151
 
 
152
 
#region Operations on folders
153
 
                [DllImport ("libgphoto2.so")]
154
 
                internal static extern ErrorCode gp_camera_folder_list_files (HandleRef camera, [MarshalAs(UnmanagedType.LPTStr)] string folder, HandleRef list, HandleRef context);
155
 
                
156
 
                public CameraList ListFiles (string folder, Context context)
157
 
                {
158
 
                        CameraList file_list = new CameraList ();
159
 
                        Error.CheckError (gp_camera_folder_list_files(this.Handle, folder, file_list.Handle, context.Handle));
160
 
 
161
 
                        return file_list;
162
 
                }
163
 
                
164
 
                [DllImport ("libgphoto2.so")]
165
 
                internal static extern ErrorCode gp_camera_folder_list_folders (HandleRef camera, [MarshalAs(UnmanagedType.LPTStr)] string folder, HandleRef list, HandleRef context);
166
 
 
167
 
                public CameraList ListFolders (string folder, Context context)
168
 
                {
169
 
                        CameraList file_list = new CameraList();
170
 
                        Error.CheckError (gp_camera_folder_list_folders (this.Handle, folder, file_list.Handle, context.Handle));
171
 
 
172
 
                        return file_list;
173
 
                }
174
 
                
175
 
                [DllImport ("libgphoto2.so")]
176
 
                internal static extern ErrorCode gp_camera_folder_delete_all (HandleRef camera, [MarshalAs(UnmanagedType.LPTStr)] string folder, HandleRef context);
177
 
                
178
 
                public void DeleteAll (string folder, Context context)
179
 
                {
180
 
                        Error.CheckError (gp_camera_folder_delete_all (this.Handle, folder, context.Handle));
181
 
                }
182
 
                
183
 
                [DllImport ("libgphoto2.so")]
184
 
                internal static extern ErrorCode gp_camera_folder_make_dir (HandleRef camera, [MarshalAs(UnmanagedType.LPTStr)] string folder, [MarshalAs(UnmanagedType.LPTStr)] string name, HandleRef context);
185
 
                
186
 
                public void MakeDirectory (string folder, string name, Context context)
187
 
                {
188
 
                        Error.CheckError (gp_camera_folder_make_dir (this.Handle, folder, name, context.Handle));
189
 
                }
190
 
                
191
 
                [DllImport ("libgphoto2.so")]
192
 
                internal static extern ErrorCode gp_camera_folder_remove_dir (HandleRef camera, [MarshalAs(UnmanagedType.LPTStr)] string folder, [MarshalAs(UnmanagedType.LPTStr)] string name, HandleRef context);
193
 
                
194
 
                public void RemoveDirectory (string folder, string name, Context context)
195
 
                {
196
 
                        Error.CheckError (gp_camera_folder_remove_dir(this.Handle, folder, name, context.Handle));
197
 
                }
198
 
 
199
 
                [DllImport ("libgphoto2.so")]
200
 
                internal unsafe static extern ErrorCode gp_camera_folder_put_file (HandleRef camera, [MarshalAs(UnmanagedType.LPTStr)] string folder, HandleRef file, HandleRef context);
201
 
                
202
 
                public void PutFile (string folder, CameraFile file, Context context)
203
 
                {
204
 
                        Error.CheckError (gp_camera_folder_put_file(this.Handle, folder, file.Handle, context.Handle));
205
 
                }
206
 
#endregion              
207
 
                        
208
 
#region Operations on files
209
 
                [DllImport ("libgphoto2.so")]
210
 
                internal static extern ErrorCode gp_camera_file_get (HandleRef camera, [MarshalAs(UnmanagedType.LPTStr)] string folder, [MarshalAs(UnmanagedType.LPTStr)] string file, CameraFileType type, HandleRef camera_file, HandleRef context);
211
 
                
212
 
                public void GetFile (string folder, string name, CameraFileType type, CameraFile camera_file, Context context)
213
 
                {
214
 
                        Error.CheckError (gp_camera_file_get(this.Handle, folder, name, type, camera_file.Handle, context.Handle));     
215
 
                }
216
 
                
217
 
                [DllImport ("libgphoto2.so")]
218
 
                internal static extern ErrorCode gp_camera_file_delete (HandleRef camera, [MarshalAs(UnmanagedType.LPTStr)] string folder, [MarshalAs(UnmanagedType.LPTStr)] string file, HandleRef context);
219
 
 
220
 
                public void DeleteFile (string folder, string name, Context context)
221
 
                {
222
 
                        Error.CheckError (gp_camera_file_delete(this.Handle, folder, name, context.Handle));
223
 
                }
224
 
                
225
 
                
226
 
                [DllImport ("libgphoto2.so")]
227
 
                internal static extern ErrorCode gp_camera_file_get_info (HandleRef camera, [MarshalAs(UnmanagedType.LPTStr)] string folder, [MarshalAs(UnmanagedType.LPTStr)] string file, out CameraFileInfo info, HandleRef context);
228
 
                
229
 
                public CameraFileInfo GetFileInfo (string folder, string name, Context context)
230
 
                {
231
 
                        CameraFileInfo fileinfo;
232
 
                        Error.CheckError (gp_camera_file_get_info(this.Handle, folder, name, out fileinfo, context.Handle));
233
 
 
234
 
                        return fileinfo;
235
 
                }
236
 
                
237
 
                [DllImport ("libgphoto2.so")]
238
 
                internal static extern ErrorCode gp_camera_file_set_info (HandleRef camera, string folder, string file, CameraFileInfo info, HandleRef context);
239
 
                
240
 
                public void SetFileInfo (string folder, string name, CameraFileInfo fileinfo, Context context)
241
 
                {
242
 
                        Error.CheckError (gp_camera_file_set_info(this.Handle, folder, name, fileinfo, context.Handle));
243
 
                }
244
 
#endregion                      
245
 
        }
246
 
}