rename wlr_deco_part to roots_deco_part

master
Tony Crisci 7 years ago
parent 54776dd19c
commit e8c407d00e

@ -135,15 +135,15 @@ void view_teardown(struct roots_view *view);
void view_get_deco_box(const struct roots_view *view, struct wlr_box *box); void view_get_deco_box(const struct roots_view *view, struct wlr_box *box);
enum wlr_deco_part { enum roots_deco_part {
WLR_DECO_PART_NONE = 0, ROOTS_DECO_PART_NONE = 0,
WLR_DECO_PART_TOP_BORDER = (1 << 0), ROOTS_DECO_PART_TOP_BORDER = (1 << 0),
WLR_DECO_PART_BOTTOM_BORDER = (1 << 1), ROOTS_DECO_PART_BOTTOM_BORDER = (1 << 1),
WLR_DECO_PART_LEFT_BORDER = (1 << 2), ROOTS_DECO_PART_LEFT_BORDER = (1 << 2),
WLR_DECO_PART_RIGHT_BORDER = (1 << 3), ROOTS_DECO_PART_RIGHT_BORDER = (1 << 3),
WLR_DECO_PART_TITLEBAR = (1 << 4), ROOTS_DECO_PART_TITLEBAR = (1 << 4),
}; };
enum wlr_deco_part view_get_deco_part(struct roots_view *view, double sx, double sy); enum roots_deco_part view_get_deco_part(struct roots_view *view, double sx, double sy);
#endif #endif

@ -40,17 +40,17 @@ static void seat_view_deco_motion(struct roots_seat_view *view, double deco_sx,
sy = view->grab_sy; sy = view->grab_sy;
} }
enum wlr_deco_part parts = view_get_deco_part(view->view, sx, sy); enum roots_deco_part parts = view_get_deco_part(view->view, sx, sy);
bool is_titlebar = (parts & WLR_DECO_PART_TITLEBAR); bool is_titlebar = (parts & ROOTS_DECO_PART_TITLEBAR);
uint32_t edges = 0; uint32_t edges = 0;
if (parts & WLR_DECO_PART_LEFT_BORDER) { if (parts & ROOTS_DECO_PART_LEFT_BORDER) {
edges |= WLR_EDGE_LEFT; edges |= WLR_EDGE_LEFT;
} else if (parts & WLR_DECO_PART_RIGHT_BORDER) { } else if (parts & ROOTS_DECO_PART_RIGHT_BORDER) {
edges |= WLR_EDGE_RIGHT; edges |= WLR_EDGE_RIGHT;
} else if (parts & WLR_DECO_PART_BOTTOM_BORDER) { } else if (parts & ROOTS_DECO_PART_BOTTOM_BORDER) {
edges |= WLR_EDGE_BOTTOM; edges |= WLR_EDGE_BOTTOM;
} else if (parts & WLR_DECO_PART_TOP_BORDER) { } else if (parts & ROOTS_DECO_PART_TOP_BORDER) {
edges |= WLR_EDGE_TOP; edges |= WLR_EDGE_TOP;
} }
@ -90,8 +90,8 @@ static void seat_view_deco_button(struct roots_seat_view *view, double sx,
view->has_button_grab = false; view->has_button_grab = false;
} }
enum wlr_deco_part parts = view_get_deco_part(view->view, sx, sy); enum roots_deco_part parts = view_get_deco_part(view->view, sx, sy);
if (state == WLR_BUTTON_RELEASED && (parts & WLR_DECO_PART_TITLEBAR)) { if (state == WLR_BUTTON_RELEASED && (parts & ROOTS_DECO_PART_TITLEBAR)) {
struct roots_cursor *cursor = view->seat->cursor; struct roots_cursor *cursor = view->seat->cursor;
wlr_xcursor_manager_set_cursor_image(cursor->xcursor_manager, wlr_xcursor_manager_set_cursor_image(cursor->xcursor_manager,
cursor->default_xcursor, cursor->cursor); cursor->default_xcursor, cursor->cursor);

@ -44,9 +44,9 @@ void view_get_deco_box(const struct roots_view *view, struct wlr_box *box) {
box->height += (view->border_width * 2 + view->titlebar_height); box->height += (view->border_width * 2 + view->titlebar_height);
} }
enum wlr_deco_part view_get_deco_part(struct roots_view *view, double sx, double sy) { enum roots_deco_part view_get_deco_part(struct roots_view *view, double sx, double sy) {
if (!view->decorated) { if (!view->decorated) {
return WLR_DECO_PART_NONE; return ROOTS_DECO_PART_NONE;
} }
int sw = view->wlr_surface->current->width; int sw = view->wlr_surface->current->width;
@ -55,24 +55,24 @@ enum wlr_deco_part view_get_deco_part(struct roots_view *view, double sx, double
int titlebar_h = view->titlebar_height; int titlebar_h = view->titlebar_height;
if (sx > 0 && sx < sw && sy < 0 && sy > -view->titlebar_height) { if (sx > 0 && sx < sw && sy < 0 && sy > -view->titlebar_height) {
return WLR_DECO_PART_TITLEBAR; return ROOTS_DECO_PART_TITLEBAR;
} }
enum wlr_deco_part parts = 0; enum roots_deco_part parts = 0;
if (sy >= -(titlebar_h + bw) && if (sy >= -(titlebar_h + bw) &&
sy <= sh + bw) { sy <= sh + bw) {
if (sx < 0 && sx > -bw) { if (sx < 0 && sx > -bw) {
parts |= WLR_DECO_PART_LEFT_BORDER; parts |= ROOTS_DECO_PART_LEFT_BORDER;
} else if (sx > sw && sx < sw + bw) { } else if (sx > sw && sx < sw + bw) {
parts |= WLR_DECO_PART_RIGHT_BORDER; parts |= ROOTS_DECO_PART_RIGHT_BORDER;
} }
} }
if (sx >= -bw && sx <= sw + bw) { if (sx >= -bw && sx <= sw + bw) {
if (sy > sh && sy <= sh + bw) { if (sy > sh && sy <= sh + bw) {
parts |= WLR_DECO_PART_BOTTOM_BORDER; parts |= ROOTS_DECO_PART_BOTTOM_BORDER;
} else if (sy >= -(titlebar_h + bw) && sy < 0) { } else if (sy >= -(titlebar_h + bw) && sy < 0) {
parts |= WLR_DECO_PART_TOP_BORDER; parts |= ROOTS_DECO_PART_TOP_BORDER;
} }
} }

Loading…
Cancel
Save