~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to tools/pdbgen/pdb/pattern.pdb

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# The GIMP -- an image manipulation program
 
1
# GIMP - The GNU Image Manipulation Program
2
2
# Copyright (C) 1995 Spencer Kimball and Peter Mattis
3
3
 
4
4
# This program is free software; you can redistribute it and/or modify
17
17
 
18
18
# "Perlized" from C source by Manish Singh <yosh@gimp.org>
19
19
 
20
 
sub mitch_misc {
21
 
    $author = 'Michael Natterer <mitch@gimp.org>';
22
 
    $copyright = 'Michael Natterer';
23
 
    $date = '2004';
24
 
    $since = '2.2';
25
 
}
26
 
 
27
 
sub pattern_arg () {{
28
 
    name => 'name',
29
 
    type => 'string',
30
 
    desc => 'The pattern name.'
31
 
}}
32
 
 
33
 
 
34
 
# The defs
35
 
 
36
20
sub pattern_get_info {
37
21
    $blurb = 'Retrieve information about the specified pattern.';
 
22
 
38
23
    $help = <<'HELP';
39
24
This procedure retrieves information about the specified pattern.
40
25
This includes the pattern extents (width and height).
41
26
HELP
42
27
 
43
 
    &mitch_misc;
 
28
    &mitch_pdb_misc('2004', '2.2');
44
29
 
45
30
    @inargs = (
46
 
        &pattern_arg
 
31
        { name => 'name', type => 'string',
 
32
          desc => 'The pattern name.' }
47
33
    );
48
34
 
49
35
    @outargs = (
50
 
        { name => 'width', type => 'int32', no_declare => '1',
51
 
          alias => 'pattern->mask->width', void_ret => '1',
 
36
        { name => 'width', type => 'int32', void_ret => '1',
52
37
          desc => "The pattern width" },
53
 
        { name => 'height', type => 'int32', no_declare => '1',
54
 
          alias => 'pattern->mask->height',
 
38
        { name => 'height', type => 'int32',
55
39
          desc => "The pattern height" },
56
 
        { name => 'bpp', type => 'int32', no_declare => '1',
57
 
          alias => 'pattern->mask->bytes',
 
40
        { name => 'bpp', type => 'int32',
58
41
          desc => "The pattern bpp" }
59
42
    );
60
43
 
61
44
    %invoke = (
62
 
        vars => [ 'GimpPattern *pattern = NULL' ],
63
45
        code => <<'CODE'
64
46
{
65
 
  pattern = (GimpPattern *)
 
47
  GimpPattern *pattern = (GimpPattern *)
66
48
    gimp_container_get_child_by_name (gimp->pattern_factory->container, name);
67
49
 
68
 
  success = (pattern != NULL);
 
50
  if (pattern)
 
51
    {
 
52
      width  = pattern->mask->width;
 
53
      height = pattern->mask->height;
 
54
      bpp    = pattern->mask->bytes;
 
55
    }
 
56
  else
 
57
    success = FALSE;
69
58
}
70
59
CODE
71
60
    );
82
71
data.
83
72
HELP
84
73
 
85
 
    &mitch_misc;
 
74
    &mitch_pdb_misc('2004', '2.2');
86
75
 
87
76
    @inargs = (
88
 
        &pattern_arg
 
77
        { name => 'name', type => 'string',
 
78
          desc => 'The pattern name.' }
89
79
    );
90
80
 
91
81
    @outargs = (
92
 
        { name => 'width', type => 'int32', no_declare => '1',
93
 
          alias => 'pattern->mask->width', void_ret => '1',
 
82
        { name => 'width', type => 'int32', void_ret => '1',
94
83
          desc => "The pattern width" },
95
 
        { name => 'height', type => 'int32', no_declare => '1',
96
 
          alias => 'pattern->mask->height',
 
84
        { name => 'height', type => 'int32',
97
85
          desc => "The pattern height" },
98
 
        { name => 'bpp', type => 'int32', no_declare => '1',
99
 
          alias => 'pattern->mask->bytes',
 
86
        { name => 'bpp', type => 'int32',
100
87
          desc => "The pattern bpp" },
101
 
        { name => 'color_bytes', type => 'int8array', init => 1,
 
88
        { name => 'color_bytes', type => 'int8array',
102
89
          desc => 'The pattern data.',
103
 
          array => { init => 1,
104
 
                     desc => 'Number of pattern bytes' } }
 
90
          array => { desc => 'Number of pattern bytes' } }
105
91
    );
106
92
    
107
93
    %invoke = (
108
 
        vars => [ 'GimpPattern *pattern = NULL' ],
109
94
        code => <<'CODE'
110
95
{
111
 
  pattern = (GimpPattern *)
 
96
  GimpPattern *pattern = (GimpPattern *)
112
97
    gimp_container_get_child_by_name (gimp->pattern_factory->container, name);
113
98
 
114
99
  if (pattern)
115
100
    {
 
101
      width           = pattern->mask->width;
 
102
      height          = pattern->mask->height;
 
103
      bpp             = pattern->mask->bytes;
116
104
      num_color_bytes = pattern->mask->height * pattern->mask->width *
117
105
                        pattern->mask->bytes;
118
106
      color_bytes     = g_memdup (temp_buf_data (pattern->mask),
131
119
              "core/gimpdatafactory.h" "core/gimppattern.h" );
132
120
 
133
121
@procs = qw(pattern_get_info pattern_get_pixels);
 
122
 
134
123
%exports = (app => [@procs], lib => [@procs]);
135
124
 
136
125
$desc = 'Pattern';