Commit 5427a4aa65b869706043d995db0c56629140088b

Authored by Perry Werneck
1 parent 0ce9ec40
Exists in master and in 1 other branch develop

Fixing getscreen width, height and length methods.

client/src/core/linux/request.cc
@@ -150,19 +150,19 @@ @@ -150,19 +150,19 @@
150 return *this; 150 return *this;
151 } 151 }
152 152
153 - static int getUIntValue(DBusMessageIter &iter) { 153 + static unsigned int getUIntValue(DBusMessageIter &iter) {
154 154
155 if(dbus_message_iter_get_arg_type(&iter) == DBUS_TYPE_UINT32) { 155 if(dbus_message_iter_get_arg_type(&iter) == DBUS_TYPE_UINT32) {
156 156
157 dbus_uint32_t rc = 0; 157 dbus_uint32_t rc = 0;
158 dbus_message_iter_get_basic(&iter, &rc); 158 dbus_message_iter_get_basic(&iter, &rc);
159 - return (int) rc; 159 + return (unsigned int) rc;
160 160
161 } else if(dbus_message_iter_get_arg_type(&iter) == DBUS_TYPE_UINT16) { 161 } else if(dbus_message_iter_get_arg_type(&iter) == DBUS_TYPE_UINT16) {
162 162
163 dbus_uint16_t rc = 0; 163 dbus_uint16_t rc = 0;
164 dbus_message_iter_get_basic(&iter, &rc); 164 dbus_message_iter_get_basic(&iter, &rc);
165 - return (int) rc; 165 + return (unsigned int) rc;
166 166
167 } else if(dbus_message_iter_get_arg_type(&iter) == DBUS_TYPE_VARIANT) { 167 } else if(dbus_message_iter_get_arg_type(&iter) == DBUS_TYPE_VARIANT) {
168 168
@@ -177,14 +177,15 @@ @@ -177,14 +177,15 @@
177 177
178 dbus_uint32_t rc = 0; 178 dbus_uint32_t rc = 0;
179 dbus_message_iter_get_basic(&sub, &rc); 179 dbus_message_iter_get_basic(&sub, &rc);
180 - return (int) rc; 180 + return (unsigned int) rc;
181 181
182 } else if (current_type == DBUS_TYPE_UINT16) { 182 } else if (current_type == DBUS_TYPE_UINT16) {
183 dbus_uint16_t rc = 0; 183 dbus_uint16_t rc = 0;
184 dbus_message_iter_get_basic(&sub, &rc); 184 dbus_message_iter_get_basic(&sub, &rc);
185 - return (int) rc; 185 + return (unsigned int) rc;
186 186
187 } 187 }
  188 +
188 dbus_message_iter_next(&sub); 189 dbus_message_iter_next(&sub);
189 } 190 }
190 191
@@ -218,6 +219,8 @@ @@ -218,6 +219,8 @@
218 219
219 while ((current_type = dbus_message_iter_get_arg_type(&sub)) != DBUS_TYPE_INVALID) { 220 while ((current_type = dbus_message_iter_get_arg_type(&sub)) != DBUS_TYPE_INVALID) {
220 221
  222 + debug("Current_type=",(char) current_type);
  223 +
221 if (current_type == DBUS_TYPE_INT32) { 224 if (current_type == DBUS_TYPE_INT32) {
222 225
223 dbus_int32_t rc = 0; 226 dbus_int32_t rc = 0;
client/src/session/remote/properties.cc
@@ -110,7 +110,7 @@ @@ -110,7 +110,7 @@
110 110
111 unsigned short IPC::Session::getScreenWidth() const { 111 unsigned short IPC::Session::getScreenWidth() const {
112 112
113 - int value; 113 + uint32_t value;
114 getProperty("width",value); 114 getProperty("width",value);
115 return (unsigned short) value; 115 return (unsigned short) value;
116 116
@@ -118,7 +118,7 @@ @@ -118,7 +118,7 @@
118 118
119 unsigned short IPC::Session::getScreenHeight() const { 119 unsigned short IPC::Session::getScreenHeight() const {
120 120
121 - int value; 121 + uint32_t value;
122 getProperty("height",value); 122 getProperty("height",value);
123 return (unsigned short) value; 123 return (unsigned short) value;
124 124
@@ -126,7 +126,7 @@ @@ -126,7 +126,7 @@
126 126
127 unsigned short IPC::Session::getScreenLength() const { 127 unsigned short IPC::Session::getScreenLength() const {
128 128
129 - int value; 129 + uint32_t value;
130 getProperty("length",value); 130 getProperty("length",value);
131 return (unsigned short) value; 131 return (unsigned short) value;
132 132
client/src/testprogram/testprogram.cc
@@ -103,6 +103,7 @@ @@ -103,6 +103,7 @@
103 << "Connection state is " << toCharString(host.getConnectionState()) << std::endl 103 << "Connection state is " << toCharString(host.getConnectionState()) << std::endl
104 << "Program message is " << toCharString(host.getProgramMessage()) << std::endl 104 << "Program message is " << toCharString(host.getProgramMessage()) << std::endl
105 << "Luname is " << host.getLUName() << std::endl 105 << "Luname is " << host.getLUName() << std::endl
  106 + << "Screen size is " << host.getScreenWidth() << "x" << host.getScreenHeight() << " (" << host.getScreenLength() << ")"
106 << std::endl; 107 << std::endl;
107 108
108 if(host) { 109 if(host) {
server/pw3270-plugin-ipc.cbp
@@ -58,8 +58,6 @@ @@ -58,8 +58,6 @@
58 <Linker> 58 <Linker>
59 <Add option="`pkg-config --libs gtk+-3.0 lib3270 v3270 gio-2.0 dbus-1 dbus-glib-1`" /> 59 <Add option="`pkg-config --libs gtk+-3.0 lib3270 v3270 gio-2.0 dbus-1 dbus-glib-1`" />
60 </Linker> 60 </Linker>
61 - <Unit filename="../common/src/include/lib3270/ipc-glib.h" />  
62 - <Unit filename="../common/src/include/lib3270/ipc.h" />  
63 <Unit filename="src/core/constants.c"> 61 <Unit filename="src/core/constants.c">
64 <Option compilerVar="CC" /> 62 <Option compilerVar="CC" />
65 </Unit> 63 </Unit>
@@ -130,6 +128,7 @@ @@ -130,6 +128,7 @@
130 <Option compilerVar="CC" /> 128 <Option compilerVar="CC" />
131 </Unit> 129 </Unit>
132 <Unit filename="src/include/config.h.in" /> 130 <Unit filename="src/include/config.h.in" />
  131 + <Unit filename="src/include/ipc-glib.h" />
133 <Unit filename="src/plugin/plugin.c"> 132 <Unit filename="src/plugin/plugin.c">
134 <Option compilerVar="CC" /> 133 <Option compilerVar="CC" />
135 </Unit> 134 </Unit>