~ubuntu-branches/ubuntu/precise/nvidia-settings/precise-proposed

« back to all changes in this revision

Viewing changes to src/parse.h

  • Committer: Package Import Robot
  • Author(s): Alberto Milone
  • Date: 2013-12-11 15:23:40 UTC
  • mfrom: (1.3.4)
  • Revision ID: package-import@ubuntu.com-20131211152340-6j6x4ldvu4ll1bu1
Tags: 331.20-0ubuntu0.0.1
* debian/patches/series:
  - Do not apply 01_allow_dark_themes.dpatch.
* debian/patches/07_remove_features_for_legacy.patch:
  - Do not expose features that are not available in the legacy
    drivers.
* debian/patches/08_add_prime_support.patch:
  - Add support for PRIME switching. An additional
    tab provides support for switching between GPUs.
    This is only visible if nvidia-prime (>= 0.5) is
    installed and reports that the system supports
    hybrid graphics. No hard dependency on nvidia-prime
    is therefore required (LP: #1259237).
* debian/patches/09_do_not_complain_if_nvidia_is_missing.patch:
  - Disable the warning dialog since it suggests to run
    nvidia-xconfig, which we don't need. This would also break
    PRIME.
* debian/control.in, debian/postinst.in, debian/postrm.in,
  debian/prerm.in, debian/rules:
  - Drop alternatives and remove templates, as we only have
    one nvidia-settings for all the driver flavours.
* debian/dirs, debian/install,
  debian/nvidia-settings-autostart.desktop,
  debian/nvidia-settings.desktop:
  - Install the icon and the desktop files.
* debian/control:
  - Add ${misc:Depends}.
  - Build depend on libvdpau-dev and depend on libvdpau1.
  - Create transitional packages for 319, 319-updates, 313-updates,
    310, 310-updates, 304, 304-updates, experimental-304, updates.
  - Remove lpia.
  - Depend on screen-resolution-extra (>= 0.14ubuntu2.1).
* debian/rules:
  - Pass the destdir argument in uppercase to match the variable.
  - Add download-sources target.
  - Clean action in rules to target "clean" instead of "distclean".
  - Do not compress .c and .mk files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
#define NV_PARSER_TYPE_COLOR_ATTRIBUTE         (1<<17)
44
44
#define NV_PARSER_TYPE_NO_CONFIG_WRITE         (1<<18)
45
45
#define NV_PARSER_TYPE_GUI_ATTRIBUTE           (1<<19)
46
 
#define NV_PARSER_TYPE_XVIDEO_ATTRIBUTE        (1<<20)
47
 
#define NV_PARSER_TYPE_PACKED_ATTRIBUTE        (1<<21)
48
 
#define NV_PARSER_TYPE_VALUE_IS_DISPLAY        (1<<22)
49
 
#define NV_PARSER_TYPE_NO_QUERY_ALL            (1<<23)
50
 
#define NV_PARSER_TYPE_NO_ZERO_VALUE           (1<<24)
51
 
#define NV_PARSER_TYPE_100Hz                   (1<<25)
52
 
#define NV_PARSER_TYPE_STRING_ATTRIBUTE        (1<<26)
53
 
#define NV_PARSER_TYPE_ASSIGN_ALL_DISPLAYS     (1<<27)
54
 
#define NV_PARSER_TYPE_VALUE_IS_SWITCH_DISPLAY (1<<28)
55
 
#define NV_PARSER_TYPE_1000Hz                  (1<<29)
56
 
#define NV_PARSER_TYPE_SDI                     (1<<30)
57
 
#define NV_PARSER_TYPE_SDI_CSC                 (1<<31)
 
46
#define NV_PARSER_TYPE_PACKED_ATTRIBUTE        (1<<20)
 
47
#define NV_PARSER_TYPE_VALUE_IS_DISPLAY        (1<<21)
 
48
#define NV_PARSER_TYPE_NO_QUERY_ALL            (1<<22)
 
49
#define NV_PARSER_TYPE_NO_ZERO_VALUE           (1<<23)
 
50
#define NV_PARSER_TYPE_100Hz                   (1<<24)
 
51
#define NV_PARSER_TYPE_STRING_ATTRIBUTE        (1<<25)
 
52
#define NV_PARSER_TYPE_ASSIGN_ALL_DISPLAYS     (1<<26)
 
53
#define NV_PARSER_TYPE_VALUE_IS_SWITCH_DISPLAY (1<<27)
 
54
#define NV_PARSER_TYPE_1000Hz                  (1<<28)
 
55
#define NV_PARSER_TYPE_SDI                     (1<<29)
 
56
#define NV_PARSER_TYPE_SDI_CSC                 (1<<30)
 
57
#define NV_PARSER_TYPE_VALUE_IS_DISPLAY_ID     (1<<31)
58
58
 
59
59
#define NV_PARSER_ASSIGNMENT 0
60
60
#define NV_PARSER_QUERY 1
84
84
#define NV_PARSER_STATUS_TARGET_SPEC_NO_TARGET_ID           13
85
85
#define NV_PARSER_STATUS_TARGET_SPEC_BAD_TARGET_ID          14
86
86
#define NV_PARSER_STATUS_TARGET_SPEC_TRAILING_GARBAGE       15
87
 
 
 
87
#define NV_PARSER_STATUS_TARGET_SPEC_NO_TARGETS             16
88
88
 
89
89
/*
90
90
 * define useful types
115
115
typedef struct _ParsedAttribute {
116
116
    char *display;
117
117
    char *name;
 
118
    char *target_specification;
 
119
    /*
 
120
     * The target_type and target_id here are mostly set by the GUI to store
 
121
     * target-specific information, as well as the cmd line for handling the
 
122
     * case where an X screen is specified as part of the display (e.g.
 
123
     * "localhost:0.1").  Note that if the target_specification is specified,
 
124
     * the target_type and target_id are ignored when resolving to the list of
 
125
     * targets that should be operated on.
 
126
     */
118
127
    int target_type;
119
128
    int target_id;
120
129
    char *target_name;
128
137
    uint32 display_device_mask;
129
138
    uint32 flags;
130
139
    struct _ParsedAttribute *next;
 
140
    /*
 
141
     * Upon being resolved, the ParsedAttribute's target_type and target_id,
 
142
     * and/or target_specification get converted into a list of targets to
 
143
     * which the attribute should be processed.
 
144
     */
 
145
    struct _CtrlHandleTargetNode *targets;
131
146
} ParsedAttribute;
132
147
 
133
148
 
136
151
 * Attribute table; defined in parse.c
137
152
 */
138
153
 
139
 
extern AttributeTableEntry attributeTable[];
 
154
extern const AttributeTableEntry attributeTable[];
140
155
 
141
156
 
142
157
/*
143
 
 * Indices into CtrlHandles->targets[] array; stored in
144
 
 * TargetTypeEntry.target_index.
 
158
 * Indices into both targetTypeTable[] and CtrlHandles->targets[] array; stored
 
159
 * in TargetTypeEntry.target_index.
145
160
 */
146
161
 
147
162
#define X_SCREEN_TARGET  0
191
206
 * TargetType table; defined in parse.c
192
207
 */
193
208
 
194
 
extern TargetTypeEntry targetTypeTable[];
 
209
extern const TargetTypeEntry targetTypeTable[];
 
210
extern const int targetTypeTableLen;
 
211
 
 
212
/*
 
213
 * accessor functions for getting target type info based on NV-CONTROL
 
214
 * attribute type or by a name.
 
215
 */
 
216
const TargetTypeEntry *nv_get_target_type_entry_by_nvctrl(int nvctrl);
 
217
const TargetTypeEntry *nv_get_target_type_entry_by_name(const char *name);
 
218
 
195
219
 
196
220
/* nv_get_sdi_csc_matrxi() - Returns an array of floats that specifies
197
 
 * all the color, offset and scale values for specifing one of the
 
221
 * all the color, offset and scale values for specifying one of the
198
222
 * Standard CSC. 's' is a string that names the matrix values to return.
199
223
 * The values are placed in the float buffer like so:
200
224
 *
216
240
 * the default X server is used.  If no X screen is specified, then
217
241
 * all X screens on the X server are used.
218
242
 *
219
 
 * {screen}/ may be specified by itself (ie: without the
 
243
 * {screen}/ may be specified by itself (i.e.: without the
220
244
 * "{host}:{display}." part).
221
245
 *
222
246
 * Additionally, instead of specifying a screen, a target
239
263
 *
240
264
 * The query parameter controls whether the attribute string is parsed
241
265
 * for setting or querying.  If query == NV_PARSER_SET, then the
242
 
 * attribute string will be interpretted as described above.  If query
 
266
 * attribute string will be interpreted as described above.  If query
243
267
 * == NV_PARSER_QUERY, the "={value}" portion of the string should be
244
268
 * omitted.
245
269
 *
270
294
 * describing the error.
271
295
 */
272
296
 
273
 
char *nv_parse_strerror(int);
 
297
const char *nv_parse_strerror(int);
274
298
 
275
299
int nv_strcasecmp(const char *, const char *);
276
300
 
279
303
char *replace_characters(const char *o, const char c, const char r);
280
304
 
281
305
/*
282
 
 * diaplay_mask/display_name conversions: the NV-CONTROL X extension
 
306
 * display_mask/display_name conversions: the NV-CONTROL X extension
283
307
 * identifies a display device by a bit in a display device mask.  The
284
308
 * below functions translate between a display mask, and a string
285
309
 * describing the display devices.
305
329
 
306
330
 
307
331
char *display_device_mask_to_display_device_name(const uint32);
308
 
uint32 display_device_name_to_display_device_mask(const char *);
309
332
 
310
 
uint32 expand_display_device_mask_wildcards(const uint32, const uint32);
 
333
uint32 expand_display_device_mask_wildcards(const uint32);
311
334
 
312
335
ParsedAttribute *nv_parsed_attribute_init(void);
313
336
 
325
348
 
326
349
/* General parsing functions */
327
350
 
 
351
int nv_parse_numerical(const char *start, const char *end, int *val);
328
352
const char *parse_skip_whitespace(const char *str);
329
353
void parse_chop_whitespace(char *str);
330
354
const char *parse_skip_integer(const char *str);