@@ -112,17 +112,17 @@ struct CefWindowInfoTraits {
112
112
113
113
static inline void set (const struct_type* src, struct_type* target,
114
114
bool copy) {
115
- target->view = src->view ;
116
- target->parent_view = src->parent_view ;
117
115
cef_string_set (src->window_name .str , src->window_name .length ,
118
116
&target->window_name , copy);
119
117
target->x = src->x ;
120
118
target->y = src->y ;
121
119
target->width = src->width ;
122
120
target->height = src->height ;
123
121
target->hidden = src->hidden ;
124
- target->transparent_painting = src->transparent_painting ;
125
- target->window_rendering_disabled = src->window_rendering_disabled ;
122
+ target->parent_view = src->parent_view ;
123
+ target->windowless_rendering_enabled = src->windowless_rendering_enabled ;
124
+ target->transparent_painting_enabled = src->transparent_painting_enabled ;
125
+ target->view = src->view ;
126
126
}
127
127
};
128
128
@@ -135,23 +135,35 @@ class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
135
135
explicit CefWindowInfo (const cef_window_info_t & r) : parent(r) {}
136
136
explicit CefWindowInfo (const CefWindowInfo& r) : parent(r) {}
137
137
138
- void SetAsChild (CefWindowHandle ParentView, int x, int y, int width,
138
+ // /
139
+ // Create the browser as a child view.
140
+ // /
141
+ void SetAsChild (CefWindowHandle parent, int x, int y, int width,
139
142
int height) {
140
- parent_view = ParentView ;
143
+ parent_view = parent ;
141
144
this ->x = x;
142
145
this ->y = y;
143
146
this ->width = width;
144
147
this ->height = height;
145
148
hidden = false ;
146
149
}
147
150
148
- void SetTransparentPainting (bool transparentPainting) {
149
- transparent_painting = transparentPainting;
150
- }
151
-
152
- void SetAsOffScreen (NSView* view) {
153
- window_rendering_disabled = true ;
154
- parent_view = view;
151
+ // /
152
+ // Create the browser using windowless (off-screen) rendering. No view
153
+ // will be created for the browser and all rendering will occur via the
154
+ // CefRenderHandler interface. The |parent| value will be used to identify
155
+ // monitor info and to act as the parent view for dialogs, context menus,
156
+ // etc. If |parent| is not provided then the main screen monitor will be used
157
+ // and some functionality that requires a parent view may not function
158
+ // correctly. If |transparent| is true a transparent background color will be
159
+ // used (RGBA=0x00000000). If |transparent| is false the background will be
160
+ // white and opaque. In order to create windowless browsers the
161
+ // CefSettings.windowless_rendering_enabled value must be set to true.
162
+ // /
163
+ void SetAsWindowless (CefWindowHandle parent, bool transparent) {
164
+ windowless_rendering_enabled = true ;
165
+ parent_view = parent;
166
+ transparent_painting_enabled = transparent;
155
167
}
156
168
};
157
169
0 commit comments