summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorDennis Kasprzyk <onestone@opencompositing.org>2008-08-06 14:39:07 +0200
committerDennis Kasprzyk <onestone@opencompositing.org>2008-08-06 14:39:07 +0200
commit9c76f36894f1f825aa01f519e2b364b979c32a26 (patch)
treeeec49bb1794ee6570acb47a30a9ddc695198e57e /src/main.cpp
parent0e942665257980878d6271cbcad4647d04204093 (diff)
downloadunity-window-decorator-9c76f36894f1f825aa01f519e2b364b979c32a26.tar.gz
unity-window-decorator-9c76f36894f1f825aa01f519e2b364b979c32a26.tar.bz2
Conversion ob main classes to C++.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp66
1 files changed, 9 insertions, 57 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 6ca3bb4..3629c88 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -98,59 +98,6 @@ usage (void)
programName);
}
-void
-compLogMessage (CompDisplay *d,
- const char *componentName,
- CompLogLevel level,
- const char *format,
- ...)
-{
- va_list args;
- char message[2048];
-
- va_start (args, format);
-
- vsnprintf (message, 2048, format, args);
-
- if (d)
- (*d->logMessage) (d, componentName, level, message);
- else
- logMessage (d, componentName, level, message);
-
- va_end (args);
-}
-
-void
-logMessage (CompDisplay *d,
- const char *componentName,
- CompLogLevel level,
- const char *message)
-{
- fprintf (stderr, "%s (%s) - %s: %s\n",
- programName, componentName,
- logLevelToString (level), message);
-}
-
-const char *
-logLevelToString (CompLogLevel level)
-{
- switch (level) {
- case CompLogLevelFatal:
- return "Fatal";
- case CompLogLevelError:
- return "Error";
- case CompLogLevelWarn:
- return "Warn";
- case CompLogLevelInfo:
- return "Info";
- case CompLogLevelDebug:
- return "Debug";
- default:
- break;
- }
-
- return "Unknown";
-}
static void
signalHandler (int sig)
@@ -425,21 +372,26 @@ main (int argc, char **argv)
compAddMetadataFromFile (&coreMetadata, "core");
- if (!initCore ())
+ core = new CompCore();
+
+ if (!core)
+ return 1;
+
+ if (!core->init ())
return 1;
if (!disableSm)
initSession (clientId);
- if (!addDisplay (displayName))
+ if (!core->addDisplay (displayName))
return 1;
- eventLoop ();
+ core->eventLoop ();
if (!disableSm)
closeSession ();
- finiCore ();
+ delete core;
compFiniMetadata (&coreMetadata);
xmlCleanupParser ();