Trees | Indices | Help |
---|
|
Built-in and/or user supplied application resources
Resource
is a base class for various application
resources. It defines common interface: questioning resource name (Resource.get_name()), modifiability (Resource.get_is_modifiable()), loading resources from
files and saving them.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
Returns resource name.
|
Returns whether a resource is modifiable.
|
Returns whether a resource is preferred.
|
Sets preferability of a resource.
|
Starts using a resource. Call to this function is necessary to use a resource properly. It makes the resource to create any auxiliary structures that consume considerable amount of memory and perform other initialization to ready-to-use form. When a resource is no longer used, it should be released with Resource.release(). In addition, it calls g_object_ref() on the resource. Resources usually exist through almost whole program lifetime from
|
Releases a resource. When the number of resource uses drops to zero, it frees all auxiliary data and returns back to `latent' form. In addition, it calls g_object_unref() on it. See Resource.use() for more. |
Tells whether a resource is currently in use. See Resource.use() for details.
|
Emits signal "data-changed" on a resource. It can be called only on non-constant resources. The default handler
sets Mostly useful in resource implementation. |
Clears Since: 2.8 |
Builds file name a resource should be saved to. If the resource has not been newly created, renamed, or system it was probably loaded from file of the same name.
|
Dumps a resource to a textual (human readable) form.
|
Renames a resource, including renaming it on disk. The method renames the resource both in the inventory and on disk. The renaming must not conflict with an existing resource, constant resources cannot be renamed, etc. It is OK to rename a resource to the same name (nothing happens then).
Since: 2.51 |
Deletes a resource, including removal from disk. The method deletes the resource both in the inventory and on disk. Constant resources cannot be deleted.
Since: 2.51 |
Saves a resource to disk. Only non-constant resources can be saved. The file name is determined by Resource.build_filename(). The resource data are saved even if the modified flag is not set. Upon successful save, the modified flag is cleared. Instead of saving individual resources, consider also using
Since: 2.62 |
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 | http://epydoc.sourceforge.net |