1 /* 2 * drawable.h - drawable functions header 3 * 4 * Copyright © 2007-2009 Julien Danjou <julien@danjou.info> 5 * Copyright © 2010-2012 Uli Schlachter <psychon@znc.in> 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation; either version 2 of the License, or 10 * (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License along 18 * with this program; if not, write to the Free Software Foundation, Inc., 19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 */ 22 23 #ifndef AWESOME_OBJECTS_DRAWABLE_H 24 #define AWESOME_OBJECTS_DRAWABLE_H 25 26 #include "common/luaclass.h" 27 #include "draw.h" 28 29 typedef void drawable_refresh_callback(void *); 30 31 /** drawable type */ 32 struct drawable_t 33 { 34 LUA_OBJECT_HEADER 35 /** The pixmap we are drawing to. */ 36 xcb_pixmap_t pixmap; 37 /** Surface for drawing. */ 38 cairo_surface_t *surface; 39 /** The geometry of the drawable (in root window coordinates). */ 40 area_t geometry; 41 /** Surface contents are undefined if this is false. */ 42 bool refreshed; 43 /** Callback for refreshing. */ 44 drawable_refresh_callback *refresh_callback; 45 /** Data for refresh callback. */ 46 void *refresh_data; 47 }; 48 typedef struct drawable_t drawable_t; 49 50 drawable_t *drawable_allocator(lua_State *, drawable_refresh_callback *, void *); 51 void drawable_set_geometry(lua_State *, int, area_t); 52 void drawable_class_setup(lua_State *); 53 54 #endif 55 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 56