|
| 1 | +from libcpp cimport bool |
| 2 | + |
| 3 | +cdef extern from *: |
| 4 | + ctypedef char* const_char_ptr "const char*" |
| 5 | + |
| 6 | +cdef extern from "stddef.h": |
| 7 | + ctypedef void wchar_t |
| 8 | + |
| 9 | +cdef extern from "include/internal/cef_ptr.h": |
| 10 | + cdef cppclass CefRefPtr[T]: |
| 11 | + T* get() |
| 12 | + |
| 13 | +cdef extern from "include/internal/cef_string.h": |
| 14 | + ctypedef struct cef_string_t: |
| 15 | + pass |
| 16 | + cdef cppclass CefString: |
| 17 | + CefString() |
| 18 | + CefString(cef_string_t*) |
| 19 | + bool FromASCII(char*) |
| 20 | + bool FromString(wchar_t*, size_t, bool) |
| 21 | + wchar_t* ToWString() |
| 22 | + char* c_str() |
| 23 | + |
| 24 | +cdef extern from "include/internal/cef_types_wrappers.h": |
| 25 | + |
| 26 | + ctypedef struct CefSettings: |
| 27 | + bool multi_threaded_message_loop |
| 28 | + cef_string_t cache_path |
| 29 | + cef_string_t user_agent |
| 30 | + cef_string_t product_version |
| 31 | + cef_string_t locale |
| 32 | + cef_string_t log_file |
| 33 | + int log_severity |
| 34 | + int graphics_implementation |
| 35 | + unsigned int local_storage_quota |
| 36 | + unsigned int session_storage_quota |
| 37 | + cef_string_t javascript_flags |
| 38 | + cef_string_t pack_file_path |
| 39 | + cef_string_t locales_dir_path |
| 40 | + |
| 41 | + ctypedef struct CefBrowserSettings: |
| 42 | + bool drag_drop_disabled |
| 43 | + bool load_drops_disabled |
| 44 | + bool history_disabled |
| 45 | + cef_string_t standard_font_family |
| 46 | + cef_string_t fixed_font_family |
| 47 | + cef_string_t serif_font_family |
| 48 | + cef_string_t sans_serif_font_family |
| 49 | + cef_string_t cursive_font_family |
| 50 | + cef_string_t fantasy_font_family |
| 51 | + int default_font_size |
| 52 | + int default_fixed_font_size |
| 53 | + int minimum_font_size |
| 54 | + int minimum_logical_font_size |
| 55 | + bool remote_fonts_disabled |
| 56 | + cef_string_t default_encoding |
| 57 | + bool encoding_detector_enabled |
| 58 | + bool javascript_disabled |
| 59 | + bool javascript_open_windows_disallowed |
| 60 | + bool javascript_close_windows_disallowed |
| 61 | + bool javascript_access_clipboard_disallowed |
| 62 | + bool dom_paste_disabled |
| 63 | + bool caret_browsing_enabled |
| 64 | + bool java_disabled |
| 65 | + bool plugins_disabled |
| 66 | + bool universal_access_from_file_urls_allowed |
| 67 | + bool file_access_from_file_urls_allowed |
| 68 | + bool web_security_disabled |
| 69 | + bool xss_auditor_enabled |
| 70 | + bool image_load_disabled |
| 71 | + bool shrink_standalone_images_to_fit |
| 72 | + bool site_specific_quirks_disabled |
| 73 | + bool text_area_resize_disabled |
| 74 | + bool page_cache_disabled |
| 75 | + bool tab_to_links_disabled |
| 76 | + bool hyperlink_auditing_disabled |
| 77 | + bool user_style_sheet_enabled |
| 78 | + cef_string_t user_style_sheet_location |
| 79 | + bool author_and_user_styles_disabled |
| 80 | + bool local_storage_disabled |
| 81 | + bool databases_disabled |
| 82 | + bool application_cache_disabled |
| 83 | + bool webgl_disabled |
| 84 | + bool accelerated_compositing_enabled |
| 85 | + bool threaded_compositing_enabled |
| 86 | + bool accelerated_layers_disabled |
| 87 | + bool accelerated_video_disabled |
| 88 | + bool accelerated_2d_canvas_disabled |
| 89 | + bool accelerated_painting_disabled |
| 90 | + bool accelerated_filters_disabled |
| 91 | + bool accelerated_plugins_disabled |
| 92 | + bool developer_tools_disabled |
| 93 | + bool fullscreen_enabled |
| 94 | + |
| 95 | + |
| 96 | +cdef extern from "include/cef.h": |
| 97 | + cdef cppclass CefApp: |
| 98 | + pass |
| 99 | + cdef int CefInitialize(CefSettings, CefRefPtr[CefApp]) |
| 100 | + cdef void CefRunMessageLoop() |
| 101 | + cdef void CefShutdown() |
| 102 | + cdef cppclass CefBase: |
| 103 | + pass |
| 104 | + cdef cppclass CefClient(CefBase): |
| 105 | + pass |
| 106 | + ctypedef int CefThreadId |
| 107 | + cdef bool CefCurrentlyOn(CefThreadId) |
| 108 | + cdef cppclass CefBrowser: |
| 109 | + void ParentWindowWillClose() |
| 110 | + void CloseBrowser() |
| 111 | + |
| 112 | +cdef extern from "cefclient2.h": |
| 113 | + cdef cppclass CefClient2(CefClient): |
| 114 | + pass |
| 115 | + |
| 116 | +ctypedef CefRefPtr[CefClient] cefrefptr_cefclient_t |
| 117 | +ctypedef CefRefPtr[CefClient2] cefrefptr_cefclient2_t |
| 118 | +ctypedef CefRefPtr[CefApp] cefrefptr_cefapp_t |
| 119 | +ctypedef CefRefPtr[CefBrowser] cefrefptr_cefbrowser_t |
| 120 | + |
| 121 | +cdef extern from "include/cef.h" namespace "CefBrowser": |
| 122 | + cdef bool CreateBrowser(CefWindowInfo, CefRefPtr[CefClient], CefString, CefBrowserSettings) |
| 123 | + cdef CefRefPtr[CefBrowser] CreateBrowserSync(CefWindowInfo, CefRefPtr[CefClient], CefString, CefBrowserSettings) |
| 124 | + |
| 125 | +cdef extern from "windows.h": |
| 126 | + ctypedef void *HWND |
| 127 | + ctypedef struct RECT: |
| 128 | + long left |
| 129 | + long top |
| 130 | + long right |
| 131 | + long bottom |
| 132 | + ctypedef char* LPCTSTR |
| 133 | + cdef HWND FindWindowA(LPCTSTR, LPCTSTR) |
| 134 | + cdef int CP_UTF8 |
| 135 | + cdef int WideCharToMultiByte(int, int, wchar_t*, int, char*, int, char*, int*) |
| 136 | + |
| 137 | +cdef extern from "include/internal/cef_win.h": |
| 138 | + ctypedef void* CefWindowHandle |
| 139 | + cdef cppclass CefWindowInfo: |
| 140 | + void SetAsChild(HWND, RECT) |
| 141 | + void SetAsOffScreen(HWND) |
| 142 | + HWND m_hWndParent |
| 143 | + HWND m_hWnd |
| 144 | + int m_x |
| 145 | + int m_y |
| 146 | + int m_nWidth |
| 147 | + int m_nHeight |
| 148 | + |
0 commit comments