00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "Core/precomp.h"
00020
00021 #ifdef USE_PTC
00022
00023 #include <ptc/ptc.h>
00024 #include "API/Core/Display/display.h"
00025 #include "Core/System/Unix/implementation_ptc.h"
00026 #include "Core/Display/PTC/displaycard_ptc.h"
00027 #include "implementation_xwindow.h"
00028 #include "API/Core/Display/display.h"
00029 #include "Core/Display/X11/display_xwindow.h"
00030 #include "API/Core/Input/input.h"
00031 #include "Core/Input/X11/mouse_x11.h"
00032 #include "Core/Input/X11/keyboard_x11.h"
00033 #include "Core/Input/X11/joystick_linux.h"
00034 #include "implementation.h"
00035
00036 extern "C"
00037 {
00038 DL_PREFIX char* clan_module_identify() {
00039 return "OpenPTC X11 target";
00040 }
00041
00042 DL_PREFIX char* clan_module_abbreviation() {
00043 return "ptc";
00044 }
00045
00046 DL_PREFIX void clan_module_init()
00047 {
00048 CL_Implementation_PTC::add_display();
00049 }
00050 }
00051
00052 char *ptc_identify() {
00053 return clan_module_identify();
00054 }
00055
00056 char *ptc_abbreviation() {
00057 return clan_module_abbreviation();
00058 }
00059
00060 void ptc_init() {
00061 return clan_module_init();
00062 }
00063
00064 void CL_Implementation_PTC::add_display()
00065 {
00066 int card_no = CL_Display::cards.size();
00067 CL_DisplayCard_PTC *card = new CL_DisplayCard_PTC(card_no);
00068 CL_Display::cards.push_back(card);
00069
00070 CL_Input::keyboards.push_back(
00071 new CL_XWindowKeyboard(card));
00072
00073 CL_Input::pointers.push_back(
00074 new CL_Mouse_XWin(card));
00075
00076 #ifdef USE_JOY
00077 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0)
00078
00079 CL_LinuxJoystick *joy = new CL_LinuxJoystick();
00080 if (joy->init())
00081 CL_Input::joysticks.push_back(joy);
00082 else
00083 delete joy;
00084
00085 #endif
00086 #endif
00087 }
00088
00089 #endif
00090
00091
00092