File: Tool.pm

package info (click to toggle)
libgtk3-imageview-perl 12-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 224 kB
  • sloc: perl: 1,160; makefile: 4
file content (65 lines) | stat: -rw-r--r-- 1,180 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package Gtk3::ImageView::Tool;

use warnings;
use strict;
use Glib qw(TRUE FALSE);    # To get TRUE and FALSE

our $VERSION = '12';

sub new {
    my $class = shift;
    my $view  = shift;
    return bless { _view => $view, }, $class;
}

sub view {
    my $self = shift;
    return $self->{_view};
}

sub button_pressed {
    my $self  = shift;
    my $event = shift;
    return FALSE;
}

sub button_released {
    my $self  = shift;
    my $event = shift;
    return FALSE;
}

sub motion {
    my $self  = shift;
    my $event = shift;
    return FALSE;
}

sub cursor_at_point {
    my ( $self, $x, $y ) = @_;
    my $display     = Gtk3::Gdk::Display::get_default;
    my $cursor_type = $self->cursor_type_at_point( $x, $y );
    if ( defined $cursor_type ) {
        return Gtk3::Gdk::Cursor->new_from_name( $display, $cursor_type );
    }
    return;
}

sub cursor_type_at_point {
    my ( $self, $x, $y ) = @_;
    return;
}

# compatibility layer

sub signal_connect {
    my ( $self, @args ) = @_;
    return $self->view->signal_connect(@args);
}

sub signal_handler_disconnect {
    my ( $self, @args ) = @_;
    return $self->view->signal_handler_disconnect(@args);
}

1;