mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
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:
@@ -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_
|
||||
|
Reference in New Issue
Block a user