@@ -155,7 +155,7 @@ fn make_class(class: &Class, ctx: &mut Context, view: &ApiView) -> GeneratedClas
155
155
// notify() and notify_reversed() are added after other methods, to list others first in docs.
156
156
let notify_methods = notifications:: make_notify_methods ( class_name, ctx) ;
157
157
158
- let ( assoc_memory, assoc_dyn_memory) = make_bounds ( class) ;
158
+ let ( assoc_memory, assoc_dyn_memory, is_exportable ) = make_bounds ( class, ctx ) ;
159
159
160
160
let internal_methods = quote ! {
161
161
fn __checked_id( & self ) -> Option <crate :: obj:: InstanceId > {
@@ -228,6 +228,7 @@ fn make_class(class: &Class, ctx: &mut Context, view: &ApiView) -> GeneratedClas
228
228
type Memory = crate :: obj:: bounds:: #assoc_memory;
229
229
type DynMemory = crate :: obj:: bounds:: #assoc_dyn_memory;
230
230
type Declarer = crate :: obj:: bounds:: DeclEngine ;
231
+ type Exportable = crate :: obj:: bounds:: #is_exportable;
231
232
}
232
233
233
234
#(
@@ -420,8 +421,10 @@ fn make_deref_impl(class_name: &TyName, base_ty: &TokenStream) -> TokenStream {
420
421
}
421
422
}
422
423
423
- fn make_bounds ( class : & Class ) -> ( Ident , Ident ) {
424
- let assoc_dyn_memory = if class. name ( ) . rust_ty == "Object" {
424
+ fn make_bounds ( class : & Class , ctx : & mut Context ) -> ( Ident , Ident , Ident ) {
425
+ let c = class. name ( ) ;
426
+
427
+ let assoc_dyn_memory = if c. rust_ty == "Object" {
425
428
ident ( "MemDynamic" )
426
429
} else if class. is_refcounted {
427
430
ident ( "MemRefCounted" )
@@ -435,7 +438,14 @@ fn make_bounds(class: &Class) -> (Ident, Ident) {
435
438
ident ( "MemManual" )
436
439
} ;
437
440
438
- ( assoc_memory, assoc_dyn_memory)
441
+ let tree = ctx. inheritance_tree ( ) ;
442
+ let is_exportable = if tree. inherits ( c, "Node" ) || tree. inherits ( c, "Resource" ) {
443
+ ident ( "Yes" )
444
+ } else {
445
+ ident ( "No" )
446
+ } ;
447
+
448
+ ( assoc_memory, assoc_dyn_memory, is_exportable)
439
449
}
440
450
441
451
fn make_class_methods (
0 commit comments