Guest User

Untitled

a guest
May 17th, 2018
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.58 KB | None | 0 0
  1. diff --git a/src/compizconfig.pyx b/src/compizconfig.pyx
  2. index d306a88..ace260d 100644
  3. --- a/src/compizconfig.pyx
  4. +++ b/src/compizconfig.pyx
  5. @@ -1,25 +1,34 @@
  6. -'''
  7. -This program is free software; you can redistribute it and/or
  8. -modify it under the terms of the GNU Lesser General Public License
  9. -as published by the Free Software Foundation; either version 2
  10. -of the License, or (at your option) any later version.
  11. -
  12. -This program 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
  15. -GNU General Public License for more details.
  16. -
  17. -You should have received a copy of the GNU Lesser General Public License
  18. -along with this program; if not, write to the Free Software
  19. -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  20. -
  21. -Authors:
  22. - Quinn Storm (quinn@beryl-project.org)
  23. - Patrick Niklaus (marex@opencompositing.org)
  24. - Guillaume Seguin (guillaume@segu.in)
  25. -Copyright (C) 2007 Quinn Storm
  26. -'''
  27. -
  28. +# This program is free software; you can redistribute it and/or
  29. +# modify it under the terms of the GNU Lesser General Public License
  30. +# as published by the Free Software Foundation; either version 2
  31. +# of the License, or (at your option) any later version.
  32. +#
  33. +# This program is distributed in the hope that it will be useful,
  34. +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  35. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  36. +# GNU General Public License for more details.
  37. +#
  38. +# You should have received a copy of the GNU Lesser General Public License
  39. +# along with this program; if not, write to the Free Software
  40. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  41. +#
  42. +# Authors:
  43. +# Quinn Storm (quinn@beryl-project.org)
  44. +# Patrick Niklaus (marex@opencompositing.org)
  45. +# Guillaume Seguin (guillaume@segu.in)
  46. +# Copyright (C) 2007 Quinn Storm
  47. +
  48. +"""Python bindings to libcompizconfig.
  49. +
  50. +All functionality of compizconfig must be accessed by creating a L{Context}.
  51. +
  52. + >>> import compizconfig
  53. + >>> context = compizconfig.Context()
  54. + >>> print context.Plugins['core'].Name
  55. + 'core'
  56. +
  57. +
  58. +"""
  59. ctypedef unsigned int Bool
  60.  
  61. cdef enum CCSSettingType:
  62. @@ -231,7 +240,7 @@ cdef struct CCSPluginConflict:
  63. CCSPluginConflictType type
  64. CCSPluginList * plugins
  65.  
  66. -'''Context functions'''
  67. +# Context functions
  68. cdef extern void ccsSetBasicMetadata (Bool value)
  69. cdef extern CCSContext * ccsContextNew (unsigned int * screens,
  70. unsigned int numScreens)
  71. @@ -239,7 +248,7 @@ cdef extern CCSContext * ccsEmptyContextNew (unsigned int * screens,
  72. unsigned int numScreens)
  73. cdef extern void ccsContextDestroy (CCSContext * context)
  74.  
  75. -'''Plugin functions'''
  76. +# Plugin functions
  77. cdef extern Bool ccsLoadPlugin (CCSContext * context, char * name)
  78. cdef extern CCSPlugin * ccsFindPlugin (CCSContext * context, char * name)
  79. cdef extern CCSSetting * ccsFindSetting (CCSPlugin * plugin,
  80. @@ -249,14 +258,14 @@ cdef extern CCSSetting * ccsFindSetting (CCSPlugin * plugin,
  81. cdef extern CCSSettingList * ccsGetPluginSettings (CCSPlugin * plugin)
  82. cdef extern CCSGroupList * ccsGetPluginGroups (CCSPlugin * plugin)
  83.  
  84. -'''Action => String'''
  85. +# Action => String
  86. cdef extern char * ccsModifiersToString (unsigned int modMask)
  87. cdef extern char * ccsEdgesToString (unsigned int edge)
  88. cdef extern char * ccsEdgesToModString (unsigned int edge)
  89. cdef extern char * ccsKeyBindingToString (CCSSettingKeyValue *key)
  90. cdef extern char * ccsButtonBindingToString (CCSSettingButtonValue *button)
  91.  
  92. -'''String utils'''
  93. +# String utils
  94. cdef extern from 'string.h':
  95. ctypedef int size_t
  96. cdef extern char * strdup (char * s)
  97. @@ -264,7 +273,7 @@ cdef extern from 'string.h':
  98. cdef extern void free (void * f)
  99. cdef extern void * malloc (size_t s)
  100.  
  101. -'''String => Action'''
  102. +# String => Action
  103. cdef extern unsigned int ccsStringToModifiers (char *binding)
  104. cdef extern unsigned int ccsStringToEdges (char *edge)
  105. cdef extern unsigned int ccsModStringToEdges (char *edge)
  106. @@ -273,7 +282,7 @@ cdef extern Bool ccsStringToKeyBinding (char * binding,
  107. cdef extern Bool ccsStringToButtonBinding (char * binding,
  108. CCSSettingButtonValue * button)
  109.  
  110. -'''General settings handling'''
  111. +# General settings handling
  112. cdef extern Bool ccsSetValue (CCSSetting * setting,
  113. CCSSettingValue * value)
  114. cdef extern void ccsFreeSettingValue (CCSSettingValue * value)
  115. @@ -283,42 +292,42 @@ cdef extern CCSSettingValueList * ccsSettingValueListAppend (
  116. cdef extern CCSSettingList *ccsSettingListFree (CCSSettingList * list,
  117. Bool freeObj)
  118.  
  119. -'''Profiles'''
  120. +# Profiles
  121. cdef extern CCSStringList * ccsGetExistingProfiles (CCSContext * context)
  122. cdef extern void ccsDeleteProfile (CCSContext * context, char * name)
  123. cdef extern void ccsSetProfile (CCSContext * context, char * name)
  124. cdef extern char* ccsGetProfile (CCSContext * context)
  125.  
  126. -'''Backends'''
  127. +# Backends
  128. cdef extern CCSBackendInfoList * ccsGetExistingBackends ()
  129. cdef extern Bool ccsSetBackend (CCSContext * context, char * name)
  130. cdef extern char* ccsGetBackend (CCSContext * context)
  131.  
  132. -'''Sorting'''
  133. +# Sorting
  134. cdef extern void ccsSetPluginListAutoSort (CCSContext *context, Bool value)
  135. cdef extern Bool ccsGetPluginListAutoSort (CCSContext *context)
  136.  
  137. -'''Integration'''
  138. +# Integration
  139. cdef extern void ccsSetIntegrationEnabled (CCSContext * context, Bool value)
  140. cdef extern Bool ccsGetIntegrationEnabled (CCSContext * context)
  141.  
  142. -'''IO handling'''
  143. +# IO handling
  144. cdef extern void ccsReadSettings (CCSContext * c)
  145. cdef extern void ccsWriteSettings (CCSContext * c)
  146. cdef extern void ccsWriteChangedSettings (CCSContext * c)
  147. cdef extern void ccsResetToDefault (CCSSetting * s)
  148.  
  149. -'''Event loop'''
  150. +# Event loop
  151. ProcessEventsNoGlibMainLoopMask = (1 << 0)
  152. cdef extern void ccsProcessEvents (CCSContext * context, unsigned int flags)
  153.  
  154. -'''Import/export'''
  155. +# Import/export
  156. cdef extern Bool ccsExportToFile (CCSContext * context, char * fileName, Bool skipDefaults)
  157. cdef extern Bool ccsImportFromFile (CCSContext * context,
  158. char * fileName,
  159. Bool overwrite)
  160.  
  161. -'''Misc. Plugin/Setting utils'''
  162. +# Misc. Plugin/Setting utils
  163. cdef extern Bool ccsSettingIsReadOnly (CCSSetting * setting)
  164. cdef extern Bool ccsSettingIsIntegrated (CCSSetting * setting)
  165.  
  166. @@ -540,6 +549,7 @@ cdef object DecodeValue (CCSSettingValue * value):
  167. return "Unhandled"
  168.  
  169. cdef class Setting:
  170. + """A representation of setting in a plugin"""
  171. cdef CCSSetting * ccsSetting
  172. cdef object info
  173. cdef Plugin plugin
  174. @@ -570,41 +580,75 @@ cdef class Setting:
  175. self.info = info
  176.  
  177. def Reset (self):
  178. + """Restore the setting's value to the default"""
  179. ccsResetToDefault (self.ccsSetting)
  180.  
  181. property Plugin:
  182. + """The L{Plugin<compizconfig.Plugin>} which owns the setting"""
  183. def __get__ (self):
  184. return self.plugin
  185.  
  186. property Name:
  187. + """The untranslated name of the setting"""
  188. def __get__ (self):
  189. return self.ccsSetting.name
  190.  
  191. property ShortDesc:
  192. + """A localized label for the setting"""
  193. def __get__ (self):
  194. return self.ccsSetting.shortDesc
  195.  
  196. property LongDesc:
  197. + """A localized description of the setting suitable for display in tooltips"""
  198. def __get__ (self):
  199. return self.ccsSetting.longDesc
  200.  
  201. property Group:
  202. + """Localized name of the group containing the setting"""
  203. def __get__ (self):
  204. return self.ccsSetting.group
  205.  
  206. property SubGroup:
  207. + """Localizedd name of the subgroup containing the setting"""
  208. def __get__ (self):
  209. return self.ccsSetting.subGroup
  210.  
  211. property Type:
  212. + """Setting type as a string. One of L{SettingTypeString}"""
  213. def __get__ (self):
  214. return SettingTypeString[self.ccsSetting.type]
  215.  
  216. property Info:
  217. + """A tuple containing informatation about the setting. The values of the tuple elements for each type are as follows::
  218. +
  219. + Int:
  220. + minimum value
  221. + maximum value
  222. + int desc dictionary (a dictionary of string values for Int settings used as enumerations)*
  223. + Float:
  224. + minimum value
  225. + maximum value
  226. + precision
  227. + Key, Button, Edge, and Bell:
  228. + internal action (one that only conflicts with other internal settings in the plugin)
  229. + List:
  230. + list type
  231. + (Info tuple for that type)
  232. +
  233. + For all other setting types, Info will be an empty tuple.
  234. +
  235. + *the int desc dictionary is not available if basic_metadata is used.
  236. +
  237. + """
  238. def __get__ (self):
  239. return self.info
  240.  
  241. property Hints:
  242. + """Additional hints about a setting's value for use by settings managers. For example, a String setting might have a "file" hint which indicates that its value is a filename
  243. +
  244. + This property does not work with basic_metadata
  245. +
  246. + """
  247. def __get__ (self):
  248. if self.ccsSetting.hints == '':
  249. return []
  250. @@ -612,16 +656,19 @@ cdef class Setting:
  251. return str (self.ccsSetting.hints).split (";")[:-1]
  252.  
  253. property IsDefault:
  254. + """Whether the setting is at the default value"""
  255. def __get__ (self):
  256. if self.ccsSetting.isDefault:
  257. return True
  258. return False
  259.  
  260. property DefaultValue:
  261. + """The setting's default value"""
  262. def __get__ (self):
  263. return DecodeValue (&self.ccsSetting.defaultValue)
  264.  
  265. property Value:
  266. + """The settings's value. The value is always a copy, so when changing items in a list setting, you must mutate the list in place, then write the list back. In-place assignment like setting.Value[3] = "foo" will not work."""
  267. def __get__ (self):
  268. return DecodeValue (self.ccsSetting.value)
  269. def __set__ (self, value):
  270. @@ -631,14 +678,17 @@ cdef class Setting:
  271. ccsFreeSettingValue (sv)
  272.  
  273. property Integrated:
  274. + """Whether the current settings backend is integrating this setting. See L{Context.Integration}"""
  275. def __get__ (self):
  276. return bool (ccsSettingIsIntegrated (self.ccsSetting))
  277.  
  278. property ReadOnly:
  279. + """Whether the setting is set to be read-only in the metadata"""
  280. def __get__ (self):
  281. return bool (ccsSettingIsReadOnly (self.ccsSetting))
  282.  
  283. cdef class SSGroup:
  284. + """A subgroup of settings in a plugin"""
  285. cdef object display
  286. cdef object screens
  287.  
  288. @@ -647,18 +697,23 @@ cdef class SSGroup:
  289. self.screens = screen
  290.  
  291. property Display:
  292. + """A dictionary of settings with similar semantics to L{Plugin.Display}"""
  293. def __get__ (self):
  294. return self.display
  295. def __set__ (self, value):
  296. self.display = value
  297.  
  298. property Screens:
  299. + """A list of dictionaries of settings with similar semantics to L{Plugin.Screens}"""
  300. def __get__ (self):
  301. return self.screens
  302. def __set__ (self, value):
  303. self.screens = value
  304.  
  305. cdef class Plugin:
  306. + """A representation of a compiz plugin. Through the plugin object, the plugin can be enabled or disabled and its settings can be viewed and manipulated.
  307. +
  308. + """
  309. cdef CCSPlugin * ccsPlugin
  310. cdef Context context
  311. cdef object screens
  312. @@ -679,6 +734,14 @@ cdef class Plugin:
  313. self.screens.append ({})
  314.  
  315. def Update (self):
  316. + """Build dictionaries of plugin settings and groups. This occurs
  317. + automatically as needed, but each plugin can be forcibly initialized
  318. + with this method while waiting for user input.
  319. +
  320. + The L{Initialized} property will return True if this
  321. + process has already occurred.
  322. +
  323. + """
  324. cdef CCSList * setlist
  325. cdef CCSList * glist
  326. cdef CCSList * sglist
  327. @@ -725,59 +788,93 @@ cdef class Plugin:
  328. self.loaded = True
  329.  
  330. property Context:
  331. + """The L{Context<compizconfig.Context>} which owns the Plugin"""
  332. def __get__ (self):
  333. return self.context
  334.  
  335. property Groups:
  336. + """A (nested) dictionary of plugin groups and subgroups. The first level contains group names as keys and dictionaries of subgroups as values. The secondary dictionaries contain subgroup names as keys and L{SSGroup} objects as values.
  337. +
  338. + The simplest example for a plugin which contains no groups or subgroups is:
  339. +
  340. + C{{'': {'': <compizconfig.SSGroup object>}}}
  341. +
  342. + The '' keys in each dictionary represent settings outside of a group or subgroup, respectively. If a plugin has settings which are in a group but not a subgroup, they will appear in a SSGroup with the key '' in the dictionary for that group.
  343. +
  344. + """
  345. def __get__ (self):
  346. if not self.loaded:
  347. self.Update ()
  348. return self.groups
  349.  
  350. property Display:
  351. + """A dictionary of all display-specific settings for the plugin. This collection is equivalent to the "/allscreens" path in the compiz D-Bus API."""
  352. def __get__ (self):
  353. if not self.loaded:
  354. self.Update ()
  355. return self.display
  356.  
  357. property Screens:
  358. + """A list of dictionaries of screen-specific settings for each managed screen."""
  359. def __get__ (self):
  360. if not self.loaded:
  361. self.Update ()
  362. return self.screens
  363.  
  364. property Ranking:
  365. + """A dictionary of "ranked" settings to preserve the sorting of the plugin's settings. in the form:
  366. +
  367. + {"setting_name": rank, ...}
  368. +
  369. + """
  370. def __get__ (self):
  371. if not self.loaded:
  372. self.Update ()
  373. return self.ranking
  374.  
  375. property Name:
  376. + """The plugin's name (which is never translated)"""
  377. def __get__ (self):
  378. return self.ccsPlugin.name
  379.  
  380. property ShortDesc:
  381. + """A localized label for the plugin.
  382. +
  383. + Not available with basic_metadata.
  384. +
  385. + """
  386. def __get__ (self):
  387. return self.ccsPlugin.shortDesc
  388.  
  389. property LongDesc:
  390. + """A localized description of the plugin
  391. +
  392. + Not available with basic_metadata.
  393. +
  394. + """
  395. def __get__ (self):
  396. return self.ccsPlugin.longDesc
  397.  
  398. property Category:
  399. + """The plugin's Category name"""
  400. def __get__ (self):
  401. return self.ccsPlugin.category
  402.  
  403. property Features:
  404. + """A list of features provided by the plugin"""
  405. def __get__ (self):
  406. features = StringListToList (self.ccsPlugin.providesFeature)
  407. return features
  408.  
  409. property Initialized:
  410. + """Indicates whether the setting and group objects for the plugin have been created. This will occur automatically if any property which requires it is read, but you can force initialization by calling the L{Update} method.
  411. +
  412. + """
  413. def __get__ (self):
  414. return bool (self.loaded)
  415.  
  416. property Enabled:
  417. + """Indicates whether the plugin is enabled. This should only be used if L{Context.AutoSort} is Enabled."""
  418. def __get__ (self):
  419. return bool (ccsPluginIsActive (self.context.ccsContext,
  420. self.ccsPlugin.name))
  421. @@ -792,6 +889,11 @@ cdef class Plugin:
  422. ccsPluginSetActive (self.ccsPlugin, False)
  423.  
  424. property EnableConflicts:
  425. + """A list of three-tuples containing conflicts which would prevent the plugin from being enabled
  426. +
  427. + Each tuple is of the form: (type, value, plugins), where type is the conflict type, value is the name of the conflict, and plugins is a list of plugins which conflict (if applicable).
  428. +
  429. + """
  430. def __get__ (self):
  431. cdef CCSPluginConflictList * pl, * pls
  432. cdef CCSPluginConflict * pc
  433. @@ -820,6 +922,11 @@ cdef class Plugin:
  434. return ret
  435.  
  436. property DisableConflicts:
  437. + """A list of three-tuples containing conflicts which would prevent the plugin from being disabled
  438. +
  439. + Each tuple is of the form: (type, value, plugins), where type is the conflict type, value is the name of the conflict, and plugins is a list of plugins which conflict (if applicable).
  440. +
  441. + """
  442. def __get__ (self):
  443. cdef CCSPluginConflictList * pl, * pls
  444. cdef CCSPluginConflict * pc
  445. @@ -848,6 +955,7 @@ cdef class Plugin:
  446. return ret
  447.  
  448. cdef class Profile:
  449. + """An object representing a settings profile"""
  450. cdef Context context
  451. cdef char * name
  452.  
  453. @@ -859,13 +967,20 @@ cdef class Profile:
  454. free (self.name)
  455.  
  456. def Delete (self):
  457. + """Delete the profile represented by the Profile object. This will only succeed on a profile other than the default profile ("")."""
  458. ccsDeleteProfile (self.context.ccsContext, self.name)
  459.  
  460. property Name:
  461. + """The profile's name, which may be user-provided"""
  462. def __get__ (self):
  463. return self.name
  464.  
  465. cdef class Backend:
  466. + """The backend is a plugin for libcompizconfig which implements storage of user settings.
  467. +
  468. + libcompizconfig ships with an ini (Flat File) backend, and the gconf and kconfig backends are packaged separately.
  469. +
  470. + """
  471. cdef Context context
  472. cdef char * name
  473. cdef char * shortDesc
  474. @@ -887,26 +1002,52 @@ cdef class Backend:
  475. free (self.longDesc)
  476.  
  477. property Name:
  478. + """Untranslated backend name"""
  479. def __get__ (self):
  480. return self.name
  481.  
  482. property ShortDesc:
  483. + """Localized short label"""
  484. def __get__ (self):
  485. return self.shortDesc
  486.  
  487. property LongDesc:
  488. + """Localized longer description"""
  489. def __get__ (self):
  490. return self.longDesc
  491.  
  492. property IntegrationSupport:
  493. + """Whether the backend suports enabling L{Desktop Integration<Context.Integration>}."""
  494. def __get__ (self):
  495. return self.integrationSupport
  496.  
  497. property ProfileSupport:
  498. + """Whether the backend supports switching between multiple profiles."""
  499. def __get__ (self):
  500. return self.profileSupport
  501.  
  502. cdef class Context:
  503. + """The Context is the tool used to view and manipulate the entire CompizConfig system.
  504. +
  505. + To increase the performance of context creation, you may limit the scope of the context:
  506. +
  507. + >>> import compizconfig
  508. + >>> context = compizconfig.Context(plugins=['core', 'decoration'], basic_metadata=True)
  509. + >>> context.Plugins['move']
  510. + Traceback (most recent call last):
  511. + ...
  512. + KeyError: 'move'
  513. + >>> decoration = context.Plugins['decoration']
  514. + >>> decoration.Name
  515. + 'decoration'
  516. + >>> decoration.ShortDesc
  517. + 'decoration'
  518. + >>> decoration.LongDesc
  519. + 'decoration'
  520. +
  521. + Without basic_metadata set, the L{ShortDesc<Plugin.ShortDesc>} and L{LongDesc<Plugin.LongDesc>} properties would produce localized descriptions of the plugin. In general, the ShortDesc, LongDesc, and Hints properties of all objects should be avoided when using basic_metadata. Check the documentation for any property used to ensure that it is still usable with basic_metadata.
  522. +
  523. + """
  524. cdef CCSContext * ccsContext
  525. cdef object plugins
  526. cdef object categories
  527. @@ -960,10 +1101,16 @@ cdef class Context:
  528. ccsContextDestroy (self.ccsContext)
  529.  
  530. def LoadPlugin (self, plugin):
  531. + """Add a plugin to the context (or reload an existing one) by name."""
  532. return ccsLoadPlugin (self.ccsContext, plugin)
  533.  
  534. # Returns the settings that should be updated
  535. def ProcessEvents (self, flags = 0):
  536. + """Call this method to process any changes which have occurred in other contexts. In an interactive application, you may want to call this periodically to receive updated, but always call it before L{writing<Write>} the context.
  537. + @param flags: Pass L{ProcessEventsNoGlibMainLoopMask} if there is no GLib mainloop running
  538. + @return: True if changes have occurred, False otherwise.
  539. +
  540. + """
  541. ccsProcessEvents (self.ccsContext, flags)
  542. if len (self.ChangedSettings):
  543. self.Read ()
  544. @@ -971,15 +1118,22 @@ cdef class Context:
  545. return False
  546.  
  547. def Write (self, onlyChanged = True):
  548. + """Write all changes made the context. If onlyChanged is False, the entire context will be written, not just values which have been modified.
  549. +
  550. + """
  551. if onlyChanged:
  552. ccsWriteChangedSettings (self.ccsContext)
  553. else:
  554. ccsWriteSettings (self.ccsContext)
  555.  
  556. def Read (self):
  557. + """Read all settings which have already been created. It is usually not necessary to call this method yourself
  558. +
  559. + """
  560. ccsReadSettings (self.ccsContext)
  561.  
  562. def UpdateProfiles (self):
  563. + """Re-read the list of profiles and backends"""
  564. self.profiles = {}
  565. self.currentProfile = Profile (self, ccsGetProfile (self.ccsContext))
  566. cdef CCSStringList * profileList
  567. @@ -1004,28 +1158,38 @@ cdef class Context:
  568. self.currentBackend = self.backends[ccsGetBackend (self.ccsContext)]
  569.  
  570. def ResetProfile (self):
  571. + """Set the profile to the default profile"""
  572. self.currentProfile = Profile (self, "")
  573. ccsSetProfile (self.ccsContext, "")
  574. ccsReadSettings (self.ccsContext)
  575.  
  576. def Import (self, path, autoSave = True):
  577. + """Import settings from an .ini file specified at path. The imported settings will be written directly onto the current profile, so a new profile should be created if the existing settings should be preserved.
  578. +
  579. + """
  580. ret = bool (ccsImportFromFile (self.ccsContext, path, True))
  581. if autoSave:
  582. ccsWriteSettings (self.ccsContext)
  583. return ret
  584.  
  585. def Export (self, path, skipDefaults = False):
  586. + """Export an .ini file of settings which may be imported with L{Import}. if skipDefaults is True, only setting values which differ from the defaults will be exported.
  587. +
  588. + """
  589. return bool (ccsExportToFile (self.ccsContext, path, skipDefaults))
  590.  
  591. property Plugins:
  592. + """A dictionary of all plugins (not just active plugins) with plugin names used as keys and L{Plugin} objects used as values"""
  593. def __get__ (self):
  594. return self.plugins
  595.  
  596. property Categories:
  597. + """A dictionary of categories. the '' category contains plugins which are uncategorized"""
  598. def __get__ (self):
  599. return self.categories
  600.  
  601. property CurrentProfile:
  602. + """A L{Profile} object representing the current profile"""
  603. def __get__ (self):
  604. return self.currentProfile
  605. def __set__ (self, profile):
  606. @@ -1046,10 +1210,12 @@ cdef class Context:
  607. ccsReadSettings (self.ccsContext)
  608.  
  609. property Backends:
  610. + """All available L{Backends<compizconfig.Backend>}"""
  611. def __get__ (self):
  612. return self.backends
  613.  
  614. property ChangedSettings:
  615. + """A list of settings populated by the L{ProcessEvents} method. Each setting in this list has changed in value since the last ProcessEvents call (or since creation of the context if ProcessEvents has not been called)"""
  616. def __get__ (self):
  617. return SettingListToList (self, self.ccsContext.changedSettings)
  618. def __set__ (self, value):
  619. @@ -1062,16 +1228,25 @@ cdef class Context:
  620. self.ccsContext.changedSettings = settingList
  621.  
  622. property AutoSort:
  623. + """ AutoSort determines whether libcompizconfig will manage the active_plugins list internally. If enabled, plugins can be enabled or disabled by setting the L{Enabled<Plugin.Enabled>} property, otherwise, the plugin must be added to the value of the active_plugins setting.
  624. +
  625. + """
  626. def __get__ (self):
  627. return bool (ccsGetPluginListAutoSort (self.ccsContext))
  628. def __set__ (self, value):
  629. ccsSetPluginListAutoSort (self.ccsContext, bool (value))
  630.  
  631. property NScreens:
  632. + """The number of screens managed by the context"""
  633. def __get__ (self):
  634. return self.nScreens
  635.  
  636. property Integration:
  637. + """Desktop Integration is a feature supported by some settings backends where they read certain settings from somewhere outside of compiz. For example, the GConf backend reads several settings from metacity when integration is enabled. Backends which support integration will have L{IntegrationSupport<Backend.IntegrationSupport>} set to True.
  638. +
  639. + If integration is enabled, the L{Integrated<Setting.Integrated>} property of each integrated setting will return True.
  640. +
  641. + """
  642. def __get__ (self):
  643. return bool (self.integration)
  644. def __set__ (self, value):
Add Comment
Please, Sign In to add comment