-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathlualock.h
105 lines (76 loc) · 2.19 KB
/
lualock.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// lualock.h - common stuff
// Copyright ©2011 Guff <cassmacguff@gmail.com>
// 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 LUALOCK_H
#define LUALOCK_H
#include <lua.h>
#include <gdk/gdk.h>
#define DEFAULT_FONT "Sans 12"
typedef struct {
PangoFontDescription *font_desc;
gint x;
gint y;
gint off_x;
gint off_y;
gint width;
gint height;
gdouble r;
gdouble g;
gdouble b;
gdouble a;
GdkRGBA bg_color;
GdkRGBA border_color;
gdouble border_width;
} style_t;
typedef struct {
cairo_surface_t *surface;
gint x;
gint y;
gint width;
gint height;
gdouble scale_x;
gdouble scale_y;
gdouble angle;
gboolean show;
} layer_t;
typedef struct {
lua_State *L;
GdkScreen *scr;
GdkWindow *win;
gchar *password;
gint pw_length;
gint pw_alloc;
struct pam_handle *pam_handle;
cairo_surface_t *surface_buf;
cairo_surface_t *surface;
cairo_surface_t *pw_surface;
cairo_surface_t *bg_surface;
GPtrArray *layers;
cairo_region_t *updates_needed;
gint timeout;
GArray *timers;
guint frame_timer_id;
GHashTable *hooks;
const gchar **hook_names;
GPtrArray *keybinds;
GMainLoop *loop;
style_t style;
} lualock_t;
extern lualock_t lualock;
void event_handler(GdkEvent *ev, gpointer data);
void reset_password(void);
#endif