Move keyboardProc() so we have all the init stuff in one place.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5076 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/unix/xserver/hw/vnc/Input.cc b/unix/xserver/hw/vnc/Input.cc
index 83a9e88..d36a4d7 100644
--- a/unix/xserver/hw/vnc/Input.cc
+++ b/unix/xserver/hw/vnc/Input.cc
@@ -64,9 +64,6 @@
 static LogWriter vlog("Input");
 
 #define BUTTONS 7
-static int pointerProc(DeviceIntPtr pDevice, int onoff);
-
-static int keyboardProc(DeviceIntPtr pDevice, int onoff);
 
 /* Event queue is shared between all devices. */
 #if XORG == 15
@@ -262,6 +259,47 @@
 	return Success;
 }
 
+static void keyboardBell(int percent, DeviceIntPtr device, pointer ctrl,
+			 int class_)
+{
+	if (percent > 0)
+		vncBell();
+}
+
+extern void GetInitKeyboardMap(KeySymsPtr keysyms, CARD8 *modmap);
+
+static int keyboardProc(DeviceIntPtr pDevice, int onoff)
+{
+#if XORG < 17
+	KeySymsRec keySyms;
+	CARD8 modMap[MAP_LENGTH];
+#endif
+	DevicePtr pDev = (DevicePtr)pDevice;
+
+	switch (onoff) {
+	case DEVICE_INIT:
+#if XORG < 17
+		GetInitKeyboardMap(&keySyms, modMap);
+#endif
+		InitKeyboardDeviceStruct(
+#if XORG >= 17
+					 pDevice, NULL,
+#else
+					 pDev, &keySyms, modMap,
+#endif
+					 keyboardBell, (KbdCtrlProcPtr)NoopDDA);
+		break;
+	case DEVICE_ON:
+		pDev->on = TRUE;
+		break;
+	case DEVICE_OFF:
+		pDev->on = FALSE;
+		break;
+	}
+
+	return Success;
+}
+
 void InputDevice::InitInputDevice(void)
 {
 	if (initialized)
@@ -568,47 +606,3 @@
 	 */
 	mieqProcessInputEvents();
 }
-
-static void keyboardBell(int percent, DeviceIntPtr device, pointer ctrl,
-			 int class_)
-{
-	if (percent > 0)
-		vncBell();
-}
-
-static int keyboardProc(DeviceIntPtr pDevice, int onoff)
-{
-#if XORG < 17
-	KeySymsRec keySyms;
-	CARD8 modMap[MAP_LENGTH];
-#endif
-	DevicePtr pDev = (DevicePtr)pDevice;
-
-	switch (onoff) {
-	case DEVICE_INIT:
-#if XORG < 17
-		GetMappings(&keySyms, modMap);
-#endif
-		InitKeyboardDeviceStruct(
-#if XORG >= 17
-					 pDevice, NULL,
-#else
-					 pDev, &keySyms, modMap,
-#endif
-					 keyboardBell, (KbdCtrlProcPtr)NoopDDA);
-		break;
-	case DEVICE_ON:
-		pDev->on = TRUE;
-		break;
-	case DEVICE_OFF:
-		pDev->on = FALSE;
-		break;
-#if 0
-	case DEVICE_CLOSE:
-		break;
-#endif
-	}
-
-	return Success;
-}
-