Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 855D5200C45 for ; Tue, 14 Mar 2017 06:12:34 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 83F75160B85; Tue, 14 Mar 2017 05:12:34 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CE03F160B5D for ; Tue, 14 Mar 2017 06:12:33 +0100 (CET) Received: (qmail 88671 invoked by uid 500); 14 Mar 2017 05:12:33 -0000 Mailing-List: contact commits-help@guacamole.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@guacamole.incubator.apache.org Delivered-To: mailing list commits@guacamole.incubator.apache.org Received: (qmail 88661 invoked by uid 99); 14 Mar 2017 05:12:33 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Mar 2017 05:12:33 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 61826C0DC6 for ; Tue, 14 Mar 2017 05:12:32 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -3.569 X-Spam-Level: X-Spam-Status: No, score=-3.569 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001, SPF_NEUTRAL=0.652] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 1f3OhyB4sySN for ; Tue, 14 Mar 2017 05:12:31 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 3DD475FBE6 for ; Tue, 14 Mar 2017 05:12:30 +0000 (UTC) Received: (qmail 88544 invoked by uid 99); 14 Mar 2017 05:12:29 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Mar 2017 05:12:29 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1CD92DFE20; Tue, 14 Mar 2017 05:12:29 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jmuehlner@apache.org To: commits@guacamole.incubator.apache.org Date: Tue, 14 Mar 2017 05:12:31 -0000 Message-Id: In-Reply-To: <04bbe8b4a44b48539fdc5b60e851c539@git.apache.org> References: <04bbe8b4a44b48539fdc5b60e851c539@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [3/5] incubator-guacamole-server git commit: GUACAMOLE-231: Add "mouse" instruction for server reporting of mouse position. archived-at: Tue, 14 Mar 2017 05:12:34 -0000 GUACAMOLE-231: Add "mouse" instruction for server reporting of mouse position. Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/commit/1a96c5b4 Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/tree/1a96c5b4 Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/diff/1a96c5b4 Branch: refs/heads/staging/0.9.12-incubating Commit: 1a96c5b41506b67aad556f885ad4a424812e2930 Parents: cf05eca Author: Michael Jumper Authored: Fri Mar 10 12:27:24 2017 -0800 Committer: Michael Jumper Committed: Sat Mar 11 14:57:09 2017 -0800 ---------------------------------------------------------------------- src/libguac/guacamole/protocol.h | 20 ++++++++++++++++++++ src/libguac/protocol.c | 17 +++++++++++++++++ 2 files changed, 37 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/1a96c5b4/src/libguac/guacamole/protocol.h ---------------------------------------------------------------------- diff --git a/src/libguac/guacamole/protocol.h b/src/libguac/guacamole/protocol.h index 638d7b2..88a0a18 100644 --- a/src/libguac/guacamole/protocol.h +++ b/src/libguac/guacamole/protocol.h @@ -145,6 +145,26 @@ int vguac_protocol_send_log(guac_socket* socket, const char* format, va_list args); /** + * Sends a mouse instruction over the given guac_socket connection. + * + * If an error occurs sending the instruction, a non-zero value is + * returned, and guac_error is set appropriately. + * + * @param socket + * The guac_socket connection to use. + * + * @param x + * The X coordinate of the current mouse position. + * + * @param y + * The Y coordinate of the current mouse position. + * + * @return + * Zero on success, non-zero on error. + */ +int guac_protocol_send_mouse(guac_socket* socket, int x, int y); + +/** * Sends a nest instruction over the given guac_socket connection. * * If an error occurs sending the instruction, a non-zero value is http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/1a96c5b4/src/libguac/protocol.c ---------------------------------------------------------------------- diff --git a/src/libguac/protocol.c b/src/libguac/protocol.c index 1040fb1..8da1824 100644 --- a/src/libguac/protocol.c +++ b/src/libguac/protocol.c @@ -684,6 +684,23 @@ int guac_protocol_send_lstroke(guac_socket* socket, } +int guac_protocol_send_mouse(guac_socket* socket, int x, int y) { + + int ret_val; + + guac_socket_instruction_begin(socket); + ret_val = + guac_socket_write_string(socket, "5.mouse,") + || __guac_socket_write_length_int(socket, x) + || guac_socket_write_string(socket, ",") + || __guac_socket_write_length_int(socket, y) + || guac_socket_write_string(socket, ";"); + + guac_socket_instruction_end(socket); + return ret_val; + +} + int guac_protocol_send_move(guac_socket* socket, const guac_layer* layer, const guac_layer* parent, int x, int y, int z) {