more vips_argument_map() fixups
This commit is contained in:
parent
a0b3573b59
commit
3f76648a11
@ -332,8 +332,7 @@ int vips_object_get_argument_priority( VipsObject *object, const char *name );
|
|||||||
/* We have many props on the arg table ... filter out the \
|
/* We have many props on the arg table ... filter out the \
|
||||||
* ones for this class. \
|
* ones for this class. \
|
||||||
*/ \
|
*/ \
|
||||||
if( ARG_INSTANCE && \
|
if( g_object_class_find_property( \
|
||||||
g_object_class_find_property( \
|
|
||||||
G_OBJECT_CLASS( object_class ), \
|
G_OBJECT_CLASS( object_class ), \
|
||||||
g_param_spec_get_name( PSPEC ) ) == PSPEC ) {
|
g_param_spec_get_name( PSPEC ) ) == PSPEC ) {
|
||||||
|
|
||||||
|
@ -346,26 +346,45 @@ vips_argument_table_destroy( VipsArgumentTable *table )
|
|||||||
* non-%NULL value from @fn.
|
* non-%NULL value from @fn.
|
||||||
*/
|
*/
|
||||||
void *
|
void *
|
||||||
vips_argument_map1( VipsObject *object,
|
vips_argument_map( VipsObject *object,
|
||||||
VipsArgumentMapFn fn, void *a, void *b )
|
VipsArgumentMapFn fn, void *a, void *b )
|
||||||
{
|
{
|
||||||
|
VipsObjectClass *object_class = VIPS_OBJECT_GET_CLASS( object );
|
||||||
|
GSList *p;
|
||||||
|
|
||||||
/* Make sure we can't go during the loop. This can happen if eg. we
|
/* Make sure we can't go during the loop. This can happen if eg. we
|
||||||
* flush an arg that refs us.
|
* flush an arg that refs us.
|
||||||
*/
|
*/
|
||||||
g_object_ref( object );
|
g_object_ref( object );
|
||||||
|
|
||||||
VIPS_ARGUMENT_FOR_ALL( object,
|
/* We only get called after all the VipsArgumentInstance have been
|
||||||
pspec, argument_class, argument_instance ) {
|
* built. We can often skip the pspec lookup.
|
||||||
void *result;
|
*/
|
||||||
|
for( p = object_class->argument_table_traverse; p; p = p->next ) {
|
||||||
|
VipsArgumentClass *argument_class =
|
||||||
|
(VipsArgumentClass *) p->data;
|
||||||
|
VipsArgument *argument = (VipsArgument *) argument_class;
|
||||||
|
GParamSpec *pspec = argument->pspec;
|
||||||
|
VipsArgumentInstance *argument_instance =
|
||||||
|
vips__argument_get_instance( argument_class,
|
||||||
|
object );
|
||||||
|
|
||||||
g_assert( argument_instance );
|
/* We have many props on the arg table ... filter out the
|
||||||
|
* ones for this class.
|
||||||
|
*/
|
||||||
|
if( argument_instance &&
|
||||||
|
g_object_class_find_property(
|
||||||
|
G_OBJECT_CLASS( object_class ),
|
||||||
|
g_param_spec_get_name( pspec ) ) == pspec ) {
|
||||||
|
void *result;
|
||||||
|
|
||||||
if( (result = fn( object, pspec,
|
if( (result = fn( object, pspec,
|
||||||
argument_class, argument_instance, a, b )) ) {
|
argument_class, argument_instance, a, b )) ) {
|
||||||
g_object_unref( object );
|
g_object_unref( object );
|
||||||
return( result );
|
return( result );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} VIPS_ARGUMENT_FOR_ALL_END
|
}
|
||||||
|
|
||||||
g_object_unref( object );
|
g_object_unref( object );
|
||||||
|
|
||||||
|
3492
po/vips7.pot
Normal file
3492
po/vips7.pot
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user