File: CameraAbilities.cs

package info (click to toggle)
f-spot 0.6.2-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 21,784 kB
  • ctags: 16,078
  • sloc: cs: 108,718; sh: 17,053; xml: 13,852; ansic: 3,187; makefile: 2,324
file content (114 lines) | stat: -rw-r--r-- 2,343 bytes parent folder | download
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/*
 * CameraAbilities.cs
 *
 * Author(s):
 *	Stephane Delcroix <stephane@delcroix.org>
 *	Ewen Cheslack-Postava <echeslack@gmail.com>
 *	Larry Ewing <lewing@novell.com>
 *
 * Copyright (c) 2005-2009 Novell, Inc.
 *
 * This is open source software. See COPYING for details.
 */

using System;
using System.Runtime.InteropServices;

namespace GPhoto2
{
	[StructLayout(LayoutKind.Sequential)]
	public unsafe struct CameraAbilities
	{
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst=128)] string model;
		CameraDriverStatus status;
		
		PortType port;
		[MarshalAs(UnmanagedType.ByValArray, SizeConst=64)] int[] speed;
		
		CameraOperation operations;
		CameraFileOperation file_operations;
		CameraFolderOperation folder_operations;
		
		int usb_vendor;
		int usb_product;
		int usb_class;
		int usb_subclass;
		int usb_protocol;
		
#pragma warning disable 169
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst=1024)] string library;
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst=1024)] string id;
#pragma warning restore 169

		DeviceType device_type;
		
#pragma warning disable 169
		int reserved2;
		int reserved3;
		int reserved4;
		int reserved5;
		int reserved6;
		int reserved7;
		int reserved8;
#pragma warning restore 169

		public override string ToString ()
		{
			string ret = String.Format ("{0} ({1})", Model, PortType);
			if (DriverStatus != CameraDriverStatus.Production)
				ret += String.Format (" <{0}>", DriverStatus);
			return ret;
		}

		public string Model {
			get { return model; }
		}

		public CameraDriverStatus DriverStatus {
			get { return status; }
		}
		public PortType PortType {
			get { return port; }
		}

		public int[] Speeds {
			get { return speed; } 
		}

		public CameraOperation CameraOperation {
			get { return operations; }
		}

		public CameraFileOperation CameraFileOperation {
			get { return file_operations; }
		}

		public CameraFolderOperation CameraFolderOperation {
			get { return folder_operations; }
		}

		public int UsbVendor {
			get { return usb_vendor; }
		}

		public int UsbProduct {
			get { return usb_product; }
		}

		public int UsbClass {
			get { return usb_class; }
		}

		public int UsbSubclass {
			get { return usb_subclass; }
		}

		public int UsbProtocol {
			get { return usb_protocol; }
		}

		public DeviceType DeviceType {
			get { return device_type;}
		}
	}
}