Code review comment for lp://staging/~smspillaz/compiz-libcompizconfig/refactor-context

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> There's not much point to a structure that only contains a void pointer.
>
> The pattern I'd expect is:
>
> // *.h
> typedef struct CCSContext CCSContext;
> CCSContext* ccsContextCreate();
> CCSPluginList ccsContextGetPlugins(CCSContext*);
> ...
> void ccsContextDestroy(CCSContext*);
>
> // *.cpp
> struct CCSContext
> {
> CCSBackend *backend;
> CCSPluginList plugins; /* list of plugins settings were loaded for */
> CCSPluginCategory *categories; /* list of plugin categories */
> void *privatePtr; /* private pointer that can be used by the caller */
> char *profile;
> Bool deIntegration;
> Bool pluginListAutoSort;
>
> unsigned int configWatchId;
>
> CCSSettingList changedSettings; /* list of settings changed since last
> settings write */
>
> unsigned int screenNum; /* screen number this context is assigned to */
> const CCSInterfaceTable *object_interfaces;
> const CCSContextInterface *interface;
> } CCSContextPrivate;

Cut&past error - that should be "> };"

> ...
> CCSPluginList
> ccsContextGetPluginsDefault (CCSContext* context)
> {
> return context->plugins;
> }
> ...
>
> Maybe there is a reason for the extra complexity? But it escapes me.

« Back to merge proposal