uint8_t LSVaction (uint8_t source) { if (source==CONSOLE) { toConsole("LSV:%s",BOM_VERSION); return COMMAND_OK; } else { toDevice("NAK:"); return COMMAND_IGNORED; } }
uint8_t NAKaction (uint8_t source) { if (source==CONSOLE) { toConsole("NAK:"); return COMMAND_OK; } else { toDevice("NAK:"); return COMMAND_OK; } }
uint8_t LFRaction (uint8_t source) { if (source==CONSOLE) { free(bigbuff); toConsole("LFR:"); return COMMAND_OK; } else { toDevice("NAK:"); return COMMAND_IGNORED; } }
uint8_t LAMaction (uint8_t source) { if (source==CONSOLE) { bigbuff=malloc(256); toConsole("LAM:"); return COMMAND_OK; } else { toDevice("NAK:"); return COMMAND_IGNORED; } }
uint8_t NOPaction(uint8_t source) { if (source==CONSOLE) { debug("Forwarding (%c%c%c)!", consoleComm.line[0], consoleComm.line[1], consoleComm.line[2]); toDevice((char *)consoleComm.line); return COMMAND_FORWARDED; } else if (source == DEVICE) { toConsole((char *)deviceComm.line); } return COMMAND_IGNORED; }
uint8_t NOPaction(uint8_t source) { if (source==CONSOLE) { toConsole("DBG: Forwarding (%c%c%c)!", consoleComm.line[0], consoleComm.line[1], consoleComm.line[2]); toConsole(actionBuffer); toDevice((char *)consoleComm.line); return COMMAND_FORWARDED; } else { return COMMAND_IGNORED; } }
/** * Converts a Weston compositor x,y coordinate into a global screen coordinate. * When Weston is using the x11 backend, the x,y coordinate is mapped to the X * display output (needed to correctly map a uinput pointer to weston). **/ static void toScreen(int32_t *x, int32_t *y) { struct weston_output *output(Globals::output()); toDevice(x, y); std::string make(output->make); if (make == "xwayland" or make == "weston-X11") { #if defined(HAVE_X11_SUPPORT) struct x11_compositor *x11_compositor = (struct x11_compositor*)Globals::compositor(); struct x11_output *x11_output = (struct x11_output*) output; xcb_get_geometry_reply_t *geom = xcb_get_geometry_reply( x11_compositor->conn, xcb_get_geometry( x11_compositor->conn, x11_output->window ), NULL ); xcb_translate_coordinates_reply_t *trans = xcb_translate_coordinates_reply( x11_compositor->conn, xcb_translate_coordinates( x11_compositor->conn, x11_output->window, geom->root, -(geom->border_width), -(geom->border_width) ), NULL ); *x += (int16_t)trans->dst_x; *y += (int16_t)trans->dst_y; delete trans; delete geom; #else exit(EXIT_FAILURE); #endif } }