Merge branch 'master' into gobject-introspection
This commit is contained in:
commit
cc330b3cbf
2
.gitignore
vendored
2
.gitignore
vendored
@ -8,6 +8,8 @@ Vips-8.0.typelib
|
|||||||
.*.swp
|
.*.swp
|
||||||
*.lo
|
*.lo
|
||||||
*.la
|
*.la
|
||||||
|
Vips-8.0.gir
|
||||||
|
Vips-8.0.typelib
|
||||||
*.pc
|
*.pc
|
||||||
*.pyc
|
*.pyc
|
||||||
.deps
|
.deps
|
||||||
|
@ -230,6 +230,7 @@ G_DEFINE_TYPE( VipsFormatTiff, vips_format_tiff, VIPS_TYPE_FORMAT );
|
|||||||
static void *
|
static void *
|
||||||
format_add_class( VipsFormatClass *format, GSList **formats )
|
format_add_class( VipsFormatClass *format, GSList **formats )
|
||||||
{
|
{
|
||||||
|
if( !G_TYPE_IS_ABSTRACT( G_OBJECT_CLASS_TYPE( format ) ) )
|
||||||
/* Append so we don't reverse the list of formats.
|
/* Append so we don't reverse the list of formats.
|
||||||
*/
|
*/
|
||||||
*formats = g_slist_append( *formats, format );
|
*formats = g_slist_append( *formats, format );
|
||||||
@ -267,7 +268,7 @@ vips_format_map( VSListMap2Fn fn, void *a, void *b )
|
|||||||
void *result;
|
void *result;
|
||||||
|
|
||||||
formats = NULL;
|
formats = NULL;
|
||||||
(void) vips_class_map_concrete_all( g_type_from_name( "VipsFormat" ),
|
(void) vips_class_map_all( g_type_from_name( "VipsFormat" ),
|
||||||
(VipsClassMap) format_add_class, (void *) &formats );
|
(VipsClassMap) format_add_class, (void *) &formats );
|
||||||
|
|
||||||
formats = g_slist_sort( formats, (GCompareFunc) format_compare );
|
formats = g_slist_sort( formats, (GCompareFunc) format_compare );
|
||||||
|
@ -1544,19 +1544,16 @@ vips_type_map( GType base, VipsTypeMap2 fn, void *a, void *b )
|
|||||||
return( result );
|
return( result );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Loop over all the concrete subtypes of a base type.
|
/* Loop over all the subtypes of a base type.
|
||||||
*/
|
*/
|
||||||
void *
|
void *
|
||||||
vips_type_map_concrete_all( GType base, VipsTypeMap fn, void *a )
|
vips_type_map_all( GType base, VipsTypeMap fn, void *a )
|
||||||
{
|
{
|
||||||
void *result;
|
void *result;
|
||||||
|
|
||||||
result = NULL;
|
if( !(result = fn( base, a )) )
|
||||||
if( !G_TYPE_IS_ABSTRACT( base ) )
|
|
||||||
result = fn( base, a );
|
|
||||||
if( !result )
|
|
||||||
result = vips_type_map( base,
|
result = vips_type_map( base,
|
||||||
(VipsTypeMap2) vips_type_map_concrete_all, fn, a );
|
(VipsTypeMap2) vips_type_map_all, fn, a );
|
||||||
|
|
||||||
return( result );
|
return( result );
|
||||||
}
|
}
|
||||||
@ -1564,20 +1561,16 @@ vips_type_map_concrete_all( GType base, VipsTypeMap fn, void *a )
|
|||||||
/* Loop over all the subclasses of a base type.
|
/* Loop over all the subclasses of a base type.
|
||||||
*/
|
*/
|
||||||
void *
|
void *
|
||||||
vips_class_map_concrete_all( GType type, VipsClassMap fn, void *a )
|
vips_class_map_all( GType type, VipsClassMap fn, void *a )
|
||||||
{
|
{
|
||||||
void *result;
|
void *result;
|
||||||
|
|
||||||
result = NULL;
|
|
||||||
if( !G_TYPE_IS_ABSTRACT( type ) )
|
|
||||||
/* We never unref this ref, but we never unload classes
|
/* We never unref this ref, but we never unload classes
|
||||||
* anyway, so so what.
|
* anyway, so so what.
|
||||||
*/
|
*/
|
||||||
result = fn( VIPS_OBJECT_CLASS( g_type_class_ref( type ) ), a );
|
if( !(result = fn( VIPS_OBJECT_CLASS( g_type_class_ref( type ) ), a )) )
|
||||||
|
|
||||||
if( !result )
|
|
||||||
result = vips_type_map( type,
|
result = vips_type_map( type,
|
||||||
(VipsTypeMap2) vips_class_map_concrete_all, fn, a );
|
(VipsTypeMap2) vips_class_map_all, fn, a );
|
||||||
|
|
||||||
return( result );
|
return( result );
|
||||||
}
|
}
|
||||||
@ -1611,7 +1604,7 @@ vips_class_find( const char *basename, const char *nickname )
|
|||||||
return( NULL );
|
return( NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !(class = vips_class_map_concrete_all( base,
|
if( !(class = vips_class_map_all( base,
|
||||||
(VipsClassMap) test_name, (void *) nickname )) ) {
|
(VipsClassMap) test_name, (void *) nickname )) ) {
|
||||||
vips_error( "VipsObject",
|
vips_error( "VipsObject",
|
||||||
_( "class \"%s\" not found" ), nickname );
|
_( "class \"%s\" not found" ), nickname );
|
||||||
@ -1629,10 +1622,7 @@ vips_type_find( const char *basename, const char *nickname )
|
|||||||
if( !(class = vips_class_find( "VipsObject", nickname )) )
|
if( !(class = vips_class_find( "VipsObject", nickname )) )
|
||||||
return( 0 );
|
return( 0 );
|
||||||
|
|
||||||
/* FIXME ... we've not supposed to use G_TYPE_FROM_CLASS(), I think.
|
return( G_OBJECT_CLASS_TYPE( class ) );
|
||||||
* I'm not sure what the alternative is.
|
|
||||||
*/
|
|
||||||
return( G_TYPE_FROM_CLASS( class ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -170,6 +170,8 @@ vips_interpolate_real_get_window_offset( VipsInterpolate *interpolate )
|
|||||||
static void
|
static void
|
||||||
vips_interpolate_class_init( VipsInterpolateClass *class )
|
vips_interpolate_class_init( VipsInterpolateClass *class )
|
||||||
{
|
{
|
||||||
|
VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class );
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
GObjectClass *gobject_class = G_OBJECT_CLASS( class );
|
GObjectClass *gobject_class = G_OBJECT_CLASS( class );
|
||||||
#endif /*DEBUG*/
|
#endif /*DEBUG*/
|
||||||
@ -178,6 +180,9 @@ vips_interpolate_class_init( VipsInterpolateClass *class )
|
|||||||
gobject_class->finalize = vips_interpolate_finalize;
|
gobject_class->finalize = vips_interpolate_finalize;
|
||||||
#endif /*DEBUG*/
|
#endif /*DEBUG*/
|
||||||
|
|
||||||
|
vobject_class->nickname = "interpolate";
|
||||||
|
vobject_class->description = _( "VIPS interpolation class" );
|
||||||
|
|
||||||
class->interpolate = NULL;
|
class->interpolate = NULL;
|
||||||
class->get_window_size = vips_interpolate_real_get_window_size;
|
class->get_window_size = vips_interpolate_real_get_window_size;
|
||||||
class->get_window_offset = vips_interpolate_real_get_window_offset;
|
class->get_window_offset = vips_interpolate_real_get_window_offset;
|
||||||
|
@ -168,6 +168,9 @@ list_function( im_function *func )
|
|||||||
static void *
|
static void *
|
||||||
list_class( VipsObjectClass *class )
|
list_class( VipsObjectClass *class )
|
||||||
{
|
{
|
||||||
|
/* Ignore abstract classes.
|
||||||
|
*/
|
||||||
|
if( !G_TYPE_IS_ABSTRACT( G_OBJECT_CLASS_TYPE( class ) ) )
|
||||||
vips_object_print_class( class );
|
vips_object_print_class( class );
|
||||||
|
|
||||||
return( NULL );
|
return( NULL );
|
||||||
@ -179,7 +182,7 @@ print_list( int argc, char **argv )
|
|||||||
if( !argv[0] || strcmp( argv[0], "packages" ) == 0 )
|
if( !argv[0] || strcmp( argv[0], "packages" ) == 0 )
|
||||||
im_map_packages( (VSListMap2Fn) list_package, NULL );
|
im_map_packages( (VSListMap2Fn) list_package, NULL );
|
||||||
else if( strcmp( argv[0], "classes" ) == 0 )
|
else if( strcmp( argv[0], "classes" ) == 0 )
|
||||||
vips_class_map_concrete_all( g_type_from_name( "VipsObject" ),
|
vips_class_map_all( g_type_from_name( "VipsObject" ),
|
||||||
(VipsClassMap) list_class, NULL );
|
(VipsClassMap) list_class, NULL );
|
||||||
else {
|
else {
|
||||||
if( map_name( argv[0], list_function ) )
|
if( map_name( argv[0], list_function ) )
|
||||||
|
Loading…
Reference in New Issue
Block a user