UDI/net_ne2000 - Fix incompatabilities pointed out by [com]buster
[tpg/acess2.git] / UDI / drivers / helpers_gfx.h
1 /*
2  * UDI Driver Helper Macros
3  *
4  * GFX-specific helpers
5  */
6 #ifndef _HELPERS_GFX_H_
7 #define _HELPERS_GFX_H_
8
9 typedef struct {
10         udi_index_t     op;
11         udi_ubit32_t    arg_1;
12         udi_ubit32_t    arg_2;
13         udi_ubit32_t    arg_3;
14 } gfxhelpers_op_t;
15
16 typedef struct {
17         udi_index_t     op_count;
18         const gfxhelpers_op_t   *ops;
19 } gfxhelpers_op_map_t;
20
21 static inline udi_ubit32_t gfxhelpers_get_engine_op(
22         const gfxhelpers_op_map_t *map, udi_index_t index, udi_index_t prop
23         )
24 {
25         if( index >= map->op_count ) {
26                 return 0;
27         }
28         switch(prop) {
29         case UDI_GFX_PROP_OPERATOR_OPCODE:      return map->ops[index].op;
30         case UDI_GFX_PROP_OPERATOR_ARG_1:       return map->ops[index].arg_1;
31         case UDI_GFX_PROP_OPERATOR_ARG_2:       return map->ops[index].arg_2;
32         case UDI_GFX_PROP_OPERATOR_ARG_3:       return map->ops[index].arg_3;
33         }
34         return 0;
35 }
36
37 static inline void gfxhelpers_return_range_simple(
38         udi_gfx_range_connector_ack_op_t *callback, udi_gfx_range_cb_t *cb,
39         udi_ubit32_t min, udi_ubit32_t max, udi_ubit32_t step
40         )
41 {
42         
43 }
44
45 static inline void gfxhelpers_return_range_set(
46         udi_gfx_range_connector_ack_op_t *callback, udi_gfx_range_cb_t *cb,
47         udi_ubit32_t count, ...
48         )
49 {
50         
51 }
52
53 static inline void gfxhelpers_return_range_fixed(
54         udi_gfx_range_connector_ack_op_t *callback, udi_gfx_range_cb_t *cb,
55         udi_ubit32_t value
56         )
57 {
58         gfxhelpers_return_range_simple(callback, cb, value, value, 1);
59 }
60
61 #endif
62

UCC git Repository :: git.ucc.asn.au