Linux: Add new CefPrintHandler and CefPrintSettings classes to support printing and a GTK implementation in cefclient (issue #1258).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1762 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2014-07-10 15:41:30 +00:00
parent 6f63f5d4f8
commit 8313963a27
47 changed files with 3803 additions and 3 deletions

View File

@@ -174,6 +174,48 @@ 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, int height) {
this->width = width, this->height = height;
}
};
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 CefScreenInfoTraits {
typedef cef_screen_info_t struct_type;
@@ -228,6 +270,7 @@ class CefScreenInfo : public CefStructBase<CefScreenInfoTraits> {
}
};
struct CefKeyEventTraits {
typedef cef_key_event_t struct_type;
@@ -253,6 +296,7 @@ struct CefKeyEventTraits {
///
typedef CefStructBase<CefKeyEventTraits> CefKeyEvent;
struct CefMouseEventTraits {
typedef cef_mouse_event_t struct_type;
@@ -273,6 +317,7 @@ struct CefMouseEventTraits {
///
typedef CefStructBase<CefMouseEventTraits> CefMouseEvent;
struct CefPopupFeaturesTraits {
typedef cef_popup_features_t struct_type;
@@ -627,4 +672,47 @@ struct CefGeopositionTraits {
///
typedef CefStructBase<CefGeopositionTraits> CefGeoposition;
struct CefPageRangeTraits {
typedef cef_page_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 print job page range.
///
class CefPageRange : public CefStructBase<CefPageRangeTraits> {
public:
typedef CefStructBase<CefPageRangeTraits> parent;
CefPageRange() : parent() {}
CefPageRange(const cef_page_range_t& r) // NOLINT(runtime/explicit)
: parent(r) {}
CefPageRange(const CefPageRange& r) // NOLINT(runtime/explicit)
: parent(r) {}
CefPageRange(int from, int to) : parent() {
Set(from, to);
}
void Set(int from, int to) {
this->from = from, this->to = to;
}
};
inline bool operator==(const CefPageRange& a, const CefPageRange& b) {
return a.from == b.from && a.to == b.to;
}
inline bool operator!=(const CefPageRange& a, const CefPageRange& b) {
return !(a == b);
}
#endif // CEF_INCLUDE_INTERNAL_CEF_TYPES_WRAPPERS_H_