Gimp.Resource¶
- Subclasses:
Gimp.Brush
,Gimp.Font
,Gimp.Gradient
,Gimp.Palette
,Gimp.Pattern
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
The id for internal use |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Gimp.Resource(**kwargs)¶
- Bases:
- Abstract:
Yes
- Structure:
Functions to manipulate resources.
- classmethod get_by_id(resource_id)¶
- Parameters:
resource_id (
int
) – The resource id.- Returns:
a
Gimp.Resource
for resource_id orNone
if resource_id does not represent a valid resource. The object belongs to libgimp and you must not modify or unref it.- Return type:
Returns a
Gimp.Resource
representing resource_id. SinceGimp.Resource
is an abstract class, the real object type will actually be the proper subclass.Note: in most use cases, you should not need to retrieve a
Gimp.Resource
by its ID, which is mostly internal data and not reusable across sessions. Use the appropriate functions for your use case instead.New in version 3.0.
- classmethod get_by_name(resource_type, resource_name)¶
- Parameters:
resource_type (
GObject.GType
) – TheGObject.GType
of the resource.resource_name (
str
) – The name of the resource.
- Returns:
The resource.
- Return type:
Returns the resource with the given resource_type and resource_name.
New in version 3.0.
- classmethod id_is_brush(resource_id)¶
- Parameters:
resource_id (
int
) – The resource ID.- Returns:
- Return type:
Returns whether the resource ID is a brush.
This procedure returns
True
if the specified resource ID is a brush.New in version 3.0.
- classmethod id_is_font(resource_id)¶
- Parameters:
resource_id (
int
) – The resource ID.- Returns:
- Return type:
Returns whether the resource ID is a font.
This procedure returns
True
if the specified resource ID is a font.New in version 3.0.
- classmethod id_is_gradient(resource_id)¶
- Parameters:
resource_id (
int
) – The resource ID.- Returns:
- Return type:
Returns whether the resource ID is a gradient.
This procedure returns
True
if the specified resource ID is a gradient.New in version 3.0.
- classmethod id_is_palette(resource_id)¶
- Parameters:
resource_id (
int
) – The resource ID.- Returns:
- Return type:
Returns whether the resource ID is a palette.
This procedure returns
True
if the specified resource ID is a palette.New in version 3.0.
- classmethod id_is_pattern(resource_id)¶
- Parameters:
resource_id (
int
) – The resource ID.- Returns:
- Return type:
Returns whether the resource ID is a pattern.
This procedure returns
True
if the specified resource ID is a pattern.New in version 3.0.
- classmethod id_is_valid(resource_id)¶
- Parameters:
resource_id (
int
) – The resource ID to check.- Returns:
Whether the resource ID is valid.
- Return type:
Returns
True
if the resource ID is valid.This procedure checks if the given resource ID is valid and refers to an existing resource.
*Note*: in most use cases, you should not use this function. If you got a [class`Gimp`.Resource] from the API, you should trust it is valid. This function is mostly for internal usage.
New in version 3.0.
- delete()¶
-
Deletes a resource.
Deletes a resource. Returns an error if the resource is not deletable. Deletes the resource’s data. You should not use the resource afterwards.
New in version 3.0.
- duplicate()¶
- Returns:
A copy of the resource.
- Return type:
Duplicates a resource.
Returns a copy having a different, unique ID.
New in version 3.0.
- get_id()¶
- Returns:
the resource ID.
- Return type:
Note: in most use cases, you should not need a resource’s ID which is mostly internal data and not reusable across sessions.
New in version 3.0.
- get_name()¶
-
Returns the resource’s name.
This procedure returns the resource’s name.
New in version 3.0.
- is_brush()¶
-
Returns whether the resource is a brush.
This procedure returns
True
if the specified resource is a brush.New in version 3.0.
- is_editable()¶
-
Whether the resource can be edited.
Returns
True
if you have permission to change the resource.New in version 3.0.
- is_font()¶
-
Returns whether the resource is a font.
This procedure returns
True
if the specified resource is a font.New in version 3.0.
- is_gradient()¶
-
Returns whether the resource is a gradient.
This procedure returns
True
if the specified resource is a gradient.New in version 3.0.
- is_palette()¶
-
Returns whether the resource is a palette.
This procedure returns
True
if the specified resource is a palette.New in version 3.0.
- is_pattern()¶
-
Returns whether the resource is a pattern.
This procedure returns
True
if the specified resource is a pattern.New in version 3.0.
- is_valid()¶
- Returns:
Whether the resource is valid.
- Return type:
Returns
True
if the resource is valid.This procedure checks if the given resource is valid and refers to an existing resource.
New in version 3.0.
- rename(new_name)¶
- Parameters:
new_name (
str
) – The proposed new name of the resource.- Returns:
True
on success.- Return type:
Renames a resource. When the name is in use, renames to a unique name.
Renames a resource. When the proposed name is already used, GIMP generates a unique name.
New in version 3.0.
Property Details¶
- Gimp.Resource.props.id¶
- Name:
id
- Type:
- Default Value:
0
- Flags:
The id for internal use