OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 483 matching lines...) Loading... |
494 | 494 |
495 static bool testGetIntIdentifier(PluginObject*, const NPVariant* args, uint32_t
argCount, NPVariant* result) | 495 static bool testGetIntIdentifier(PluginObject*, const NPVariant* args, uint32_t
argCount, NPVariant* result) |
496 { | 496 { |
497 if (argCount != 1) | 497 if (argCount != 1) |
498 return false; | 498 return false; |
499 | 499 |
500 NPIdentifier identifier; | 500 NPIdentifier identifier; |
501 | 501 |
502 if (NPVARIANT_IS_DOUBLE(args[0])) { | 502 if (NPVARIANT_IS_DOUBLE(args[0])) { |
503 identifier = browser->getintidentifier((int)NPVARIANT_TO_DOUBLE(args[0])
); | 503 identifier = browser->getintidentifier((int)NPVARIANT_TO_DOUBLE(args[0])
); |
504 INT32_TO_NPVARIANT((int32)identifier, *result); | |
505 return true; | |
506 } else if (NPVARIANT_IS_INT32(args[0])) { | 504 } else if (NPVARIANT_IS_INT32(args[0])) { |
507 identifier = browser->getintidentifier((int)NPVARIANT_TO_INT32(args[0]))
; | 505 identifier = browser->getintidentifier((int)NPVARIANT_TO_INT32(args[0]))
; |
508 INT32_TO_NPVARIANT((int32)identifier, *result); | 506 } else { |
509 return true; | 507 return false; |
510 } | 508 } |
511 return false; | 509 |
| 510 INT32_TO_NPVARIANT(static_cast<int32>(reinterpret_cast<intptr_t>(identifier)
), *result); |
| 511 return true; |
512 } | 512 } |
513 | 513 |
514 static bool testGetProperty(PluginObject* obj, const NPVariant* args, uint32_t a
rgCount, NPVariant* result) | 514 static bool testGetProperty(PluginObject* obj, const NPVariant* args, uint32_t a
rgCount, NPVariant* result) |
515 { | 515 { |
516 if (argCount == 0) | 516 if (argCount == 0) |
517 return false; | 517 return false; |
518 | 518 |
519 NPObject *object; | 519 NPObject *object; |
520 browser->getvalue(obj->npp, NPNVWindowNPObject, &object); | 520 browser->getvalue(obj->npp, NPNVWindowNPObject, &object); |
521 | 521 |
(...skipping 398 matching lines...) Loading... |
920 DOUBLE_TO_NPVARIANT(242.242, args[4]); | 920 DOUBLE_TO_NPVARIANT(242.242, args[4]); |
921 STRINGZ_TO_NPVARIANT("Hello, World", args[5]); | 921 STRINGZ_TO_NPVARIANT("Hello, World", args[5]); |
922 OBJECT_TO_NPVARIANT(windowScriptObject, args[6]); | 922 OBJECT_TO_NPVARIANT(windowScriptObject, args[6]); |
923 | 923 |
924 NPVariant result; | 924 NPVariant result; |
925 if (browser->invoke(npp, windowScriptObject, testNPInvoke, args, 7, &result)
) | 925 if (browser->invoke(npp, windowScriptObject, testNPInvoke, args, 7, &result)
) |
926 browser->releasevariantvalue(&result); | 926 browser->releasevariantvalue(&result); |
927 | 927 |
928 browser->releaseobject(windowScriptObject); | 928 browser->releaseobject(windowScriptObject); |
929 } | 929 } |
OLD | NEW |