|
1 /* |
|
2 * Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: SVGT Plugin Implementation source file |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "Svgtplugin.h" |
|
20 |
|
21 |
|
22 #include <implementationproxy.h> |
|
23 #include <CEcomBrowserPluginInterface.h> |
|
24 /***************************************************/ |
|
25 /**********ECOM STYLE SVGT PLUGIN ENTRY POINTS******/ |
|
26 /***************************************************/ |
|
27 CSvgtPluginEcomMain* CSvgtPluginEcomMain::NewL(TAny* aInitParam) |
|
28 { |
|
29 TFuncs* funcs = REINTERPRET_CAST( TFuncs*, aInitParam); |
|
30 CSvgtPluginEcomMain* self = new(ELeave)CSvgtPluginEcomMain(funcs->iNetscapeFuncs); |
|
31 CleanupStack::PushL(self); |
|
32 self->ConstructL(funcs->iPluginFuncs); |
|
33 CleanupStack::Pop(); |
|
34 |
|
35 Dll :: SetTls ( (void*) self ); |
|
36 |
|
37 return self; |
|
38 } |
|
39 |
|
40 void CSvgtPluginEcomMain::ConstructL(NPPluginFuncs* aPluginFuncs) |
|
41 { |
|
42 InitializeFuncs(aPluginFuncs); |
|
43 } |
|
44 |
|
45 CSvgtPluginEcomMain::CSvgtPluginEcomMain(NPNetscapeFuncs* aNpf) : CEcomBrowserPluginInterface(),iNpf(aNpf) |
|
46 { |
|
47 } |
|
48 |
|
49 CSvgtPluginEcomMain::~CSvgtPluginEcomMain() |
|
50 { |
|
51 |
|
52 } |
|
53 const TImplementationProxy KImplementationTable[] = |
|
54 { |
|
55 {{KSvgtPluginImplementationValue}, (TProxyNewLPtr) CSvgtPluginEcomMain::NewL} |
|
56 }; |
|
57 |
|
58 // ----------------------------------------------------------------------------- |
|
59 // ImplementationGroupProxy |
|
60 // Returns the filters implemented in this DLL |
|
61 // Returns: The filters implemented in this DLL |
|
62 // ----------------------------------------------------------------------------- |
|
63 // |
|
64 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) |
|
65 { |
|
66 aTableCount = sizeof(KImplementationTable) / sizeof(TImplementationProxy); |
|
67 return KImplementationTable; |
|
68 } |
|
69 |
|
70 |
|
71 |
|
72 /** |
|
73 * The E32Dll() entry point function. |
|
74 **/ |
|
75 |
|
76 |
|
77 EXPORT_C NPError InitializeFuncs(NPPluginFuncs* aPpf) |
|
78 { |
|
79 aPpf->size = sizeof(NPPluginFuncs); |
|
80 aPpf->version = 1; |
|
81 aPpf->newp = NewNPP_NewProc(SvgtPluginNewp); |
|
82 aPpf->destroy = NewNPP_DestroyProc(SvgtPluginDestroy); |
|
83 aPpf->setwindow = NewNPP_SetWindowProc(SvgtPluginSetWindow); |
|
84 aPpf->newstream = NewNPP_NewStreamProc(SvgtPluginNewStream); |
|
85 aPpf->destroystream = NewNPP_DestroyStreamProc(SvgtPluginDestroyStream); |
|
86 aPpf->asfile = NewNPP_StreamAsFileProc(SvgtPluginAsFile); |
|
87 aPpf->writeready = NewNPP_WriteReadyProc(SvgtPluginWriteReady); |
|
88 aPpf->write = NewNPP_WriteProc(SvgtPluginWrite); |
|
89 aPpf->print = NewNPP_PrintProc(SvgtPluginPrint); |
|
90 aPpf->event = NewNPP_HandleEventProc(SvgtPluginEvent); |
|
91 aPpf->urlnotify = NewNPP_URLNotifyProc(SvgtPluginURLNotify); |
|
92 aPpf->javaClass = NULL; |
|
93 aPpf->getvalue = NewNPP_GetValueProc(SvgtPluginGetValue); |
|
94 aPpf->setvalue = NewNPP_SetValueProc(SvgtPluginSetValue); |
|
95 |
|
96 return NPERR_NO_ERROR; |
|
97 } |
|
98 |
|
99 EXPORT_C void NPP_Shutdown(void) |
|
100 { |
|
101 CSvgtPluginEcomMain* npm = (CSvgtPluginEcomMain*) Dll :: Tls (); |
|
102 delete npm; |
|
103 Dll :: SetTls ( NULL ); |
|
104 } |
|
105 |