3 /* HID internal interfaces. These may ONLY be called from the HID
4 modules, not from the common PCB code. */
6 /* These decode the set_layer index. */
7 #define SL_TYPE(x) ((x) < 0 ? (x) & 0x0f0 : 0)
8 #define SL_SIDE(x) ((x) & 0x00f)
9 #define SL_MYSIDE(x) ((((x) & SL_BOTTOM_SIDE)!=0) == (SWAP_IDENT != 0))
11 /* Called by the init funcs, used to set up hid_list. */
12 extern void hid_register_hid (HID
* hid
);
14 /* NULL terminated list of all static HID structures. Built by
15 hid_register_hid, used by hid_find_*() and hid_enumerate(). The
16 order in this list is the same as the order of hid_register_hid
18 extern HID
**hid_list
;
20 /* Count of entries in the above. */
21 extern int hid_num_hids
;
23 /* Used to cache color lookups. If set is zero, it looks up the name
24 and if found sets val and returns nonzero. If not found, it
25 returns zero. If set is nonzero, name/val is added to the
27 int hid_cache_color (int set
, const char *name
, hidval
* val
, void **cache
);
29 typedef struct HID_AttrNode
31 struct HID_AttrNode
*next
;
32 HID_Attribute
*attributes
;
36 extern HID_AttrNode
*hid_attr_nodes
;
38 HID_Action
*hid_find_action (const char *name
);
40 HID_Flag
*hid_find_flag (const char *name
);
42 /* Any field that is NULL in "d" is copied from the matching field in
43 "s". If "s" is NULL, the nogui HID is used. */
44 void apply_default_hid (HID
* d
, HID
* s
);
46 /* A HID may use this if it does not need command line arguments in
47 any special format; for example, the Lesstif HID needs to use the
48 Xt parser, but the Postscript HID can use this function. */
49 void hid_parse_command_line (int *argc
, char ***argv
);
51 /* Use this to temporarily enable all layers, so that they can be
52 exported even if they're not currently visible. save_array must be
54 void hid_save_and_show_layer_ons (int *save_array
);
55 /* Use this to restore them. */
56 void hid_restore_layer_ons (int *save_array
);
58 /* Returns a filename base that can be used to output the layer. */
59 const char *layer_type_to_file_name (int idx
);
61 #ifdef __GLOBAL_INCLUDED__
63 /* Convenience function that calls the expose callback for the item,
64 and returns the extents of what was drawn. */
65 BoxType
*hid_get_extents (void *item
);
69 void derive_default_filename(const char *pcbfile
, HID_Attribute
*filename_attrib
, const char *suffix
, char **memory
);