Add (and install) svg for the new krunner interface.
[kdebase/uwolfer.git] / apps / kinfocenter / info / main.cpp
blobd37b11c379b7eed3209b6bd5bc8a58e2140ca1b4
1 /*
2 * main.cpp
4 * Copyright (c) 1999 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
6 * Requires the Qt widget libraries, available at no cost at
7 * http://www.troll.no/
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.
26 #include "memory.h"
27 #include <kcomponentdata.h>
28 #include <KPluginFactory>
29 #include <KPluginLoader>
31 /* we have to include the info.cpp-file, to get the DEFINES about possible properties.
32 example: we need the "define INFO_CPU_AVAILABLE" */
33 #include "info.cpp"
35 class KInfoModulesFactory : public KPluginFactory
37 public:
38 KInfoModulesFactory(const char *componentName);
39 static KComponentData componentData();
41 private:
42 static KPluginFactory *s_instance;
44 KPluginFactory *KInfoModulesFactory::s_instance = 0;
46 #define CREATE_FACTORY(type, name) \
47 class K##type##InfoWidget : public KInfoListWidget \
48 { \
49 public: \
50 K##type##InfoWidget(QWidget *parent, const QVariantList &) \
51 : KInfoListWidget(KInfoModulesFactory::componentData(), \
52 name, parent, GetInfo_##type) \
53 { \
54 } \
55 }; \
57 #ifdef INFO_CPU_AVAILABLE
58 CREATE_FACTORY(CPU, i18n("Processor(s)"))
59 #endif
60 #ifdef INFO_IRQ_AVAILABLE
61 CREATE_FACTORY(IRQ, i18n("Interrupt"))
62 #endif
63 #ifdef INFO_PCI_AVAILABLE
64 CREATE_FACTORY(PCI, i18n("PCI"))
65 #endif
66 #ifdef INFO_DMA_AVAILABLE
67 CREATE_FACTORY(DMA, i18n("DMA-Channel"))
68 #endif
69 #ifdef INFO_IOPORTS_AVAILABLE
70 CREATE_FACTORY(IO_Ports, i18n("I/O-Port"))
71 #endif
72 #ifdef INFO_SOUND_AVAILABLE
73 CREATE_FACTORY(Sound, i18n("Soundcard"))
74 #endif
75 #ifdef INFO_SCSI_AVAILABLE
76 CREATE_FACTORY(SCSI, i18n("SCSI"))
77 #endif
78 #ifdef INFO_DEVICES_AVAILABLE
79 CREATE_FACTORY(Devices, i18n("Devices"))
80 #endif
81 #ifdef INFO_PARTITIONS_AVAILABLE
82 CREATE_FACTORY(Partitions, i18n("Partitions"))
83 #endif
84 #ifdef INFO_XSERVER_AVAILABLE
85 CREATE_FACTORY(XServer_and_Video, i18n("X-Server"))
86 #endif
87 #ifdef INFO_OPENGL_AVAILABLE
88 CREATE_FACTORY(OpenGL, i18n("OpenGL"))
89 #endif
91 KInfoModulesFactory::KInfoModulesFactory(const char *componentName)
92 : KPluginFactory(componentName)
94 s_instance = this;
95 registerPlugin<KMemoryWidget>("memory");
96 #ifdef INFO_CPU_AVAILABLE
97 registerPlugin<KCPUInfoWidget>("cpu");
98 #endif
99 #ifdef INFO_IRQ_AVAILABLE
100 registerPlugin<KIRQInfoWidget>("irq");
101 #endif
102 #ifdef INFO_PCI_AVAILABLE
103 registerPlugin<KPCIInfoWidget>("pci");
104 #endif
105 #ifdef INFO_DMA_AVAILABLE
106 registerPlugin<KDMAInfoWidget>("dma");
107 #endif
108 #ifdef INFO_IOPORTS_AVAILABLE
109 registerPlugin<KIO_PortsInfoWidget>("ioports");
110 #endif
111 #ifdef INFO_SOUND_AVAILABLE
112 registerPlugin<KSoundInfoWidget>("sound");
113 #endif
114 #ifdef INFO_SCSI_AVAILABLE
115 registerPlugin<KSCSIInfoWidget>("scsi");
116 #endif
117 #ifdef INFO_DEVICES_AVAILABLE
118 registerPlugin<KDevicesInfoWidget>("devices");
119 #endif
120 #ifdef INFO_PARTITIONS_AVAILABLE
121 registerPlugin<KPartitionsInfoWidget>("partitions");
122 #endif
123 #ifdef INFO_XSERVER_AVAILABLE
124 registerPlugin<KXServer_and_VideoInfoWidget>("xserver");
125 #endif
126 #ifdef INFO_OPENGL_AVAILABLE
127 registerPlugin<KOpenGLInfoWidget>("opengl");
128 #endif
131 KComponentData KInfoModulesFactory::componentData()
133 Q_ASSERT(s_instance);
134 return s_instance->componentData();
137 K_EXPORT_PLUGIN(KInfoModulesFactory("kcminfo"))