File: CarAdaptor.pm

package info (click to toggle)
qt4-perl 4.8.4-1.2
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 8,636 kB
  • ctags: 8,100
  • sloc: perl: 42,963; cpp: 28,039; makefile: 160; xml: 98; sh: 4
file content (94 lines) | stat: -rw-r--r-- 2,058 bytes parent folder | download | duplicates (3)
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#
# This file was generated by qdbusxml2cpp version 0.7
# Command line was: qdbusxml2cpp -a CarAdaptor.pm car.xml
#
# qdbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
#
# This is an auto-generated file.
# This file may have been hand-edited. Look for HAND-EDIT comments
# before re-generating it.
#

#
# Adaptor class for interface com.trolltech.Examples.CarInterface
#
package CarAdaptor;
use strict;
use warnings;
use QtCore4;
use QtDBus4;
use QtCore4::isa qw( Qt::DBusAbstractAdaptor );

use QtCore4::classinfo
    'D-Bus Interface' => 'com.trolltech.Examples.CarInterface',
    'D-Bus Introspection' => '' .
"  <interface name=\"com.trolltech.Examples.CarInterface\">\n" .
"    <method name=\"accelerate\"/>\n" .
"    <method name=\"decelerate\"/>\n" .
"    <method name=\"turnLeft\"/>\n" .
"    <method name=\"turnRight\"/>\n" .
"    <signal name=\"crashed\"/>\n" .
"  </interface>\n" .
    '';

use QtCore4::slots # METHODS
    'public' => 1,
    'accelerate' => [],
    'decelerate' => [],
    'turnLeft' => [],
    'turnRight' => [];
use QtCore4::signals # SIGNALS
    'public' => 1,
    'crashed' => [];

#
# Implementation of adaptor class CarInterfaceAdaptor
#

sub NEW
{
    # constructor
    my ( $class, $parent, $data ) = @_;
    $class->SUPER::NEW($parent);
    if ( defined $data ) {
        this->{data} = $data;
    } else {
        this->{data} = $parent;
    }
    this->setAutoRelaySignals(1);

    # HAND-EDIT
    this->startTimer(1000 / 33);
}

sub accelerate
{
    # handle method call com.trolltech.Examples.CarInterface.accelerate
    this->{data}->accelerate();
}

sub decelerate
{
    # handle method call com.trolltech.Examples.CarInterface.decelerate
    this->{data}->decelerate();
}

sub turnLeft
{
    # handle method call com.trolltech.Examples.CarInterface.turnLeft
    this->{data}->turnLeft();
}

sub turnRight
{
    # handle method call com.trolltech.Examples.CarInterface.turnRight
    this->{data}->turnRight();
}

# HAND-EDIT
sub timerEvent
{
    this->{data}->timerEvent(@_);
}

1;