/* * The Helium Toolkit * * Copyright (C) 1996-2000 Edouard Thiel * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License; see http://www.lif-sud.univ-mrs.fr/~thiel/helium/LICENSE */ /* * include/types.h - 12/07/1999 * * Declaration des types communs */ #ifndef HELIUM__TYPES_H #define HELIUM__TYPES_H /* -------- Divers -------- */ typedef unsigned char Uchar; typedef unsigned short Ushort; typedef unsigned long Ulong; /* -------- Définis plus loin -------- */ typedef struct He_node_st *He_node_ptr; typedef struct He_event_st *He_event_ptr; typedef struct He_upd_info_st *He_upd_info_ptr; typedef struct He_focus_info_st *He_focus_info_ptr; typedef struct He_tip_info_st *He_tip_info_ptr; /* -------- Prototypes callbacks -------- */ typedef void (*He_mess_proc) (long l[5]); typedef void (*He_init_proc) (He_node_ptr hn); typedef void (*He_destroy_proc) (He_node_ptr hn); typedef void (*He_close_proc) (He_node_ptr hn); typedef void (*He_replace_proc) (He_node_ptr hn, int xb, int yb); typedef void (*He_resize_proc) (He_node_ptr hn, int width, int height); typedef void (*He_notify_proc) (He_node_ptr hn); typedef void (*He_event_proc) (He_node_ptr hn, He_event_ptr hev); typedef int (*He_kbd_proc) (He_node_ptr hn, He_event_ptr hev); typedef void (*He_repaint_proc) (He_node_ptr hn, Window win); typedef void (*He_dialog_proc) (char *name, void *data); typedef void (*He_io_proc) (int fd, Ulong rcond, void *data); typedef int (*He_timeout_proc) (int handle, void *data); typedef void (*He_sig_proc) (int sig, void *data); typedef int (*He_compar_proc) (void *v1, void *v2); /* -------- Prototypes methodes -------- */ typedef void (*He_destroy_meth) (He_node_ptr hn); typedef void (*He_fit_meth) (He_node_ptr hn); typedef void (*He_update_meth) (He_node_ptr hn, He_upd_info_ptr ui); typedef int (*He_event_meth) (He_node_ptr hn, He_event_ptr hev); typedef void (*He_draw_meth) (He_node_ptr hn); typedef int (*He_export_meth) (He_node_ptr hn, Atom sel_type, Atom target, Atom *type, Uchar **value, int *length, int *format, int *free_value); typedef void (*He_import_meth) (He_node_ptr hn, Atom sel_type, Atom target, Atom prop, Atom type, int format, Ulong nitems, Uchar *data, int *free_data); typedef He_focus_info_ptr (*He_focus_meth) (He_node_ptr hn); typedef He_tip_info_ptr (*He_tip_meth) (He_node_ptr hn); /* -------- method.c -------- */ typedef struct He_method_st { Ulong magic, /* Certifie que c'est un He_method */ nat, /* HE_NAT_FRAME, HE_NAT_CANVAS, etc */ props; /* Masque de proprie'te's HE_PM_ */ He_destroy_meth destroy; He_fit_meth fit; He_update_meth update; He_event_meth event; He_draw_meth draw; He_export_meth sel_export; /* le nom "export" est réservé par C++ */ He_import_meth sel_import; He_focus_meth focus; He_tip_meth tip; } He_method; /* -------- noeud.c -------- */ typedef union { void *any; struct Obj_frame_st *frame; struct Obj_canvas_st *canvas; struct Obj_panel_st *panel; struct Obj_panel_message_st *message; struct Obj_panel_button_st *button; struct Obj_panel_toggle_st *toggle; struct Obj_panel_text_st *text; struct Obj_panel_rule_st *rule; struct Obj_panel_arrow_st *arrow; struct Obj_plug_st *plug; struct Obj_menu_st *menu; struct Obj_menu_item_st *menu_item; struct Obj_bubble_st *bubble; } Obj_union; typedef struct He_node_st { He_node_ptr owner, /* Le proprietaire unique */ next_node, /* Un des freres, liste terminee par 0 */ sub_node; /* Un des fils, liste terminee par 0 */ int id, /* Le handle du noeud */ xb, yb, /* Coord / pere ou window */ xm, ym, /* Largeur, hauteur de l'INTERIEUR */ upd_index; /* Index dans he_update_list, sinon -1 */ Ulong status; /* Affiche', actif, destroy, etc */ He_method *meth; /* HE_FRAME, HE_CANVAS, etc */ Obj_union obj; /* Union suivant la nature */ void *client_data; /* Donnee du client */ He_destroy_proc destroy_proc; /* Appele' a la destruction, par ex */ /* pour liberer le client_data */ Window win; int win_border; /* Bord du window, par defaut a 0 */ } He_node; /* -------- event.c -------- */ typedef struct He_event_st { int type, /* Type d'evenement = xev->type */ sx, sy, /* Coords souris / window */ sb; /* Bouton souris filtre' : 0, 1, 2, 3 */ Time time; /* Temps en milli secondes */ Window win; /* Le Window X sur lequel s'exerce l'action */ XEvent *xev; /* Evenement X complet */ char str[256]; /* Buffer lu au clavier */ int len; /* Nb char dans str */ KeySym sym; /* Symbole de la touche presse'e */ } He_event; /* -------- update.c -------- */ typedef struct He_upd_info_st { He_node_ptr hn; Ulong mask; int xb, yb, /* Coord / pere ou window */ xm, ym; /* Largeur, hauteur */ } He_upd_info; /* -------- focus.c -------- */ typedef struct He_focus_info_st { int id, /* item qui a le focus clavier */ borrow; /* item dont le focus est emprunté */ } He_focus_info; /* -------- tip.c -------- */ typedef struct He_tip_info_st { char *label; /* Texte à afficher dans la bulle d'aide */ } He_tip_info; #endif /* HELIUM__TYPES_H */