00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
#ifndef _MB_TRAY_H_
00021
#define _MB_TRAY_H_
00022
00023
#include <stdio.h>
00024
#include <stdlib.h>
00025
#include <sys/types.h>
00026
#include <unistd.h>
00027
#include <X11/Xlib.h>
00028
#include <X11/Xutil.h>
00029
#include <X11/Xatom.h>
00030
#include <X11/Xmd.h>
00031
00032
#include "libmb/mb.h"
00033
00034
#ifdef __cplusplus
00035
extern "C" {
00036
#endif
00037
00114 typedef struct MBTrayApp MBTrayApp;
00115
00116
00117
typedef void (*MBTrayBackgroundCB)(
void *user_data ) ;
00118
00125 typedef void (*
MBTrayAppResizeCB)(
MBTrayApp *mb,
int width,
int height ) ;
00126
00139 typedef void (*
MBTrayAppPaintCB)(
MBTrayApp *mb, Drawable drawable ) ;
00140
00150
typedef void (*MBTrayAppContextCB)(
MBTrayApp *mb ) ;
00151
00157 typedef void (*
MBTrayAppButtonEventCB)(
MBTrayApp *mb_tray_app,
00158
int x,
00159
int y,
00160 Bool is_release ) ;
00161
00168 typedef void (*
MBTrayAppXEventCB)(
MBTrayApp *mb_tray_app, XEvent *event ) ;
00169
00175 typedef void (*
MBTrayAppThemeChangeCB)(
MBTrayApp *mb_tray_app,
char *theme_name ) ;
00176
00182 typedef void (*
MBTrayAppPollCB)(
MBTrayApp *mb_tray_app) ;
00183
00184
00216
MBTrayApp*
00217
mb_tray_app_new (
unsigned char *app_name,
00218 MBTrayAppResizeCB resize_cb,
00219 MBTrayAppPaintCB paint_cb,
00220
int *argc,
00221
char ***argv);
00222
00238
MBTrayApp*
00239
mb_tray_app_new_with_display (
unsigned char *app_name,
00240 MBTrayAppResizeCB resize_cb,
00241 MBTrayAppPaintCB paint_cb,
00242
int *argc,
00243
char ***argv,
00244 Display *display);
00245
00253
void
00254
mb_tray_app_set_xevent_callback (MBTrayApp *mb_tray_app,
00255 MBTrayAppXEventCB xevent_cb );
00256
00263
void
00264
mb_tray_app_set_button_callback (MBTrayApp *mb_tray_app,
00265 MBTrayAppButtonEventCB button_cb );
00266
00273
void
00274
mb_tray_app_set_theme_change_callback (MBTrayApp *mb_tray_app,
00275 MBTrayAppThemeChangeCB theme_cb );
00276
00284
void
00285
mb_tray_app_set_timeout_callback (MBTrayApp *mb_tray_app,
00286 MBTrayAppPollCB poll_cb,
00287
struct timeval *tv);
00288
00295
void
00296
mb_tray_app_set_resize_callback (MBTrayApp *mb_tray_app,
00297 MBTrayAppResizeCB resize_cb );
00298
00305
void
00306
mb_tray_app_set_paint_callback (MBTrayApp *mb_tray_app,
00307 MBTrayAppPaintCB paint_cb );
00308
00315
void
00316
mb_tray_app_set_context_callback (MBTrayApp *mb_tray_app,
00317 MBTrayAppContextCB context_cb );
00318
00331
void
00332
mb_tray_app_request_size (MBTrayApp *mb_tray_app,
00333
int width,
00334
int height );
00335
00347
void
00348
mb_tray_app_request_offset (MBTrayApp *mb_tray_app,
00349
int offset);
00350
00351
00352
void
00353 mb_tray_app_set_poll_timeout (MBTrayApp *mb_tray_app,
00354
struct timeval *tv );
00355
00361
void
00362
mb_tray_app_repaint (MBTrayApp *mb_tray_app);
00363
00371
void
00372
mb_tray_app_tray_send_message (MBTrayApp *mb_tray_app,
00373
unsigned char *msg,
00374
int timeout);
00375
00382
void
00383
mb_tray_app_set_name (MBTrayApp *mb_tray_app,
00384
unsigned char *name);
00385
00392
void
00393
mb_tray_app_set_context_info (MBTrayApp *mb_tray_app,
00394
unsigned char *info);
00395
00403
void
00404
mb_tray_app_set_icon(MBTrayApp *mb_tray_app,
00405 MBPixbuf *pixbuf,
00406 MBPixbufImage *image);
00407
00416
void
00417
mb_tray_app_set_session ( MBTrayApp *mb_tray_app,
00418 Bool val );
00419
00426 Bool
00427
mb_tray_app_get_session ( MBTrayApp *mb );
00428
00437 Bool
00438
mb_tray_app_get_absolute_coords (MBTrayApp *mb_tray_app,
00439
int *x,
00440
int *y );
00441
00448
void
00449
mb_tray_app_set_user_data (MBTrayApp *mb_tray_app,
00450
void *data );
00451
00458
void*
00459
mb_tray_app_get_user_data (MBTrayApp *mb_tray_app);
00460
00461
00462 Bool
00463 mb_tray_app_tray_is_vertical (MBTrayApp *mb_tray_app );
00464
00472
MBPixbufImage *
00473
mb_tray_app_get_background (MBTrayApp *mb_tray_app,
00474 MBPixbuf *pixbuf);
00475
00482
char *
00483
mb_tray_app_get_theme_name (MBTrayApp *mb_tray_app);
00484
00491
long
00492
mb_tray_app_get_xevent_mask (MBTrayApp *mb_tray_app );
00493
00501
void
00502
mb_tray_app_set_xevent_mask (MBTrayApp *mb_tray_app,
long mask);
00503
00504
00511 Display*
00512
mb_tray_app_xdisplay (MBTrayApp *mb_tray_app);
00513
00520
int
00521
mb_tray_app_xscreen (MBTrayApp *mb_tray_app);
00522
00529 Window
00530
mb_tray_app_xrootwin(MBTrayApp *mb_tray_app);
00531
00538 Window
00539
mb_tray_app_xwin (MBTrayApp *mb_tray_app);
00540
00547
int
00548
mb_tray_app_width (MBTrayApp *mb_tray_app);
00549
00556
int
00557
mb_tray_app_height (MBTrayApp *mb_tray_app);
00558
00565
int
00566
mb_tray_app_offset ( MBTrayApp *mb_tray_app ) ;
00567
00575
void
00576
mb_tray_app_main_init ( MBTrayApp *mb_tray_app );
00577
00583
void
00584
mb_tray_app_main (MBTrayApp *mb_tray_app);
00585
00591
void
00592
mb_tray_app_hide (MBTrayApp *mb_tray_app );
00593
00599
void
00600
mb_tray_app_unhide (MBTrayApp *mb_tray_app );
00601
00602
00608
void
00609
mb_tray_app_main_quit (MBTrayApp *mb_tray_app);
00610
00617
void
00618
mb_tray_handle_xevent (MBTrayApp *mb_tray_app,
00619 XEvent *xevent);
00620
00621
00622
00623
00624
00625
00626
int mb_tray_init(Display* dpy, Window win);
00627
00628 Window mb_tray_get_window(
void);
00629
00630
void mb_tray_init_session_info(Display *d, Window win,
char **argv,
int argc);
00631
00632
void mb_tray_handle_event(Display *dpy, Window win, XEvent *an_event);
00633
00634
void mb_tray_send_message(Display *d, Window win,
00635
unsigned char* msg,
int timeout);
00636
00637
void mb_tray_map_window (Display* dpy, Window win);
00638
00639
void
00640 mb_tray_bg_change_cb_set(MBTrayBackgroundCB bg_changed_cb,
void *user_data);
00641
00642 Bool mb_tray_get_bg_col(Display *dpy, XColor *xcol);
00643
00644
void
00645 mb_tray_window_icon_set(Display *dpy, Window win_panel, MBPixbufImage *img);
00646
00647
void mb_tray_unmap_window (Display* dpy, Window win);
00648
00649
MBPixbufImage *mb_tray_get_bg_img(MBPixbuf *pb, Window win);
00650
00653
#ifdef __cplusplus
00654
}
00655
#endif
00656
00657
#endif