4 * Virteos HID Implementation for the OpenH323 Project.
6 * Virteos is a Trade Mark of ISVO (Asia) Pte Ltd.
8 * Copyright (c) 2005 ISVO (Asia) Pte Ltd. All Rights Reserved.
10 * The contents of this file are subject to the Mozilla Public License
11 * Version 1.0 (the "License"); you may not use this file except in
12 * compliance with the License. You may obtain a copy of the License at
13 * http://www.mozilla.org/MPL/
15 * Software distributed under the License is distributed on an "AS IS"
16 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17 * the License for the specific language governing rights and limitations
20 * The Initial Developer of the Original Code is ISVO (Asia) Pte Ltd.
23 * Contributor(s): ______________________________________.
26 * Revision 1.4 2006/06/26 17:03:16 shorne
27 * Fixed build with latest CVS
29 * Revision 1.3 2005/07/13 18:01:01 shorne
30 * Added HIDdevices::AddAllHIDs
32 * Revision 1.2 2005/07/06 11:15:25 shorne
33 * Added HIDdevices::PrintOn
35 * Revision 1.1 2005/07/03 14:38:42 shorne
36 * *** empty log message ***
42 #include <ptlib/pluginmgr.h>
47 #endif // _MSC_VER > 1000
50 #pragma warning(disable:4100)
54 PDECLARE_LIST(HIDDevices
, OpalLineInterfaceDevice
)
59 BOOL
HasAvailDevice();
60 OpalLineInterfaceDevice
* AvailDevice();
61 BOOL
AddAllHIDs(const PString
& name
);
63 void PrintOn(ostream
& strm
) const;
66 class HIDPluginDeviceManager
: public PPluginModuleManager
68 PCLASSINFO(HIDPluginDeviceManager
, PPluginModuleManager
);
70 HIDPluginDeviceManager(PPluginManager
* pluginMgr
= NULL
);
71 ~HIDPluginDeviceManager();
73 void OnLoadPlugin(PDynaLink
& dll
, INT code
);
75 virtual void OnShutdown();
77 static void Bootstrap();
79 virtual BOOL
RegisterHID(unsigned int count
, void * _HIDList
);
80 virtual BOOL
UnregisterHID(unsigned int count
, void * _HIDList
);
82 void CreateHIDDevice(PluginHID_Definition
* HIDDevice
);
87 static PFactory
<PPluginModuleManager
>::Worker
<HIDPluginDeviceManager
> h323PluginCodecManagerFactory("HIDPluginDeviceManager", true);
89 ///////////////////////////////////////////////////////////////////////////////
91 typedef PFactory
<OpalLineInterfaceDevice
> HIDFactory
;
93 #define HID_REGISTER_DEVICE(cls, HIDName) static HIDFactory::Worker<cls> cls##Factory(HIDName, true); \
95 #define HID_DEFINE_DEVICE(cls, HIDName, fmtName) \
96 class cls : public OpalLineInterfaceDevice { \
98 cls() : OpalLineInterfaceDevice() { } \
99 PString GetName() const \
100 { return fmtName; } \
102 HID_REGISTER_DEVICE(cls, capName) \
104 /////////////////////////////////////////////////////////////////////////////