add more spacing
[personal-kdebase.git] / apps / nsplugins / viewer / pluginhost.cpp
blobe53e6bb0d11d0904c91763194420804cfa3d5009
1 /*
3 Common stuff for all plugin hosts
5 Copyright (c) 2000 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
6 Stefan Schimanski <1Stein@gmx.de>
7 2003-2005 George Staikos <staikos@kde.org>
8 2007 Maksim orlovich <maksim@kde.org>
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 #include "pluginhost.h"
27 #include <QX11Info>
29 void PluginHost::setupPluginWindow(NSPluginInstance* plugin, void* winID, int width, int height)
31 NPWindow win;
32 win.x = 0;
33 win.y = 0;
34 win.width = width;
35 win.height = height;
36 win.type = NPWindowTypeWindow;
38 // Well, the docu says sometimes, this is only used on the
39 // MAC, but sometimes it says it's always. Who knows...
40 win.clipRect.top = 0;
41 win.clipRect.left = 0;
42 win.clipRect.bottom = height;
43 win.clipRect.right = width;
45 win.window = winID;
46 QX11Info x11info;
47 NPSetWindowCallbackStruct win_info;
48 win_info.display = QX11Info::display();
49 win_info.visual = (Visual*) x11info.visual();
50 win_info.colormap = x11info.colormap();
51 win_info.depth = x11info.depth();
52 win.ws_info = &win_info;
54 NPError error = plugin->NPSetWindow( &win );
56 kDebug(1431) << "error = " << error;
59 // kate: indent-width 4; replace-tabs on; tab-width 4; space-indent on;