1Gtk2::Gdk::Region(3)  User Contributed Perl Documentation Gtk2::Gdk::Region(3)
2
3
4

NAME

6       Gtk2::Gdk::Region - wrapper for GdkRegion
7

HIERARCHY

9         Glib::Boxed
10         +----Gtk2::Gdk::Region
11

METHODS

13   region = Gtk2::Gdk::Region->new
14   rectangle = $region->get_clipbox
15   boolean = $region->empty
16   boolean = $region1->equal ($region2)
17       ·   $region2 (Gtk2::Gdk::Region)
18
19   $source1->intersect ($source2)
20       ·   $source2 (Gtk2::Gdk::Region)
21
22   $region->offset ($dx, $dy)
23       ·   $dx (integer)
24
25       ·   $dy (integer)
26
27   boolean = $region->point_in ($x, $y)
28       ·   $x (integer)
29
30       ·   $y (integer)
31
32   region = Gtk2::Gdk::Region->polygon ($points_ref, $fill_rule)
33       ·   $points_ref (scalar)
34
35       ·   $fill_rule (Gtk2::Gdk::FillRule)
36
37   boolean = $region->rect_equal ($rectangle)
38       ·   $rectangle (Gtk2::Gdk::Rectangle)
39
40       Since: gtk+ 2.18
41
42   overlaptype = $region->rect_in ($rect)
43       ·   $rect (Gtk2::Gdk::Rectangle)
44
45   region = Gtk2::Gdk::Region->rectangle ($rectangle)
46       ·   $rectangle (Gtk2::Gdk::Rectangle)
47
48   list = $region->get_rectangles
49       Returns a list of rectangles (Gtk2::Gdk::Rectangle's), the area covered
50       by the region.
51
52   $region->shrink ($dx, $dy)
53       ·   $dx (integer)
54
55       ·   $dy (integer)
56
57   $region->spans_intersect_foreach ($spans_ref, $sorted, $func, $data=undef)
58       ·   $spans_ref (scalar) arrayref of triples [$x1,$y1,$width1,
59           $x2,$y2,$width2, ...]
60
61       ·   $sorted (boolean)
62
63       ·   $func (scalar)
64
65       ·   $data (scalar)
66
67       Call $function for horizontal lines which intersect $region.
68
69       $spans_ref is an arrayref of x,y,width horizontal lines.  If $sorted is
70       true then they're assumed to be sorted by increasing y coordinate
71       (allowing a single pass across the region rectangles).  $function is
72       called
73
74           &$function ($x, $y, $width, $data)
75
76       for each portion of a span which intersects $region.  $function must
77       not change $region.
78
79           $region->spans_intersect_foreach ([ 0,0,50, 20,20,100, 0,10,50 ],
80                                             0, # spans not sorted by y
81                                             \&my_callback,
82                                             'hello');  # userdata
83           sub my_callback {
84             my ($x, $y, $width, $userdata) = @_;
85             print "$userdata: $x, $y, $width\n";
86           }
87
88   $source1->subtract ($source2)
89       ·   $source2 (Gtk2::Gdk::Region)
90
91   $source1->union ($source2)
92       ·   $source2 (Gtk2::Gdk::Region)
93
94   $region->union_with_rect ($rect)
95       ·   $rect (Gtk2::Gdk::Rectangle)
96
97   $source1->xor ($source2)
98       ·   $source2 (Gtk2::Gdk::Region)
99

ENUMS AND FLAGS

101   enum Gtk2::Gdk::FillRule
102       ·   'even-odd-rule' / 'GDK_EVEN_ODD_RULE'
103
104       ·   'winding-rule' / 'GDK_WINDING_RULE'
105
106   enum Gtk2::Gdk::OverlapType
107       ·   'in' / 'GDK_OVERLAP_RECTANGLE_IN'
108
109       ·   'out' / 'GDK_OVERLAP_RECTANGLE_OUT'
110
111       ·   'part' / 'GDK_OVERLAP_RECTANGLE_PART'
112

SEE ALSO

114       Gtk2, Glib::Boxed
115
117       Copyright (C) 2003-2011 by the gtk2-perl team.
118
119       This software is licensed under the LGPL.  See Gtk2 for a full notice.
120
121
122
123perl v5.32.0                      2020-07-28              Gtk2::Gdk::Region(3)
Impressum