1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
|
#ifndef BALLOON_H
#define BALLOON_H
#ifdef __cplusplus
extern "C" {
#endif
struct MyStyle;
struct MyStyle;
struct ASTBarData;
struct ASCanvas;
typedef struct ASBalloonLook
{
int ref_count ;
Bool show;
int BorderHilite;
int YOffset, XOffset;
int Delay;
int CloseDelay;
struct MyStyle *Style;
int TextPaddingX, TextPaddingY;
}ASBalloonLook;
struct ASBalloonState;
typedef struct ASBalloon
{
enum
{
ASBalloon_Text =0,
ASBalloon_Image,
} type;
union
{
struct {
char *text; /* text to display in balloon */
unsigned long encoding ;
}text;
struct {
char *filename;
ASImage *image;
}image;
}data;
enum
{
BALLOON_TIMER_OPEN,
BALLOON_TIMER_CLOSE
} timer_action; /* what to do when the timer expires */
struct ASTBarData *owner ;
struct ASBalloonState *state ;
}ASBalloon;
typedef struct ASBalloonState
{
ASBalloonLook *look ;
ASBalloon *active ;
struct ASCanvas *active_canvas;
struct ASTBarData *active_bar ;
Window active_window ;
struct ASBalloonState *next ;
}ASBalloonState;
ASBalloonState *is_balloon_click( XEvent *xe );
/* void balloon_init (int free_resources); */
ASBalloonState *create_balloon_state();
void destroy_balloon_state(ASBalloonState **pstate);
void cleanup_default_balloons();
void withdraw_balloon( ASBalloon *balloon );
void withdraw_active_balloon_from( ASBalloonState *state );
void withdraw_active_balloon();
void display_balloon( ASBalloon *balloon );
void display_balloon_nodelay( ASBalloon *balloon );
ASBalloonLook* create_balloon_look();
int destroy_balloon_look( ASBalloonLook *blook );
void set_balloon_look( ASBalloonLook *blook );
void set_balloon_state_look( ASBalloonState *state, ASBalloonLook *blook );
ASBalloon *create_asballoon_for_state (ASBalloonState *state, struct ASTBarData *owner);
ASBalloon *create_asballoon_with_text_for_state ( ASBalloonState *state, struct ASTBarData *owner, const char *text, unsigned long encoding);
ASBalloon *create_asballoon (struct ASTBarData *owner);
ASBalloon *create_asballoon_with_text ( struct ASTBarData *owner, const char *text, unsigned long encoding);
void destroy_asballoon(ASBalloon **pballoon );
void balloon_set_text (ASBalloon * balloon, const char *text, unsigned long encoding);
void balloon_set_image_from_file (ASBalloon * balloon, const char *filename);
void balloon_set_image (ASBalloon * balloon, ASImage *im);
#ifdef __cplusplus
}
#endif
#endif /* BALLOON_H */
|