diff options
author | Alexander Larsson <alexl@redhat.com> | 2010-02-04 18:04:26 +0100 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2010-02-04 18:49:00 +0100 |
commit | 1f516978527b223882c02d8c23834a0f30279dec (patch) | |
tree | 7472bb21b145c2c586a3ad7aebb7bd136cef9e70 /client/x11 | |
parent | c1694fb51bb29d3cbd03f679372339f9e8f29803 (diff) | |
download | spice-1f516978527b223882c02d8c23834a0f30279dec.tar.gz spice-1f516978527b223882c02d8c23834a0f30279dec.tar.xz spice-1f516978527b223882c02d8c23834a0f30279dec.zip |
Rename symbols that were changed in spice-protocol
This is an automatic change using:
$ find -name "*.[ch]" | xargs ../spice-protocol/rename-identifiers.sh ../spice-protocol/renames
$ find -name "*.cpp" | xargs ../spice-protocol/rename-identifiers.sh ../spice-protocol/renames
Diffstat (limited to 'client/x11')
-rw-r--r-- | client/x11/pixels_source.cpp | 8 | ||||
-rw-r--r-- | client/x11/platform.cpp | 208 | ||||
-rw-r--r-- | client/x11/red_drawable.cpp | 112 | ||||
-rw-r--r-- | client/x11/red_pixmap_gl.cpp | 2 | ||||
-rw-r--r-- | client/x11/red_window.cpp | 66 | ||||
-rw-r--r-- | client/x11/red_window_p.h | 2 |
6 files changed, 199 insertions, 199 deletions
diff --git a/client/x11/pixels_source.cpp b/client/x11/pixels_source.cpp index d8d8cb75..7b9ed05f 100644 --- a/client/x11/pixels_source.cpp +++ b/client/x11/pixels_source.cpp @@ -94,10 +94,10 @@ ImageFromRes::~ImageFromRes() delete ((PixelsSource_p*)get_opaque())->pixmap.x_image; } -Point ImageFromRes::get_size() +SpicePoint ImageFromRes::get_size() { XImage *image = ((PixelsSource_p*)get_opaque())->pixmap.x_image; - Point pt; + SpicePoint pt; pt.x = image->width; pt.y = image->height; return pt; @@ -118,10 +118,10 @@ AlphaImageFromRes::~AlphaImageFromRes() delete ((PixelsSource_p*)get_opaque())->pixmap.x_image; } -Point AlphaImageFromRes::get_size() +SpicePoint AlphaImageFromRes::get_size() { XImage *image = ((PixelsSource_p*)get_opaque())->pixmap.x_image; - Point pt; + SpicePoint pt; pt.x = image->width; pt.y = image->height; return pt; diff --git a/client/x11/platform.cpp b/client/x11/platform.cpp index 6aab7992..a41488eb 100644 --- a/client/x11/platform.cpp +++ b/client/x11/platform.cpp @@ -478,12 +478,12 @@ public: void set_width(int width) {_width = width;} int get_height() const { return _height;} void set_height(int height) {_height = height;} - Point get_position() const {return _position;} + SpicePoint get_position() const {return _position;} private: Display* _display; int _screen; - Point _position; + SpicePoint _position; int _width; int _height; bool _broken; @@ -520,8 +520,8 @@ public: } virtual int get_depth() { return XPlatform::get_vinfo()[0]->depth;} - virtual Point get_position() { return XScreen::get_position();} - virtual Point get_size() const { Point pt = {get_width(), get_height()}; return pt;} + virtual SpicePoint get_position() { return XScreen::get_position();} + virtual SpicePoint get_size() const { SpicePoint pt = {get_width(), get_height()}; return pt;} virtual bool is_out_of_sync() { return _out_of_sync;} virtual int get_screen_id() { return get_screen();} @@ -544,8 +544,8 @@ public: void publish_monitors(MonitorsList& monitors); virtual int get_depth() { return XPlatform::get_vinfo()[0]->depth;} - virtual Point get_position() { return XScreen::get_position();} - virtual Point get_size() const { Point pt = {get_width(), get_height()}; return pt;} + virtual SpicePoint get_position() { return XScreen::get_position();} + virtual SpicePoint get_size() const { SpicePoint pt = {get_width(), get_height()}; return pt;} virtual bool is_out_of_sync() { return _out_of_sync;} virtual int get_screen_id() { return get_screen();} @@ -694,8 +694,8 @@ public: private: void set_size(int width, int height); void get_trans_size(int& width, int& hight); - Point get_trans_top_left(); - Point get_trans_bottom_right(); + SpicePoint get_trans_top_left(); + SpicePoint get_trans_bottom_right(); bool changed(); XMonitor* crtc_overlap_test(int x, int y, int width, int height); @@ -722,8 +722,8 @@ public: virtual ~XMonitor(); virtual int get_depth(); - virtual Point get_position(); - virtual Point get_size() const; + virtual SpicePoint get_position(); + virtual SpicePoint get_size() const; virtual bool is_out_of_sync(); virtual int get_screen_id() { return _container.get_screen();} @@ -733,8 +733,8 @@ public: void enable(); void set_mode(const XRRModeInfo& mode); - const Rect& get_prev_area(); - Rect& get_trans_area(); + const SpiceRect& get_prev_area(); + SpiceRect& get_trans_area(); void pin() { _pin_count++;} void unpin() { ASSERT(_pin_count > 0); _pin_count--;} bool is_pinned() {return !!_pin_count;} @@ -763,15 +763,15 @@ private: MultyMonScreen& _container; RRCrtc _crtc; XMonitorsList _clones; - Point _position; - Point _size; + SpicePoint _position; + SpicePoint _size; RRMode _mode; Rotation _rotation; int _noutput; RROutput* _outputs; - Point _saved_position; - Point _saved_size; + SpicePoint _saved_position; + SpicePoint _saved_size; RRMode _saved_mode; Rotation _saved_rotation; @@ -780,7 +780,7 @@ private: RedSubpixelOrder _subpixel_order; int _trans_depth; - Rect _trans_area[MAX_TRANS_DEPTH]; + SpiceRect _trans_area[MAX_TRANS_DEPTH]; int _pin_count; XMonitor* _pusher; }; @@ -852,8 +852,8 @@ XMonitor* MultyMonScreen::crtc_overlap_test(int x, int y, int width, int height) for (; iter != _monitors.end(); iter++) { XMonitor* mon = *iter; - Point pos = mon->get_position(); - Point size = mon->get_size(); + SpicePoint pos = mon->get_position(); + SpicePoint size = mon->get_size(); if (x == pos.x && y == pos.y && width == size.x && height == size.y) { return mon; @@ -949,28 +949,28 @@ void MultyMonScreen::restore() X_DEBUG_SYNC(get_display()); } -Point MultyMonScreen::get_trans_top_left() +SpicePoint MultyMonScreen::get_trans_top_left() { - Point position; + SpicePoint position; position.y = position.x = MAXINT; XMonitorsList::iterator iter = _monitors.begin(); for (; iter != _monitors.end(); iter++) { - Rect& area = (*iter)->get_trans_area(); + SpiceRect& area = (*iter)->get_trans_area(); position.x = MIN(position.x, area.left); position.y = MIN(position.y, area.top); } return position; } -Point MultyMonScreen::get_trans_bottom_right() +SpicePoint MultyMonScreen::get_trans_bottom_right() { - Point position; + SpicePoint position; position.y = position.x = MININT; XMonitorsList::iterator iter = _monitors.begin(); for (; iter != _monitors.end(); iter++) { - Rect& area = (*iter)->get_trans_area(); + SpiceRect& area = (*iter)->get_trans_area(); position.x = MAX(position.x, area.right); position.y = MAX(position.y, area.bottom); } @@ -980,7 +980,7 @@ Point MultyMonScreen::get_trans_bottom_right() void MultyMonScreen::get_trans_size(int& width, int& height) { ASSERT(get_trans_top_left().x == 0 && get_trans_top_left().y == 0); - Point bottom_right = get_trans_bottom_right(); + SpicePoint bottom_right = get_trans_bottom_right(); ASSERT(bottom_right.x > 0 && bottom_right.y > 0); width = bottom_right.x; height = bottom_right.y; @@ -989,17 +989,17 @@ void MultyMonScreen::get_trans_size(int& width, int& height) #endif /*class Variant { - static void get_area_in_front(const Rect& base, int size, Rect& area) - static int get_push_distance(const Rect& fix_area, const Rect& other) - static int get_head(const Rect& area) - static int get_tail(const Rect& area) - static void move_head(Rect& area, int delta) - static int get_pull_distance(const Rect& fix_area, const Rect& other) - static void offset(Rect& area, int delta) - static void shrink(Rect& area, int delta) - static int get_distance(const Rect& area, const Rect& other_area) - static bool is_on_tail(const Rect& area, const Rect& other_area) - static bool is_on_perpendiculars(const Rect& area, const Rect& other_area) + static void get_area_in_front(const SpiceRect& base, int size, SpiceRect& area) + static int get_push_distance(const SpiceRect& fix_area, const SpiceRect& other) + static int get_head(const SpiceRect& area) + static int get_tail(const SpiceRect& area) + static void move_head(SpiceRect& area, int delta) + static int get_pull_distance(const SpiceRect& fix_area, const SpiceRect& other) + static void offset(SpiceRect& area, int delta) + static void shrink(SpiceRect& area, int delta) + static int get_distance(const SpiceRect& area, const SpiceRect& other_area) + static bool is_on_tail(const SpiceRect& area, const SpiceRect& other_area) + static bool is_on_perpendiculars(const SpiceRect& area, const SpiceRect& other_area) }*/ #ifdef USE_XRANDR_1_2 @@ -1017,7 +1017,7 @@ typedef std::multiset<XMonitor*, SortRightToLeft> PushLeftSet; class LeftVariant { public: - static void get_area_in_front(const Rect& base, int size, Rect& area) + static void get_area_in_front(const SpiceRect& base, int size, SpiceRect& area) { area.right = base.left; area.left = area.right - size; @@ -1025,55 +1025,55 @@ public: area.top = base.top; } - static int get_push_distance(const Rect& fix_area, const Rect& other) + static int get_push_distance(const SpiceRect& fix_area, const SpiceRect& other) { return other.right - fix_area.left; } - static int get_head(const Rect& area) + static int get_head(const SpiceRect& area) { return area.left; } - static int get_tail(const Rect& area) + static int get_tail(const SpiceRect& area) { return area.right; } - static void move_head(Rect& area, int delta) + static void move_head(SpiceRect& area, int delta) { area.left -= delta; ASSERT(area.right >= area.left); } - static int get_pull_distance(const Rect& fix_area, const Rect& other) + static int get_pull_distance(const SpiceRect& fix_area, const SpiceRect& other) { return other.left - fix_area.right; } - static void offset(Rect& area, int delta) + static void offset(SpiceRect& area, int delta) { rect_offset(area, -delta, 0); } - static void shrink(Rect& area, int delta) + static void shrink(SpiceRect& area, int delta) { area.right -= delta; ASSERT(area.right > area.left); } - static int get_distance(const Rect& area, const Rect& other_area) + static int get_distance(const SpiceRect& area, const SpiceRect& other_area) { return other_area.left - area.left; } - static bool is_on_tail(const Rect& area, const Rect& other_area) + static bool is_on_tail(const SpiceRect& area, const SpiceRect& other_area) { return area.right == other_area.left && other_area.top < area.bottom && other_area.bottom > area.top; } - static bool is_on_perpendiculars(const Rect& area, const Rect& other_area) + static bool is_on_perpendiculars(const SpiceRect& area, const SpiceRect& other_area) { return (other_area.bottom == area.top || other_area.top == area.bottom) && other_area.left < area.right && other_area.right > area.left; @@ -1093,7 +1093,7 @@ typedef std::multiset<XMonitor*, SortLeftToRight> PushRightSet; class RightVariant { public: - static void get_area_in_front(const Rect& base, int size, Rect& area) + static void get_area_in_front(const SpiceRect& base, int size, SpiceRect& area) { area.left = base.right; area.right = area.left + size; @@ -1101,44 +1101,44 @@ public: area.bottom = base.bottom; } - static int get_push_distance(const Rect& fix_area, const Rect& other) + static int get_push_distance(const SpiceRect& fix_area, const SpiceRect& other) { return fix_area.right - other.left; } - static int get_head(const Rect& area) + static int get_head(const SpiceRect& area) { return area.right; } - static int get_tail(const Rect& area) + static int get_tail(const SpiceRect& area) { return area.left; } - static void move_head(Rect& area, int delta) + static void move_head(SpiceRect& area, int delta) { area.right += delta; ASSERT(area.right >= area.left); } - static int get_pull_distance(const Rect& fix_area, const Rect& other) + static int get_pull_distance(const SpiceRect& fix_area, const SpiceRect& other) { return fix_area.left - other.right; } - static void offset(Rect& area, int delta) + static void offset(SpiceRect& area, int delta) { rect_offset(area, delta, 0); } - static bool is_on_tail(const Rect& area, const Rect& other_area) + static bool is_on_tail(const SpiceRect& area, const SpiceRect& other_area) { return other_area.right == area.left && other_area.top < area.bottom && other_area.bottom > area.top; } - static bool is_on_perpendiculars(const Rect& area, const Rect& other_area) + static bool is_on_perpendiculars(const SpiceRect& area, const SpiceRect& other_area) { return (other_area.bottom == area.top || other_area.top == area.bottom) && other_area.left < area.right && other_area.right > area.left; @@ -1157,7 +1157,7 @@ typedef std::multiset<XMonitor*, SortBottomToTop> PushTopSet; class TopVariant { public: - static void get_area_in_front(const Rect& base, int size, Rect& area) + static void get_area_in_front(const SpiceRect& base, int size, SpiceRect& area) { area.left = base.left; area.right = base.right; @@ -1165,55 +1165,55 @@ public: area.top = area.bottom - size; } - static int get_push_distance(const Rect& fix_area, const Rect& other) + static int get_push_distance(const SpiceRect& fix_area, const SpiceRect& other) { return other.bottom - fix_area.top; } - static int get_head(const Rect& area) + static int get_head(const SpiceRect& area) { return area.top; } - static int get_tail(const Rect& area) + static int get_tail(const SpiceRect& area) { return area.bottom; } - static void move_head(Rect& area, int delta) + static void move_head(SpiceRect& area, int delta) { area.top -= delta; ASSERT(area.bottom >= area.top); } - static int get_pull_distance(const Rect& fix_area, const Rect& other) + static int get_pull_distance(const SpiceRect& fix_area, const SpiceRect& other) { return other.top - fix_area.bottom; } - static void offset(Rect& area, int delta) + static void offset(SpiceRect& area, int delta) { rect_offset(area, 0, -delta); } - static void shrink(Rect& area, int delta) + static void shrink(SpiceRect& area, int delta) { area.bottom -= delta; ASSERT(area.bottom > area.top); } - static int get_distance(const Rect& area, const Rect& other_area) + static int get_distance(const SpiceRect& area, const SpiceRect& other_area) { return other_area.top - area.top; } - static bool is_on_tail(const Rect& area, const Rect& other_area) + static bool is_on_tail(const SpiceRect& area, const SpiceRect& other_area) { return area.bottom == other_area.top && other_area.left < area.right && other_area.right > area.left; } - static bool is_on_perpendiculars(const Rect& area, const Rect& other_area) + static bool is_on_perpendiculars(const SpiceRect& area, const SpiceRect& other_area) { return (other_area.right == area.left || other_area.left == area.right) && other_area.top < area.bottom && other_area.bottom > area.top; @@ -1233,7 +1233,7 @@ typedef std::multiset<XMonitor*, SortTopToBottom> PushBottomSet; class BottomVariant { public: - static void get_area_in_front(const Rect& base, int size, Rect& area) + static void get_area_in_front(const SpiceRect& base, int size, SpiceRect& area) { area.left = base.left; area.right = base.right; @@ -1241,44 +1241,44 @@ public: area.bottom = area.top + size; } - static int get_push_distance(const Rect& fix_area, const Rect& other) + static int get_push_distance(const SpiceRect& fix_area, const SpiceRect& other) { return fix_area.bottom - other.top; } - static int get_head(const Rect& area) + static int get_head(const SpiceRect& area) { return area.bottom; } - static int get_tail(const Rect& area) + static int get_tail(const SpiceRect& area) { return area.top; } - static void move_head(Rect& area, int delta) + static void move_head(SpiceRect& area, int delta) { area.bottom += delta; ASSERT(area.bottom >= area.top); } - static int get_pull_distance(const Rect& fix_area, const Rect& other) + static int get_pull_distance(const SpiceRect& fix_area, const SpiceRect& other) { return fix_area.top - other.bottom; } - static void offset(Rect& area, int delta) + static void offset(SpiceRect& area, int delta) { rect_offset(area, 0, delta); } - static bool is_on_tail(const Rect& area, const Rect& other_area) + static bool is_on_tail(const SpiceRect& area, const SpiceRect& other_area) { return other_area.bottom == area.top && other_area.left < area.right && other_area.right > area.left; } - static bool is_on_perpendiculars(const Rect& area, const Rect& other_area) + static bool is_on_perpendiculars(const SpiceRect& area, const SpiceRect& other_area) { return (other_area.right == area.left || other_area.left == area.right) && other_area.top < area.bottom && other_area.bottom > area.top; @@ -1294,7 +1294,7 @@ static void bounce_back(XMonitor& monitor, const XMonitorsList& monitors, int he while (wait_for_me); for (XMonitorsList::const_iterator iter = monitors.begin(); iter != monitors.end(); iter++) { - Rect& area = (*iter)->get_trans_area(); + SpiceRect& area = (*iter)->get_trans_area(); if (Variant::get_tail(area) == head && (*iter)->get_pusher() == &monitor) { Variant::offset(area, -distance); bounce_back<Variant>(**iter, monitors, Variant::get_head(area) + distance, distance); @@ -1318,13 +1318,13 @@ static int push(XMonitor& pusher, XMonitor& monitor, const XMonitorsList& monito sort.insert(*iter); } - Rect area_to_clear; + SpiceRect area_to_clear; Variant::get_area_in_front(monitor.get_trans_area(), delta, area_to_clear); SortListIter sort_iter = sort.begin(); for (; sort_iter != sort.end(); sort_iter++) { - const Rect& other_area = (*sort_iter)->get_trans_area(); + const SpiceRect& other_area = (*sort_iter)->get_trans_area(); if (rect_intersects(area_to_clear, other_area)) { int distance = Variant::get_push_distance(area_to_clear, other_area); @@ -1343,13 +1343,13 @@ static int push(XMonitor& pusher, XMonitor& monitor, const XMonitorsList& monito } Variant::offset(monitor.get_trans_area(), delta); - const Rect& area = monitor.get_prev_area(); + const SpiceRect& area = monitor.get_prev_area(); for (iter = monitors.begin(); iter != monitors.end(); iter++) { if ((*iter)->is_pinned()) { continue; } - const Rect& other_area = (*iter)->get_prev_area(); + const SpiceRect& other_area = (*iter)->get_prev_area(); if (Variant::is_on_perpendiculars(area, other_area)) { int current_distance = Variant::get_pull_distance(monitor.get_trans_area(), (*iter)->get_trans_area()); @@ -1371,10 +1371,10 @@ static int push(XMonitor& pusher, XMonitor& monitor, const XMonitorsList& monito template <class Variant> static void pin(XMonitor& monitor, const XMonitorsList& monitors) { - const Rect& area = monitor.get_trans_area(); + const SpiceRect& area = monitor.get_trans_area(); for (XMonitorsList::const_iterator iter = monitors.begin(); iter != monitors.end(); iter++) { - const Rect& other_area = (*iter)->get_trans_area(); + const SpiceRect& other_area = (*iter)->get_trans_area(); if ((*iter)->is_pinned()) { continue; } @@ -1402,10 +1402,10 @@ static void shrink(XMonitor& monitor, const XMonitorsList& monitors, int delta) sort.insert(*iter); } - const Rect area = monitor.get_trans_area(); + const SpiceRect area = monitor.get_trans_area(); Variant::shrink(monitor.get_trans_area(), delta); for (SortListIter sort_iter = sort.begin(); sort_iter != sort.end(); sort_iter++) { - const Rect& other_area = (*sort_iter)->get_trans_area(); + const SpiceRect& other_area = (*sort_iter)->get_trans_area(); if (Variant::is_on_perpendiculars(area, other_area)) { int distance = Variant::get_distance(area, other_area); if (distance > 0) { @@ -1433,11 +1433,11 @@ static void expand(XMonitor& monitor, const XMonitorsList& monitors, int delta) sort.insert(*iter); } - Rect area_to_clear; + SpiceRect area_to_clear; Variant::get_area_in_front(monitor.get_trans_area(), delta, area_to_clear); for (SortListIter sort_iter = sort.begin(); sort_iter != sort.end(); sort_iter++) { - const Rect& other_area = (*sort_iter)->get_trans_area(); + const SpiceRect& other_area = (*sort_iter)->get_trans_area(); if (rect_intersects(area_to_clear, other_area)) { int distance = Variant::get_push_distance(area_to_clear, other_area); @@ -1459,7 +1459,7 @@ bool MultyMonScreen::set_monitor_mode(XMonitor& monitor, const XRRModeInfo& mode return false; } - Point size = monitor.get_size(); + SpicePoint size = monitor.get_size(); int dx = mode_info.width - size.x; int dy = mode_info.height - size.y; @@ -1790,12 +1790,12 @@ int XMonitor::get_depth() return XPlatform::get_vinfo()[0]->depth; } -Point XMonitor::get_position() +SpicePoint XMonitor::get_position() { return _position; } -Point XMonitor::get_size() const +SpicePoint XMonitor::get_size() const { return _size; } @@ -1810,12 +1810,12 @@ void XMonitor::add_clone(XMonitor *clone) _clones.push_back(clone); } -const Rect& XMonitor::get_prev_area() +const SpiceRect& XMonitor::get_prev_area() { return _trans_area[_trans_depth - 1]; } -Rect& XMonitor::get_trans_area() +SpiceRect& XMonitor::get_trans_area() { return _trans_area[_trans_depth]; } @@ -2357,8 +2357,8 @@ void Platform::reset_cursor_pos() if (!primary_monitor) { return; } - Point pos = primary_monitor->get_position(); - Point size = primary_monitor->get_size(); + SpicePoint pos = primary_monitor->get_position(); + SpicePoint size = primary_monitor->get_size(); Window root_window = RootWindow(x_display, DefaultScreen(x_display)); XWarpPointer(x_display, None, root_window, 0, 0, 0, 0, pos.x + size.x / 2, pos.y + size.y / 2); } @@ -2434,7 +2434,7 @@ static inline uint32_t get_pix_hack(int pix_index, int width) XLocalCursor::XLocalCursor(CursorData* cursor_data) { - const CursorHeader& header = cursor_data->header(); + const SpiceCursorHeader& header = cursor_data->header(); const uint8_t* data = cursor_data->data(); int cur_size = header.width * header.height; uint8_t pix_mask; @@ -2449,9 +2449,9 @@ XLocalCursor::XLocalCursor(CursorData* cursor_data) uint32_t* cur_data = new uint32_t[cur_size]; switch (header.type) { - case CURSOR_TYPE_ALPHA: + case SPICE_CURSOR_TYPE_ALPHA: break; - case CURSOR_TYPE_COLOR32: + case SPICE_CURSOR_TYPE_COLOR32: memcpy(cur_data, data, cur_size * sizeof(uint32_t)); for (i = 0; i < cur_size; i++) { pix_mask = get_pix_mask(data, size, i); @@ -2462,7 +2462,7 @@ XLocalCursor::XLocalCursor(CursorData* cursor_data) } } break; - case CURSOR_TYPE_COLOR16: + case SPICE_CURSOR_TYPE_COLOR16: for (i = 0; i < cur_size; i++) { pix_mask = get_pix_mask(data, size, i); pix = *((uint16_t*)data + i); @@ -2474,7 +2474,7 @@ XLocalCursor::XLocalCursor(CursorData* cursor_data) } } break; - case CURSOR_TYPE_MONO: + case SPICE_CURSOR_TYPE_MONO: for (i = 0; i < cur_size; i++) { pix_mask = get_pix_mask(data, 0, i); pix = get_pix_mask(data, size, i); @@ -2485,7 +2485,7 @@ XLocalCursor::XLocalCursor(CursorData* cursor_data) } } break; - case CURSOR_TYPE_COLOR4: + case SPICE_CURSOR_TYPE_COLOR4: for (i = 0; i < cur_size; i++) { pix_mask = get_pix_mask(data, size + (sizeof(uint32_t) << 4), i); int idx = (i & 1) ? (data[i >> 1] & 0x0f) : ((data[i >> 1] & 0xf0) >> 4); @@ -2497,8 +2497,8 @@ XLocalCursor::XLocalCursor(CursorData* cursor_data) } } break; - case CURSOR_TYPE_COLOR24: - case CURSOR_TYPE_COLOR8: + case SPICE_CURSOR_TYPE_COLOR24: + case SPICE_CURSOR_TYPE_COLOR8: default: LOG_WARN("unsupported cursor type %d", header.type); _handle = XCreateFontCursor(x_display, XC_arrow); @@ -2510,7 +2510,7 @@ XLocalCursor::XLocalCursor(CursorData* cursor_data) memset(&image, 0, sizeof(image)); image.width = header.width; image.height = header.height; - image.data = (header.type == CURSOR_TYPE_ALPHA ? (char*)data : (char*)cur_data); + image.data = (header.type == SPICE_CURSOR_TYPE_ALPHA ? (char*)data : (char*)cur_data); image.byte_order = LSBFirst; image.bitmap_unit = 32; image.bitmap_bit_order = LSBFirst; diff --git a/client/x11/red_drawable.cpp b/client/x11/red_drawable.cpp index 4436152b..7485c94d 100644 --- a/client/x11/red_drawable.cpp +++ b/client/x11/red_drawable.cpp @@ -28,8 +28,8 @@ #include <GL/glext.h> static inline void copy_to_gldrawable_from_gltexture(const RedDrawable_p* dest, - const Rect& area, - const Point& offset, + const SpiceRect& area, + const SpicePoint& offset, const PixelsSource_p* source, int src_x, int src_y) { @@ -90,8 +90,8 @@ static inline void copy_to_gldrawable_from_gltexture(const RedDrawable_p* dest, } static inline void copy_to_gldrawable_from_pixmap(const RedDrawable_p* dest, - const Rect& area, - const Point& offset, + const SpiceRect& area, + const SpicePoint& offset, const PixelsSource_p* source, int src_x, int src_y) { @@ -134,8 +134,8 @@ static inline void copy_to_gldrawable_from_pixmap(const RedDrawable_p* dest, } static inline void copy_to_drawable_from_drawable(const RedDrawable_p* dest, - const Rect& area, - const Point& offset, + const SpiceRect& area, + const SpicePoint& offset, const PixelsSource_p* source, int src_x, int src_y) { @@ -151,8 +151,8 @@ static inline void copy_to_drawable_from_drawable(const RedDrawable_p* dest, } static inline void copy_to_drawable_from_pixmap(const RedDrawable_p* dest, - const Rect& area, - const Point& offset, + const SpiceRect& area, + const SpicePoint& offset, const PixelsSource_p* source, int src_x, int src_y) { @@ -167,8 +167,8 @@ static inline void copy_to_drawable_from_pixmap(const RedDrawable_p* dest, } static inline void copy_to_drawable_from_shmdrawable(const RedDrawable_p* dest, - const Rect& area, - const Point& offset, + const SpiceRect& area, + const SpicePoint& offset, const PixelsSource_p* source, int src_x, int src_y) { @@ -184,8 +184,8 @@ static inline void copy_to_drawable_from_shmdrawable(const RedDrawable_p* dest, } static inline void copy_to_x_drawable(const RedDrawable_p* dest, - const Rect& area, - const Point& offset, + const SpiceRect& area, + const SpicePoint& offset, const PixelsSource_p* source, int src_x, int src_y) { @@ -205,8 +205,8 @@ static inline void copy_to_x_drawable(const RedDrawable_p* dest, } static inline void copy_to_gl_drawable(const RedDrawable_p* dest, - const Rect& area, - const Point& offset, + const SpiceRect& area, + const SpicePoint& offset, const PixelsSource_p* source, int src_x, int src_y) { @@ -223,8 +223,8 @@ static inline void copy_to_gl_drawable(const RedDrawable_p* dest, } static inline void copy_to_pixmap_from_drawable(const RedDrawable_p* dest, - const Rect& area, - const Point& offset, + const SpiceRect& area, + const SpicePoint& offset, const PixelsSource_p* source, int src_x, int src_y) { @@ -232,8 +232,8 @@ static inline void copy_to_pixmap_from_drawable(const RedDrawable_p* dest, } static inline void copy_to_pixmap_from_shmdrawable(const RedDrawable_p* dest, - const Rect& area, - const Point& offset, + const SpiceRect& area, + const SpicePoint& offset, const PixelsSource_p* source, int src_x, int src_y) { @@ -252,8 +252,8 @@ static inline void copy_to_pixmap_from_shmdrawable(const RedDrawable_p* dest, } static inline void copy_to_pixmap_from_pixmap(const RedDrawable_p* dest, - const Rect& area, - const Point& offset, + const SpiceRect& area, + const SpicePoint& offset, const PixelsSource_p* source, int src_x, int src_y) { @@ -272,8 +272,8 @@ static inline void copy_to_pixmap_from_pixmap(const RedDrawable_p* dest, } static inline void copy_to_pixmap_from_gltexture(const RedDrawable_p* dest, - const Rect& area, - const Point& offset, + const SpiceRect& area, + const SpicePoint& offset, const PixelsSource_p* source, int src_x, int src_y) { @@ -316,8 +316,8 @@ static inline void copy_to_pixmap_from_gltexture(const RedDrawable_p* dest, } static inline void copy_to_pixmap(const RedDrawable_p* dest, - const Rect& area, - const Point& offset, + const SpiceRect& area, + const SpicePoint& offset, const PixelsSource_p* source, int src_x, int src_y) { @@ -339,7 +339,7 @@ static inline void copy_to_pixmap(const RedDrawable_p* dest, } } -void RedDrawable::copy_pixels(const PixelsSource& src, int src_x, int src_y, const Rect& area) +void RedDrawable::copy_pixels(const PixelsSource& src, int src_x, int src_y, const SpiceRect& area) { PixelsSource_p* source = (PixelsSource_p*)src.get_opaque(); RedDrawable_p* dest = (RedDrawable_p*)get_opaque(); @@ -361,8 +361,8 @@ void RedDrawable::copy_pixels(const PixelsSource& src, int src_x, int src_y, con } static inline void blend_to_drawable(const RedDrawable_p* dest, - const Rect& area, - const Point& offset, + const SpiceRect& area, + const SpicePoint& offset, const PixelsSource_p* source, int src_x, int src_y) { @@ -370,8 +370,8 @@ static inline void blend_to_drawable(const RedDrawable_p* dest, } static inline void blend_to_pixmap_from_drawable(const RedDrawable_p* dest, - const Rect& area, - const Point& offset, + const SpiceRect& area, + const SpicePoint& offset, const PixelsSource_p* source, int src_x, int src_y) { @@ -379,8 +379,8 @@ static inline void blend_to_pixmap_from_drawable(const RedDrawable_p* dest, } static inline void blend_to_pixmap_from_pixmap(const RedDrawable_p* dest, - const Rect& area, - const Point& offset, + const SpiceRect& area, + const SpicePoint& offset, const PixelsSource_p* source, int src_x, int src_y) { @@ -399,8 +399,8 @@ static inline void blend_to_pixmap_from_pixmap(const RedDrawable_p* dest, } static inline void blend_to_pixmap(const RedDrawable_p* dest, - const Rect& area, - const Point& offset, + const SpiceRect& area, + const SpicePoint& offset, const PixelsSource_p* source, int src_x, int src_y) { @@ -416,7 +416,7 @@ static inline void blend_to_pixmap(const RedDrawable_p* dest, } } -void RedDrawable::blend_pixels(const PixelsSource& src, int src_x, int src_y, const Rect& area) +void RedDrawable::blend_pixels(const PixelsSource& src, int src_x, int src_y, const SpiceRect& area) { PixelsSource_p* source = (PixelsSource_p*)src.get_opaque(); RedDrawable_p* dest = (RedDrawable_p*)get_opaque(); @@ -434,8 +434,8 @@ void RedDrawable::blend_pixels(const PixelsSource& src, int src_x, int src_y, co } static inline void combine_to_drawable(const RedDrawable_p* dest, - const Rect& area, - const Point& offset, + const SpiceRect& area, + const SpicePoint& offset, const PixelsSource_p* source, int src_x, int src_y, RedDrawable::CombineOP op) @@ -444,8 +444,8 @@ static inline void combine_to_drawable(const RedDrawable_p* dest, } static inline void combine_to_pixmap_from_drawable(const RedDrawable_p* dest, - const Rect& area, - const Point& offset, + const SpiceRect& area, + const SpicePoint& offset, const PixelsSource_p* source, int src_x, int src_y, RedDrawable::CombineOP op) @@ -454,8 +454,8 @@ static inline void combine_to_pixmap_from_drawable(const RedDrawable_p* dest, } static inline void combine_to_pixmap_from_pixmap(const RedDrawable_p* dest, - const Rect& area, - const Point& offset, + const SpiceRect& area, + const SpicePoint& offset, const PixelsSource_p* source, int src_x, int src_y, RedDrawable::CombineOP op) @@ -499,8 +499,8 @@ static inline void combine_to_pixmap_from_pixmap(const RedDrawable_p* dest, } static inline void combine_to_pixmap(const RedDrawable_p* dest, - const Rect& area, - const Point& offset, + const SpiceRect& area, + const SpicePoint& offset, const PixelsSource_p* source, int src_x, int src_y, RedDrawable::CombineOP op) @@ -517,7 +517,7 @@ static inline void combine_to_pixmap(const RedDrawable_p* dest, } } -void RedDrawable::combine_pixels(const PixelsSource& src, int src_x, int src_y, const Rect& area, +void RedDrawable::combine_pixels(const PixelsSource& src, int src_x, int src_y, const SpiceRect& area, CombineOP op) { PixelsSource_p* source = (PixelsSource_p*)src.get_opaque(); @@ -536,13 +536,13 @@ void RedDrawable::combine_pixels(const PixelsSource& src, int src_x, int src_y, } } -void RedDrawable::erase_rect(const Rect& area, rgb32_t color) +void RedDrawable::erase_rect(const SpiceRect& area, rgb32_t color) { LOG_WARN("not implemented"); } -static inline void fill_drawable(RedDrawable_p* dest, const Rect& area, rgb32_t color, - const Point& offset) +static inline void fill_drawable(RedDrawable_p* dest, const SpiceRect& area, rgb32_t color, + const SpicePoint& offset) { Drawable drawable = dest->source.x_drawable.drawable; GC gc = dest->source.x_drawable.gc; @@ -569,8 +569,8 @@ static inline void fill_drawable(RedDrawable_p* dest, const Rect& area, rgb32_t area.right - area.left, area.bottom - area.top); } -static inline void fill_gl_drawable(RedDrawable_p* dest, const Rect& area, rgb32_t color, - const Point& offset) +static inline void fill_gl_drawable(RedDrawable_p* dest, const SpiceRect& area, rgb32_t color, + const SpicePoint& offset) { int vertex_x1, vertex_x2; int vertex_y1, vertex_y2; @@ -603,8 +603,8 @@ static inline void fill_gl_drawable(RedDrawable_p* dest, const Rect& area, rgb32 glColor3f(1, 1, 1); } -static inline void fill_pixmap(RedDrawable_p* dest, const Rect& area, rgb32_t color, - const Point& offset) +static inline void fill_pixmap(RedDrawable_p* dest, const SpiceRect& area, rgb32_t color, + const SpicePoint& offset) { cairo_t* cairo = dest->cairo; @@ -619,7 +619,7 @@ static inline void fill_pixmap(RedDrawable_p* dest, const Rect& area, rgb32_t co cairo_fill(cairo); } -void RedDrawable::fill_rect(const Rect& area, rgb32_t color) +void RedDrawable::fill_rect(const SpiceRect& area, rgb32_t color) { RedDrawable_p* dest = (RedDrawable_p*)get_opaque(); switch (dest->source.type) { @@ -637,8 +637,8 @@ void RedDrawable::fill_rect(const Rect& area, rgb32_t color) } } -static inline void frame_drawable(RedDrawable_p* dest, const Rect& area, rgb32_t color, - const Point& offset) +static inline void frame_drawable(RedDrawable_p* dest, const SpiceRect& area, rgb32_t color, + const SpicePoint& offset) { Drawable drawable = dest->source.x_drawable.drawable; GC gc = dest->source.x_drawable.gc; @@ -665,8 +665,8 @@ static inline void frame_drawable(RedDrawable_p* dest, const Rect& area, rgb32_t area.right - area.left, area.bottom - area.top); } -static inline void frame_pixmap(RedDrawable_p* dest, const Rect& area, rgb32_t color, - const Point& offset) +static inline void frame_pixmap(RedDrawable_p* dest, const SpiceRect& area, rgb32_t color, + const SpicePoint& offset) { cairo_t* cairo = dest->cairo; @@ -682,7 +682,7 @@ static inline void frame_pixmap(RedDrawable_p* dest, const Rect& area, rgb32_t c cairo_stroke(cairo); } -void RedDrawable::frame_rect(const Rect& area, rgb32_t color) +void RedDrawable::frame_rect(const SpiceRect& area, rgb32_t color) { RedDrawable_p* dest = (RedDrawable_p*)get_opaque(); switch (dest->source.type) { diff --git a/client/x11/red_pixmap_gl.cpp b/client/x11/red_pixmap_gl.cpp index 886bb0b3..3ed5f73c 100644 --- a/client/x11/red_pixmap_gl.cpp +++ b/client/x11/red_pixmap_gl.cpp @@ -173,7 +173,7 @@ void RedPixmapGL::touch_context() GLC_ERROR_TEST_FLUSH; } -void RedPixmapGL::update_texture(const Rect *bbox) +void RedPixmapGL::update_texture(const SpiceRect *bbox) { RenderType rendertype; GLuint tex; diff --git a/client/x11/red_window.cpp b/client/x11/red_window.cpp index 795a7bbd..14394982 100644 --- a/client/x11/red_window.cpp +++ b/client/x11/red_window.cpp @@ -672,37 +672,37 @@ static inline RedKey to_red_key_code(unsigned int keycode) static inline int to_red_buttons_state(unsigned int state) { - return ((state & Button1Mask) ? REDC_LBUTTON_MASK : 0) | - ((state & Button2Mask) ? REDC_MBUTTON_MASK : 0) | - ((state & Button3Mask) ? REDC_RBUTTON_MASK : 0); + return ((state & Button1Mask) ? SPICE_MOUSE_BUTTON_MASK_LEFT : 0) | + ((state & Button2Mask) ? SPICE_MOUSE_BUTTON_MASK_MIDDLE : 0) | + ((state & Button3Mask) ? SPICE_MOUSE_BUTTON_MASK_RIGHT : 0); } -static inline RedButton to_red_button(unsigned int botton, unsigned int& state, bool press) +static inline SpiceMouseButton to_red_button(unsigned int botton, unsigned int& state, bool press) { unsigned int mask = 0; - RedButton ret; + SpiceMouseButton ret; switch (botton) { case Button1: - mask = REDC_LBUTTON_MASK; - ret = REDC_MOUSE_LBUTTON; + mask = SPICE_MOUSE_BUTTON_MASK_LEFT; + ret = SPICE_MOUSE_BUTTON_LEFT; break; case Button2: - mask = REDC_MBUTTON_MASK; - ret = REDC_MOUSE_MBUTTON; + mask = SPICE_MOUSE_BUTTON_MASK_MIDDLE; + ret = SPICE_MOUSE_BUTTON_MIDDLE; break; case Button3: - mask = REDC_RBUTTON_MASK; - ret = REDC_MOUSE_RBUTTON; + mask = SPICE_MOUSE_BUTTON_MASK_RIGHT; + ret = SPICE_MOUSE_BUTTON_RIGHT; break; case Button4: - ret = REDC_MOUSE_UBUTTON; + ret = SPICE_MOUSE_BUTTON_UP; break; case Button5: - ret = REDC_MOUSE_DBUTTON; + ret = SPICE_MOUSE_BUTTON_DOWN; break; default: - ret = REDC_MOUSE_INVALID_BUTTON; + ret = SPICE_MOUSE_BUTTON_INVALID; } if (press) { state |= mask; @@ -766,10 +766,10 @@ void RedWindow_p::win_proc(XEvent& event) red_window = (RedWindow*)window_pointer; switch (event.type) { case MotionNotify: { - Point size = red_window->get_size(); + SpicePoint size = red_window->get_size(); if (event.xmotion.x >= 0 && event.xmotion.y >= 0 && event.xmotion.x < size.x && event.xmotion.y < size.y) { - Point origin = red_window->get_origin(); + SpicePoint origin = red_window->get_origin(); red_window->get_listener().on_pointer_motion(event.xmotion.x - origin.x, event.xmotion.y - origin.y, to_red_buttons_state(event.xmotion.state)); @@ -797,8 +797,8 @@ void RedWindow_p::win_proc(XEvent& event) } case ButtonPress: { unsigned int state = to_red_buttons_state(event.xbutton.state); - RedButton button = to_red_button(event.xbutton.button, state, true); - if (button == REDC_MOUSE_INVALID_BUTTON) { + SpiceMouseButton button = to_red_button(event.xbutton.button, state, true); + if (button == SPICE_MOUSE_BUTTON_INVALID) { DBG(0, "ButtonPress: invalid button %u", event.xbutton.button); break; } @@ -807,8 +807,8 @@ void RedWindow_p::win_proc(XEvent& event) } case ButtonRelease: { unsigned int state = to_red_buttons_state(event.xbutton.state); - RedButton button = to_red_button(event.xbutton.button, state, false); - if (button == REDC_MOUSE_INVALID_BUTTON) { + SpiceMouseButton button = to_red_button(event.xbutton.button, state, false); + if (button == SPICE_MOUSE_BUTTON_INVALID) { DBG(0, "ButtonRelease: invalid button %u", event.xbutton.button); break; } @@ -816,8 +816,8 @@ void RedWindow_p::win_proc(XEvent& event) break; } case Expose: { - Point origin; - Rect area; + SpicePoint origin; + SpiceRect area; origin = red_window->get_origin(); area.left = event.xexpose.x - origin.x; @@ -887,7 +887,7 @@ void RedWindow_p::win_proc(XEvent& event) break; case EnterNotify: if (!red_window->_ignore_pointer) { - Point origin = red_window->get_origin(); + SpicePoint origin = red_window->get_origin(); red_window->on_pointer_enter(event.xcrossing.x - origin.x, event.xcrossing.y - origin.y, to_red_buttons_state(event.xcrossing.state)); } else { @@ -1560,7 +1560,7 @@ void RedWindow::minimize() sync(); } -static bool __get_position(Window window, Point& pos) +static bool __get_position(Window window, SpicePoint& pos) { pos.x = pos.y = 0; for (;;) { @@ -1592,9 +1592,9 @@ static bool __get_position(Window window, Point& pos) return true; } -Point RedWindow::get_position() +SpicePoint RedWindow::get_position() { - Point pos; + SpicePoint pos; AutoXErrorHandler auto_error_handler; int get_position_retries = GET_POSITION_RETRIES; @@ -1719,17 +1719,17 @@ void RedWindow::set_mouse_position(int x, int y) XWarpPointer(x_display, None, _win, 0, 0, 0, 0, x + get_origin().x, y + get_origin().y); } -Point RedWindow::get_size() +SpicePoint RedWindow::get_size() { XWindowAttributes attrib; XGetWindowAttributes(x_display, _win, &attrib); - Point size; + SpicePoint size; size.x = attrib.width; size.y = attrib.height; return size; } -static void window_area_from_attributes(Rect& area, XWindowAttributes& attrib) +static void window_area_from_attributes(SpiceRect& area, XWindowAttributes& attrib) { area.left = attrib.x; area.right = area.left + attrib.width; @@ -1760,7 +1760,7 @@ static QRegion *get_visibale_region(Window window) return region; } - Rect window_area; + SpiceRect window_area; window_area_from_attributes(window_area, attrib); window_area.right -= window_area.left; window_area.bottom -= window_area.top; @@ -1830,7 +1830,7 @@ public: Region_p(QRegion* region) : _region (region) {} ~Region_p() { delete _region;} - void get_bbox(Rect& bbox) const + void get_bbox(SpiceRect& bbox) const { if (region_is_empty(_region)) { bbox.left = bbox.right = bbox.top = bbox.bottom = 0; @@ -1848,7 +1848,7 @@ private: QRegion* _region; }; -bool RedWindow::get_mouse_anchor_point(Point& pt) +bool RedWindow::get_mouse_anchor_point(SpicePoint& pt) { QRegion* vis_region; int vis_region_retries = GET_VIS_REGION_RETRIES; @@ -1869,7 +1869,7 @@ bool RedWindow::get_mouse_anchor_point(Point& pt) if (!find_anchor_point(region, pt)) { return false; } - Point position = get_position(); + SpicePoint position = get_position(); pt.x -= (position.x + get_origin().x); pt.y -= (position.y + get_origin().y); return true; diff --git a/client/x11/red_window_p.h b/client/x11/red_window_p.h index df306344..e630b618 100644 --- a/client/x11/red_window_p.h +++ b/client/x11/red_window_p.h @@ -58,7 +58,7 @@ protected: Cursor _invisible_cursor; bool _visibale; bool _expect_parent; - Point _show_pos; + SpicePoint _show_pos; GLXContext _glcont_copy; Icon* _icon; bool _focused; |