-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathApplication.h
More file actions
81 lines (65 loc) · 2.06 KB
/
Application.h
File metadata and controls
81 lines (65 loc) · 2.06 KB
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
/*
* Copyright (c) 2010 Andry Gunawan <angun33@gmail.com>
*
* Parts of this file are based on Telescope which is
* Copyright (c) 2010 Ilya Skriblovsky <Ilya.Skriblovsky@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* 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 St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef APPLICATION_H
#define APPLICATION_H
#include <X11/Xlib.h>
#include <X11/extensions/Xdamage.h>
#include <X11/extensions/Xrender.h>
#include <X11/Xft/Xft.h>
#include <glib.h>
class Image;
class Application
{
public:
Application(Display *dpy, const gchar *filename);
~Application();
const gchar* getIcon();
const gchar* getApplicationName();
bool execute();
bool isValid();
void setPosition(int x, int y);
// Picture draw(Display *dpy);
bool isAHit(int x, int y);
int x() { return _x; }
int y() { return _y; }
static int width() { return _pixmapWidth; }
static int height() { return _pixmapHeight; }
Image* image() { return _image; }
private:
gchar * _filename;
gchar *_icon;
gchar *_iconPath;
gchar *_appName;
gchar *_executable;
gchar *_service;
bool _runInTerminal;
bool _isValid;
int _x, _y;
static int _pixmapWidth;
static int _pixmapHeight;
bool _executeService();
bool _executeNormally();
bool _executeInTerminal();
Display * _dpy;
static XftFont *_xftFont;
Image* _image;
void createPicture();
};
#endif // APPLICATION_H