2009-09-30 16:04:42 +02:00
|
|
|
/*
|
|
|
|
* window.h - window object header
|
|
|
|
*
|
|
|
|
* Copyright © 2009 Julien Danjou <julien@danjou.info>
|
|
|
|
*
|
|
|
|
* 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_WINDOW_H
|
|
|
|
#define AWESOME_OBJECTS_WINDOW_H
|
|
|
|
|
2009-10-01 16:36:46 +02:00
|
|
|
#include "strut.h"
|
2009-10-02 16:16:34 +02:00
|
|
|
#include "objects/button.h"
|
2009-09-30 16:04:42 +02:00
|
|
|
#include "common/luaclass.h"
|
|
|
|
|
2010-09-27 21:16:30 +02:00
|
|
|
/** Windows type */
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
WINDOW_TYPE_NORMAL = 0,
|
|
|
|
WINDOW_TYPE_DESKTOP,
|
|
|
|
WINDOW_TYPE_DOCK,
|
|
|
|
WINDOW_TYPE_SPLASH,
|
|
|
|
WINDOW_TYPE_DIALOG,
|
|
|
|
/* The ones below may have TRANSIENT_FOR, but are not plain dialogs.
|
|
|
|
* They were purposefully placed below DIALOG.
|
|
|
|
*/
|
|
|
|
WINDOW_TYPE_MENU,
|
|
|
|
WINDOW_TYPE_TOOLBAR,
|
|
|
|
WINDOW_TYPE_UTILITY,
|
|
|
|
/* This ones are usually set on override-redirect windows. */
|
|
|
|
WINDOW_TYPE_DROPDOWN_MENU,
|
|
|
|
WINDOW_TYPE_POPUP_MENU,
|
|
|
|
WINDOW_TYPE_TOOLTIP,
|
|
|
|
WINDOW_TYPE_NOTIFICATION,
|
|
|
|
WINDOW_TYPE_COMBO,
|
|
|
|
WINDOW_TYPE_DND
|
|
|
|
} window_type_t;
|
|
|
|
|
2009-09-30 16:04:42 +02:00
|
|
|
#define WINDOW_OBJECT_HEADER \
|
|
|
|
LUA_OBJECT_HEADER \
|
|
|
|
/** The X window number */ \
|
|
|
|
xcb_window_t window; \
|
2010-07-30 20:54:20 +02:00
|
|
|
/** The frame window, might be XCB_NONE */ \
|
|
|
|
xcb_window_t frame_window; \
|
2009-09-30 16:04:42 +02:00
|
|
|
/** Opacity */ \
|
2009-10-01 16:36:46 +02:00
|
|
|
double opacity; \
|
|
|
|
/** Strut */ \
|
|
|
|
strut_t strut; \
|
2009-10-02 16:16:34 +02:00
|
|
|
/** Button bindings */ \
|
2009-10-02 16:42:31 +02:00
|
|
|
button_array_t buttons; \
|
|
|
|
/** Border color */ \
|
2010-10-06 20:14:19 +02:00
|
|
|
color_t border_color; \
|
2009-10-06 19:04:36 +02:00
|
|
|
/** Border width */ \
|
2010-09-27 21:16:30 +02:00
|
|
|
uint16_t border_width; \
|
|
|
|
/** The window type */ \
|
|
|
|
window_type_t type;
|
2009-09-30 16:04:42 +02:00
|
|
|
|
|
|
|
/** Window structure */
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
WINDOW_OBJECT_HEADER
|
|
|
|
} window_t;
|
|
|
|
|
|
|
|
lua_class_t window_class;
|
|
|
|
|
|
|
|
void window_class_setup(lua_State *);
|
|
|
|
|
|
|
|
void window_set_opacity(lua_State *, int, double);
|
2009-10-06 19:04:36 +02:00
|
|
|
void window_set_border_width(lua_State *, int, int);
|
2010-09-27 21:16:30 +02:00
|
|
|
int luaA_window_get_type(lua_State *, window_t *);
|
2010-09-27 22:03:34 +02:00
|
|
|
int luaA_window_set_type(lua_State *, window_t *);
|
2014-03-23 18:09:32 +01:00
|
|
|
uint32_t window_translate_type(window_type_t);
|
|
|
|
int window_set_xproperty(lua_State *, xcb_window_t, int, int);
|
|
|
|
int window_get_xproperty(lua_State *, xcb_window_t, int);
|
2009-09-30 16:04:42 +02:00
|
|
|
|
|
|
|
#endif
|
2011-09-11 16:50:01 +02:00
|
|
|
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|