sync with tizen_2.2
[sdk/emulator/qemu.git] / tizen / src / skin / client / src / org / tizen / emulator / skin / comm / sock / data / MouseEventData.java
1 /**
2  * 
3  *
4  * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact:
7  * GiWoong Kim <giwoong.kim@samsung.com>
8  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
9  * HyunJun Son
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
24  *
25  * Contributors:
26  * - S-Core Co., Ltd
27  *
28  */
29
30 package org.tizen.emulator.skin.comm.sock.data;
31
32 import java.io.IOException;
33
34 /**
35  * 
36  *
37  */
38 public class MouseEventData extends AbstractSendData {
39
40         int mouseButton;
41         int eventType;
42         int hostX;
43         int hostY;
44         int guestX;
45         int guestY;
46         int z;
47
48         public MouseEventData(int mouseButton, int eventType,
49                         int hostX, int hostY, int guestX, int guestY, int z) {
50                 this.mouseButton = mouseButton;
51                 this.eventType = eventType;
52                 this.hostX = hostX;
53                 this.hostY = hostY;
54                 this.guestX = guestX;
55                 this.guestY = guestY;
56                 this.z = z;
57         }
58
59         @Override
60         protected void write() throws IOException {
61                 writeInt(mouseButton);
62                 writeInt(eventType);
63                 writeInt(hostX);
64                 writeInt(hostY);
65                 writeInt(guestX);
66                 writeInt(guestY);
67                 writeInt(z);
68         }
69
70         @Override
71         public String toString() {
72                 StringBuilder builder = new StringBuilder();
73                 builder.append("MouseEventData [mouseButton=");
74                 builder.append(mouseButton);
75                 builder.append(", eventType=");
76                 builder.append(eventType);
77                 builder.append(", hostX=");
78                 builder.append(hostX);
79                 builder.append(", hostY=");
80                 builder.append(hostY);
81                 builder.append(", guestX=");
82                 builder.append(guestX);
83                 builder.append(", guestY=");
84                 builder.append(guestY);
85                 builder.append(", id=");
86                 builder.append(z);
87                 builder.append("]");
88                 return builder.toString();
89         }
90
91 }