Changeset e67aa8aaf61864b4266dd63ea8e4e83b03c88dbb
- Timestamp:
- 15/04/06 15:48:34 (3 years ago)
- git-parent:
- Files:
-
- mozilla/support/npunix.c (modified) (6 diffs)
- mozilla/support/npwin.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
mozilla/support/npunix.c
r1671f59 re67aa8a 227 227 } 228 228 229 NPIdentifier NPN_GetStringIdentifier(const NPUTF8 *name) 230 { 231 int navMinorVers = gNetscapeFuncs.version & 0xFF; 232 if( navMinorVers >= 14 ) 233 { 234 return CallNPN_GetStringIdentifierProc( gNetscapeFuncs.getstringidentifier, name); 235 } 236 return NULL; 237 } 238 239 void NPN_GetStringIdentifiers(const NPUTF8 **names, int32_t nameCount, NPIdentifier *identifiers) 240 { 241 int navMinorVers = gNetscapeFuncs.version & 0xFF; 242 if( navMinorVers >= 14 ) 243 { 244 CallNPN_GetStringIdentifiersProc( gNetscapeFuncs.getstringidentifiers, names, nameCount, identifiers); 245 } 246 } 247 248 NPIdentifier NPN_GetIntIdentifier(int32_t intid) 249 { 250 int navMinorVers = gNetscapeFuncs.version & 0xFF; 251 if( navMinorVers >= 14 ) 252 { 253 return CallNPN_GetIntIdentifierProc( gNetscapeFuncs.getintidentifier, intid); 254 } 255 return NULL; 256 } 257 258 bool NPN_IdentifierIsString(NPIdentifier identifier) 259 { 260 int navMinorVers = gNetscapeFuncs.version & 0xFF; 261 if( navMinorVers >= 14 ) 262 { 263 return CallNPN_IdentifierIsStringProc( gNetscapeFuncs.identifierisstring, identifier); 264 } 265 return false; 266 } 267 268 NPUTF8 *NPN_UTF8FromIdentifier(NPIdentifier identifier) 269 { 270 int navMinorVers = gNetscapeFuncs.version & 0xFF; 271 if( navMinorVers >= 14 ) 272 { 273 return CallNPN_UTF8FromIdentifierProc( gNetscapeFuncs.utf8fromidentifier, identifier); 274 } 275 return NULL; 276 } 277 278 int32_t NPN_IntFromIdentifier(NPIdentifier identifier) 279 { 280 int navMinorVers = gNetscapeFuncs.version & 0xFF; 281 if( navMinorVers >= 14 ) 282 { 283 return CallNPN_IntFromIdentifierProc( gNetscapeFuncs.intfromidentifier, identifier); 284 } 285 return 0; 286 } 287 288 NPObject *NPN_CreateObject(NPP instance, NPClass *aClass) 289 { 290 int navMinorVers = gNetscapeFuncs.version & 0xFF; 291 if( navMinorVers >= 14 ) 292 { 293 return CallNPN_CreateObjectProc( gNetscapeFuncs.createobject, instance, aClass); 294 } 295 return NULL; 296 } 297 298 NPObject *NPN_RetainObject(NPObject *npobj) 299 { 300 int navMinorVers = gNetscapeFuncs.version & 0xFF; 301 if( navMinorVers >= 14 ) 302 { 303 return CallNPN_RetainObjectProc( gNetscapeFuncs.retainobject, npobj); 304 } 305 return NULL; 306 } 307 308 void NPN_ReleaseObject(NPObject *npobj) 309 { 310 int navMinorVers = gNetscapeFuncs.version & 0xFF; 311 if( navMinorVers >= 14 ) 312 { 313 CallNPN_ReleaseObjectProc( gNetscapeFuncs.releaseobject, npobj); 314 } 315 } 316 317 bool NPN_Invoke(NPP instance, NPObject *npobj, NPIdentifier methodName, const NPVariant *args, uint32_t argCount, NPVariant *result) 318 { 319 int navMinorVers = gNetscapeFuncs.version & 0xFF; 320 if( navMinorVers >= 14 ) 321 { 322 return CallNPN_InvokeProc( gNetscapeFuncs.invoke, instance, npobj, methodName, args, argCount, result); 323 } 324 return false; 325 } 326 327 bool NPN_InvokeDefault(NPP instance, NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result) 328 { 329 int navMinorVers = gNetscapeFuncs.version & 0xFF; 330 if( navMinorVers >= 14 ) 331 { 332 return CallNPN_InvokeDefaultProc( gNetscapeFuncs.invokeDefault, instance, npobj, args, argCount, result); 333 } 334 return false; 335 } 336 337 bool NPN_Evaluate(NPP instance, NPObject *npobj, NPString *script, NPVariant *result) 338 { 339 int navMinorVers = gNetscapeFuncs.version & 0xFF; 340 if( navMinorVers >= 14 ) 341 { 342 return CallNPN_EvaluateProc( gNetscapeFuncs.evaluate, instance, npobj, script, result); 343 } 344 return false; 345 } 346 347 bool NPN_GetProperty(NPP instance, NPObject *npobj, NPIdentifier propertyName, NPVariant *result) 348 { 349 int navMinorVers = gNetscapeFuncs.version & 0xFF; 350 if( navMinorVers >= 14 ) 351 { 352 return CallNPN_GetPropertyProc( gNetscapeFuncs.getproperty, instance, npobj, propertyName, result); 353 } 354 return false; 355 } 356 357 bool NPN_SetProperty(NPP instance, NPObject *npobj, NPIdentifier propertyName, const NPVariant *value) 358 { 359 int navMinorVers = gNetscapeFuncs.version & 0xFF; 360 if( navMinorVers >= 14 ) 361 { 362 return CallNPN_SetPropertyProc( gNetscapeFuncs.setproperty, instance, npobj, propertyName, value); 363 } 364 return false; 365 } 366 367 bool NPN_RemoveProperty(NPP instance, NPObject *npobj, NPIdentifier propertyName) 368 { 369 int navMinorVers = gNetscapeFuncs.version & 0xFF; 370 if( navMinorVers >= 14 ) 371 { 372 return CallNPN_RemovePropertyProc( gNetscapeFuncs.removeproperty, instance, npobj, propertyName); 373 } 374 return false; 375 } 376 377 bool NPN_HasProperty(NPP instance, NPObject *npobj, NPIdentifier propertyName) 378 { 379 int navMinorVers = gNetscapeFuncs.version & 0xFF; 380 if( navMinorVers >= 14 ) 381 { 382 return CallNPN_HasPropertyProc( gNetscapeFuncs.hasproperty, instance, npobj, propertyName); 383 } 384 return false; 385 } 386 387 bool NPN_HasMethod(NPP instance, NPObject *npobj, NPIdentifier methodName) 388 { 389 int navMinorVers = gNetscapeFuncs.version & 0xFF; 390 if( navMinorVers >= 14 ) 391 { 392 return CallNPN_HasMethodProc( gNetscapeFuncs.hasmethod, instance, npobj, methodName); 393 } 394 return false; 395 } 396 397 void NPN_ReleaseVariantValue(NPVariant *variant) 398 { 399 int navMinorVers = gNetscapeFuncs.version & 0xFF; 400 if( navMinorVers >= 14 ) 401 { 402 CallNPN_ReleaseVariantValueProc( gNetscapeFuncs.releasevariantvalue, variant); 403 } 404 } 405 406 void NPN_SetException(NPObject *npobj, const NPUTF8 *message) 407 { 408 int navMinorVers = gNetscapeFuncs.version & 0xFF; 409 if( navMinorVers >= 14 ) 410 { 411 CallNPN_SetExceptionProc( gNetscapeFuncs.setexception, npobj, message); 412 } 413 } 229 414 230 415 … … 335 520 PLUGINDEBUGSTR("GetValue"); 336 521 return NPP_GetValue(instance, variable, r_value); 522 } 523 524 NPError 525 Private_SetValue(NPP instance, NPPVariable variable, void *r_value) 526 { 527 PLUGINDEBUGSTR("SetValue"); 528 return NPERR_NO_ERROR; //NPP_SetValue(instance, variable, r_value); 337 529 } 338 530 … … 424 616 err = NPERR_INVALID_FUNCTABLE_ERROR; 425 617 } 426 427 618 428 619 if (err == NPERR_NO_ERROR) { … … 434 625 * could actually be bigger than what we expect. 435 626 */ 627 int navMinorVers = nsTable->version & 0xFF; 628 436 629 gNetscapeFuncs.version = nsTable->version; 437 630 gNetscapeFuncs.size = nsTable->size; 438 631 gNetscapeFuncs.posturl = nsTable->posturl; 439 632 gNetscapeFuncs.geturl = nsTable->geturl; 440 gNetscapeFuncs.geturlnotify = nsTable->geturlnotify;441 633 gNetscapeFuncs.requestread = nsTable->requestread; 442 634 gNetscapeFuncs.newstream = nsTable->newstream; … … 449 641 gNetscapeFuncs.memflush = nsTable->memflush; 450 642 gNetscapeFuncs.reloadplugins = nsTable->reloadplugins; 451 gNetscapeFuncs.getJavaEnv = nsTable->getJavaEnv; 452 gNetscapeFuncs.getJavaPeer = nsTable->getJavaPeer; 453 gNetscapeFuncs.getvalue = nsTable->getvalue; 643 if( navMinorVers >= NPVERS_HAS_LIVECONNECT ) 644 { 645 gNetscapeFuncs.getJavaEnv = nsTable->getJavaEnv; 646 gNetscapeFuncs.getJavaPeer = nsTable->getJavaPeer; 647 } 648 if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) 649 { 650 gNetscapeFuncs.geturlnotify = nsTable->geturlnotify; 651 gNetscapeFuncs.posturlnotify = nsTable->posturlnotify; 652 } 653 gNetscapeFuncs.getvalue = nsTable->getvalue; 654 gNetscapeFuncs.setvalue = nsTable->setvalue; 655 gNetscapeFuncs.invalidaterect = nsTable->invalidaterect; 656 gNetscapeFuncs.invalidateregion = nsTable->invalidateregion; 657 gNetscapeFuncs.forceredraw = nsTable->forceredraw; 658 if( navMinorVers >= 14 ) 659 { 660 // NPRuntime support 661 gNetscapeFuncs.getstringidentifier = nsTable->getstringidentifier; 662 gNetscapeFuncs.getstringidentifiers = nsTable->getstringidentifiers; 663 gNetscapeFuncs.getintidentifier = nsTable->getintidentifier; 664 gNetscapeFuncs.identifierisstring = nsTable->identifierisstring; 665 gNetscapeFuncs.utf8fromidentifier = nsTable->utf8fromidentifier; 666 gNetscapeFuncs.intfromidentifier = nsTable->intfromidentifier; 667 gNetscapeFuncs.createobject = nsTable->createobject; 668 gNetscapeFuncs.retainobject = nsTable->retainobject; 669 gNetscapeFuncs.releaseobject = nsTable->releaseobject; 670 gNetscapeFuncs.invoke = nsTable->invoke; 671 gNetscapeFuncs.invokeDefault = nsTable->invokeDefault; 672 gNetscapeFuncs.evaluate = nsTable->evaluate; 673 gNetscapeFuncs.getproperty = nsTable->getproperty; 674 gNetscapeFuncs.setproperty = nsTable->setproperty; 675 gNetscapeFuncs.removeproperty = nsTable->removeproperty; 676 gNetscapeFuncs.hasproperty = nsTable->hasproperty; 677 gNetscapeFuncs.hasmethod = nsTable->hasmethod; 678 gNetscapeFuncs.releasevariantvalue = nsTable->releasevariantvalue; 679 gNetscapeFuncs.setexception = nsTable->setexception; 680 } 454 681 455 682 /* … … 470 697 pluginFuncs->write = NewNPP_WriteProc(Private_Write); 471 698 pluginFuncs->print = NewNPP_PrintProc(Private_Print); 472 pluginFuncs->urlnotify = NewNPP_URLNotifyProc(Private_URLNotify);473 699 pluginFuncs->event = NULL; 474 pluginFuncs->javaClass = Private_GetJavaClass();475 700 pluginFuncs->getvalue = NewNPP_GetValueProc(Private_GetValue); 701 if( navMinorVers >= NPVERS_HAS_NOTIFICATION ) 702 { 703 pluginFuncs->urlnotify = NewNPP_URLNotifyProc(PLUGIN_TO_HOST_GLUE(urlnotify, Private_URLNotify)); 704 } 705 #ifdef OJI 706 if( navMinorVers >= NPVERS_HAS_LIVECONNECT ) 707 { 708 pluginFuncs->javaClass = (JRIGlobalRef) Private_GetJavaClass(); 709 } 710 #else 711 pluginFuncs->javaClass = NULL; 712 #endif 476 713 477 714 err = NPP_Initialize(); mozilla/support/npwin.cpp
rdc29951 re67aa8a 116 116 pFuncs->write = NPP_Write; 117 117 pFuncs->print = NPP_Print; 118 pFuncs->event = 0; /// reserved 118 119 pFuncs->getvalue = NPP_GetValue; 119 pFuncs->event = 0; /// reserved120 //pFuncs->setvalue = NPP_SetValue; 120 121 121 122 g_pluginFuncs = pFuncs; … … 207 208 } 208 209 209 NPError NPN_GetValue(NPP instance, NPNVariable variable, void *result)210 {211 return g_pNavigatorFuncs->getvalue(instance, variable, result);212 }213 214 215 210 /* causes the specified URL to be fetched and streamed in 216 211 */ … … 363 358 } 364 359 360 NPError NPN_GetValue(NPP instance, NPNVariable variable, void *result) 361 { 362 return g_pNavigatorFuncs->getvalue(instance, variable, result); 363 } 364 365 NPError NPN_SetValue(NPP instance, NPPVariable variable, void *value) 366 { 367 return g_pNavigatorFuncs->setvalue(instance, variable, value); 368 } 369 370 void NPN_InvalidateRect(NPP instance, NPRect *rect) 371 { 372 g_pNavigatorFuncs->invalidaterect(instance, rect); 373 } 374 375 void NPN_InvalidateRegion(NPP instance, NPRegion region) 376 { 377 g_pNavigatorFuncs->invalidateregion(instance, region); 378 } 379 380 void NPN_ForceRedraw(NPP instance) 381 { 382 g_pNavigatorFuncs->forceredraw(instance); 383 } 384 385 NPIdentifier NPN_GetStringIdentifier(const NPUTF8 *name) 386 { 387 int navMinorVers = g_pNavigatorFuncs->version & 0xFF; 388 if( navMinorVers >= 14 ) 389 { 390 return g_pNavigatorFuncs->getstringidentifier(name); 391 } 392 return NULL; 393 } 394 395 void NPN_GetStringIdentifiers(const NPUTF8 **names, int32_t nameCount, NPIdentifier *identifiers) 396 { 397 int navMinorVers = g_pNavigatorFuncs->version & 0xFF; 398 if( navMinorVers >= 14 ) 399 { 400 g_pNavigatorFuncs->getstringidentifiers(names, nameCount, identifiers); 401 } 402 } 403 404 NPIdentifier NPN_GetIntIdentifier(int32_t intid) 405 { 406 int navMinorVers = g_pNavigatorFuncs->version & 0xFF; 407 if( navMinorVers >= 14 ) 408 { 409 return g_pNavigatorFuncs->getintidentifier(intid); 410 } 411 return NULL; 412 } 413 414 bool NPN_IdentifierIsString(NPIdentifier identifier) 415 { 416 int navMinorVers = g_pNavigatorFuncs->version & 0xFF; 417 if( navMinorVers >= 14 ) 418 { 419 return g_pNavigatorFuncs->identifierisstring(identifier); 420 } 421 return false; 422 } 423 424 NPUTF8 *NPN_UTF8FromIdentifier(NPIdentifier identifier) 425 { 426 int navMinorVers = g_pNavigatorFuncs->version & 0xFF; 427 if( navMinorVers >= 14 ) 428 { 429 return g_pNavigatorFuncs->utf8fromidentifier(identifier); 430 } 431 return NULL; 432 } 433 434 int32_t NPN_IntFromIdentifier(NPIdentifier identifier) 435 { 436 int navMinorVers = g_pNavigatorFuncs->version & 0xFF; 437 if( navMinorVers >= 14 ) 438 { 439 return g_pNavigatorFuncs->intfromidentifier(identifier); 440 } 441 return 0; 442 } 443 444 NPObject *NPN_CreateObject(NPP instance, NPClass *aClass) 445 { 446 int navMinorVers = g_pNavigatorFuncs->version & 0xFF; 447 if( navMinorVers >= 14 ) 448 { 449 return g_pNavigatorFuncs->createobject(instance, aClass); 450 } 451 return NULL; 452 } 453 454 NPObject *NPN_RetainObject(NPObject *npobj) 455 { 456 int navMinorVers = g_pNavigatorFuncs->version & 0xFF; 457 if( navMinorVers >= 14 ) 458 { 459 return g_pNavigatorFuncs->retainobject(npobj); 460 } 461 return NULL; 462 } 463 464 void NPN_ReleaseObject(NPObject *npobj) 465 { 466 int navMinorVers = g_pNavigatorFuncs->version & 0xFF; 467 if( navMinorVers >= 14 ) 468 { 469 g_pNavigatorFuncs->releaseobject(npobj); 470 } 471 } 472 473 bool NPN_Invoke(NPP instance, NPObject *npobj, NPIdentifier methodName, const NPVariant *args, uint32_t argCount, NPVariant *result) 474 { 475 int navMinorVers = g_pNavigatorFuncs->version & 0xFF; 476 if( navMinorVers >= 14 ) 477 { 478 return g_pNavigatorFuncs->invoke(instance, npobj, methodName, args, argCount, result); 479 } 480 return false; 481 } 482 483 bool NPN_InvokeDefault(NPP instance, NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result) 484 { 485 int navMinorVers = g_pNavigatorFuncs->version & 0xFF; 486 if( navMinorVers >= 14 ) 487 { 488 return g_pNavigatorFuncs->invokeDefault(instance, npobj, args, argCount, result); 489 } 490 return false; 491 } 492 493 bool NPN_Evaluate(NPP instance, NPObject *npobj, NPString *script, NPVariant *result) 494 { 495 int navMinorVers = g_pNavigatorFuncs->version & 0xFF; 496 if( navMinorVers >= 14 ) 497 { 498 return g_pNavigatorFuncs->evaluate(instance, npobj, script, result); 499 } 500 return false; 501 } 502 503 bool NPN_GetProperty(NPP instance, NPObject *npobj, NPIdentifier propertyName, NPVariant *result) 504 { 505 int navMinorVers = g_pNavigatorFuncs->version & 0xFF; 506 if( navMinorVers >= 14 ) 507 { 508 return g_pNavigatorFuncs->getproperty(instance, npobj, propertyName, result); 509 } 510 return false; 511 } 512 513 bool NPN_SetProperty(NPP instance, NPObject *npobj, NPIdentifier propertyName, const NPVariant *value) 514 { 515 int navMinorVers = g_pNavigatorFuncs->version & 0xFF; 516 if( navMinorVers >= 14 ) 517 { 518 return g_pNavigatorFuncs->setproperty(instance, npobj, propertyName, value); 519 } 520 return false; 521 } 522 523 bool NPN_RemoveProperty(NPP instance, NPObject *npobj, NPIdentifier propertyName) 524 { 525 int navMinorVers = g_pNavigatorFuncs->version & 0xFF; 526 if( navMinorVers >= 14 ) 527 { 528 return g_pNavigatorFuncs->removeproperty(instance, npobj, propertyName); 529 } 530 return false; 531 } 532 533 bool NPN_HasProperty(NPP instance, NPObject *npobj, NPIdentifier propertyName) 534 { 535 int navMinorVers = g_pNavigatorFuncs->version & 0xFF; 536 if( navMinorVers >= 14 ) 537 { 538 return g_pNavigatorFuncs->hasproperty(instance, npobj, propertyName); 539 } 540 return false; 541 } 542 543 bool NPN_HasMethod(NPP instance, NPObject *npobj, NPIdentifier methodName) 544 { 545 int navMinorVers = g_pNavigatorFuncs->version & 0xFF; 546 if( navMinorVers >= 14 ) 547 { 548 return g_pNavigatorFuncs->hasmethod(instance, npobj, methodName); 549 } 550 return false; 551 } 552 553 void NPN_ReleaseVariantValue(NPVariant *variant) 554 { 555 int navMinorVers = g_pNavigatorFuncs->version & 0xFF; 556 if( navMinorVers >= 14 ) 557 { 558 g_pNavigatorFuncs->releasevariantvalue(variant); 559 } 560 } 561 562 void NPN_SetException(NPObject *npobj, const NPUTF8 *message) 563 { 564 int navMinorVers = g_pNavigatorFuncs->version & 0xFF; 565 if( navMinorVers >= 14 ) 566 { 567 g_pNavigatorFuncs->setexception(npobj, message); 568 } 569 } 570
