2009-09-29 Jeffrey Stedfast <fejj@novell.com>
[moon.git] / plugin / plugin-class.g.cpp
blobf168fe547bc4e3bd4fe69c5f962fd244b6d03490
1 /*
2 * Automatically generated, do not edit this file directly
3 */
5 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
6 /*
7 * plugin-class.g.cpp: MoonLight browser plugin - autogenerated classes
9 * Contact:
10 * Moonlight List (moonlight-list@lists.ximian.com)
12 * Copyright 2007-2009 Novell, Inc. (http://www.novell.com)
14 * See the LICENSE file included with the distribution for details.
18 #include <config.h>
20 #include <ctype.h>
22 #include "plugin-class.h"
23 #include "browser-bridge.h"
24 #include "plugin.h"
25 #include "deployment.h"
26 #include "bitmapimage.h"
27 #include "uri.h"
28 #include "textbox.h"
30 /*** MoonlightUIElementClass *********/
31 static NPObject *
32 moonlight_uielement_allocate (NPP instance, NPClass *klass)
34 return new MoonlightUIElementObject (instance);
37 static const MoonNameIdMapping moonlight_uielement_mapping[] = {
38 {"capturemouse", MoonId_UIElement_CaptureMouse},
39 {"transformtovisual", MoonId_UIElement_TransformToVisual},
40 {"releasemousecapture", MoonId_UIElement_ReleaseMouseCapture},
41 {"updatelayout", MoonId_UIElement_UpdateLayout}
44 bool
45 MoonlightUIElementObject::Invoke (int id, NPIdentifier name,
46 const NPVariant *args, guint32 argCount,
47 NPVariant *result)
49 UIElement *dob = (UIElement*)GetDependencyObject ();
51 switch (id) {
53 case MoonId_UIElement_CaptureMouse: {
54 bool ret = dob->CaptureMouse();
55 BOOLEAN_TO_NPVARIANT (ret, *result);
56 return true;
57 break;
60 case MoonId_UIElement_TransformToVisual: {
61 if (!check_arg_list ("o", argCount, args))
62 THROW_JS_EXCEPTION ("TransformToVisual");
63 MoonError err;
64 NPObject *obj0 = NPVARIANT_TO_OBJECT (args[0]);
65 if (!npobject_is_dependency_object (obj0))
66 THROW_JS_EXCEPTION ("TransformToVisual");
67 DependencyObject *arg0 = ((MoonlightDependencyObjectObject *) obj0)->GetDependencyObject();
68 GeneralTransform * ret = dob->GetTransformToUIElementWithError((UIElement *) arg0,&err);
69 if (err.number != 0) THROW_JS_EXCEPTION (err.message);
70 if (ret)
71 OBJECT_TO_NPVARIANT (EventObjectCreateWrapper (instance, ret), *result);
72 else
73 NULL_TO_NPVARIANT (*result);
74 return true;
75 break;
78 case MoonId_UIElement_ReleaseMouseCapture: {
79 dob->ReleaseMouseCapture();
80 VOID_TO_NPVARIANT (*result);
81 return true;
82 break;
85 case MoonId_UIElement_UpdateLayout: {
86 dob->UpdateLayout();
87 VOID_TO_NPVARIANT (*result);
88 return true;
89 break;
93 return MoonlightDependencyObjectObject::Invoke (id, name, args, argCount, result);
96 MoonlightUIElementType::MoonlightUIElementType ()
98 AddMapping (moonlight_uielement_mapping, G_N_ELEMENTS (moonlight_uielement_mapping));
100 allocate = moonlight_uielement_allocate;