]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - plugins/archivezip/plugin.cpp
Merge branch 'transfilterfix' into 'master'
[xonotic/netradiant.git] / plugins / archivezip / plugin.cpp
1 /*
2    Copyright (C) 2001-2006, William Joseph.
3    All Rights Reserved.
4
5    This file is part of GtkRadiant.
6
7    GtkRadiant is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2 of the License, or
10    (at your option) any later version.
11
12    GtkRadiant is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with GtkRadiant; if not, write to the Free Software
19    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20  */
21
22 #include "iarchive.h"
23
24 #include "debugging/debugging.h"
25 #include "modulesystem/singletonmodule.h"
26
27 #include "archive.h"
28
29
30 class ArchiveZipAPI {
31     _QERArchiveTable m_archivezip;
32 public:
33     typedef _QERArchiveTable Type;
34
35     STRING_CONSTANT(Name, "pk3");
36
37     ArchiveZipAPI()
38     {
39         m_archivezip.m_pfnOpenArchive = &OpenArchive;
40     }
41
42     _QERArchiveTable *getTable()
43     {
44         return &m_archivezip;
45     }
46 };
47
48 typedef SingletonModule<ArchiveZipAPI> ArchiveZipModule;
49
50 ArchiveZipModule g_ArchiveZipModule;
51
52
53 class ArchivePK4API {
54     _QERArchiveTable m_archivepk4;
55 public:
56     typedef _QERArchiveTable Type;
57
58     STRING_CONSTANT(Name, "pk4");
59
60     ArchivePK4API()
61     {
62         m_archivepk4.m_pfnOpenArchive = &OpenArchive;
63     }
64
65     _QERArchiveTable *getTable()
66     {
67         return &m_archivepk4;
68     }
69 };
70
71 typedef SingletonModule<ArchivePK4API> ArchivePK4Module;
72
73 ArchivePK4Module g_ArchivePK4Module;
74
75
76 class ArchiveDPKAPI {
77     _QERArchiveTable m_archivedpk;
78 public:
79     typedef _QERArchiveTable Type;
80
81     STRING_CONSTANT(Name, "dpk");
82
83     ArchiveDPKAPI()
84     {
85         m_archivedpk.m_pfnOpenArchive = &OpenArchive;
86     }
87
88     _QERArchiveTable *getTable()
89     {
90         return &m_archivedpk;
91     }
92 };
93
94 typedef SingletonModule<ArchiveDPKAPI> ArchiveDPKModule;
95
96 ArchiveDPKModule g_ArchiveDPKModule;
97
98
99 extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer &server)
100 {
101     initialiseModule(server);
102
103     g_ArchiveZipModule.selfRegister();
104     g_ArchivePK4Module.selfRegister();
105     g_ArchiveDPKModule.selfRegister();
106 }