]> git.sesse.net Git - casparcg/blobdiff - dependencies64/cef/linux/include/internal/cef_types_wrappers.h
Upgrade CEF to 3.3029.1611.g44e39a8 / Chromium 58.0.3029.81.
[casparcg] / dependencies64 / cef / linux / include / internal / cef_types_wrappers.h
similarity index 62%
rename from dependencies64/cef/include/internal/cef_types_wrappers.h
rename to dependencies64/cef/linux/include/internal/cef_types_wrappers.h
index 8ff0a45afd0f78f3cb2dc8c487923ed4201f99c0..4108a933e1a1c6e4553e8ebe75541831c55bdfc8 100644 (file)
@@ -134,6 +134,47 @@ class CefStructBase : public traits::struct_type {
 };
 
 
+struct CefPointTraits {
+  typedef cef_point_t struct_type;
+
+  static inline void init(struct_type* s) {}
+  static inline void clear(struct_type* s) {}
+
+  static inline void set(const struct_type* src, struct_type* target,
+      bool copy) {
+    *target = *src;
+  }
+};
+
+///
+// Class representing a point.
+///
+class CefPoint : public CefStructBase<CefPointTraits> {
+ public:
+  typedef CefStructBase<CefPointTraits> parent;
+
+  CefPoint() : parent() {}
+  CefPoint(const cef_point_t& r) : parent(r) {}  // NOLINT(runtime/explicit)
+  CefPoint(const CefPoint& r) : parent(r) {}  // NOLINT(runtime/explicit)
+  CefPoint(int x, int y) : parent() {
+    Set(x, y);
+  }
+
+  bool IsEmpty() const { return x <= 0 && y <= 0; }
+  void Set(int x_val, int y_val) {
+    x = x_val, y = y_val;
+  }
+};
+
+inline bool operator==(const CefPoint& a, const CefPoint& b) {
+  return a.x == b.x && a.y == b.y;
+}
+
+inline bool operator!=(const CefPoint& a, const CefPoint& b) {
+  return !(a == b);
+}
+
+
 struct CefRectTraits {
   typedef cef_rect_t struct_type;
 
@@ -161,8 +202,19 @@ class CefRect : public CefStructBase<CefRectTraits> {
   }
 
   bool IsEmpty() const { return width <= 0 || height <= 0; }
-  void Set(int x, int y, int width, int height) {
-    this->x = x, this->y = y, this->width = width, this->height = height;
+  void Set(int x_val, int y_val, int width_val, int height_val) {
+    x = x_val, y = y_val, width = width_val, height = height_val;
+  }
+
+  // Returns true if the point identified by point_x and point_y falls inside
+  // this rectangle.  The point (x, y) is inside the rectangle, but the
+  // point (x + width, y + height) is not.
+  bool Contains(int point_x, int point_y) const {
+    return (point_x >= x) && (point_x < x + width) && (point_y >= y) &&
+           (point_y < y + height);
+  }
+  bool Contains(const CefPoint& point) const {
+    return Contains(point.x, point.y);
   }
 };
 
@@ -174,6 +226,175 @@ inline bool operator!=(const CefRect& a, const CefRect& b) {
   return !(a == b);
 }
 
+
+struct CefSizeTraits {
+  typedef cef_size_t struct_type;
+
+  static inline void init(struct_type* s) {}
+  static inline void clear(struct_type* s) {}
+
+  static inline void set(const struct_type* src, struct_type* target,
+      bool copy) {
+    *target = *src;
+  }
+};
+
+///
+// Class representing a size.
+///
+class CefSize : public CefStructBase<CefSizeTraits> {
+ public:
+  typedef CefStructBase<CefSizeTraits> parent;
+
+  CefSize() : parent() {}
+  CefSize(const cef_size_t& r) : parent(r) {}  // NOLINT(runtime/explicit)
+  CefSize(const CefSize& r) : parent(r) {}  // NOLINT(runtime/explicit)
+  CefSize(int width, int height) : parent() {
+    Set(width, height);
+  }
+
+  bool IsEmpty() const { return width <= 0 || height <= 0; }
+  void Set(int width_val, int height_val) {
+    width = width_val, height = height_val;
+  }
+};
+
+inline bool operator==(const CefSize& a, const CefSize& b) {
+  return a.width == b.width && a.height == b.height;
+}
+
+inline bool operator!=(const CefSize& a, const CefSize& b) {
+  return !(a == b);
+}
+
+
+struct CefRangeTraits {
+  typedef cef_range_t struct_type;
+
+  static inline void init(struct_type* s) {}
+  static inline void clear(struct_type* s) {}
+
+  static inline void set(const struct_type* src, struct_type* target,
+      bool copy) {
+    *target = *src;
+  }
+};
+
+///
+// Class representing a range.
+///
+class CefRange : public CefStructBase<CefRangeTraits> {
+ public:
+  typedef CefStructBase<CefRangeTraits> parent;
+
+  CefRange() : parent() {}
+  CefRange(const cef_range_t& r)  // NOLINT(runtime/explicit)
+      : parent(r) {}
+  CefRange(const CefRange& r)  // NOLINT(runtime/explicit)
+      : parent(r) {}
+  CefRange(int from, int to) : parent() {
+    Set(from, to);
+  }
+
+  void Set(int from_val, int to_val) {
+    from = from_val, to = to_val;
+  }
+};
+
+inline bool operator==(const CefRange& a, const CefRange& b) {
+  return a.from == b.from && a.to == b.to;
+}
+
+inline bool operator!=(const CefRange& a, const CefRange& b) {
+  return !(a == b);
+}
+
+
+struct CefInsetsTraits {
+  typedef cef_insets_t struct_type;
+
+  static inline void init(struct_type* s) {}
+  static inline void clear(struct_type* s) {}
+
+  static inline void set(const struct_type* src, struct_type* target,
+      bool copy) {
+    *target = *src;
+  }
+};
+
+///
+// Class representing insets.
+///
+class CefInsets : public CefStructBase<CefInsetsTraits> {
+ public:
+  typedef CefStructBase<CefInsetsTraits> parent;
+
+  CefInsets() : parent() {}
+  CefInsets(const cef_insets_t& r) : parent(r) {}  // NOLINT(runtime/explicit)
+  CefInsets(const CefInsets& r) : parent(r) {}  // NOLINT(runtime/explicit)
+  CefInsets(int top, int left, int bottom, int right) : parent() {
+    Set(top, left, bottom, right);
+  }
+
+  void Set(int top_val, int left_val, int bottom_val, int right_val) {
+    top = top_val, left = left_val, bottom = bottom_val, right = right_val;
+  }
+};
+
+inline bool operator==(const CefInsets& a, const CefInsets& b) {
+  return a.top == b.top && a.left == b.left && a.bottom == b.bottom &&
+         a.right == b.right;
+}
+
+inline bool operator!=(const CefInsets& a, const CefInsets& b) {
+  return !(a == b);
+}
+
+
+struct CefDraggableRegionTraits {
+  typedef cef_draggable_region_t struct_type;
+
+  static inline void init(struct_type* s) {}
+  static inline void clear(struct_type* s) {}
+
+  static inline void set(const struct_type* src, struct_type* target,
+      bool copy) {
+    *target = *src;
+  }
+};
+
+///
+// Class representing a draggable region.
+///
+class CefDraggableRegion : public CefStructBase<CefDraggableRegionTraits> {
+ public:
+  typedef CefStructBase<CefDraggableRegionTraits> parent;
+
+  CefDraggableRegion() : parent() {}
+  CefDraggableRegion(const cef_draggable_region_t& r)  // NOLINT(runtime/explicit)
+    : parent(r) {}
+  CefDraggableRegion(const CefDraggableRegion& r)  // NOLINT(runtime/explicit)
+    : parent(r) {}
+  CefDraggableRegion(const CefRect& bounds, bool draggable) : parent() {
+    Set(bounds, draggable);
+  }
+
+  void Set(const CefRect& bounds_val, bool draggable_val) {
+    bounds = bounds_val, draggable = draggable_val;
+  }
+};
+
+inline bool operator==(const CefDraggableRegion& a,
+    const CefDraggableRegion& b) {
+  return a.bounds == b.bounds && a.draggable == b.draggable;
+}
+
+inline bool operator!=(const CefDraggableRegion& a,
+    const CefDraggableRegion& b) {
+  return !(a == b);
+}
+
+
 struct CefScreenInfoTraits {
   typedef cef_screen_info_t struct_type;
 
@@ -193,8 +414,8 @@ struct CefScreenInfoTraits {
 };
 
 ///
-// Class representing the virtual screen information for use when window rendering
-// is disabled.
+// Class representing the virtual screen information for use when window
+// rendering is disabled.
 ///
 class CefScreenInfo : public CefStructBase<CefScreenInfoTraits> {
  public:
@@ -213,21 +434,22 @@ class CefScreenInfo : public CefStructBase<CefScreenInfoTraits> {
         is_monochrome, rect, available_rect);
   }
 
-  void Set(float device_scale_factor,
-           int depth,
-           int depth_per_component,
-           bool is_monochrome,
-           const CefRect& rect,
-           const CefRect& available_rect) {
-    this->device_scale_factor = device_scale_factor;
-    this->depth = depth;
-    this->depth_per_component = depth_per_component;
-    this->is_monochrome = is_monochrome;
-    this->rect = rect;
-    this->available_rect = available_rect;
+  void Set(float device_scale_factor_val,
+           int depth_val,
+           int depth_per_component_val,
+           bool is_monochrome_val,
+           const CefRect& rect_val,
+           const CefRect& available_rect_val) {
+    device_scale_factor = device_scale_factor_val;
+    depth = depth_val;
+    depth_per_component = depth_per_component_val;
+    is_monochrome = is_monochrome_val;
+    rect = rect_val;
+    available_rect = available_rect_val;
   }
 };
 
+
 struct CefKeyEventTraits {
   typedef cef_key_event_t struct_type;
 
@@ -253,6 +475,7 @@ struct CefKeyEventTraits {
 ///
 typedef CefStructBase<CefKeyEventTraits> CefKeyEvent;
 
+
 struct CefMouseEventTraits {
   typedef cef_mouse_event_t struct_type;
 
@@ -273,6 +496,7 @@ struct CefMouseEventTraits {
 ///
 typedef CefStructBase<CefMouseEventTraits> CefMouseEvent;
 
+
 struct CefPopupFeaturesTraits {
   typedef cef_popup_features_t struct_type;
 
@@ -285,18 +509,10 @@ struct CefPopupFeaturesTraits {
     s->resizable = true;
   }
 
-  static inline void clear(struct_type* s) {
-    if (s->additionalFeatures)
-      cef_string_list_free(s->additionalFeatures);
-  }
+  static inline void clear(struct_type* s) {}
 
   static inline void set(const struct_type* src, struct_type* target,
       bool copy) {
-    if (target->additionalFeatures)
-      cef_string_list_free(target->additionalFeatures);
-    target->additionalFeatures = src->additionalFeatures ?
-        cef_string_list_copy(src->additionalFeatures) : NULL;
-
     target->x = src->x;
     target->xSet = src->xSet;
     target->y = src->y;
@@ -331,7 +547,9 @@ struct CefSettingsTraits {
 
   static inline void clear(struct_type* s) {
     cef_string_clear(&s->browser_subprocess_path);
+    cef_string_clear(&s->framework_dir_path);
     cef_string_clear(&s->cache_path);
+    cef_string_clear(&s->user_data_path);
     cef_string_clear(&s->user_agent);
     cef_string_clear(&s->product_version);
     cef_string_clear(&s->locale);
@@ -339,6 +557,7 @@ struct CefSettingsTraits {
     cef_string_clear(&s->javascript_flags);
     cef_string_clear(&s->resources_dir_path);
     cef_string_clear(&s->locales_dir_path);
+    cef_string_clear(&s->accept_language_list);
   }
 
   static inline void set(const struct_type* src, struct_type* target,
@@ -348,12 +567,20 @@ struct CefSettingsTraits {
     cef_string_set(src->browser_subprocess_path.str,
         src->browser_subprocess_path.length,
         &target->browser_subprocess_path, copy);
+    cef_string_set(src->framework_dir_path.str,
+        src->framework_dir_path.length,
+        &target->framework_dir_path, copy);
     target->multi_threaded_message_loop = src->multi_threaded_message_loop;
+    target->external_message_pump = src->external_message_pump;
+    target->windowless_rendering_enabled = src->windowless_rendering_enabled;
     target->command_line_args_disabled = src->command_line_args_disabled;
 
     cef_string_set(src->cache_path.str, src->cache_path.length,
         &target->cache_path, copy);
+    cef_string_set(src->user_data_path.str, src->user_data_path.length,
+        &target->user_data_path, copy);
     target->persist_session_cookies = src->persist_session_cookies;
+    target->persist_user_preferences = src->persist_user_preferences;
 
     cef_string_set(src->user_agent.str, src->user_agent.length,
         &target->user_agent, copy);
@@ -364,7 +591,6 @@ struct CefSettingsTraits {
     cef_string_set(src->log_file.str, src->log_file.length, &target->log_file,
         copy);
     target->log_severity = src->log_severity;
-    target->release_dcheck_enabled = src->release_dcheck_enabled;
     cef_string_set(src->javascript_flags.str, src->javascript_flags.length,
         &target->javascript_flags, copy);
 
@@ -377,7 +603,12 @@ struct CefSettingsTraits {
     target->uncaught_exception_stack_size = src->uncaught_exception_stack_size;
     target->context_safety_implementation = src->context_safety_implementation;
     target->ignore_certificate_errors = src->ignore_certificate_errors;
+    target->enable_net_security_expiration =
+        src->enable_net_security_expiration;
     target->background_color = src->background_color;
+
+    cef_string_set(src->accept_language_list.str,
+        src->accept_language_list.length, &target->accept_language_list, copy);
   }
 };
 
@@ -387,6 +618,39 @@ struct CefSettingsTraits {
 typedef CefStructBase<CefSettingsTraits> CefSettings;
 
 
+struct CefRequestContextSettingsTraits {
+  typedef cef_request_context_settings_t struct_type;
+
+  static inline void init(struct_type* s) {
+    s->size = sizeof(struct_type);
+  }
+
+  static inline void clear(struct_type* s) {
+    cef_string_clear(&s->cache_path);
+    cef_string_clear(&s->accept_language_list);
+  }
+
+  static inline void set(const struct_type* src, struct_type* target,
+      bool copy) {
+    cef_string_set(src->cache_path.str, src->cache_path.length,
+        &target->cache_path, copy);
+    target->persist_session_cookies = src->persist_session_cookies;
+    target->persist_user_preferences = src->persist_user_preferences;
+    target->ignore_certificate_errors = src->ignore_certificate_errors;
+    target->enable_net_security_expiration =
+        src->enable_net_security_expiration;
+    cef_string_set(src->accept_language_list.str,
+        src->accept_language_list.length, &target->accept_language_list, copy);
+  }
+};
+
+///
+// Class representing request context initialization settings.
+///
+typedef CefStructBase<CefRequestContextSettingsTraits>
+    CefRequestContextSettings;
+
+
 struct CefBrowserSettingsTraits {
   typedef cef_browser_settings_t struct_type;
 
@@ -402,10 +666,13 @@ struct CefBrowserSettingsTraits {
     cef_string_clear(&s->cursive_font_family);
     cef_string_clear(&s->fantasy_font_family);
     cef_string_clear(&s->default_encoding);
+    cef_string_clear(&s->accept_language_list);
   }
 
   static inline void set(const struct_type* src, struct_type* target,
       bool copy) {
+    target->windowless_frame_rate = src->windowless_frame_rate;
+
     cef_string_set(src->standard_font_family.str,
         src->standard_font_family.length, &target->standard_font_family, copy);
     cef_string_set(src->fixed_font_family.str, src->fixed_font_family.length,
@@ -434,8 +701,6 @@ struct CefBrowserSettingsTraits {
     target->javascript_close_windows = src->javascript_close_windows;
     target->javascript_access_clipboard = src->javascript_access_clipboard;
     target->javascript_dom_paste = src->javascript_dom_paste;
-    target->caret_browsing = src->caret_browsing;
-    target->java = src->java;
     target->plugins = src->plugins;
     target->universal_access_from_file_urls =
         src->universal_access_from_file_urls;
@@ -450,9 +715,11 @@ struct CefBrowserSettingsTraits {
     target->databases= src->databases;
     target->application_cache = src->application_cache;
     target->webgl = src->webgl;
-    target->accelerated_compositing = src->accelerated_compositing;
 
     target->background_color = src->background_color;
+
+    cef_string_set(src->accept_language_list.str,
+        src->accept_language_list.length, &target->accept_language_list, copy);
   }
 };
 
@@ -626,4 +893,115 @@ struct CefGeopositionTraits {
 ///
 typedef CefStructBase<CefGeopositionTraits> CefGeoposition;
 
+
+struct CefCursorInfoTraits {
+  typedef cef_cursor_info_t struct_type;
+
+  static inline void init(struct_type* s) {}
+
+  static inline void clear(struct_type* s) {}
+
+  static inline void set(const struct_type* src, struct_type* target,
+      bool copy) {
+    target->hotspot = src->hotspot;
+    target->image_scale_factor = src->image_scale_factor;
+    target->buffer = src->buffer;
+    target->size = src->size;
+  }
+};
+
+///
+// Class representing cursor information.
+///
+typedef CefStructBase<CefCursorInfoTraits> CefCursorInfo;
+
+
+struct CefPdfPrintSettingsTraits {
+  typedef cef_pdf_print_settings_t struct_type;
+
+  static inline void init(struct_type* s) {}
+
+  static inline void clear(struct_type* s) {
+    cef_string_clear(&s->header_footer_title);
+    cef_string_clear(&s->header_footer_url);
+  }
+
+  static inline void set(const struct_type* src, struct_type* target,
+      bool copy) {
+
+    cef_string_set(src->header_footer_title.str,
+        src->header_footer_title.length, &target->header_footer_title, copy);
+    cef_string_set(src->header_footer_url.str, src->header_footer_url.length,
+        &target->header_footer_url, copy);
+
+    target->page_width = src->page_width;
+    target->page_height = src->page_height;
+
+    target->scale_factor = src->scale_factor;
+
+    target->margin_top = src->margin_top;
+    target->margin_right = src->margin_right;
+    target->margin_bottom = src->margin_bottom;
+    target->margin_left = src->margin_left;
+    target->margin_type = src->margin_type;
+
+    target->header_footer_enabled = src->header_footer_enabled;
+    target->selection_only = src->selection_only;
+    target->landscape = src->landscape;
+    target->backgrounds_enabled = src->backgrounds_enabled;
+  }
+};
+
+///
+// Class representing PDF print settings
+///
+typedef CefStructBase<CefPdfPrintSettingsTraits> CefPdfPrintSettings;
+
+
+struct CefBoxLayoutSettingsTraits {
+  typedef cef_box_layout_settings_t struct_type;
+
+  static inline void init(struct_type* s) {}
+
+  static inline void clear(struct_type* s) {}
+
+  static inline void set(const struct_type* src, struct_type* target,
+      bool copy) {
+    *target = *src;
+  }
+};
+
+///
+// Class representing CefBoxLayout settings.
+///
+typedef CefStructBase<CefBoxLayoutSettingsTraits> CefBoxLayoutSettings;
+
+struct CefCompositionUnderlineTraits {
+  typedef cef_composition_underline_t struct_type;
+
+  static inline void init(struct_type* s) {
+    s->range.from = 0;
+    s->range.to = 0;
+    s->color = 0;
+    s->background_color = 0;
+    s->thick = 0;
+  }
+
+  static inline void clear(struct_type* s) {
+  }
+
+  static inline void set(const struct_type* src, struct_type* target,
+                         bool copy) {
+    target->range = src->range;
+    target->color = src->color;
+    target->background_color = src->background_color;
+    target->thick = src->thick;
+  }
+};
+
+///
+// Class representing IME composition underline.
+///
+typedef CefStructBase<CefCompositionUnderlineTraits> CefCompositionUnderline;
+
 #endif  // CEF_INCLUDE_INTERNAL_CEF_TYPES_WRAPPERS_H_