1 // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. 2 // 3 // Redistribution and use in source and binary forms, with or without 4 // modification, are permitted provided that the following conditions are 5 // met: 6 // 7 // * Redistributions of source code must retain the above copyright 8 // notice, this list of conditions and the following disclaimer. 9 // * Redistributions in binary form must reproduce the above 10 // copyright notice, this list of conditions and the following disclaimer 11 // in the documentation and/or other materials provided with the 12 // distribution. 13 // * Neither the name of Google Inc. nor the name Chromium Embedded 14 // Framework nor the names of its contributors may be used to endorse 15 // or promote products derived from this software without specific prior 16 // written permission. 17 // 18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 30 #ifndef CEF_INCLUDE_INTERNAL_CEF_TYPES_LINUX_H_ 31 #define CEF_INCLUDE_INTERNAL_CEF_TYPES_LINUX_H_ 32 #pragma once 33 34 #include "include/base/cef_build.h" 35 #include "include/cef_config.h" 36 37 #if defined(OS_LINUX) 38 39 #if defined(CEF_X11) 40 typedef union _XEvent XEvent; 41 typedef struct _XDisplay XDisplay; 42 #endif 43 44 #include "include/internal/cef_export.h" 45 #include "include/internal/cef_string.h" 46 #include "include/internal/cef_types_geometry.h" 47 48 // Handle types. 49 #if defined(CEF_X11) 50 #define cef_cursor_handle_t unsigned long 51 #define cef_event_handle_t XEvent* 52 #else 53 #define cef_cursor_handle_t void* 54 #define cef_event_handle_t void* 55 #endif 56 57 #define cef_window_handle_t unsigned long 58 59 #define kNullCursorHandle 0 60 #define kNullEventHandle NULL 61 #define kNullWindowHandle 0 62 63 #ifdef __cplusplus 64 extern "C" { 65 #endif 66 67 /// 68 // Return the singleton X11 display shared with Chromium. The display is not 69 // thread-safe and must only be accessed on the browser process UI thread. 70 /// 71 #if defined(CEF_X11) 72 CEF_EXPORT XDisplay* cef_get_xdisplay(); 73 #endif 74 75 /// 76 // Structure representing CefExecuteProcess arguments. 77 /// 78 typedef struct _cef_main_args_t { 79 int argc; 80 char** argv; 81 } cef_main_args_t; 82 83 /// 84 // Class representing window information. 85 /// 86 typedef struct _cef_window_info_t { 87 /// 88 // The initial title of the window, to be set when the window is created. 89 // Some layout managers (e.g., Compiz) can look at the window title 90 // in order to decide where to place the window when it is 91 // created. When this attribute is not empty, the window title will 92 // be set before the window is mapped to the dispay. Otherwise the 93 // title will be initially empty. 94 /// 95 cef_string_t window_name; 96 97 /// 98 // Initial window bounds. 99 /// 100 cef_rect_t bounds; 101 102 /// 103 // Pointer for the parent window. 104 /// 105 cef_window_handle_t parent_window; 106 107 /// 108 // Set to true (1) to create the browser using windowless (off-screen) 109 // rendering. No window will be created for the browser and all rendering will 110 // occur via the CefRenderHandler interface. The |parent_window| value will be 111 // used to identify monitor info and to act as the parent window for dialogs, 112 // context menus, etc. If |parent_window| is not provided then the main screen 113 // monitor will be used and some functionality that requires a parent window 114 // may not function correctly. In order to create windowless browsers the 115 // CefSettings.windowless_rendering_enabled value must be set to true. 116 // Transparent painting is enabled by default but can be disabled by setting 117 // CefBrowserSettings.background_color to an opaque value. 118 /// 119 int windowless_rendering_enabled; 120 121 /// 122 // Set to true (1) to enable shared textures for windowless rendering. Only 123 // valid if windowless_rendering_enabled above is also set to true. Currently 124 // only supported on Windows (D3D11). 125 /// 126 int shared_texture_enabled; 127 128 /// 129 // Set to true (1) to enable the ability to issue BeginFrame requests from the 130 // client application by calling CefBrowserHost::SendExternalBeginFrame. 131 /// 132 int external_begin_frame_enabled; 133 134 /// 135 // Pointer for the new browser window. Only used with windowed rendering. 136 /// 137 cef_window_handle_t window; 138 } cef_window_info_t; 139 140 #ifdef __cplusplus 141 } 142 #endif 143 144 #endif // OS_LINUX 145 146 #endif // CEF_INCLUDE_INTERNAL_CEF_TYPES_LINUX_H_ 147