iceWing
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
grab_prop.h
Go to the documentation of this file.
1 /* -*- mode: C; tab-width: 4; c-basic-offset: 4; -*- */
2 
3 /*
4  * Author: Frank Loemker
5  *
6  * Copyright (C) 1999-2009
7  * Frank Loemker, Applied Computer Science, Faculty of Technology,
8  * Bielefeld University, Germany
9  *
10  * This file is part of iceWing, a graphical plugin shell.
11  *
12  * iceWing is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 2 of the License, or
15  * (at your option) any later version.
16  *
17  * iceWing is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
25  */
26 
27 #ifndef iw_grab_prop_H
28 #define iw_grab_prop_H
29 
30 #include "tools/tools.h"
31 
32 /* Ident of the function for setting grabbing properties */
33 #define IW_GRAB_IDENT_PROPERTIES "setProperties"
34 
35 /* Possible values for the iwGrabPropertiesFunc() */
36 typedef enum {
37  IW_GRAB_LAST = 0, /* Must be given as last argument to finalize the argument list */
38  IW_GRAB_SET_ROI, /* Args: int x, int y, int width, int height
39  Set ROI. If a value is -1, the current value is not changed. */
40  IW_GRAB_GET_PROP, /* Args: iwGrabProperty **prop
41  Get an array of all properties, finished with (*prop)[last].name == NULL */
42  IW_GRAB_GET_PROPVALUES, /* Args: iwGrabProperty **prop
43  Get an array of all properties and reacquire there values.
44  The array is finished with (*prop)[last].name == NULL */
45  IW_GRAB_SET_PROP /* Args: char *propvals
46  Set properties to new values, argument format: 'propX=val:propY=val:...' */
48 
49 /* Possible results for setting grabbing properties */
50 typedef enum {
52  IW_GRAB_STATUS_UNSUPPORTED = -1, /* Unsupported property */
53  IW_GRAB_STATUS_ERR = -2, /* Another error */
54  IW_GRAB_STATUS_NOTOPEN = -3, /* No grabbing device is open */
55  IW_GRAB_STATUS_ARGUMENT = -4, /* Invalid argument */
56 } iwGrabStatus;
57 
58 /* Type of the property, which is stored in iwGrabProperty */
59 typedef enum {
60  IW_GRAB_CATEGORY, /* Arranging the props in a tree structure.
61  A sub tree is finished if name starts with '<'. */
69 
70 /* Characteristics of properties */
71 typedef enum {
72  IW_GRAB_READONLY /* Property is read only */
74 
75 typedef struct {
76  char *name;
77  gint64 priv;
79 
80 typedef struct {
81  char *name; /* Name of the property e.g. "Contrast", array finished with a NULL entry */
82  char *description; /* Optional help text */
84  iwGrabPropertyType type; /* Type of the property */
85  union {
86  struct {
87  BOOL def; /* Default value */
89  } b;
90  struct {
91  gint64 min;
92  gint64 max;
93  gint64 def; /* Default value */
94  gint64 value;
95  } i;
96  struct {
97  double min;
98  double max;
99  double def; /* Default value */
100  double value;
101  } d;
102  struct {
103  iwGrabPropertyEnum *enums; /* Possible values, finished with a NULL name */
104  int max; /* Max allowed value */
105  int def; /* Default value, index into enums */
106  int value; /* Index into enums */
107  } e;
108  struct {
109  char *def; /* Default value */
110  char *value;
111  } s;
112  } data;
113  gint64 priv; /* Private driver data */
114  void *reserved[4]; /* For future expansion */
116 
117 /* To prevent inclusion of "plugin.h" */
120 
121 #endif /* iw_grab_prop_H */