OLD | NEW |
1 /* Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 */ | 4 */ |
5 | 5 |
6 #ifndef _NP_EXTENSIONS_H_ | 6 #ifndef _NP_EXTENSIONS_H_ |
7 #define _NP_EXTENSIONS_H_ | 7 #define _NP_EXTENSIONS_H_ |
8 | 8 |
9 // Use the shorter include path here so that this file can be used in non- | 9 // Use the shorter include path here so that this file can be used in non- |
10 // Chromium projects, such as the Native Client SDK. | 10 // Chromium projects, such as the Native Client SDK. |
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 NPCursorTypeNotAllowed = 38, | 623 NPCursorTypeNotAllowed = 38, |
624 NPCursorTypeZoomIn = 39, | 624 NPCursorTypeZoomIn = 39, |
625 NPCursorTypeZoomOut = 40, | 625 NPCursorTypeZoomOut = 40, |
626 } NPCursorType; | 626 } NPCursorType; |
627 | 627 |
628 // Temporary SetCursor API. | 628 // Temporary SetCursor API. |
629 typedef NPError (*NPSetCursorPtr)( | 629 typedef NPError (*NPSetCursorPtr)( |
630 NPP instance, | 630 NPP instance, |
631 NPCursorType type); | 631 NPCursorType type); |
632 | 632 |
| 633 /* unique id for each font */ |
| 634 typedef int NPFontID; |
| 635 |
| 636 typedef enum { |
| 637 NPCharsetAnsi = 0, |
| 638 NPCharsetDefault = 1, |
| 639 NPCharsetSymbol = 2, |
| 640 NPCharsetMac = 77, |
| 641 NPCharsetShiftJIS = 128, |
| 642 NPCharsetHangul = 129, |
| 643 NPCharsetJohab = 130, |
| 644 NPCharsetGB2312 =134, |
| 645 NPCharsetChineseBIG5 = 136, |
| 646 NPCharsetGreek = 161, |
| 647 NPCharsetTurkish = 162, |
| 648 NPCharsetVietnamese = 163, |
| 649 NPCharsetHebrew = 177, |
| 650 NPCharsetArabic = 178, |
| 651 NPCharsetBaltic = 186, |
| 652 NPCharsetRussian = 204, |
| 653 NPCharsetThai = 222, |
| 654 NPCharsetEastEurope = 238, |
| 655 NPCharsetOEM = 255 |
| 656 } NPCharset; |
| 657 |
| 658 typedef enum { |
| 659 NPPitchDefault, |
| 660 NPPitchFixed |
| 661 } NPPitch; |
| 662 |
| 663 typedef enum { |
| 664 NPFamilyDefault, |
| 665 NPFamilyRoman, |
| 666 NPFamilyScript |
| 667 } NPFamily; |
| 668 |
| 669 typedef struct _NPFontDescription { |
| 670 const char* face; |
| 671 int weight; |
| 672 bool italic; |
| 673 NPPitch pitch; |
| 674 NPFamily family; |
| 675 NPCharset charset; |
| 676 } NPFontDescription; |
| 677 |
| 678 // Return a font which best matches the given properties. |
| 679 typedef NPError (*NPMatchFontWithFallbackPtr) ( |
| 680 NPP instance, |
| 681 const NPFontDescription* description, |
| 682 NPFontID* id); |
| 683 |
| 684 // Loads a specified font table for the given font. |
| 685 // table: the table in *big-endian* format, or 0 for the whole font file. |
| 686 // output: a buffer of size output_length that gets the data. can be 0, in |
| 687 // which case output_length will be set to the required size in bytes. |
| 688 // output_length: size of output, if it's not 0. |
| 689 typedef NPError (*GetFontTablePtr) ( |
| 690 NPP instance, |
| 691 NPFontID id, |
| 692 uint32_t table, |
| 693 void* output, |
| 694 size_t* output_length); |
| 695 |
| 696 // Destroys a font. |
| 697 typedef NPError (*NPDestroyFontPtr) ( |
| 698 NPP instance, |
| 699 NPFontID id); |
| 700 |
| 701 typedef struct _NPFontExtensions { |
| 702 NPMatchFontWithFallbackPtr matchFontWithFallback; |
| 703 GetFontTablePtr getFontTable; |
| 704 NPDestroyFontPtr destroyFont; |
| 705 } NPFontExtensions; |
| 706 |
| 707 typedef NPFontExtensions* (*NPGetFontExtensionsPtr)( |
| 708 NPP instance); |
| 709 |
633 /* Pepper extensions */ | 710 /* Pepper extensions */ |
634 struct NPNExtensions { | 711 struct NPNExtensions { |
635 /* Device interface acquisition */ | 712 /* Device interface acquisition */ |
636 NPAcquireDevicePtr acquireDevice; | 713 NPAcquireDevicePtr acquireDevice; |
637 /* Clipboard functionality */ | 714 /* Clipboard functionality */ |
638 NPCopyTextToClipboardPtr copyTextToClipboard; | 715 NPCopyTextToClipboardPtr copyTextToClipboard; |
639 /* Find */ | 716 /* Find */ |
640 NPNumberOfFindResultsChangedPtr numberOfFindResultsChanged; | 717 NPNumberOfFindResultsChangedPtr numberOfFindResultsChanged; |
641 NPSelectedFindResultChangedPtr selectedFindResultChanged; | 718 NPSelectedFindResultChangedPtr selectedFindResultChanged; |
642 /* File I/O extensions */ | 719 /* File I/O extensions */ |
643 NPChooseFilePtr chooseFile; | 720 NPChooseFilePtr chooseFile; |
644 /* Widget */ | 721 /* Widget */ |
645 NPGetWidgetExtensionsPtr getWidgetExtensions; | 722 NPGetWidgetExtensionsPtr getWidgetExtensions; |
646 /* Cursor */ | 723 /* Cursor */ |
647 NPSetCursorPtr setCursor; | 724 NPSetCursorPtr setCursor; |
| 725 /* Font */ |
| 726 NPGetFontExtensionsPtr getFontExtensions; |
648 }; | 727 }; |
649 | 728 |
650 /* 3D -----------------------------------------------------------------------*/ | 729 /* 3D -----------------------------------------------------------------------*/ |
651 | 730 |
652 #define NPPepper3DDevice 2 | 731 #define NPPepper3DDevice 2 |
653 | 732 |
654 typedef struct _NPDeviceContext3DConfig { | 733 typedef struct _NPDeviceContext3DConfig { |
655 int32_t commandBufferSize; | 734 int32_t commandBufferSize; |
656 } NPDeviceContext3DConfig; | 735 } NPDeviceContext3DConfig; |
657 | 736 |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
964 | 1043 |
965 typedef struct _NPPExtensions { | 1044 typedef struct _NPPExtensions { |
966 NPPGetPrintExtensionsPtr getPrintExtensions; | 1045 NPPGetPrintExtensionsPtr getPrintExtensions; |
967 NPPGetFindExtensionsPtr getFindExtensions; | 1046 NPPGetFindExtensionsPtr getFindExtensions; |
968 NPPZoomPtr zoom; | 1047 NPPZoomPtr zoom; |
969 NPPWidgetPropertyChangedPtr widgetPropertyChanged; | 1048 NPPWidgetPropertyChangedPtr widgetPropertyChanged; |
970 NPPCopyPtr copy; | 1049 NPPCopyPtr copy; |
971 } NPPExtensions; | 1050 } NPPExtensions; |
972 | 1051 |
973 #endif /* _NP_EXTENSIONS_H_ */ | 1052 #endif /* _NP_EXTENSIONS_H_ */ |
OLD | NEW |