summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorDennis Kasprzyk <onestone@compiz-fusion.org>2008-08-27 15:08:10 +0200
committerDennis Kasprzyk <onestone@compiz-fusion.org>2008-08-27 15:08:10 +0200
commitac82488c022665492713d633d832480063f67067 (patch)
treeab9e230bc8ad1055fe080506dfc784fc088c43cb /src/main.cpp
parentb92393878f81ec008ac7f383f63afe648bc5f80f (diff)
downloadunity-window-decorator-ac82488c022665492713d633d832480063f67067.tar.gz
unity-window-decorator-ac82488c022665492713d633d832480063f67067.tar.bz2
Moved composite handling and opengl painting into separate plugins.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp75
1 files changed, 1 insertions, 74 deletions
diff --git a/src/main.cpp b/src/main.cpp
index bc27859..cb7c675 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -49,17 +49,11 @@ char *backgroundImage = NULL;
REGION emptyRegion;
REGION infiniteRegion;
-GLushort defaultColor[4] = { 0xffff, 0xffff, 0xffff, 0xffff };
-Window currentRoot = 0;
-
-int defaultRefreshRate = 50;
-const char *defaultTextureFilter = "Good";
bool shutDown = false;
bool restartSignal = false;
CompWindow *lastFoundWindow = 0;
-CompWindow *lastDamagedWindow = 0;
bool replaceCurrentWm = false;
bool indirectRendering = false;
@@ -68,9 +62,7 @@ bool noDetection = false;
bool useDesktopHints = true;
bool onlyCurrentScreen = false;
-#ifdef USE_COW
bool useCow = true;
-#endif
CompMetadata *coreMetadata = NULL;
@@ -80,8 +72,6 @@ usage (void)
printf ("Usage: %s "
"[--display DISPLAY] "
"[--bg-image PNG] "
- "[--refresh-rate RATE]\n "
- "[--fast-filter] "
"[--indirect-rendering] "
"[--loose-binding] "
"[--replace]\n "
@@ -90,13 +80,7 @@ usage (void)
"[--no-detection]\n "
"[--ignore-desktop-hints] "
"[--only-current-screen]"
-
-#ifdef USE_COW
" [--use-root-window]\n "
-#else
- "\n "
-#endif
-
"[--version] "
"[--help] "
"[PLUGIN]...\n",
@@ -127,8 +111,6 @@ signalHandler (int sig)
typedef struct _CompIOCtx {
unsigned int offset;
char *pluginData;
- char *textureFilterData;
- char *refreshRateData;
} CompIOCtx;
static int
@@ -152,9 +134,6 @@ readCoreXmlCallback (void *context,
if (ctx->pluginData)
info.data = ctx->pluginData;
break;
- case COMP_DISPLAY_OPTION_TEXTURE_FILTER:
- if (ctx->textureFilterData)
- info.data = ctx->textureFilterData;
default:
break;
}
@@ -163,28 +142,9 @@ readCoreXmlCallback (void *context,
buffer + i, length - i);
}
- i += CompMetadata::readXmlChunk ("</display><screen>", &offset,
+ i += CompMetadata::readXmlChunk ("</display></core></compiz>", &offset,
buffer + i, length - 1);
- for (j = 0; j < COMP_SCREEN_OPTION_NUM; j++)
- {
- CompMetadata::OptionInfo info = coreScreenOptionInfo[j];
-
- switch (j) {
- case COMP_SCREEN_OPTION_REFRESH_RATE:
- if (ctx->refreshRateData)
- info.data = ctx->refreshRateData;
- default:
- break;
- }
-
- i += CompMetadata::readXmlChunkFromOptionInfo (&info, &offset,
- buffer + i, length - i);
- }
-
- i += CompMetadata::readXmlChunk ("</screen></core></compiz>", &offset,
- buffer + i, length - i);
-
if (!offset && length > (int)i)
buffer[i++] = '\0';
@@ -202,7 +162,6 @@ main (int argc, char **argv)
int i, nPlugin = 0;
Bool disableSm = FALSE;
char *clientId = NULL;
- char *refreshRateArg = NULL;
programName = argv[0];
programArgc = argc;
@@ -247,22 +206,6 @@ main (int argc, char **argv)
if (i + 1 < argc)
displayName = argv[++i];
}
- else if (!strcmp (argv[i], "--refresh-rate"))
- {
- if (i + 1 < argc)
- {
- refreshRateArg = programArgv[++i];
- defaultRefreshRate = atoi (refreshRateArg);
- defaultRefreshRate = RESTRICT_VALUE (defaultRefreshRate,
- 1, 1000);
- }
- }
- else if (!strcmp (argv[i], "--fast-filter"))
- {
- ctx.textureFilterData =
- const_cast<char *> ("<default>Fast</default>");
- defaultTextureFilter = "Fast";
- }
else if (!strcmp (argv[i], "--indirect-rendering"))
{
indirectRendering = TRUE;
@@ -279,14 +222,10 @@ main (int argc, char **argv)
{
onlyCurrentScreen = TRUE;
}
-
-#ifdef USE_COW
else if (!strcmp (argv[i], "--use-root-window"))
{
useCow = FALSE;
}
-#endif
-
else if (!strcmp (argv[i], "--replace"))
{
replaceCurrentWm = TRUE;
@@ -321,15 +260,6 @@ main (int argc, char **argv)
}
}
- if (refreshRateArg)
- {
- ctx.refreshRateData = (char *) malloc (strlen (refreshRateArg) + 256);
- if (ctx.refreshRateData)
- sprintf (ctx.refreshRateData,
- "<min>1</min><default>%s</default>",
- refreshRateArg);
- }
-
if (nPlugin)
{
int size = 256;
@@ -360,9 +290,6 @@ main (int argc, char **argv)
if (!coreMetadata->addFromIO (readCoreXmlCallback, NULL, &ctx))
return 1;
- if (ctx.refreshRateData)
- free (ctx.refreshRateData);
-
if (ctx.pluginData)
free (ctx.pluginData);