From Compiz
I thought I would write a quick post to explain the differences as far as a plugin developer is concerned. These are the problems that I have fixed to get all of the plugins working. There are other differences which I do not know about.
Contents |
The header file
Starting with the easy and obvious, change the header file from beryl.h to compiz.h.
vTable differences
The vTable is different in a few minor ways. Beryl's vTable is bigger and has the version done in a different way. To change from Beryl to Compiz, do this.
Remove the last 2 entries, they will be BERYL_ABI_INFO and something like "beryl-core". Remember to delete the trailing comma too.
Add a function called <plugin_name>GetVersion (just copy from a Compiz plugin and change the name). Then add this after the long description.
Action differences
There are 2 related changes to the actions which need to be changed before they will work.
Firstly, in Beryl there is no keycode member of the CompAction, instead there is keysym. This means that the function used to get this is slightly different to Compiz.
In Beryl:
o->value.action.key.keysym = XStringToKeysym (PLUGIN_OPTION_KEY_DEFAULT);
In Compiz:
o->value.action.key.keycode = XKeysymToKeycode (display, XStringToKeysym (PLUGIN_OPTION_KEY_DEFAULT));
Just change the keysym to keycode and add the XKeysymToKeycode function.
Secondly, now you have added that function which takes display, you must re-add the Display *display parameter to the <plugin_name>Display/ScreenInitOptions function. Then you need to find all occurances of that function and add the extra parameter where it is called. NOTE: This is a Display not a CompDisplay. The Display is a held in the display member of the CompDisplay.
Option changes
Each beryl option now has 3 extra members for their settings system. They are group, subGroup and displayHints. They look like this.
o->group = N_("");
o->subGroup = N_("");
o->displayHints = "";
Just delete then, they are no use to us.
pointerX/Y
For some reason, in Beryl the pointerX and pointerY are stored as members of CompDisplay rather than being global. Just remove the d-> from any references to d->pointerX.
PAINT_SCREEN_ORDER_BACK_TO_FRONT_MASK
As far as I know this is exactly the same as PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK, all the plugins seem to work the same way with it replaced with this.
This is 99% of the changes that are required for most of the plugins. The rest of the work that I have done has been fixing bugs which somehow work in Beryl but fail in Compiz. I know for sure of 1 bug in Beryl which allows plugin developers to write sloppy code. There seem to be a few others too.
