@@ -11,9 +11,9 @@ function _enums_and_flags(es, skiplist, incl_typeinit, const_mod, const_exports,
1111 end
1212end
1313
14- function all_const_exprs! (const_mod, const_exports, ns;print_summary= true ,incl_typeinit= true ,skiplist= Symbol[], export_constants = true )
14+ function all_const_exprs! (const_mod, const_exports, ns;print_summary= true ,incl_typeinit= true ,skiplist= Symbol[], export_constants = true , exclude_deprecated = true )
1515 loaded= Symbol[]
16- c = get_consts (ns)
16+ c = get_consts (ns, exclude_deprecated )
1717
1818 for (name,val) in c
1919 in (name, skiplist) && continue
@@ -24,14 +24,14 @@ function all_const_exprs!(const_mod, const_exports, ns;print_summary=true,incl_t
2424 printstyled (" Generated " ,length (c)," constants\n " ;color= :green )
2525 end
2626
27- es= get_all (ns,GIEnumInfo)
27+ es= get_all (ns,GIEnumInfo,exclude_deprecated )
2828 _enums_and_flags (es, skiplist, incl_typeinit, const_mod, const_exports, loaded, export_constants)
2929
3030 if print_summary && length (es)> 0
3131 printstyled (" Generated " ,length (es)," enums\n " ;color= :green )
3232 end
3333
34- es= get_all (ns,GIFlagsInfo)
34+ es= get_all (ns,GIFlagsInfo,exclude_deprecated )
3535 _enums_and_flags (es, skiplist, incl_typeinit, const_mod, const_exports, loaded, export_constants)
3636
3737 if print_summary && length (es)> 0
@@ -40,12 +40,12 @@ function all_const_exprs!(const_mod, const_exports, ns;print_summary=true,incl_t
4040 loaded
4141end
4242
43- function export_consts! (ns,path,prefix,skiplist = Symbol[]; doc_prefix = prefix, doc_xml = nothing , export_constants = true )
43+ function export_consts! (ns,path,prefix,skiplist = Symbol[]; doc_prefix = prefix, doc_xml = nothing , export_constants = true , exclude_deprecated = true )
4444 toplevel, exprs, exports = GI. output_exprs ()
4545
4646 const_mod = Expr (:block )
4747
48- c = all_const_exprs! (const_mod, exports, ns; skiplist= skiplist, export_constants)
48+ c = all_const_exprs! (const_mod, exports, ns; skiplist= skiplist, export_constants, exclude_deprecated )
4949 if doc_xml != = nothing
5050 GI. append_const_docs! (const_mod. args, doc_prefix, doc_xml, c)
5151 end
@@ -134,13 +134,10 @@ end
134134
135135function struct_constructor_exprs! (exprs,ns;constructor_skiplist= [], struct_skiplist= [], exclude_deprecated= true ,first_list= [])
136136 s= get_non_skipped (ns,GIStructInfo,struct_skiplist,exclude_deprecated)
137- structs = get_name .(s)
138- for ss in vcat (first_list, structs)
137+ for ss in vcat (first_list, get_name .(s))
139138 ssi= gi_find_by_name (ns,ss)
140139 constructors = get_constructors (ssi;skiplist= constructor_skiplist, struct_skiplist= struct_skiplist, exclude_deprecated= exclude_deprecated)
141- if ! isempty (constructors)
142- append! (exprs,constructors)
143- end
140+ append! (exprs,constructors)
144141 end
145142end
146143
@@ -191,18 +188,17 @@ function all_struct_exprs!(exprs,exports,ns;print_summary=true,excludelist=[],co
191188 struct_skiplist, loaded
192189end
193190
194- function all_callbacks! (exprs, exports, ns; callback_skiplist = [])
195- callbacks= get_all (ns,GICallbackInfo)
196- for c in callbacks
191+ function all_callbacks! (exprs, exports, ns; callback_skiplist = [], exclude_deprecated = true )
192+ for c in get_all (ns,GICallbackInfo,exclude_deprecated)
197193 get_name (c) in callback_skiplist && continue
198194 try
199- push! (exprs, decl (c))
200- catch e
201- if isa (e, NotImplementedError)
202- continue
203- else
204- rethrow (e)
205- end
195+ push! (exprs, decl (c))
196+ catch e
197+ if isa (e, NotImplementedError)
198+ continue
199+ else
200+ rethrow (e)
201+ end
206202 end
207203 push! (exports. args, get_full_name (c))
208204 end
@@ -235,7 +231,7 @@ function export_struct_exprs!(ns,path,prefix, struct_skiplist, import_as_opaque;
235231 end
236232 all_object_signals! (exprs, ns;skiplist= signal_skiplist,object_skiplist= object_skiplist, exclude_deprecated = exclude_deprecated)
237233 if output_callbacks
238- all_callbacks! (exprs, exports, ns; callback_skiplist)
234+ all_callbacks! (exprs, exports, ns; callback_skiplist, exclude_deprecated )
239235 end
240236 push! (exprs,exports)
241237 write_to_file (path," $(prefix) _structs" ,toplevel)
@@ -268,8 +264,7 @@ function all_struct_methods!(exprs,ns;print_summary=true,print_detailed=false,sk
268264 (exclude_deprecated && is_deprecated (m)) && continue
269265 print_detailed && println (get_name (m))
270266 try
271- fun= create_method (m, liboverride)
272- push! (exprs, fun)
267+ create_method (exprs, m, liboverride)
273268 push! (handled_symbols,get_symbol (m))
274269 created+= 1
275270 catch e
@@ -314,7 +309,7 @@ function all_objects!(exprs,exports,ns;print_summary=true,handled=Symbol[],skipl
314309 imported -= 1
315310 continue
316311 end
317- if get_type_init (o)== :intern # GParamSpec and children output this
312+ if get_type_init_function_name (o)== :intern # GParamSpec and children output this
318313 continue
319314 end
320315 obj_decl! (exprs,o,ns,handled)
@@ -332,7 +327,7 @@ function all_objects!(exprs,exports,ns;print_summary=true,handled=Symbol[],skipl
332327 end
333328 for o in objects
334329 constructors = get_constructors (o;skiplist= constructor_skiplist, struct_skiplist= skiplist, exclude_deprecated= exclude_deprecated)
335- isempty (constructors) || append! (exprs,constructors)
330+ append! (exprs,constructors)
336331 end
337332 if print_summary
338333 printstyled (" Created " ,imported," objects out of " ,length (objects)," \n " ;color= :green )
@@ -344,8 +339,7 @@ function all_object_methods!(exprs,ns;skiplist=Symbol[],object_skiplist=Symbol[]
344339 not_implemented= 0
345340 skipped= 0
346341 created= 0
347- objects= get_non_skipped (ns,GIObjectInfo,object_skiplist,exclude_deprecated)
348- for o in objects
342+ for o in get_non_skipped (ns,GIObjectInfo,object_skiplist,exclude_deprecated)
349343 name= get_name (o)
350344 methods= get_methods (o)
351345 for m in methods
@@ -355,8 +349,7 @@ function all_object_methods!(exprs,ns;skiplist=Symbol[],object_skiplist=Symbol[]
355349 end
356350 (exclude_deprecated && is_deprecated (m)) && continue
357351 try
358- fun= create_method (m, liboverride)
359- push! (exprs, fun)
352+ create_method (exprs, m, liboverride)
360353 created+= 1
361354 catch e
362355 if isa (e, NotImplementedError)
383376
384377function all_object_signals! (exprs,ns;skiplist= Symbol[],object_skiplist= Symbol[], liboverride= nothing , exclude_deprecated= true )
385378 not_implemented= 0
386- objects= get_non_skipped (ns,GIObjectInfo,object_skiplist,exclude_deprecated)
387- for o in objects
379+ for o in get_non_skipped (ns,GIObjectInfo,object_skiplist,exclude_deprecated)
388380 signals = get_all_signals (o)
389381 for s in signals
390382 (exclude_deprecated && is_deprecated (s)) && continue
@@ -423,8 +415,7 @@ function all_interface_methods!(exprs,ns;skiplist=Symbol[],interface_skiplist=Sy
423415 end
424416 (exclude_deprecated && is_deprecated (m)) && continue
425417 try
426- fun= create_method (m, liboverride)
427- push! (exprs, fun)
418+ create_method (exprs, m, liboverride)
428419 created+= 1
429420 catch e
430421 if isa (e, NotImplementedError)
@@ -462,11 +453,11 @@ function all_functions!(exprs,ns;print_summary=true,skiplist=Symbol[],symbol_ski
462453 unsupported = false # whatever we happen to unsupport
463454 for arg in get_args (i)
464455 try
465- bt = get_base_type (get_type (arg))
456+ bt = get_base_type (get_type_info (arg))
466457 if isa (bt,Ptr{GIArrayType}) || isa (bt,Ptr{GIArrayType{3 }})
467458 unsupported = true ; break
468459 end
469- if (isa (get_base_type (get_type (arg)), Nothing))
460+ if (isa (get_base_type (get_type_info (arg)), Nothing))
470461 unsupported = true ; break
471462 end
472463 catch e
@@ -496,8 +487,7 @@ function all_functions!(exprs,ns;print_summary=true,skiplist=Symbol[],symbol_ski
496487 name = get_name (i)
497488 name = Symbol (" $name " )
498489 try
499- fun= create_method (i, liboverride)
500- push! (exprs, fun)
490+ create_method (exprs, i, liboverride)
501491 j+= 1
502492 catch e
503493 if isa (e, NotImplementedError)
0 commit comments