2
* Copyright (C) 2010 Canonical Ltd
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 3 as
6
* published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authored by: Jason Smith <jason.smith@canonical.com>
20
#include "PluginAdapter.h"
22
PluginAdapter * PluginAdapter::_default = 0;
26
PluginAdapter::Default ()
35
PluginAdapter::Initialize (CompScreen *screen)
37
_default = new PluginAdapter (screen);
40
PluginAdapter::PluginAdapter(CompScreen *screen)
47
PluginAdapter::~PluginAdapter()
53
PluginAdapter::SetExpoAction (CompAction *expo)
59
PluginAdapter::SetScaleAction (CompAction *scale)
61
m_ScaleAction = scale;
65
PluginAdapter::MatchStringForXids (std::list<Window> *windows)
68
std::string *result = new std::string ("any & (");
70
std::list<Window>::iterator it;
72
for (it = windows->begin (); it != windows->end (); it++)
74
string = g_strdup_printf ("| xid=%i ", (int) *it);
75
result->append (string);
85
PluginAdapter::InitiateScale (std::string *match)
90
CompOption::Value value;
91
CompOption::Type type;
92
CompOption::Vector argument;
95
name = (char *) "root";
96
type = CompOption::TypeInt;
97
value.set ((int) m_Screen->root ());
99
CompOption arg = CompOption (name, type);
101
argument.push_back (arg);
103
name = (char *) "match";
104
type = CompOption::TypeMatch;
105
value.set (CompMatch (*match));
107
arg = CompOption (name, type);
109
argument.push_back (arg);
111
m_ScaleAction->initiate () (m_ScaleAction, 0, argument);
115
PluginAdapter::InitiateExpo ()
120
CompOption::Value value;
121
CompOption::Type type;
122
CompOption::Vector argument;
125
name = (char *) "root";
126
type = CompOption::TypeInt;
127
value.set ((int) m_Screen->root ());
129
CompOption arg (name, type);
131
argument.push_back (arg);
133
m_ExpoAction->initiate () (m_ExpoAction, 0, argument);