2 * Copyright 2000, International Business Machines Corporation and others.
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
10 #ifndef __gator_lightobject_h
11 #define __gator_lightobject_h 1
13 #include "gtxobjects.h" /*Basic gator object definitions */
15 /*Value for onode o_type field*/
16 #define GATOR_OBJ_LIGHT 1
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 */
24 #define GATOR_LABEL_CHARS 128 /*Max chars in light label */
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 */
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 */
45 /*Light object's creation routine*/
47 extern int gator_light_create(struct onode
*, struct onode_createparams
*);
50 * Create a gator light object.
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)
60 * Error value otherwise.
63 /*Light object's generic onode routines*/
65 extern int gator_light_destroy(struct onode
*);
68 * Destroy a gator light object.
71 * struct onode *onp : Ptr to the light onode to delete.
75 * Error value otherwise.
78 extern int gator_light_display(struct onode
*);
81 * Display/redraw a gator light object.
84 * struct onode *onp: Ptr to the light onode to display.
88 * Error value otherwise.
91 extern int gator_light_release(struct onode
*);
94 * Drop the refcount on a gator light object.
97 * struct onode *onp : Ptr to the onode whose refcount is
102 * Error value otherwise.
106 * Additional, light-specific operations.
109 extern int gator_light_set(struct onode
*, int);
112 * Set the value of the given gator light object.
115 * struct onode *onp : Ptr to the light onode to be set.
116 * int setting : Non-zero for ``on'', zero for ``off''.
120 * Error value otherwise.
124 * Set of exported generic light onode operations.
126 extern struct onodeops gator_light_ops
;
128 #endif /* __gator_lightobject_h */