Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / gtx / gtxlightobj.h
1 /*
2 * Copyright 2000, International Business Machines Corporation and others.
3 * All Rights Reserved.
4 *
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
8 */
9
10 #ifndef __gator_lightobject_h
11 #define __gator_lightobject_h 1
12
13 #include "gtxobjects.h" /*Basic gator object definitions */
14
15 /*Value for onode o_type field*/
16 #define GATOR_OBJ_LIGHT 1
17
18 /*Light masks*/
19 #define GATOR_LIGHTMASK_OUTLINE 0x1 /*Outline the light? */
20 #define GATOR_LIGHTMASK_INVVIDEO 0x2 /*Show light in inverse video? */
21 #define GATOR_LIGHTMASK_FLASH 0x4 /*Flash light when turned on? */
22 #define GATOR_LIGHTMASK_FLASHCYCLE 0x8 /*Current flash cycle */
23
24 #define GATOR_LABEL_CHARS 128 /*Max chars in light label */
25
26 /*Private data for light onode*/
27 struct gator_lightobj {
28 int *llrock; /*Rock for lower-level graphics layer */
29 int setting; /*Is light on or off */
30 int appearance; /*Bit array describing light's appearance */
31 int flashfreq; /*Flashing frequency in msecs */
32 int lasttoggletime; /*Last time ``flashed'' */
33 char label[GATOR_LABEL_CHARS]; /*Light label */
34 };
35
36 /*Light object's creation parameters*/
37 struct gator_light_crparams {
38 struct onode_createparams onode_params; /*Creation params for the whole onode */
39 int appearance; /*General appearance */
40 int flashfreq; /*Flash frequency in msecs, if any */
41 char label[GATOR_LABEL_CHARS]; /*Light label */
42 int label_x, label_y; /*X,Y offsets for label within light */
43 };
44
45 /*Light object's creation routine*/
46
47 extern int gator_light_create(struct onode *, struct onode_createparams *);
48 /*
49 * Summary:
50 * Create a gator light object.
51 *
52 * Args:
53 * struct onode *light_onp : Ptr to the light onode to fill out.
54 * struct onode_createparams *params : Ptr to creation params.
55 * (Note: this actually points to a gator_light_crparams
56 * structure, but we use the generic version of the ptr)
57 *
58 * Returns:
59 * Zero if successful,
60 * Error value otherwise.
61 */
62
63 /*Light object's generic onode routines*/
64
65 extern int gator_light_destroy(struct onode *);
66 /*
67 * Summary:
68 * Destroy a gator light object.
69 *
70 * Args:
71 * struct onode *onp : Ptr to the light onode to delete.
72 *
73 * Returns:
74 * 0: Success.
75 * Error value otherwise.
76 */
77
78 extern int gator_light_display(struct onode *);
79 /*
80 * Summary:
81 * Display/redraw a gator light object.
82 *
83 * Args:
84 * struct onode *onp: Ptr to the light onode to display.
85 *
86 * Returns:
87 * 0: Success.
88 * Error value otherwise.
89 */
90
91 extern int gator_light_release(struct onode *);
92 /*
93 * Summary:
94 * Drop the refcount on a gator light object.
95 *
96 * Args:
97 * struct onode *onp : Ptr to the onode whose refcount is
98 * to be dropped.
99 *
100 * Returns:
101 * 0: Success.
102 * Error value otherwise.
103 */
104
105 /*
106 * Additional, light-specific operations.
107 */
108
109 extern int gator_light_set(struct onode *, int);
110 /*
111 * Summary:
112 * Set the value of the given gator light object.
113 *
114 * Args:
115 * struct onode *onp : Ptr to the light onode to be set.
116 * int setting : Non-zero for ``on'', zero for ``off''.
117 *
118 * Returns:
119 * 0: Success.
120 * Error value otherwise.
121 */
122
123 /*
124 * Set of exported generic light onode operations.
125 */
126 extern struct onodeops gator_light_ops;
127
128 #endif /* __gator_lightobject_h */