4
* Copyright (c) 1999 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
6
* Requires the Qt widget libraries, available at no cost at
9
* This program is free software; you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation; either version 2 of the License, or
12
* (at your option) any later version.
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU General Public License for more details.
19
* You should have received a copy of the GNU General Public License
20
* along with this program; if not, write to the Free Software
21
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24
#include <kcomponentdata.h>
25
#include <KPluginFactory>
26
#include <KPluginLoader>
28
/* we have to include the info.cpp-file, to get the DEFINES about possible properties.
29
example: we need the "define INFO_DMA_AVAILABLE" */
32
#include "os_current.h"
34
class KInfoModulesFactory : public KPluginFactory
37
KInfoModulesFactory(const char *componentName);
38
static KComponentData componentData();
41
static KPluginFactory *s_instance;
43
KPluginFactory *KInfoModulesFactory::s_instance = 0;
45
#define CREATE_FACTORY(type, name) \
46
class K##type##InfoWidget : public KInfoListWidget \
49
K##type##InfoWidget(QWidget *parent, const QVariantList &) \
50
: KInfoListWidget(KInfoModulesFactory::componentData(), \
51
name, parent, GetInfo_##type) \
56
#ifdef INFO_IRQ_AVAILABLE
57
CREATE_FACTORY(IRQ, i18n("Interrupt"))
59
#ifdef INFO_IOPORTS_AVAILABLE
60
CREATE_FACTORY(IO_Ports, i18n("I/O-Port"))
62
#ifdef INFO_SCSI_AVAILABLE
63
CREATE_FACTORY(SCSI, i18n("SCSI"))
65
#ifdef INFO_DMA_AVAILABLE
66
CREATE_FACTORY(DMA, i18n("DMA-Channel"))
68
#ifdef INFO_XSERVER_AVAILABLE
69
CREATE_FACTORY(XServer_and_Video, i18n("X-Server"))
72
KInfoModulesFactory::KInfoModulesFactory(const char *componentName)
73
: KPluginFactory(componentName)
77
#ifdef INFO_IRQ_AVAILABLE
78
registerPlugin<KIRQInfoWidget>("irq");
80
#ifdef INFO_IOPORTS_AVAILABLE
81
registerPlugin<KIO_PortsInfoWidget>("ioports");
83
#ifdef INFO_SCSI_AVAILABLE
84
registerPlugin<KSCSIInfoWidget>("scsi");
86
#ifdef INFO_DMA_AVAILABLE
87
registerPlugin<KDMAInfoWidget>("dma");
89
#ifdef INFO_XSERVER_AVAILABLE
90
registerPlugin<KXServer_and_VideoInfoWidget>("xserver");
94
KComponentData KInfoModulesFactory::componentData()
97
return s_instance->componentData();
100
K_EXPORT_PLUGIN(KInfoModulesFactory("kcminfo"))