3
* This file is part of unity
5
* Copyright (C) 2010 - Jason Smith
7
* unity is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
10
* (at your option) any later version.
12
* unity is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with unity; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin St, Fifth Floor,
20
* Boston, MA 02110-1301 USA
24
#include "PluginAdapter.h"
26
PluginAdapter * PluginAdapter::_default = 0;
30
PluginAdapter::Default ()
39
PluginAdapter::Initialize (CompScreen *screen)
41
_default = new PluginAdapter (screen);
44
PluginAdapter::PluginAdapter(CompScreen *screen)
51
PluginAdapter::~PluginAdapter()
57
PluginAdapter::SetExpoAction (CompAction *expo)
63
PluginAdapter::SetScaleAction (CompAction *scale)
65
m_ScaleAction = scale;
69
PluginAdapter::MatchStringForXids (std::list<Window> *windows)
72
std::string *result = new std::string ("any & (");
74
std::list<Window>::iterator it;
76
for (it = windows->begin (); it != windows->end (); it++)
78
string = g_strdup_printf ("| xid=%i ", (int) *it);
79
result->append (string);
89
PluginAdapter::InitiateScale (std::string *match)
94
CompOption::Value value;
95
CompOption::Type type;
96
CompOption::Vector argument;
99
name = (char *) "root";
100
type = CompOption::TypeInt;
101
value.set ((int) m_Screen->root ());
103
CompOption arg = CompOption (name, type);
105
argument.push_back (arg);
107
name = (char *) "match";
108
type = CompOption::TypeMatch;
109
value.set (CompMatch (*match));
111
arg = CompOption (name, type);
113
argument.push_back (arg);
115
m_ScaleAction->initiate () (m_ScaleAction, 0, argument);
119
PluginAdapter::InitiateExpo ()
124
CompOption::Value value;
125
CompOption::Type type;
126
CompOption::Vector argument;
129
name = (char *) "root";
130
type = CompOption::TypeInt;
131
value.set ((int) m_Screen->root ());
133
CompOption arg (name, type);
135
argument.push_back (arg);
137
m_ExpoAction->initiate () (m_ExpoAction, 0, argument);