Re: gtkdoc-scangobj patch



jacob berkman <jacob ximian com> writes:

> hello,
> 
> this patch allows gtk's docs to build w/o an X connection.  it also
> provides a way for you to use a different type init func than
> gtk_type_init().  in this way, the --nogtkinit argument could just be
> removed.
> 
> if you don't like this, could we at least change gtk_init() to
> gtk_type_init() so it doesn't require X?

I would support changing gtkdoc-scangobj to remove nogtkinit
and have only --init-func, defaulting to g_type_init().
I don't think gtkdoc-scangobj should have anything GTK+ specific
in it.

Actually, we are supposed to be moving to use lazy initialization
of enum/flags/boxed for GTK+ as we do for all other libraries,
which would probably allow simply using g_type_init() for GTK+.

Regards,
                                        Owen

> Index: gtkdoc-scangobj.in
> ===================================================================
> RCS file: /cvs/gnome/gtk-doc/gtkdoc-scangobj.in,v
> retrieving revision 1.17
> diff -u -r1.17 gtkdoc-scangobj.in
> --- gtkdoc-scangobj.in	2001/08/15 11:05:15	1.17
> +++ gtkdoc-scangobj.in	2001/10/29 18:46:06
> @@ -39,14 +39,17 @@
>  my $MODULE;
>  my $OUTPUT_DIR;
>  my $PRINT_VERSION;
> +my $TYPE_INIT_FUNC="gtk_type_init ()";
>  
>  %optctl = (module => \$MODULE,
>  	   types => \$TYPES_FILE,
>  	   nogtkinit => \$NO_GTK_INIT,
>  	   'output-dir' => \$OUTPUT_DIR,
> -	   version => \$PRINT_VERSION);
> +	   version => \$PRINT_VERSION,
> +	   'type-init-func' => \$TYPE_INIT_FUNC
> +	  );
>  	   
> -GetOptions(\%optctl, "module=s", "types:s", "output-dir:s", "nogtkinit", "version");
> +GetOptions(\%optctl, "module=s", "types:s", "output-dir:s", "type-init-func:s", "nogtkinit", "version");
>  
>  if ($PRINT_VERSION) {
>      print "@VERSION \n";
> @@ -57,6 +60,10 @@
>  
>  $TYPES_FILE = $TYPES_FILE ? $TYPES_FILE : "$OUTPUT_DIR/$MODULE.types";
>  
> +if ($NO_GTK_INIT) {
> +  $TYPE_INIT_FUNC="g_type_init ()";
> +}
> +
>  open TYPES, $TYPES_FILE || die "Cannot open $TYPES_FILE: $!\n";
>  open OUTPUT, ">$MODULE-scan.c" || die "Cannot open $MODULE-scan.c: $!\n";
>  
> @@ -152,19 +159,8 @@
>  int
>  main (int argc, char *argv[])
>  {
> -EOT
> +  $TYPE_INIT_FUNC;
>  
> -  if ($NO_GTK_INIT) {
> -    print OUTPUT <<EOT;
> -  g_type_init ();
> -EOT
> -  } else {
> -    print OUTPUT <<EOT;
> -  gtk_init (&argc, &argv);
> -EOT
> -  }
> -
> -print OUTPUT <<EOT;
>    get_object_types ();
>  
>    output_signals ();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]