summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--VERSION2
-rw-r--r--src/bcop.h1
-rw-r--r--src/code_generator.c89
-rw-r--r--src/xml_parser.c24
4 files changed, 21 insertions, 95 deletions
diff --git a/VERSION b/VERSION
index 8303ced..1d3625b 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-VERSION=0.0.1
+VERSION=0.0.2-compiz
diff --git a/src/bcop.h b/src/bcop.h
index 1f0f0d2..c3bc413 100644
--- a/src/bcop.h
+++ b/src/bcop.h
@@ -62,7 +62,6 @@ typedef enum {
} OptionType;
typedef enum {
- CodeBeryl,
CodeCompiz,
CodeNone
} CodeType;
diff --git a/src/code_generator.c b/src/code_generator.c
index 3b5de80..76341ef 100644
--- a/src/code_generator.c
+++ b/src/code_generator.c
@@ -676,21 +676,14 @@ void addActionOption(Option *o)
{
addString(&defines,"#define %s_%s_KEY_DEFAULT \"%s\"\n",
data.uName,o->uName,key);
- if (data.mode == CodeBeryl)
- addString(out,"\to->value.action.key.keysym = XStringToKeysym("
- "%s_%s_KEY_DEFAULT);\n",data.uName,o->uName);
- else
- addString(out,"\to->value.action.key.keycode = \n"
+ addString(out,"\to->value.action.key.keycode = \n"
"\t\tXKeysymToKeycode (display,\n"
"\n\nXStringToKeysym(%s_%s_KEY_DEFAULT));\n",
data.uName,o->uName);
}
else
{
- if (data.mode == CodeBeryl)
- addString(out,"\to->value.action.key.keysym = 0;\n");
- else
- addString(out,"\to->value.action.key.keycode = 0;\n");
+ addString(out,"\to->value.action.key.keycode = 0;\n");
}
}
@@ -791,24 +784,6 @@ void addOption(Option *o)
addString(out,"\to->longDesc = \"%s\";\n",o->name);
}
- if (data.mode == CodeBeryl)
- {
- if (o->hints)
- addString(out,"\to->displayHints = \"%s\";\n",o->hints);
- else
- addString(out,"\to->displayHints = \"\";\n");
-
- if (o->group)
- addString(out,"\to->group = N_(\"%s\");\n",o->group);
- else
- addString(out,"\to->group = \"\";\n");
-
- if (o->subGroup)
- addString(out,"\to->subGroup = N_(\"%s\");\n",o->subGroup);
- else
- addString(out,"\to->subGroup = \"\";\n");
- }
-
addString(outs,"\tcase %s:\n",o->temp);
switch (o->type)
@@ -926,27 +901,14 @@ void addDisplayOptions()
"\tCompOption *o;\n\tint index;\n\n"
"\t%s_OPTIONS_DISPLAY(display);\n\n",data.name,data.uName);
- if (data.mode == CodeBeryl)
- {
- addString(&initDisplay,"\t%sOptionsDisplayInitOptions(od);\n\n",
- data.name);
+ addString(&initDisplay,"\t%sOptionsDisplayInitOptions"
+ "(od, d->display);\n\n", data.name);
- addString(&initDisplayOpt,"static void %sOptionsDisplayInitOptions"
- "(%sOptionsDisplay * od)\n{\n"
- "\tCompOption *o;\n\tint i;\n\ti = 0;\n\n",
- data.name,data.fUName);
- }
- else
- {
- addString(&initDisplay,"\t%sOptionsDisplayInitOptions"
- "(od, d->display);\n\n", data.name);
+ addString(&initDisplayOpt,"static void %sOptionsDisplayInitOptions"
+ "(%sOptionsDisplay * od, Display *display)\n{\n"
+ "\tCompOption *o;\n\tint i;\n\ti = 0;\n\n",
+ data.name,data.fUName);
- addString(&initDisplayOpt,"static void %sOptionsDisplayInitOptions"
- "(%sOptionsDisplay * od, Display *display)\n{\n"
- "\tCompOption *o;\n\tint i;\n\ti = 0;\n\n",
- data.name,data.fUName);
- }
-
addString(&hdefines,"typedef enum\n"
"{\n");
@@ -1003,30 +965,8 @@ void addDisplayOptions()
addString(&initDisplayOpt,"}\n\n");
- if (data.mode == CodeBeryl)
- addString(&setDisplayOpt,"static CompOption *%sOptionsGetDisplayOptions"
- "(CompDisplay * d, int *count)\n{\n"
- "\tCompOption *pOpt = NULL;\n\tint pOptNum = 0;\n"
- "\tif (%sPluginVTable && %sPluginVTable->getDisplayOptions)\n"
- "\t\tpOpt = %sPluginVTable->getDisplayOptions(d,&pOptNum);\n\n"
- "\t%sOptionsDisplay *od;\n"
- "\tif (d)\n\t\tod = GET_%s_OPTIONS_DISPLAY(d);\n"
- "\telse\n\t{\n\t\tod = calloc(1,sizeof(%sOptionsDisplay));\n"
- "\t\t%sOptionsDisplayInitOptions(od);\n\t}\n\n"
- "\tif (!pOptNum)\n\t{\n\t\t*count = %sDisplayOptionNum;\n"
- "\t\treturn od->opt;\n\t}\n\n"
- "\tint sOptSize = sizeof(CompOption) * %sDisplayOptionNum;\n"
- "\tint pOptSize = sizeof(CompOption) * pOptNum;\n\n"
- "\tif (!od->mOpt)\n"
- "\t\tod->mOpt = malloc(sOptSize + pOptSize);\n\n"
- "\tmemcpy(od->mOpt,od->opt,sOptSize);\n"
- "\tmemcpy(od->mOpt + %sDisplayOptionNum,pOpt,pOptSize);\n\n"
- "\t*count = %sDisplayOptionNum + pOptNum;\n"
- "\treturn od->mOpt;\n}\n\n",
- data.name,data.name,data.name,data.name,data.fUName,data.uName,
- data.fUName,data.name,data.fUName,data.fUName,data.fUName,data.fUName);
- else
- addString(&setDisplayOpt,"static CompOption *%sOptionsGetDisplayOptions"
+
+ addString(&setDisplayOpt,"static CompOption *%sOptionsGetDisplayOptions"
"(CompDisplay * d, int *count)\n{\n"
"\tCompOption *pOpt = NULL;\n\tint pOptNum = 0;\n"
"\tif (%sPluginVTable && %sPluginVTable->getDisplayOptions)\n"
@@ -1045,7 +985,7 @@ void addDisplayOptions()
"\treturn od->mOpt;\n}\n\n",
data.name,data.name,data.name,data.name,data.fUName,data.uName,
data.fUName,data.fUName,data.fUName,data.fUName);
-
+
}
addString(&displayStruct,"} %sOptionsDisplay;\n\n",data.fUName);
@@ -1160,14 +1100,11 @@ void addScreenOptions()
void finilizeCode()
{
-
+
addString(&file,"#include <stdio.h>\n#include <stdlib.h>\n"
"#include <string.h>\n\n");
- if (data.mode == CodeBeryl)
- addString(&file,"#include <beryl.h>\n\n");
- else
- addString(&file,"#include <compiz.h>\n\n");
+ addString(&file,"#include <compiz.h>\n\n");
addString(&file,"#define _%s_OPTIONS_INTERNAL\n"
"#include \"%s\"\n\n",
diff --git a/src/xml_parser.c b/src/xml_parser.c
index 28f84dd..63eee6d 100644
--- a/src/xml_parser.c
+++ b/src/xml_parser.c
@@ -17,7 +17,7 @@
* GNU General Public License for more details.
*
*/
-
+
#ifdef HAVE_CONFIG_H
# include "../config.h"
#endif
@@ -853,7 +853,7 @@ char * strToCamel(char *str)
}
free (lowString);
-
+
return buffer;
}
@@ -863,7 +863,6 @@ static void usage(void)
printf("Options:\n");
printf(" -h, --help display this help message\n");
printf(" -v, --version print version information\n");
- printf(" -b, --beryl generate beryl compatible code (default)\n");
printf(" -c, --compiz generate compiz compatible code\n");
printf(" -q, --quiet don't print informational messages\n");
printf(" --source=<file> source file name\n");
@@ -877,7 +876,7 @@ static void usage(void)
#define OPT_QUIET 'q'
#define OPT_SOURCE 1
#define OPT_HEADER 2
-
+
int main(int argc, char **argv)
{
xmlDoc *doc = NULL;
@@ -885,19 +884,18 @@ int main(int argc, char **argv)
programName = argv[0];
char *src = NULL;
char *hdr = NULL;
-
+
char sopts[] = "hvbcq";
struct option lopts[] = {
{"help", 0, 0, OPT_HELP},
{"version", 0, 0, OPT_VERSION},
- {"beryl", 0, 0, OPT_BERYL},
{"compiz", 0, 0, OPT_COMPIZ},
{"quiet", 0, &quiet, OPT_QUIET},
{"source", 1, 0, OPT_SOURCE},
{"header", 1, 0, OPT_HEADER},
{0, 0, 0, 0}
};
-
+
if (argc < 2)
{
usage();
@@ -917,14 +915,6 @@ int main(int argc, char **argv)
case OPT_VERSION:
printf(PACKAGE_STRING "\n");
return 0;
- case OPT_BERYL:
- if (data.mode != CodeNone)
- {
- fprintf(stderr,"%s: can only generate output for one composite manager\n",programName);
- return 1;
- }
- data.mode = CodeBeryl;
- break;
case OPT_COMPIZ:
if (data.mode != CodeNone)
{
@@ -953,7 +943,7 @@ int main(int argc, char **argv)
}
if (data.mode == CodeNone)
- data.mode = CodeBeryl;
+ data.mode = CodeCompiz;
fileName = argv[argc-1];
@@ -991,7 +981,7 @@ int main(int argc, char **argv)
sprintf(str,"%s_options.h",prefix);
hdr = strdup(str);
}
-
+
int rv = error;
if (!error)
rv = genCode(src,hdr);