~ubuntu-branches/ubuntu/quantal/texmacs/quantal

« back to all changes in this revision

Viewing changes to src/Plugins/Cairo/munge.pl

  • Committer: Bazaar Package Importer
  • Author(s): Atsuhito KOHDA, Kamaraju Kusumanchi, kohda
  • Date: 2009-04-26 19:35:14 UTC
  • mfrom: (1.1.10 upstream) (4.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090426193514-9yo3oggdslgdls4b
Tags: 1:1.0.7.2-1
[Kamaraju Kusumanchi <kamaraju@gmail.com>]
* New upstream release
* texmacs crashes if /usr/share/texmacs/TeXmacs/misc/pixmaps/unknown.ps
  is not present. Do not remove it. (Closes: #484073, #497021)
* update patches 03_mupad.dpatch, 04_axiom.dpatch, 11-desktop-file.dpatch
* fix the mime problem in gnome. Thanks to Andrea Gamba for the fix.
[kohda]
* Refined a fix for the mime problem in gnome a bit.
* Try to fix /bin/sh problem (debian/fixsh) but it is not complete fix yet.
* Try to fix hard coded settings for ipa fonts(patches/09_ipa.dpatch), 
  especially for Debian where no ipa fonts exist yet.
* Fixed obsolete Build-Depends: changed libltdl3-dev to 
  libltdl-dev | libltdl7-dev (the latter for Ubuntu?)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/local/bin/perl
 
2
# use this program to generate interface informations for the cairo library
 
3
# to be used in the glue code
 
4
# output: list of declarations for proxy function pointers, macros to link symbols, converted source for cairo_renderer.cpp
 
5
 
 
6
# by M. Gubinelli, 12/2008
 
7
 
 
8
use strict;
 
9
 
 
10
my $acc = "";
 
11
my %b;
 
12
 
 
13
 
 
14
my $filename = shift;
 
15
 
 
16
while ($filename) {
 
17
  open (FILE, "<", $filename)  or  die "Failed to read file $filename : $! \n";
 
18
  my $whole_file;
 
19
  {
 
20
    local $/;
 
21
    $whole_file = <FILE>;
 
22
  }
 
23
  close(FILE);
 
24
 
 
25
  while ($whole_file =~ m#cairo_public([^;]*)#sg) {
 
26
    $_ = $1 ;
 
27
    s/[\n\t ]+/ /g;
 
28
    s/^ //;
 
29
    m/ (cairo_[a-z_]*)/;
 
30
    my $l = $1;  
 
31
    s/ (cairo_[a-z_]*)/ \(\*tm_\1\)/;
 
32
    #m/(tm_cairo_[a-z_]*)/;  
 
33
    $b{$l} = $_;
 
34
    $acc .= $l . " --> " . $_ . ";\n";
 
35
  }
 
36
 
 
37
  $filename = shift;
 
38
}
 
39
 
 
40
my $decl;
 
41
my $source_file;
 
42
$filename = "cairo_renderer.cpp";
 
43
open (FILE, "<", $filename)  or  die "Failed to read file $filename : $! \n";
 
44
{
 
45
  local $/;
 
46
  $source_file = <FILE>;
 
47
}
 
48
close(FILE);
 
49
 
 
50
#print $source_file;
 
51
 
 
52
my $acc_int;
 
53
my $acc_link;
 
54
my $acc_dynlink;
 
55
 
 
56
 
 
57
foreach $decl (keys %b) {
 
58
  if ($source_file =~ /$decl/) {
 
59
    #    print $decl . ";\n";
 
60
    $acc_int .= "extern " . $b{$decl} . ";\n";
 
61
    $acc_link .= "tm_" . $decl . " = " . $decl . ";\n";
 
62
    $acc_dynlink .= "CAIRO_LINK(" . $decl . ", tm_" . $decl . ");\n";
 
63
};
 
64
}
 
65
 
 
66
print $acc_int . "\n" ;
 
67
print $acc_link . "\n" ;
 
68
print $acc_dynlink . "\n" ;
 
69
 
 
70
foreach $decl (keys %b) {
 
71
  $source_file =~ s/$decl/tm_$decl/g;
 
72
}
 
73
 
 
74
$filename = "cairo_renderer.cpp.transated";
 
75
open (FILE, ">", $filename)  or  die "Failed to read file $filename : $! \n";
 
76
print FILE $source_file;
 
77
close(FILE);
 
78
 
 
79
 
 
80
 
 
81
#$acc ~= s/
 
 
b'\\ No newline at end of file'