summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <smspillaz@gmail.com>2011-01-05 00:53:06 +0800
committerSam Spilsbury <smspillaz@gmail.com>2011-01-05 00:53:06 +0800
commitc3c811f3af966df8f882cb785bf3c2aa0bc57c57 (patch)
treea6bfa313f3307f9af7a955ac15c562f79bd47c65
parent2bc1923009dc9e37b982b3914f320340a03cb933 (diff)
downloadcompiz-with-glib-mainloop-c3c811f3af966df8f882cb785bf3c2aa0bc57c57.tar.gz
compiz-with-glib-mainloop-c3c811f3af966df8f882cb785bf3c2aa0bc57c57.tar.bz2
Remove glib plugin.
It conflicts with this branch
-rw-r--r--plugins/glib/CMakeLists.txt5
-rw-r--r--plugins/glib/glib.xml.in14
-rw-r--r--plugins/glib/src/glib.cpp177
-rw-r--r--plugins/glib/src/private.h77
4 files changed, 0 insertions, 273 deletions
diff --git a/plugins/glib/CMakeLists.txt b/plugins/glib/CMakeLists.txt
deleted file mode 100644
index 3133d9a..0000000
--- a/plugins/glib/CMakeLists.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-find_package (Compiz REQUIRED)
-
-include (CompizPlugin)
-
-compiz_plugin (glib PKGDEPS glib-2.0)
diff --git a/plugins/glib/glib.xml.in b/plugins/glib/glib.xml.in
deleted file mode 100644
index 66f688a..0000000
--- a/plugins/glib/glib.xml.in
+++ /dev/null
@@ -1,14 +0,0 @@
-<compiz>
- <plugin name="glib">
- <_short>GLib</_short>
- <_long>GLib main loop support</_long>
- <category>General</category>
- <deps>
- <relation type="after">
- <plugin>composite</plugin>
- <plugin>opengl</plugin>
- <plugin>decor</plugin>
- </relation>
- </deps>
- </plugin>
-</compiz>
diff --git a/plugins/glib/src/glib.cpp b/plugins/glib/src/glib.cpp
deleted file mode 100644
index 7c56ab0..0000000
--- a/plugins/glib/src/glib.cpp
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright © 2007 Novell, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without
- * fee, provided that the above copyright notice appear in all copies
- * and that both that copyright notice and this permission notice
- * appear in supporting documentation, and that the name of
- * Novell, Inc. not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior permission.
- * Novell, Inc. makes no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
- * NO EVENT SHALL NOVELL, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
- * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: David Reveman <davidr@novell.com>
- */
-
-#include "private.h"
-
-COMPIZ_PLUGIN_20090315 (glib, GlibPluginVTable);
-
-GlibScreen::GlibScreen (CompScreen *screen) :
- PluginClassHandler <GlibScreen, CompScreen> (screen),
- mFds (0),
- mFdsSize (0),
- mNFds (0),
- mWatch (0)
-{
- mTimer.setCallback (boost::bind (&GlibScreen::dispatchAndPrepare, this));
-
- mNotifyAtom = XInternAtom (screen->dpy (), "_COMPIZ_GLIB_NOTIFY", 0);
-
- prepare (g_main_context_default ());
-
- ScreenInterface::setHandler (screen, true);
-}
-
-GlibScreen::~GlibScreen ()
-{
- dispatch (g_main_context_default ());
-
- if (mFds)
- delete[] mFds;
- if (mWatch)
- delete[] mWatch;
-}
-
-bool
-GlibPluginVTable::init ()
-{
- if (!CompPlugin::checkPluginABI ("core", CORE_ABIVERSION))
- return false;
-
- return true;
-}
-
-
-void
-GlibScreen::dispatch (GMainContext *context)
-{
- int i;
-
- g_main_context_check (context, mMaxPriority, mFds, mNFds);
- g_main_context_dispatch (context);
-
- for (i = 0; i < mNFds; i++)
- screen->removeWatchFd (mWatch[i].handle);
-}
-
-void
-GlibScreen::prepare (GMainContext *context)
-{
- int nFds = 0;
- int timeout = -1;
- int i;
-
- g_main_context_prepare (context, &mMaxPriority);
-
- do
- {
- if (nFds > mFdsSize)
- {
- if (mFds)
- delete[] mFds;
- if (mWatch)
- delete[] mWatch;
-
- mFds = new GPollFD [nFds];
- if (!mFds)
- {
- mWatch = NULL;
- mFdsSize = 0;
- break;
- }
-
- mWatch = new GLibWatch [nFds];
- if (!mWatch)
- {
- delete[] mFds;
- mFds = NULL;
- mFdsSize = 0;
- break;
- }
-
- mFdsSize = nFds;
- }
-
- nFds = g_main_context_query (context,
- mMaxPriority,
- &timeout,
- mFds,
- mFdsSize);
- } while (nFds > mFdsSize);
-
- if (timeout < 0)
- timeout = INT_MAX;
-
- for (i = 0; i < nFds; i++)
- {
- mWatch[i].index = i;
- mWatch[i].handle =
- screen->addWatchFd (mFds[i].fd, mFds[i].events,
- boost::bind (&GlibScreen::collectEvents, this,
- _1, &mWatch[i]));
- }
-
- mNFds = nFds;
- mTimer.start (timeout);
-}
-
-
-
-bool
-GlibScreen::dispatchAndPrepare ()
-{
- GMainContext *context = g_main_context_default ();
-
- dispatch (context);
- prepare (context);
-
- return false;
-}
-
-void
-GlibScreen::wakeup ()
-{
- mTimer.start (0);
-}
-
-void
-GlibScreen::collectEvents (short int revents,
- GLibWatch *w)
-{
- mFds[w->index].revents |= revents;
-
- wakeup ();
-}
-
-void
-GlibScreen::handleEvent (XEvent *event)
-{
- if (event->type == ClientMessage)
- {
- if (event->xclient.message_type == mNotifyAtom)
- wakeup ();
- }
-
- screen->handleEvent (event);
-}
diff --git a/plugins/glib/src/private.h b/plugins/glib/src/private.h
deleted file mode 100644
index 4ccd458..0000000
--- a/plugins/glib/src/private.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright © 2007 Novell, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without
- * fee, provided that the above copyright notice appear in all copies
- * and that both that copyright notice and this permission notice
- * appear in supporting documentation, and that the name of
- * Novell, Inc. not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior permission.
- * Novell, Inc. makes no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
- * NO EVENT SHALL NOVELL, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
- * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: David Reveman <davidr@novell.com>
- */
-
-#include <core/core.h>
-#include <core/timer.h>
-#include <core/pluginclasshandler.h>
-
-#include <glib.h>
-
-class GLibWatch {
- public:
- CompWatchFdHandle handle;
- int index;
-};
-
-class GlibScreen :
- public PluginClassHandler <GlibScreen, CompScreen>,
- public ScreenInterface
-{
- public:
-
- GlibScreen (CompScreen *);
- virtual ~GlibScreen ();
-
- void handleEvent (XEvent *event);
-
- private:
-
- void dispatch (GMainContext *context);
- void prepare (GMainContext *context);
-
- bool dispatchAndPrepare ();
-
- void collectEvents (short int revents, GLibWatch *w);
-
- void wakeup ();
-
-
- private:
- CompTimer mTimer;
- gint mMaxPriority;
- GPollFD *mFds;
- gint mFdsSize;
- gint mNFds;
- GLibWatch *mWatch;
- Atom mNotifyAtom;
-};
-
-class GlibPluginVTable :
- public CompPlugin::VTableForScreen <GlibScreen>
-{
- public:
-
- bool init ();
-};