/*
 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
 */

#include <WebKit/WebKitPluginHostTypes.defs>

// FIXME: Come up with a better name.
subsystem WebKitPluginClient 300;

serverprefix WKPC;
userprefix _WKPC;

simpleroutine StatusText(clientPort :mach_port_t;
                         pluginID :uint32_t;
                         text :data_t);

routine LoadURL(clientPort :mach_port_t;
                      pluginID :uint32_t;
                      url :data_t;
                      target :data_t;
                      postData :data_t;
                      flags: uint32_t;
                      out resultCode :uint16_t;
                      out requestID :uint32_t);

simpleroutine CancelLoadURL(clientPort :mach_port_t;
                            pluginID :uint32_t;
                            streamID :uint32_t;
                            reason :int16_t);

simpleroutine InvalidateRect(clientPort :mach_port_t;
                             pluginID :uint32_t;
                             x :double;
                             y :double;
                             width :double;
                             height :double);

// NPRuntime

routine GetStringIdentifier(clientPort :mach_port_t;
                            name :data_t;
                            out identifier :uint64_t);

routine GetIntIdentifier(clientPort :mach_port_t;
                         value :int32_t;
                         out identifier: uint64_t);

routine GetWindowNPObject(clientPort :mach_port_t;
                          pluginID :uint32_t;
                          out objectID :uint32_t);
                      
routine ReleaseObject(clientPort :mach_port_t;
                      pluginID :uint32_t;
                      objectID :uint32_t);
                      
// FIXME: This should be a simpleroutine with an EvaluateReply that has
// the out parameters.
routine Evaluate(clientPort :mach_port_t;
                 pluginID :uint32_t;
                 objectID :uint32_t;
                 script :data_t;
                 out returnValue :boolean_t;
                 out result :data_t, dealloc);

routine Invoke(clientPort :mach_port_t;
               pluginID :uint32_t;
               objectID :uint32_t;
               methodNameIdentifier :uint64_t;
               arguments :data_t;
               out returnValue :boolean_t;
               out result :data_t, dealloc);

routine InvokeDefault(clientPort :mach_port_t;
               pluginID :uint32_t;
               objectID :uint32_t;
               arguments :data_t;
               out returnValue :boolean_t;
               out result :data_t, dealloc);

routine Construct(clientPort :mach_port_t;
                  pluginID :uint32_t;
                  objectID :uint32_t;
                  arguments :data_t;
                  out returnValue :boolean_t;
                  out result :data_t, dealloc);

routine GetProperty(clientPort :mach_port_t;
                    pluginID :uint32_t;
                    objectID :uint32_t;
                    propertyNameIdentifier :uint64_t;
                    out returnValue :boolean_t;
                    out result :data_t, dealloc);

routine SetProperty(clientPort :mach_port_t;
                    pluginID :uint32_t;
                    objectID :uint32_t;
                    propertyNameIdentifier :uint64_t;
                    value :data_t;
                    out returnValue :boolean_t);

routine RemoveProperty(clientPort :mach_port_t;
                       pluginID :uint32_t;
                       objectID :uint32_t;
                       propertyNameIdentifier :uint64_t;
                       out returnValue :boolean_t);

routine HasProperty(clientPort :mach_port_t;
                    pluginID :uint32_t;
                    objectID :uint32_t;
                    propertyNameIdentifier :uint64_t;
                    out returnValue :boolean_t);

routine HasMethod(clientPort :mach_port_t;
                    pluginID :uint32_t;
                    objectID :uint32_t;
                    methodNameIdentifier :uint64_t;
                    out returnValue :boolean_t);

// Replies
simpleroutine InstantiatePluginReply(clientPort :mach_port_t;
                                     pluginID :uint32_t;
                                     result :kern_return_t;
                                     renderContextID :uint32_t;
                                     useSoftwareRenderer :boolean_t);



