Revision 17553 (by benny, 2005/09/11 00:07:08) 2005-09-09 Benedikt Meurer <benny@xfce.org>

* configure.in.in: Substitute version information.
* thunar/thunar-window.c(thunar_window_action_about): Escape the
copyright sign.
* thunar/thunar-gdk-pixbuf-extensions.{c,h},
thunar/thunar-gtk-extensions.{c,h}, thunar/thunar-desktop-view.c,
thunar/thunar-icon-factory.c, thunar/thunar-icon-renderer.c,
thunar/thunar-standard-view.c, thunar/thunar-window.c,
thunar/Makefile.am: Merge the GdkPixbuf and GTK+ extensions into
the thunar namespace.
* configure.in.in, thunarx/: Import the initial extensions library.
* configure.in.in, docs/Makefile.am, Makefile.am, docs/reference/:
Import the reference manual for the extensions library.
* thunar/thunar-file.c: Implement the ThunarxFileInfo interface.
* thunar/thunar-extension-manager.{c,h}, thunar/Makefile.am: Import the
ThunarExtensionManager class.
* thunar/thunar-standard-view-ui.xml, thunar/thunar-standard-view.c: Add
support for context menu providers to the standard views.
* po/POTFILES.in: Add thunarx/thunarx-property-page.c here.
* thunar/thunar-properties-dialog.c: Add support for property page
providers here.
* Makefile.am, configure.in.in, examples/Makefile.am,
examples/open-terminal-here/: Add "Open Terminal Here" menu provider
example.


#!/usr/bin/env perl -w
#
# Copyright (c) 2004 The GLib Development Team.
# Copyright (c) 2005 Benedikt Meurer <benny@xfce.org>.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#

my $option_def = 0;

if (($#ARGV >= 0) && ($ARGV[0] eq "-def"))
  {
    shift;
    $option_def = 1;
  }

print <<EOF;
/* Generated by make-thunarx-alias.pl. Do not edit this file. */

#ifdef HAVE_GNUC_VISIBILITY

#include <glib.h>

EOF

if ($option_def)
  {
    print <<EOF
#undef IN_HEADER
#define IN_HEADER(x) 1

#undef IN_SOURCE
#define IN_SOURCE defined

EOF
  }
else
  {
    print <<EOF
#define IN_HEADER defined
#define IN_SOURCE(x) 1

EOF
  }

my $in_comment = 0;
my $in_skipped_section = 0;

while (<>)
  {
    # ignore empty lines
    next if /^\s*$/;

    # skip comments
    if ($_ =~ /^\s*\/\*/)
      {
        $in_comment = 1;
      }
    
    if ($in_comment)
      {
        if ($_ =~  /\*\/\s$/)
          {
            $in_comment = 0;
          }
        next;
      }

    # handle ifdefs
    if ($_ =~ /^\#endif/)
      {
        if (!$in_skipped_section)
          {
            print $_;
          }

        $in_skipped_section = 0;
        next;
      }

    if ($_ =~ /^\#ifdef\s+(INCLUDE_VARIABLES|INCLUDE_INTERNAL_SYMBOLS|ALL_FILES)/)
      {
        $in_skipped_section = 1;
      }

    if ($in_skipped_section)
      {
        next;
      }

    if ($_ =~ /^\#ifn?def\s+G/)
      {
        print $_;
        next;
      }
   
    if ($_ =~ /^\#if.*(IN_SOURCE|IN_HEADER)/)
      {
        print $_;
        next;
      }

    chop;
    my $line = $_;
    my @words;
    my $attributes = "";

    @words = split (/ /, $line);
    my $symbol = shift (@words);
    chomp ($symbol);
    my $alias = "IA__".$symbol;
    
    # Drop any Win32 specific .def file syntax,  but keep attributes
    foreach $word (@words)
      {
        $attributes = "$attributes $word" unless $word eq "PRIVATE";
      }
    
    if (!$option_def)
      {
        print <<EOF
extern __typeof ($symbol) $alias __attribute((visibility("hidden")))$attributes;
\#define $symbol $alias

EOF
      }
    else
      {
        print <<EOF
\#undef $symbol 
extern __typeof ($symbol) $symbol __attribute((alias("$alias"), visibility("default")));

EOF
      }
  }

print <<EOF;

#endif /* HAVE_GNUC_VISIBILITY */
EOF