mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add support for draggable regions (issue #1645).
Regions are defined using the '-webkit-app-region: drag/no-drag' CSS property and passed to the CefDragHandler:: OnDraggableRegionsChanged callback.
This commit is contained in:
committed by
Marshall Greenblatt
parent
ead921a3f6
commit
c5b8b8b9c8
@@ -1265,6 +1265,21 @@ typedef struct _cef_size_t {
|
||||
int height;
|
||||
} cef_size_t;
|
||||
|
||||
///
|
||||
// Structure representing a draggable region.
|
||||
///
|
||||
typedef struct _cef_draggable_region_t {
|
||||
///
|
||||
// Bounds of the region.
|
||||
///
|
||||
cef_rect_t bounds;
|
||||
|
||||
///
|
||||
// True (1) this this region is draggable and false (0) otherwise.
|
||||
///
|
||||
int draggable;
|
||||
} cef_draggable_region_t;
|
||||
|
||||
///
|
||||
// Existing process IDs.
|
||||
///
|
||||
|
@@ -257,6 +257,50 @@ inline bool operator!=(const CefSize& a, const CefSize& 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, bool draggable) {
|
||||
this->bounds = bounds, this->draggable = draggable;
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
|
||||
|
Reference in New Issue
Block a user