~vanvugt/compiz-plugins-main/fix-1084386

« back to all changes in this revision

Viewing changes to titleinfo/src/titleinfo.h

  • Committer: Sam Spilsbury
  • Date: 2011-08-12 06:36:10 UTC
  • Revision ID: sam.spilsbury@canonical.com-20110812063610-8mcxo2xohctyp2ak
Sync - Remove Plugins

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 *
3
 
 * Compiz title bar information extension plugin
4
 
 *
5
 
 * titleinfo.h
6
 
 *
7
 
 * Copyright : (C) 2009 by Danny Baumann
8
 
 * E-mail    : maniac@compiz.org
9
 
 *
10
 
 * Ported to Compiz 0.9 by:
11
 
 * Copyright : (C) 2009 Sam Spilsbury
12
 
 * E-mail    : smspillaz@gmail.com
13
 
 *
14
 
 * This program is free software; you can redistribute it and/or
15
 
 * modify it under the terms of the GNU General Public License
16
 
 * as published by the Free Software Foundation; either version 2
17
 
 * of the License, or (at your option) any later version.
18
 
 *
19
 
 * This program is distributed in the hope that it will be useful,
20
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22
 
 * GNU General Public License for more details.
23
 
 *
24
 
 */
25
 
#ifndef _GNU_SOURCE
26
 
#define _GNU_SOURCE
27
 
#endif
28
 
 
29
 
#include <cmath>
30
 
#include <unistd.h>
31
 
#include <cstring>
32
 
#include <X11/Xatom.h>
33
 
 
34
 
#include <sys/types.h>
35
 
#include <sys/stat.h>
36
 
 
37
 
#include <core/core.h>
38
 
#include <core/pluginclasshandler.h>
39
 
#include <core/atoms.h>
40
 
 
41
 
#include "titleinfo_options.h"
42
 
 
43
 
class TitleinfoScreen :
44
 
    public PluginClassHandler <TitleinfoScreen, CompScreen>,
45
 
    public ScreenInterface,
46
 
    public TitleinfoOptions
47
 
{
48
 
    public:
49
 
 
50
 
        TitleinfoScreen (CompScreen *);
51
 
        ~TitleinfoScreen ();
52
 
 
53
 
        Atom visibleNameAtom;
54
 
        Atom wmPidAtom;
55
 
 
56
 
        void
57
 
        handleEvent (XEvent *);
58
 
 
59
 
 
60
 
        void
61
 
        addSupportedAtoms (std::vector<Atom> &atoms);
62
 
 
63
 
        CompString
64
 
        getUtf8Property (Window      id,
65
 
                         Atom        atom);
66
 
 
67
 
        CompString
68
 
        getTextProperty (Window      id,
69
 
                         Atom        atom);
70
 
 
71
 
 
72
 
};
73
 
 
74
 
#define TITLEINFO_SCREEN(s)                                                    \
75
 
    TitleinfoScreen *ts = TitleinfoScreen::get (screen)
76
 
 
77
 
class TitleinfoWindow :
78
 
    public PluginClassHandler <TitleinfoWindow, CompWindow>
79
 
{
80
 
    public:
81
 
        TitleinfoWindow (CompWindow *);
82
 
 
83
 
        CompWindow *window;
84
 
 
85
 
        CompString title;
86
 
        CompString remoteMachine;
87
 
        int        owner;
88
 
 
89
 
        void
90
 
        updateMachine ();
91
 
 
92
 
        void
93
 
        updateTitle ();
94
 
 
95
 
        void
96
 
        updatePid ();
97
 
 
98
 
        void
99
 
        updateVisibleName ();
100
 
 
101
 
 
102
 
};
103
 
 
104
 
#define TITLEINFO_WINDOW(w)                                                    \
105
 
     TitleinfoWindow *tw = TitleinfoWindow::get (w);
106
 
 
107
 
class TitleinfoPluginVTable :
108
 
    public CompPlugin::VTableForScreenAndWindow <TitleinfoScreen, TitleinfoWindow>
109
 
{
110
 
    public:
111
 
 
112
 
        bool init ();
113
 
};