Cleanup: use const arguments for GHOST/Wayland
This commit is contained in:
@@ -626,12 +626,12 @@ static const std::vector<std::string> mime_send = {
|
||||
static void relative_pointer_handle_relative_motion(
|
||||
void *data,
|
||||
struct zwp_relative_pointer_v1 * /*zwp_relative_pointer_v1*/,
|
||||
uint32_t /*utime_hi*/,
|
||||
uint32_t /*utime_lo*/,
|
||||
wl_fixed_t dx,
|
||||
wl_fixed_t dy,
|
||||
wl_fixed_t /*dx_unaccel*/,
|
||||
wl_fixed_t /*dy_unaccel*/)
|
||||
const uint32_t /*utime_hi*/,
|
||||
const uint32_t /*utime_lo*/,
|
||||
const wl_fixed_t dx,
|
||||
const wl_fixed_t dy,
|
||||
const wl_fixed_t /*dx_unaccel*/,
|
||||
const wl_fixed_t /*dy_unaccel*/)
|
||||
{
|
||||
input_t *input = static_cast<input_t *>(data);
|
||||
GHOST_WindowWayland *win = window_from_surface(input->focus_pointer);
|
||||
@@ -741,7 +741,7 @@ static void data_source_handle_target(void * /*data*/,
|
||||
static void data_source_handle_send(void *data,
|
||||
struct wl_data_source * /*wl_data_source*/,
|
||||
const char * /*mime_type*/,
|
||||
int32_t fd)
|
||||
const int32_t fd)
|
||||
{
|
||||
input_t *input = static_cast<input_t *>(data);
|
||||
std::lock_guard lock{input->data_source_mutex};
|
||||
@@ -793,7 +793,7 @@ static void data_source_handle_dnd_finished(void * /*data*/,
|
||||
*/
|
||||
static void data_source_handle_action(void * /*data*/,
|
||||
struct wl_data_source * /*wl_data_source*/,
|
||||
uint32_t /*dnd_action*/)
|
||||
const uint32_t /*dnd_action*/)
|
||||
{
|
||||
/* pass */
|
||||
}
|
||||
@@ -822,14 +822,14 @@ static void data_offer_handle_offer(void *data,
|
||||
|
||||
static void data_offer_handle_source_actions(void *data,
|
||||
struct wl_data_offer * /*wl_data_offer*/,
|
||||
uint32_t source_actions)
|
||||
const uint32_t source_actions)
|
||||
{
|
||||
static_cast<data_offer_t *>(data)->source_actions = source_actions;
|
||||
}
|
||||
|
||||
static void data_offer_handle_action(void *data,
|
||||
struct wl_data_offer * /*wl_data_offer*/,
|
||||
uint32_t dnd_action)
|
||||
const uint32_t dnd_action)
|
||||
{
|
||||
static_cast<data_offer_t *>(data)->dnd_action = dnd_action;
|
||||
}
|
||||
@@ -857,10 +857,10 @@ static void data_device_handle_data_offer(void * /*data*/,
|
||||
|
||||
static void data_device_handle_enter(void *data,
|
||||
struct wl_data_device * /*wl_data_device*/,
|
||||
uint32_t serial,
|
||||
const uint32_t serial,
|
||||
struct wl_surface *surface,
|
||||
wl_fixed_t x,
|
||||
wl_fixed_t y,
|
||||
const wl_fixed_t x,
|
||||
const wl_fixed_t y,
|
||||
struct wl_data_offer *id)
|
||||
{
|
||||
input_t *input = static_cast<input_t *>(data);
|
||||
@@ -903,9 +903,9 @@ static void data_device_handle_leave(void *data, struct wl_data_device * /*wl_da
|
||||
|
||||
static void data_device_handle_motion(void *data,
|
||||
struct wl_data_device * /*wl_data_device*/,
|
||||
uint32_t /*time*/,
|
||||
wl_fixed_t x,
|
||||
wl_fixed_t y)
|
||||
const uint32_t /*time*/,
|
||||
const wl_fixed_t x,
|
||||
const wl_fixed_t y)
|
||||
{
|
||||
input_t *input = static_cast<input_t *>(data);
|
||||
std::lock_guard lock{input->data_offer_dnd_mutex};
|
||||
@@ -1157,10 +1157,10 @@ struct wl_surface_listener cursor_surface_listener = {
|
||||
|
||||
static void pointer_handle_enter(void *data,
|
||||
struct wl_pointer * /*wl_pointer*/,
|
||||
uint32_t serial,
|
||||
const uint32_t serial,
|
||||
struct wl_surface *surface,
|
||||
wl_fixed_t surface_x,
|
||||
wl_fixed_t surface_y)
|
||||
const wl_fixed_t surface_x,
|
||||
const wl_fixed_t surface_y)
|
||||
{
|
||||
GHOST_WindowWayland *win = window_from_surface(surface);
|
||||
if (!win) {
|
||||
@@ -1189,7 +1189,7 @@ static void pointer_handle_enter(void *data,
|
||||
|
||||
static void pointer_handle_leave(void *data,
|
||||
struct wl_pointer * /*wl_pointer*/,
|
||||
uint32_t /*serial*/,
|
||||
const uint32_t /*serial*/,
|
||||
struct wl_surface *surface)
|
||||
{
|
||||
/* First clear the `focus_pointer`, since the window won't exist when closing the window. */
|
||||
@@ -1204,9 +1204,9 @@ static void pointer_handle_leave(void *data,
|
||||
|
||||
static void pointer_handle_motion(void *data,
|
||||
struct wl_pointer * /*wl_pointer*/,
|
||||
uint32_t /*time*/,
|
||||
wl_fixed_t surface_x,
|
||||
wl_fixed_t surface_y)
|
||||
const uint32_t /*time*/,
|
||||
const wl_fixed_t surface_x,
|
||||
const wl_fixed_t surface_y)
|
||||
{
|
||||
input_t *input = static_cast<input_t *>(data);
|
||||
GHOST_WindowWayland *win = window_from_surface(input->focus_pointer);
|
||||
@@ -1228,10 +1228,10 @@ static void pointer_handle_motion(void *data,
|
||||
|
||||
static void pointer_handle_button(void *data,
|
||||
struct wl_pointer * /*wl_pointer*/,
|
||||
uint32_t serial,
|
||||
uint32_t /*time*/,
|
||||
uint32_t button,
|
||||
uint32_t state)
|
||||
const uint32_t serial,
|
||||
const uint32_t /*time*/,
|
||||
const uint32_t button,
|
||||
const uint32_t state)
|
||||
{
|
||||
input_t *input = static_cast<input_t *>(data);
|
||||
GHOST_IWindow *win = window_from_surface(input->focus_pointer);
|
||||
@@ -1282,9 +1282,9 @@ static void pointer_handle_button(void *data,
|
||||
|
||||
static void pointer_handle_axis(void *data,
|
||||
struct wl_pointer * /*wl_pointer*/,
|
||||
uint32_t /*time*/,
|
||||
uint32_t axis,
|
||||
wl_fixed_t value)
|
||||
const uint32_t /*time*/,
|
||||
const uint32_t axis,
|
||||
const wl_fixed_t value)
|
||||
{
|
||||
input_t *input = static_cast<input_t *>(data);
|
||||
GHOST_IWindow *win = window_from_surface(input->focus_pointer);
|
||||
@@ -1316,7 +1316,7 @@ static const struct wl_pointer_listener pointer_listener = {
|
||||
|
||||
static void tablet_tool_handle_type(void *data,
|
||||
struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
||||
uint32_t tool_type)
|
||||
const uint32_t tool_type)
|
||||
{
|
||||
tablet_tool_input_t *tool_input = static_cast<tablet_tool_input_t *>(data);
|
||||
|
||||
@@ -1325,22 +1325,22 @@ static void tablet_tool_handle_type(void *data,
|
||||
|
||||
static void tablet_tool_handle_hardware_serial(void * /*data*/,
|
||||
struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
||||
uint32_t /*hardware_serial_hi*/,
|
||||
uint32_t /*hardware_serial_lo*/)
|
||||
const uint32_t /*hardware_serial_hi*/,
|
||||
const uint32_t /*hardware_serial_lo*/)
|
||||
{
|
||||
}
|
||||
|
||||
static void tablet_tool_handle_hardware_id_wacom(
|
||||
void * /*data*/,
|
||||
struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
||||
uint32_t /*hardware_id_hi*/,
|
||||
uint32_t /*hardware_id_lo*/)
|
||||
const uint32_t /*hardware_id_hi*/,
|
||||
const uint32_t /*hardware_id_lo*/)
|
||||
{
|
||||
}
|
||||
|
||||
static void tablet_tool_handle_capability(void * /*data*/,
|
||||
struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
||||
uint32_t /*capability*/)
|
||||
const uint32_t /*capability*/)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1362,7 +1362,7 @@ static void tablet_tool_handle_removed(void *data, struct zwp_tablet_tool_v2 *zw
|
||||
}
|
||||
static void tablet_tool_handle_proximity_in(void *data,
|
||||
struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
||||
uint32_t serial,
|
||||
const uint32_t serial,
|
||||
struct zwp_tablet_v2 * /*tablet*/,
|
||||
struct wl_surface *surface)
|
||||
{
|
||||
@@ -1407,7 +1407,7 @@ static void tablet_tool_handle_proximity_out(void *data,
|
||||
|
||||
static void tablet_tool_handle_down(void *data,
|
||||
struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
||||
uint32_t serial)
|
||||
const uint32_t serial)
|
||||
{
|
||||
tablet_tool_input_t *tool_input = static_cast<tablet_tool_input_t *>(data);
|
||||
input_t *input = tool_input->input;
|
||||
@@ -1442,8 +1442,8 @@ static void tablet_tool_handle_up(void *data, struct zwp_tablet_tool_v2 * /*zwp_
|
||||
|
||||
static void tablet_tool_handle_motion(void *data,
|
||||
struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
||||
wl_fixed_t x,
|
||||
wl_fixed_t y)
|
||||
const wl_fixed_t x,
|
||||
const wl_fixed_t y)
|
||||
{
|
||||
tablet_tool_input_t *tool_input = static_cast<tablet_tool_input_t *>(data);
|
||||
input_t *input = tool_input->input;
|
||||
@@ -1456,7 +1456,7 @@ static void tablet_tool_handle_motion(void *data,
|
||||
|
||||
static void tablet_tool_handle_pressure(void *data,
|
||||
struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
||||
uint32_t pressure)
|
||||
const uint32_t pressure)
|
||||
{
|
||||
tablet_tool_input_t *tool_input = static_cast<tablet_tool_input_t *>(data);
|
||||
input_t *input = tool_input->input;
|
||||
@@ -1470,13 +1470,13 @@ static void tablet_tool_handle_pressure(void *data,
|
||||
}
|
||||
static void tablet_tool_handle_distance(void * /*data*/,
|
||||
struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
||||
uint32_t /*distance*/)
|
||||
const uint32_t /*distance*/)
|
||||
{
|
||||
}
|
||||
static void tablet_tool_handle_tilt(void *data,
|
||||
struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
||||
wl_fixed_t tilt_x,
|
||||
wl_fixed_t tilt_y)
|
||||
const wl_fixed_t tilt_x,
|
||||
const wl_fixed_t tilt_y)
|
||||
{
|
||||
tablet_tool_input_t *tool_input = static_cast<tablet_tool_input_t *>(data);
|
||||
input_t *input = tool_input->input;
|
||||
@@ -1495,21 +1495,21 @@ static void tablet_tool_handle_tilt(void *data,
|
||||
|
||||
static void tablet_tool_handle_rotation(void * /*data*/,
|
||||
struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
||||
wl_fixed_t /*degrees*/)
|
||||
const wl_fixed_t /*degrees*/)
|
||||
{
|
||||
/* Pass. */
|
||||
}
|
||||
|
||||
static void tablet_tool_handle_slider(void * /*data*/,
|
||||
struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
||||
int32_t /*position*/)
|
||||
const int32_t /*position*/)
|
||||
{
|
||||
/* Pass. */
|
||||
}
|
||||
static void tablet_tool_handle_wheel(void *data,
|
||||
struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
||||
wl_fixed_t /*degrees*/,
|
||||
int32_t clicks)
|
||||
const wl_fixed_t /*degrees*/,
|
||||
const int32_t clicks)
|
||||
{
|
||||
if (clicks == 0) {
|
||||
return;
|
||||
@@ -1526,9 +1526,9 @@ static void tablet_tool_handle_wheel(void *data,
|
||||
}
|
||||
static void tablet_tool_handle_button(void *data,
|
||||
struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
||||
uint32_t serial,
|
||||
uint32_t button,
|
||||
uint32_t state)
|
||||
const uint32_t serial,
|
||||
const uint32_t button,
|
||||
const uint32_t state)
|
||||
{
|
||||
tablet_tool_input_t *tool_input = static_cast<tablet_tool_input_t *>(data);
|
||||
input_t *input = tool_input->input;
|
||||
@@ -1567,7 +1567,7 @@ static void tablet_tool_handle_button(void *data,
|
||||
}
|
||||
static void tablet_tool_handle_frame(void *data,
|
||||
struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
||||
uint32_t /*time*/)
|
||||
const uint32_t /*time*/)
|
||||
{
|
||||
tablet_tool_input_t *tool_input = static_cast<tablet_tool_input_t *>(data);
|
||||
input_t *input = tool_input->input;
|
||||
@@ -1656,8 +1656,11 @@ const struct zwp_tablet_seat_v2_listener tablet_seat_listener = {
|
||||
/** \name Listener (Keyboard), #wl_keyboard_listener
|
||||
* \{ */
|
||||
|
||||
static void keyboard_handle_keymap(
|
||||
void *data, struct wl_keyboard * /*wl_keyboard*/, uint32_t format, int32_t fd, uint32_t size)
|
||||
static void keyboard_handle_keymap(void *data,
|
||||
struct wl_keyboard * /*wl_keyboard*/,
|
||||
const uint32_t format,
|
||||
const int32_t fd,
|
||||
const uint32_t size)
|
||||
{
|
||||
input_t *input = static_cast<input_t *>(data);
|
||||
|
||||
@@ -1699,7 +1702,7 @@ static void keyboard_handle_keymap(
|
||||
*/
|
||||
static void keyboard_handle_enter(void *data,
|
||||
struct wl_keyboard * /*wl_keyboard*/,
|
||||
uint32_t /*serial*/,
|
||||
const uint32_t /*serial*/,
|
||||
struct wl_surface *surface,
|
||||
struct wl_array * /*keys*/)
|
||||
{
|
||||
@@ -1715,7 +1718,7 @@ static void keyboard_handle_enter(void *data,
|
||||
*/
|
||||
static void keyboard_handle_leave(void *data,
|
||||
struct wl_keyboard * /*wl_keyboard*/,
|
||||
uint32_t /*serial*/,
|
||||
const uint32_t /*serial*/,
|
||||
struct wl_surface * /*surface*/)
|
||||
{
|
||||
input_t *input = static_cast<input_t *>(data);
|
||||
@@ -1732,7 +1735,7 @@ static void keyboard_handle_leave(void *data,
|
||||
* Needed because #GHOST_TKey uses these values as key-codes.
|
||||
*/
|
||||
static xkb_keysym_t xkb_state_key_get_one_sym_without_modifiers(struct xkb_state *xkb_state,
|
||||
xkb_keycode_t key)
|
||||
const xkb_keycode_t key)
|
||||
{
|
||||
/* Use an empty keyboard state to access key symbol without modifiers. */
|
||||
xkb_state_get_keymap(xkb_state);
|
||||
@@ -1781,10 +1784,10 @@ static void keyboard_handle_key_repeat_reset(input_t *input, const bool use_dela
|
||||
|
||||
static void keyboard_handle_key(void *data,
|
||||
struct wl_keyboard * /*wl_keyboard*/,
|
||||
uint32_t serial,
|
||||
uint32_t /*time*/,
|
||||
uint32_t key,
|
||||
uint32_t state)
|
||||
const uint32_t serial,
|
||||
const uint32_t /*time*/,
|
||||
const uint32_t key,
|
||||
const uint32_t state)
|
||||
{
|
||||
input_t *input = static_cast<input_t *>(data);
|
||||
const xkb_keycode_t key_code = key + 8;
|
||||
@@ -1911,11 +1914,11 @@ static void keyboard_handle_key(void *data,
|
||||
|
||||
static void keyboard_handle_modifiers(void *data,
|
||||
struct wl_keyboard * /*wl_keyboard*/,
|
||||
uint32_t /*serial*/,
|
||||
uint32_t mods_depressed,
|
||||
uint32_t mods_latched,
|
||||
uint32_t mods_locked,
|
||||
uint32_t group)
|
||||
const uint32_t /*serial*/,
|
||||
const uint32_t mods_depressed,
|
||||
const uint32_t mods_latched,
|
||||
const uint32_t mods_locked,
|
||||
const uint32_t group)
|
||||
{
|
||||
input_t *input = static_cast<input_t *>(data);
|
||||
xkb_state_update_mask(input->xkb_state, mods_depressed, mods_latched, mods_locked, 0, 0, group);
|
||||
@@ -1929,8 +1932,8 @@ static void keyboard_handle_modifiers(void *data,
|
||||
|
||||
static void keyboard_repeat_handle_info(void *data,
|
||||
struct wl_keyboard * /*wl_keyboard*/,
|
||||
int32_t rate,
|
||||
int32_t delay)
|
||||
const int32_t rate,
|
||||
const int32_t delay)
|
||||
{
|
||||
input_t *input = static_cast<input_t *>(data);
|
||||
|
||||
@@ -1958,7 +1961,9 @@ static const struct wl_keyboard_listener keyboard_listener = {
|
||||
/** \name Listener (Seat), #wl_seat_listener
|
||||
* \{ */
|
||||
|
||||
static void seat_handle_capabilities(void *data, struct wl_seat *wl_seat, uint32_t capabilities)
|
||||
static void seat_handle_capabilities(void *data,
|
||||
struct wl_seat *wl_seat,
|
||||
const uint32_t capabilities)
|
||||
{
|
||||
input_t *input = static_cast<input_t *>(data);
|
||||
input->wl_pointer = nullptr;
|
||||
@@ -2002,8 +2007,8 @@ static const struct wl_seat_listener seat_listener = {
|
||||
|
||||
static void xdg_output_handle_logical_position(void *data,
|
||||
struct zxdg_output_v1 * /*xdg_output*/,
|
||||
int32_t x,
|
||||
int32_t y)
|
||||
const int32_t x,
|
||||
const int32_t y)
|
||||
{
|
||||
output_t *output = static_cast<output_t *>(data);
|
||||
output->position_logical[0] = x;
|
||||
@@ -2013,8 +2018,8 @@ static void xdg_output_handle_logical_position(void *data,
|
||||
|
||||
static void xdg_output_handle_logical_size(void *data,
|
||||
struct zxdg_output_v1 * /*xdg_output*/,
|
||||
int32_t width,
|
||||
int32_t height)
|
||||
const int32_t width,
|
||||
const int32_t height)
|
||||
{
|
||||
output_t *output = static_cast<output_t *>(data);
|
||||
|
||||
@@ -2080,14 +2085,14 @@ static const struct zxdg_output_v1_listener xdg_output_listener = {
|
||||
|
||||
static void output_handle_geometry(void *data,
|
||||
struct wl_output * /*wl_output*/,
|
||||
int32_t /*x*/,
|
||||
int32_t /*y*/,
|
||||
int32_t physical_width,
|
||||
int32_t physical_height,
|
||||
int32_t /*subpixel*/,
|
||||
const int32_t /*x*/,
|
||||
const int32_t /*y*/,
|
||||
const int32_t physical_width,
|
||||
const int32_t physical_height,
|
||||
const int32_t /*subpixel*/,
|
||||
const char *make,
|
||||
const char *model,
|
||||
int32_t transform)
|
||||
const int32_t transform)
|
||||
{
|
||||
output_t *output = static_cast<output_t *>(data);
|
||||
output->transform = transform;
|
||||
@@ -2099,10 +2104,10 @@ static void output_handle_geometry(void *data,
|
||||
|
||||
static void output_handle_mode(void *data,
|
||||
struct wl_output * /*wl_output*/,
|
||||
uint32_t flags,
|
||||
int32_t width,
|
||||
int32_t height,
|
||||
int32_t /*refresh*/)
|
||||
const uint32_t flags,
|
||||
const int32_t width,
|
||||
const int32_t height,
|
||||
const int32_t /*refresh*/)
|
||||
{
|
||||
output_t *output = static_cast<output_t *>(data);
|
||||
|
||||
@@ -2154,7 +2159,7 @@ static void output_handle_done(void *data, struct wl_output * /*wl_output*/)
|
||||
}
|
||||
}
|
||||
|
||||
static void output_handle_scale(void *data, struct wl_output * /*wl_output*/, int32_t factor)
|
||||
static void output_handle_scale(void *data, struct wl_output * /*wl_output*/, const int32_t factor)
|
||||
{
|
||||
static_cast<output_t *>(data)->scale = factor;
|
||||
}
|
||||
@@ -2172,7 +2177,9 @@ static const struct wl_output_listener output_listener = {
|
||||
/** \name Listener (XDG WM Base), #xdg_wm_base_listener
|
||||
* \{ */
|
||||
|
||||
static void shell_handle_ping(void * /*data*/, struct xdg_wm_base *xdg_wm_base, uint32_t serial)
|
||||
static void shell_handle_ping(void * /*data*/,
|
||||
struct xdg_wm_base *xdg_wm_base,
|
||||
const uint32_t serial)
|
||||
{
|
||||
xdg_wm_base_pong(xdg_wm_base, serial);
|
||||
}
|
||||
@@ -2189,9 +2196,9 @@ static const struct xdg_wm_base_listener shell_listener = {
|
||||
|
||||
static void global_handle_add(void *data,
|
||||
struct wl_registry *wl_registry,
|
||||
uint32_t name,
|
||||
const uint32_t name,
|
||||
const char *interface,
|
||||
uint32_t /*version*/)
|
||||
const uint32_t /*version*/)
|
||||
{
|
||||
struct display_t *display = static_cast<struct display_t *>(data);
|
||||
if (!strcmp(interface, wl_compositor_interface.name)) {
|
||||
@@ -2272,7 +2279,7 @@ static void global_handle_add(void *data,
|
||||
*/
|
||||
static void global_handle_remove(void * /*data*/,
|
||||
struct wl_registry * /*wl_registry*/,
|
||||
uint32_t /*name*/)
|
||||
const uint32_t /*name*/)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -2475,7 +2482,7 @@ GHOST_TSuccess GHOST_SystemWayland::getCursorPosition(int32_t &x, int32_t &y) co
|
||||
return GHOST_kSuccess;
|
||||
}
|
||||
|
||||
GHOST_TSuccess GHOST_SystemWayland::setCursorPosition(int32_t /*x*/, int32_t /*y*/)
|
||||
GHOST_TSuccess GHOST_SystemWayland::setCursorPosition(const int32_t /*x*/, const int32_t /*y*/)
|
||||
{
|
||||
return GHOST_kFailure;
|
||||
}
|
||||
@@ -2568,13 +2575,13 @@ GHOST_TSuccess GHOST_SystemWayland::disposeContext(GHOST_IContext *context)
|
||||
}
|
||||
|
||||
GHOST_IWindow *GHOST_SystemWayland::createWindow(const char *title,
|
||||
int32_t left,
|
||||
int32_t top,
|
||||
uint32_t width,
|
||||
uint32_t height,
|
||||
GHOST_TWindowState state,
|
||||
GHOST_TDrawingContextType type,
|
||||
GHOST_GLSettings glSettings,
|
||||
const int32_t left,
|
||||
const int32_t top,
|
||||
const uint32_t width,
|
||||
const uint32_t height,
|
||||
const GHOST_TWindowState state,
|
||||
const GHOST_TDrawingContextType type,
|
||||
const GHOST_GLSettings glSettings,
|
||||
const bool exclusive,
|
||||
const bool is_dialog,
|
||||
const GHOST_IWindow *parentWindow)
|
||||
@@ -2796,7 +2803,7 @@ static bool cursor_is_software(const GHOST_TGrabCursorMode mode, const bool use_
|
||||
return false;
|
||||
}
|
||||
|
||||
GHOST_TSuccess GHOST_SystemWayland::setCursorShape(GHOST_TStandardCursor shape)
|
||||
GHOST_TSuccess GHOST_SystemWayland::setCursorShape(const GHOST_TStandardCursor shape)
|
||||
{
|
||||
if (d->inputs.empty()) {
|
||||
return GHOST_kFailure;
|
||||
@@ -2838,7 +2845,7 @@ GHOST_TSuccess GHOST_SystemWayland::setCursorShape(GHOST_TStandardCursor shape)
|
||||
return GHOST_kSuccess;
|
||||
}
|
||||
|
||||
GHOST_TSuccess GHOST_SystemWayland::hasCursorShape(GHOST_TStandardCursor cursorShape)
|
||||
GHOST_TSuccess GHOST_SystemWayland::hasCursorShape(const GHOST_TStandardCursor cursorShape)
|
||||
{
|
||||
auto cursor_find = cursors.find(cursorShape);
|
||||
if (cursor_find == cursors.end()) {
|
||||
@@ -2853,11 +2860,11 @@ GHOST_TSuccess GHOST_SystemWayland::hasCursorShape(GHOST_TStandardCursor cursorS
|
||||
|
||||
GHOST_TSuccess GHOST_SystemWayland::setCustomCursorShape(uint8_t *bitmap,
|
||||
uint8_t *mask,
|
||||
int sizex,
|
||||
int sizey,
|
||||
int hotX,
|
||||
int hotY,
|
||||
bool /*canInvertColor*/)
|
||||
const int sizex,
|
||||
const int sizey,
|
||||
const int hotX,
|
||||
const int hotY,
|
||||
const bool /*canInvertColor*/)
|
||||
{
|
||||
if (d->inputs.empty()) {
|
||||
return GHOST_kFailure;
|
||||
@@ -2981,7 +2988,7 @@ GHOST_TSuccess GHOST_SystemWayland::getCursorBitmap(GHOST_CursorBitmapRef *bitma
|
||||
return GHOST_kSuccess;
|
||||
}
|
||||
|
||||
GHOST_TSuccess GHOST_SystemWayland::setCursorVisibility(bool visible)
|
||||
GHOST_TSuccess GHOST_SystemWayland::setCursorVisibility(const bool visible)
|
||||
{
|
||||
if (d->inputs.empty()) {
|
||||
return GHOST_kFailure;
|
||||
|
||||
@@ -120,8 +120,11 @@ static int outputs_max_scale_or_default(const std::vector<output_t *> &outputs,
|
||||
/** \name Listener (XDG Top Level), #xdg_toplevel_listener
|
||||
* \{ */
|
||||
|
||||
static void xdg_toplevel_handle_configure(
|
||||
void *data, xdg_toplevel * /*xdg_toplevel*/, int32_t width, int32_t height, wl_array *states)
|
||||
static void xdg_toplevel_handle_configure(void *data,
|
||||
xdg_toplevel * /*xdg_toplevel*/,
|
||||
const int32_t width,
|
||||
const int32_t height,
|
||||
wl_array *states)
|
||||
{
|
||||
window_t *win = static_cast<window_t *>(data);
|
||||
win->size_pending[0] = win->scale * width;
|
||||
@@ -172,7 +175,7 @@ static const xdg_toplevel_listener toplevel_listener = {
|
||||
static void xdg_toplevel_decoration_handle_configure(
|
||||
void *data,
|
||||
struct zxdg_toplevel_decoration_v1 * /*zxdg_toplevel_decoration_v1*/,
|
||||
uint32_t mode)
|
||||
const uint32_t mode)
|
||||
{
|
||||
static_cast<window_t *>(data)->decoration_mode = zxdg_toplevel_decoration_v1_mode(mode);
|
||||
}
|
||||
@@ -187,7 +190,9 @@ static const zxdg_toplevel_decoration_v1_listener toplevel_decoration_v1_listene
|
||||
/** \name Listener (XDG Surface Handle Configure), #xdg_surface_listener
|
||||
* \{ */
|
||||
|
||||
static void xdg_surface_handle_configure(void *data, xdg_surface *xdg_surface, uint32_t serial)
|
||||
static void xdg_surface_handle_configure(void *data,
|
||||
xdg_surface *xdg_surface,
|
||||
const uint32_t serial)
|
||||
{
|
||||
window_t *win = static_cast<window_t *>(data);
|
||||
|
||||
@@ -274,13 +279,13 @@ GHOST_TSuccess GHOST_WindowWayland::hasCursorShape(GHOST_TStandardCursor cursorS
|
||||
|
||||
GHOST_WindowWayland::GHOST_WindowWayland(GHOST_SystemWayland *system,
|
||||
const char *title,
|
||||
int32_t /*left*/,
|
||||
int32_t /*top*/,
|
||||
uint32_t width,
|
||||
uint32_t height,
|
||||
GHOST_TWindowState state,
|
||||
const int32_t /*left*/,
|
||||
const int32_t /*top*/,
|
||||
const uint32_t width,
|
||||
const uint32_t height,
|
||||
const GHOST_TWindowState state,
|
||||
const GHOST_IWindow *parentWindow,
|
||||
GHOST_TDrawingContextType type,
|
||||
const GHOST_TDrawingContextType type,
|
||||
const bool is_dialog,
|
||||
const bool stereoVisual,
|
||||
const bool exclusive)
|
||||
@@ -530,17 +535,17 @@ void GHOST_WindowWayland::getClientBounds(GHOST_Rect &bounds) const
|
||||
bounds.set(0, 0, w->size[0], w->size[1]);
|
||||
}
|
||||
|
||||
GHOST_TSuccess GHOST_WindowWayland::setClientWidth(uint32_t width)
|
||||
GHOST_TSuccess GHOST_WindowWayland::setClientWidth(const uint32_t width)
|
||||
{
|
||||
return setClientSize(width, uint32_t(w->size[1]));
|
||||
}
|
||||
|
||||
GHOST_TSuccess GHOST_WindowWayland::setClientHeight(uint32_t height)
|
||||
GHOST_TSuccess GHOST_WindowWayland::setClientHeight(const uint32_t height)
|
||||
{
|
||||
return setClientSize(uint32_t(w->size[0]), height);
|
||||
}
|
||||
|
||||
GHOST_TSuccess GHOST_WindowWayland::setClientSize(uint32_t width, uint32_t height)
|
||||
GHOST_TSuccess GHOST_WindowWayland::setClientSize(const uint32_t width, const uint32_t height)
|
||||
{
|
||||
wl_egl_window_resize(w->egl_window, int(width), int(height), 0, 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user