2012-10-14 17:14:22 +02:00
|
|
|
/*
|
|
|
|
* drawable.h - drawable functions header
|
|
|
|
*
|
|
|
|
* Copyright © 2007-2009 Julien Danjou <julien@danjou.info>
|
|
|
|
* Copyright © 2010-2012 Uli Schlachter <psychon@znc.in>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef AWESOME_OBJECTS_DRAWABLE_H
|
|
|
|
#define AWESOME_OBJECTS_DRAWABLE_H
|
|
|
|
|
|
|
|
#include "common/luaclass.h"
|
2014-03-30 20:07:48 +02:00
|
|
|
#include "draw.h"
|
2012-10-14 17:14:22 +02:00
|
|
|
|
|
|
|
typedef void drawable_refresh_callback(void *);
|
|
|
|
|
|
|
|
/** drawable type */
|
|
|
|
struct drawable_t
|
|
|
|
{
|
|
|
|
LUA_OBJECT_HEADER
|
2014-03-16 17:08:36 +01:00
|
|
|
/** The pixmap we are drawing to. */
|
|
|
|
xcb_pixmap_t pixmap;
|
2012-10-14 17:14:22 +02:00
|
|
|
/** Surface for drawing. */
|
|
|
|
cairo_surface_t *surface;
|
|
|
|
/** The geometry of the drawable (in root window coordinates). */
|
|
|
|
area_t geometry;
|
2014-03-17 16:27:10 +01:00
|
|
|
/** Surface contents are undefined if this is false. */
|
|
|
|
bool refreshed;
|
2012-10-14 17:14:22 +02:00
|
|
|
/** Callback for refreshing. */
|
|
|
|
drawable_refresh_callback *refresh_callback;
|
|
|
|
/** Data for refresh callback. */
|
|
|
|
void *refresh_data;
|
|
|
|
};
|
2014-03-30 20:07:48 +02:00
|
|
|
typedef struct drawable_t drawable_t;
|
2012-10-14 17:14:22 +02:00
|
|
|
|
2012-10-20 22:51:52 +02:00
|
|
|
drawable_t *drawable_allocator(lua_State *, drawable_refresh_callback *, void *);
|
2014-12-06 10:46:45 +01:00
|
|
|
void drawable_set_geometry(lua_State *, int, area_t);
|
2012-10-14 17:14:22 +02:00
|
|
|
void drawable_class_setup(lua_State *);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|