1 /* 2 * Compiz configuration system library 3 * 4 * Copyright (C) 2007 Dennis Kasprzyk <onestone@opencompositing.org> 5 * Copyright (C) 2007 Danny Baumann <maniac@opencompositing.org> 6 * 7 * This library is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU Lesser General Public 9 * License as published by the Free Software Foundation; either 10 * version 2.1 of the License, or (at your option) any later version. 11 12 * This library is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 * Lesser General Public License for more details. 16 17 * You should have received a copy of the GNU Lesser General Public 18 * License along with this library; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 */ 21 22 #ifndef CCS_BACKEND_H 23 #define CCS_BACKEND_H 24 25 #include <ccs.h> 26 27 typedef struct _CCSBackend CCSBackend; 28 typedef struct _CCSBackendVTable CCSBackendVTable; 29 30 struct _CCSBackend 31 { 32 void *dlhand; 33 CCSBackendVTable *vTable; 34 }; 35 36 typedef CCSBackendVTable * (*BackendGetInfoProc) (void); 37 38 typedef void (*CCSExecuteEventsFunc) (unsigned int flags); 39 40 typedef Bool (*CCSInitBackendFunc) (CCSContext * context); 41 typedef Bool (*CCSFiniBackendFunc) (CCSContext * context); 42 43 typedef Bool (*CCSContextReadInitFunc) (CCSContext * context); 44 typedef void (*CCSContextReadSettingFunc) 45 (CCSContext * context, CCSSetting * setting); 46 typedef void (*CCSContextReadDoneFunc) (CCSContext * context); 47 48 typedef Bool (*CCSContextWriteInitFunc) (CCSContext * context); 49 typedef void (*CCSContextWriteSettingFunc) 50 (CCSContext * context, CCSSetting * setting); 51 typedef void (*CCSContextWriteDoneFunc) (CCSContext * context); 52 53 typedef Bool (*CCSGetIsIntegratedFunc) (CCSSetting * setting); 54 typedef Bool (*CCSGetIsReadOnlyFunc) (CCSSetting * setting); 55 56 typedef CCSStringList (*CCSGetExistingProfilesFunc) (CCSContext * context); 57 typedef Bool (*CCSDeleteProfileFunc) (CCSContext * context, char * name); 58 59 struct _CCSBackendVTable 60 { 61 char *name; 62 char *shortDesc; 63 char *longDesc; 64 Bool integrationSupport; 65 Bool profileSupport; 66 67 /* something like a event loop call for the backend, 68 so it can check for file changes (gconf changes in the gconf backend) 69 no need for reload settings signals anymore */ 70 CCSExecuteEventsFunc executeEvents; 71 72 CCSInitBackendFunc backendInit; 73 CCSFiniBackendFunc backendFini; 74 75 CCSContextReadInitFunc readInit; 76 CCSContextReadSettingFunc readSetting; 77 CCSContextReadDoneFunc readDone; 78 79 CCSContextWriteInitFunc writeInit; 80 CCSContextWriteSettingFunc writeSetting; 81 CCSContextWriteDoneFunc writeDone; 82 83 84 CCSGetIsIntegratedFunc getSettingIsIntegrated; 85 CCSGetIsReadOnlyFunc getSettingIsReadOnly; 86 87 CCSGetExistingProfilesFunc getExistingProfiles; 88 CCSDeleteProfileFunc deleteProfile; 89 }; 90 91 CCSBackendVTable* getBackendInfo (void); 92 93 #endif 94