libgimp: add convenience macros GIMP_VALUES_GET_FOO_ID()
becuse some plug-ins really want the ID for good reasons and not the object, and code looks so much nicer when the entire list of arguments is extracted using the macros.
This commit is contained in:
parent
0c83f4a96d
commit
81ee690bbf
1 changed files with 27 additions and 0 deletions
|
|
@ -474,6 +474,9 @@ G_BEGIN_DECLS
|
|||
#define GIMP_VALUES_GET_DISPLAY(args, n) \
|
||||
g_value_get_object (gimp_value_array_index (args, n))
|
||||
|
||||
#define GIMP_VALUES_GET_DISPLAY_ID(args, n) \
|
||||
gimp_display_get_id (g_value_get_object (gimp_value_array_index (args, n)))
|
||||
|
||||
#define GIMP_VALUES_SET_DISPLAY(args, n, value) \
|
||||
g_value_set_object (gimp_value_array_index (args, n), value)
|
||||
|
||||
|
|
@ -495,6 +498,9 @@ G_BEGIN_DECLS
|
|||
#define GIMP_VALUES_GET_IMAGE(args, n) \
|
||||
g_value_get_object (gimp_value_array_index (args, n))
|
||||
|
||||
#define GIMP_VALUES_GET_IMAGE_ID(args, n) \
|
||||
gimp_image_get_id (g_value_get_object (gimp_value_array_index (args, n)))
|
||||
|
||||
#define GIMP_VALUES_SET_IMAGE(args, n, value) \
|
||||
g_value_set_object (gimp_value_array_index (args, n), value)
|
||||
|
||||
|
|
@ -516,6 +522,9 @@ G_BEGIN_DECLS
|
|||
#define GIMP_VALUES_GET_ITEM(args, n) \
|
||||
g_value_get_object (gimp_value_array_index (args, n))
|
||||
|
||||
#define GIMP_VALUES_GET_ITEM_ID(args, n) \
|
||||
gimp_item_get_id (g_value_get_object (gimp_value_array_index (args, n)))
|
||||
|
||||
#define GIMP_VALUES_SET_ITEM(args, n, value) \
|
||||
g_value_set_object (gimp_value_array_index (args, n), value)
|
||||
|
||||
|
|
@ -537,6 +546,9 @@ G_BEGIN_DECLS
|
|||
#define GIMP_VALUES_GET_DRAWABLE(args, n) \
|
||||
g_value_get_object (gimp_value_array_index (args, n))
|
||||
|
||||
#define GIMP_VALUES_GET_DRAWABLE_ID(args, n) \
|
||||
gimp_item_get_id (g_value_get_object (gimp_value_array_index (args, n)))
|
||||
|
||||
#define GIMP_VALUES_SET_DRAWABLE(args, n, value) \
|
||||
g_value_set_object (gimp_value_array_index (args, n), value)
|
||||
|
||||
|
|
@ -558,6 +570,9 @@ G_BEGIN_DECLS
|
|||
#define GIMP_VALUES_GET_LAYER(args, n) \
|
||||
g_value_get_object (gimp_value_array_index (args, n))
|
||||
|
||||
#define GIMP_VALUES_GET_LAYER_ID(args, n) \
|
||||
gimp_item_get_id (g_value_get_object (gimp_value_array_index (args, n)))
|
||||
|
||||
#define GIMP_VALUES_SET_LAYER(args, n, value) \
|
||||
g_value_set_object (gimp_value_array_index (args, n), value)
|
||||
|
||||
|
|
@ -579,6 +594,9 @@ G_BEGIN_DECLS
|
|||
#define GIMP_VALUES_GET_CHANNEL(args, n) \
|
||||
g_value_get_object (gimp_value_array_index (args, n))
|
||||
|
||||
#define GIMP_VALUES_GET_CHANNEL_ID(args, n) \
|
||||
gimp_item_get_id (g_value_get_object (gimp_value_array_index (args, n)))
|
||||
|
||||
#define GIMP_VALUES_SET_CHANNEL(args, n, value) \
|
||||
g_value_set_object (gimp_value_array_index (args, n), value)
|
||||
|
||||
|
|
@ -600,6 +618,9 @@ G_BEGIN_DECLS
|
|||
#define GIMP_VALUES_GET_LAYER_MASK(args, n) \
|
||||
g_value_get_object (gimp_value_array_index (args, n))
|
||||
|
||||
#define GIMP_VALUES_GET_LAYER_MASK_ID(args, n) \
|
||||
gimp_item_get_id (g_value_get_object (gimp_value_array_index (args, n)))
|
||||
|
||||
#define GIMP_VALUES_SET_LAYER_MASK(args, n, value) \
|
||||
g_value_set_object (gimp_value_array_index (args, n), value)
|
||||
|
||||
|
|
@ -621,6 +642,9 @@ G_BEGIN_DECLS
|
|||
#define GIMP_VALUES_GET_SELECTION(args, n) \
|
||||
g_value_get_object (gimp_value_array_index (args, n))
|
||||
|
||||
#define GIMP_VALUES_GET_SELECTION_ID(args, n) \
|
||||
gimp_item_get_id (g_value_get_object (gimp_value_array_index (args, n)))
|
||||
|
||||
#define GIMP_VALUES_SET_SELECTION(args, n, value) \
|
||||
g_value_set_object (gimp_value_array_index (args, n), value)
|
||||
|
||||
|
|
@ -642,6 +666,9 @@ G_BEGIN_DECLS
|
|||
#define GIMP_VALUES_GET_VECTORS(args, n) \
|
||||
g_value_get_object (gimp_value_array_index (args, n))
|
||||
|
||||
#define GIMP_VALUES_GET_VECTORS_ID(args, n) \
|
||||
gimp_item_get_id (g_value_get_object (gimp_value_array_index (args, n)))
|
||||
|
||||
#define GIMP_VALUES_SET_VECTORS(args, n, value) \
|
||||
g_value_set_object (gimp_value_array_index (args, n), value)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue