Back to index

unity  6.0.0
PluginAdapterStandalone.cpp
Go to the documentation of this file.
00001 // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
00002 /*
00003  * Copyright (C) 2010 Canonical Ltd
00004  *
00005  * This program is free software: you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License version 3 as
00007  * published by the Free Software Foundation.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016  *
00017  * Authored by: Jason Smith <jason.smith@canonical.com>
00018  */
00019 
00020 #include <glib.h>
00021 #include <sstream>
00022 #include "PluginAdapter.h"
00023 #include "UScreen.h"
00024 
00025 #include <NuxCore/Logger.h>
00026 #include <UnityCore/Variant.h>
00027 
00028 //FIXME!! Entirely stubs for now, unless we need this functionality at some point
00029 
00030 namespace
00031 {
00032 nux::logging::Logger logger("unity.plugin");
00033 }
00034 
00035 PluginAdapter* PluginAdapter::_default = 0;
00036 
00037 /* static */
00038 PluginAdapter*
00039 PluginAdapter::Default()
00040 {
00041   if (!_default)
00042     return 0;
00043   return _default;
00044 }
00045 
00046 /* static */
00047 void
00048 PluginAdapter::Initialize(CompScreen* screen)
00049 {
00050   _default = new PluginAdapter(screen);
00051 }
00052 
00053 PluginAdapter::PluginAdapter(CompScreen* screen) :
00054   m_Screen(screen),
00055   m_ExpoActionList(0),
00056   m_ScaleActionList(0),
00057   _in_show_desktop (false),
00058   _last_focused_window(nullptr)
00059 {
00060 }
00061 
00062 PluginAdapter::~PluginAdapter()
00063 {
00064 }
00065 
00066 /* A No-op for now, but could be useful later */
00067 void
00068 PluginAdapter::OnScreenGrabbed()
00069 {
00070 }
00071 
00072 void
00073 PluginAdapter::OnScreenUngrabbed()
00074 {
00075 }
00076 
00077 void
00078 PluginAdapter::NotifyResized(CompWindow* window, int x, int y, int w, int h)
00079 {
00080 }
00081 
00082 void
00083 PluginAdapter::NotifyMoved(CompWindow* window, int x, int y)
00084 {
00085 }
00086 
00087 void
00088 PluginAdapter::NotifyStateChange(CompWindow* window, unsigned int state, unsigned int last_state)
00089 {
00090 }
00091 
00092 void
00093 PluginAdapter::NotifyNewDecorationState(guint32 xid)
00094 {
00095 }
00096 
00097 void
00098 PluginAdapter::Notify(CompWindow* window, CompWindowNotify notify)
00099 {
00100 }
00101 
00102 void
00103 PluginAdapter::NotifyCompizEvent(const char* plugin, const char* event, CompOption::Vector& option)
00104 {
00105 }
00106 
00107 void
00108 MultiActionList::AddNewAction(CompAction* a, bool primary)
00109 {
00110 }
00111 
00112 void
00113 MultiActionList::RemoveAction(CompAction* a)
00114 {
00115 }
00116 
00117 void
00118 MultiActionList::InitiateAll(CompOption::Vector& extraArgs, int state)
00119 {
00120 }
00121 
00122 void
00123 MultiActionList::TerminateAll(CompOption::Vector& extraArgs)
00124 {
00125 }
00126 
00127 unsigned long long 
00128 PluginAdapter::GetWindowActiveNumber (guint32 xid)
00129 {
00130   return 0;
00131 }
00132 
00133 void
00134 PluginAdapter::SetExpoAction(MultiActionList& expo)
00135 {
00136 }
00137 
00138 void
00139 PluginAdapter::SetScaleAction(MultiActionList& scale)
00140 {
00141 }
00142 
00143 std::string
00144 PluginAdapter::MatchStringForXids(std::vector<Window> *windows)
00145 {
00146   return "";
00147 }
00148 
00149 void
00150 PluginAdapter::InitiateScale(std::string const& match, int state)
00151 {
00152 }
00153 
00154 void
00155 PluginAdapter::TerminateScale()
00156 {
00157 }
00158 
00159 bool
00160 PluginAdapter::IsScaleActive()
00161 {
00162   return false;
00163 }
00164 
00165 bool
00166 PluginAdapter::IsScaleActiveForGroup()
00167 {
00168   return false;
00169 }
00170 
00171 bool
00172 PluginAdapter::IsExpoActive()
00173 {
00174   return false;
00175 }
00176 
00177 void
00178 PluginAdapter::InitiateExpo()
00179 {
00180 }
00181 
00182 // WindowManager implementation
00183 guint32
00184 PluginAdapter::GetActiveWindow()
00185 {
00186   return 0;
00187 }
00188 
00189 bool
00190 PluginAdapter::IsWindowMaximized(guint xid)
00191 {
00192   return false;
00193 }
00194 
00195 bool
00196 PluginAdapter::IsWindowDecorated(guint32 xid)
00197 {
00198   return false;
00199 }
00200 
00201 bool
00202 PluginAdapter::IsWindowOnCurrentDesktop(guint32 xid)
00203 {
00204   return false;
00205 }
00206 
00207 bool
00208 PluginAdapter::IsWindowObscured(guint32 xid)
00209 {
00210   return false;
00211 }
00212 
00213 bool
00214 PluginAdapter::IsWindowMapped(guint32 xid)
00215 {
00216   return false;
00217 }
00218 
00219 bool
00220 PluginAdapter::IsWindowVisible(guint32 xid)
00221 {
00222   return false;
00223 }
00224 
00225 bool
00226 PluginAdapter::IsWindowOnTop(guint32 xid)
00227 {
00228   return false;
00229 }
00230 
00231 bool
00232 PluginAdapter::IsWindowClosable(guint32 xid)
00233 {
00234   return false;
00235 }
00236 
00237 bool
00238 PluginAdapter::IsWindowMinimizable(guint32 xid)
00239 {
00240   return false;
00241 }
00242 
00243 bool
00244 PluginAdapter::IsWindowMaximizable(guint32 xid)
00245 {
00246   return false;
00247 }
00248 
00249 void
00250 PluginAdapter::Restore(guint32 xid)
00251 {
00252 }
00253 
00254 void
00255 PluginAdapter::RestoreAt(guint32 xid, int x, int y)
00256 {
00257 }
00258 
00259 void
00260 PluginAdapter::Minimize(guint32 xid)
00261 {
00262 }
00263 
00264 void
00265 PluginAdapter::Close(guint32 xid)
00266 {
00267 }
00268 
00269 void
00270 PluginAdapter::Activate(guint32 xid)
00271 {
00272 }
00273 
00274 void
00275 PluginAdapter::Raise(guint32 xid)
00276 {
00277 }
00278 
00279 void
00280 PluginAdapter::Lower(guint32 xid)
00281 {
00282 }
00283 
00284 void 
00285 PluginAdapter::FocusWindowGroup(std::vector<Window> window_ids, FocusVisibility focus_visibility, int monitor, bool only_top_win)
00286 {
00287 }
00288 
00289 bool 
00290 PluginAdapter::ScaleWindowGroup(std::vector<Window> windows, int state, bool force)
00291 {
00292   return false;
00293 }
00294 
00295 void 
00296 PluginAdapter::SetWindowIconGeometry(Window window, nux::Geometry const& geo)
00297 {
00298 }
00299 
00300 void
00301 PluginAdapter::ShowDesktop()
00302 {
00303 }
00304 
00305 void
00306 PluginAdapter::OnShowDesktop()
00307 {
00308 }
00309 
00310 void
00311 PluginAdapter::OnLeaveDesktop()
00312 {
00313 }
00314 
00315 int
00316 PluginAdapter::GetWindowMonitor(guint32 xid) const
00317 {
00318   return -1;
00319 }
00320 
00321 nux::Geometry
00322 PluginAdapter::GetWindowGeometry(guint32 xid) const
00323 {
00324   nux::Geometry geo(0, 0, 1, 1);
00325   return geo;
00326 }
00327 
00328 nux::Geometry
00329 PluginAdapter::GetWindowSavedGeometry(guint32 xid) const
00330 {
00331   nux::Geometry geo(0, 0, 1, 1);
00332   return geo;
00333 }
00334 
00335 nux::Geometry 
00336 PluginAdapter::GetScreenGeometry() const
00337 {
00338   nux::Geometry geo(0, 0, 1, 1);
00339   return geo;  
00340 }
00341 
00342 nux::Geometry 
00343 PluginAdapter::GetWorkAreaGeometry(guint32 xid) const
00344 {
00345   nux::Geometry geo(0, 0, 1, 1);
00346   return geo;
00347 }
00348 
00349 bool
00350 PluginAdapter::CheckWindowIntersection(nux::Geometry const& region, CompWindow* window)
00351 {
00352   return false;
00353 }
00354 
00355 void 
00356 PluginAdapter::CheckWindowIntersections (nux::Geometry const& region, bool &active, bool &any)
00357 {
00358 }
00359 
00360 int
00361 PluginAdapter::WorkspaceCount()
00362 {
00363   return 4;
00364 }
00365 
00366 void
00367 PluginAdapter::SetMwmWindowHints(Window xid, MotifWmHints* new_hints)
00368 {
00369 }
00370 
00371 void
00372 PluginAdapter::Decorate(guint32 xid)
00373 {
00374 }
00375 
00376 void
00377 PluginAdapter::Undecorate(guint32 xid)
00378 {
00379 }
00380 
00381 bool
00382 PluginAdapter::IsScreenGrabbed()
00383 {
00384   return false;
00385 }
00386 
00387 bool
00388 PluginAdapter::IsViewPortSwitchStarted()
00389 {
00390   return false;
00391 }
00392 
00393 /* Returns true if the window was maximized */
00394 bool PluginAdapter::MaximizeIfBigEnough(CompWindow* window)
00395 {
00396   return true;
00397 }
00398 
00399 void
00400 PluginAdapter::ShowGrabHandles(CompWindow* window, bool use_timer)
00401 {
00402 }
00403 
00404 void
00405 PluginAdapter::HideGrabHandles(CompWindow* window)
00406 {
00407 }
00408 
00409 void
00410 PluginAdapter::ToggleGrabHandles(CompWindow* window)
00411 {
00412 }
00413 
00414 void
00415 PluginAdapter::SetCoverageAreaBeforeAutomaximize(float area)
00416 {
00417 }
00418 
00419 bool
00420 PluginAdapter::saveInputFocus()
00421 {
00422   return false;
00423 }
00424 
00425 bool
00426 PluginAdapter::restoreInputFocus()
00427 {
00428   return false;
00429 }
00430 
00431 void
00432 PluginAdapter::MoveResizeWindow(guint32 xid, nux::Geometry geometry)
00433 {
00434 }
00435 
00436 void
00437 PluginAdapter::OnWindowClosed(CompWindow *w)
00438 {
00439 }
00440 
00441 void
00442 PluginAdapter::AddProperties(GVariantBuilder* builder)
00443 {
00444   unity::variant::BuilderWrapper wrapper(builder);
00445   wrapper.add(GetScreenGeometry())
00446          .add("workspace_count", WorkspaceCount())
00447          .add("active_window", GetActiveWindow())
00448          .add("screen_grabbed", IsScreenGrabbed())
00449          .add("scale_active", IsScaleActive())
00450          .add("scale_active_for_group", IsScaleActiveForGroup())
00451          .add("expo_active", IsExpoActive())
00452          .add("viewport_switch_running", IsViewPortSwitchStarted())
00453          .add("showdesktop_active", _in_show_desktop);
00454 }