1 /* xlp_win.h - XLP functions for manipulating windows 2 3 Copyright 2001 Carl Worth 4 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; either version 2, or (at your option) 8 any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 */ 15 16 #ifndef XLP_WIN_H 17 #define XLP_WIN_H 18 19 #include <X11/Xlib.h> 20 21 #include "xlp.h" 22 #include "xlp_color.h" 23 #include "xlp_callback.h" 24 #include "xlp_timeout.h" 25 26 struct xlp_win 27 { 28 struct xlp *xlp; 29 Display *dpy; 30 int screen; 31 Window window; 32 int window_owner; 33 long event_mask; 34 int x, y; 35 int width, height; 36 struct xlp_color fg; 37 struct xlp_color bg; 38 XftDraw *draw; 39 XftFont *font; 40 }; 41 typedef struct xlp_win xlp_win_t; 42 43 int xlp_win_init(xlp_win_t *xlp_win, struct xlp *xlp, char *geometry, char *default_geometry, char *fg_color, char *bg_color, char *font, char *name, char *class); 44 int xlp_win_init_from_window(xlp_win_t *xlp_win, struct xlp *xlp, Window window, char *fg_color, char *bg_color); 45 void xlp_win_deinit(xlp_win_t *xlp_win); 46 47 int xlp_win_map(xlp_win_t *xlp_win); 48 int xlp_win_unmap(xlp_win_t *xlp_win); 49 50 int xlp_win_register_callback(xlp_win_t *xlp_win, int type, 51 xlp_cb_fun_t cb_fun, void *data); 52 int xlp_win_register_window_callback(xlp_win_t *xlp_win, 53 Window window, 54 int type, 55 xlp_cb_fun_t cb_fun, void *data); 56 int xlp_win_register_timeout(xlp_win_t *xlp_win, long delay_ms, 57 xlp_to_fun_t to_fun, void *data, 58 struct timeval *start_tv_ret); 59 60 61 #endif /* XLP_WIN_H */ 62