| 1 | # Copyright 2010, 2011, 2012, 2017 Kevin Ryde | ||
| 2 | |||
| 3 | # This file is part of Glib-Ex-ConnectProperties. | ||
| 4 | # | ||
| 5 | # Glib-Ex-ConnectProperties is free software; you can redistribute it and/or | ||
| 6 | # modify it under the terms of the GNU General Public License as published | ||
| 7 | # by the Free Software Foundation; either version 3, or (at your option) any | ||
| 8 | # later version. | ||
| 9 | # | ||
| 10 | # Glib-Ex-ConnectProperties is distributed in the hope that it will be | ||
| 11 | # useful, but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
| 13 | # Public License for more details. | ||
| 14 | # | ||
| 15 | # You should have received a copy of the GNU General Public License along | ||
| 16 | # with Glib-Ex-ConnectProperties. If not, see <http://www.gnu.org/licenses/>. | ||
| 17 | |||
| 18 | package Glib::Ex::ConnectProperties::Element::object; | ||
| 19 | use 5.008; | ||
| 20 | use strict; | ||
| 21 | use warnings; | ||
| 22 | use base 'Glib::Ex::ConnectProperties::Element'; | ||
| 23 | |||
| 24 | our $VERSION = 20; | ||
| 25 | |||
| 26 | |||
| 27 | sub find_property { | ||
| 28 | my ($self) = @_; | ||
| 29 | return $self->{'object'}->find_property ($self->{'pname'}); | ||
| 30 | } | ||
| 31 | |||
| 32 | sub read_signal { | ||
| 33 | my ($self) = @_; | ||
| 34 | return 'notify::' . $self->{'pname'}; | ||
| 35 | } | ||
| 36 | |||
| 37 | sub get_value { | ||
| 38 | my ($self) = @_; | ||
| 39 | return $self->{'object'}->get_property ($self->{'pname'}); | ||
| 40 | } | ||
| 41 | sub set_value { | ||
| 42 | my ($self, $value) = @_; | ||
| 43 | $self->{'object'}->set_property ($self->{'pname'}, $value); | ||
| 44 | } | ||
| 45 | |||
| 46 | 1; | ||
| 47 | __END__ |