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 770FC200CA5 for ; Sat, 27 May 2017 03:11:55 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7590A160B9C; Sat, 27 May 2017 01:11:55 +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 9465F160BD6 for ; Sat, 27 May 2017 03:11:54 +0200 (CEST) Received: (qmail 6395 invoked by uid 500); 27 May 2017 01:11:53 -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 6386 invoked by uid 99); 27 May 2017 01:11:53 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 27 May 2017 01:11:53 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 5B2A9180311 for ; Sat, 27 May 2017 01:11:53 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.222 X-Spam-Level: X-Spam-Status: No, score=-4.222 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_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id mIsOn-fEyG5H for ; Sat, 27 May 2017 01:11:51 +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 E5D975F2FD for ; Sat, 27 May 2017 01:11:50 +0000 (UTC) Received: (qmail 6314 invoked by uid 99); 27 May 2017 01:11:50 -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; Sat, 27 May 2017 01:11:50 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0BE8DDFC2E; Sat, 27 May 2017 01:11:50 +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: Sat, 27 May 2017 01:11:50 -0000 Message-Id: <40b8e596343c4bfaa120119c97534048@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/3] incubator-guacamole-server git commit: GUACAMOLE-280: Add support for faint (low) intensity SGR. archived-at: Sat, 27 May 2017 01:11:55 -0000 Repository: incubator-guacamole-server Updated Branches: refs/heads/master 6d2cfdabf -> 9ee224f2c GUACAMOLE-280: Add support for faint (low) intensity SGR. 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/2146200d Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/tree/2146200d Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/diff/2146200d Branch: refs/heads/master Commit: 2146200dfde612029303787d40d1f53581d77a37 Parents: 6d2cfda Author: Michael Jumper Authored: Sun May 21 13:34:30 2017 -0700 Committer: Michael Jumper Committed: Sun May 21 13:46:21 2017 -0700 ---------------------------------------------------------------------- src/terminal/display.c | 7 +++++++ src/terminal/terminal.c | 11 ++++++----- src/terminal/terminal/types.h | 6 ++++++ src/terminal/terminal_handlers.c | 8 +++++++- 4 files changed, 26 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/2146200d/src/terminal/display.c ---------------------------------------------------------------------- diff --git a/src/terminal/display.c b/src/terminal/display.c index cd9f6a6..a1f37b3 100644 --- a/src/terminal/display.c +++ b/src/terminal/display.c @@ -128,6 +128,13 @@ int __guac_terminal_set_colors(guac_terminal_display* display, display->glyph_foreground = *foreground; display->glyph_background = *background; + /* Modify color if half-bright (low intensity) */ + if (attributes->half_bright) { + display->glyph_foreground.red /= 2; + display->glyph_foreground.green /= 2; + display->glyph_foreground.blue /= 2; + } + return 0; } http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/2146200d/src/terminal/terminal.c ---------------------------------------------------------------------- diff --git a/src/terminal/terminal.c b/src/terminal/terminal.c index 711a0fa..bba95f0 100644 --- a/src/terminal/terminal.c +++ b/src/terminal/terminal.c @@ -296,11 +296,12 @@ guac_terminal* guac_terminal_create(guac_client* client, guac_terminal_char default_char = { .value = 0, .attributes = { - .foreground = guac_terminal_palette[default_foreground], - .background = guac_terminal_palette[default_background], - .bold = false, - .reverse = false, - .underscore = false + .foreground = guac_terminal_palette[default_foreground], + .background = guac_terminal_palette[default_background], + .bold = false, + .half_bright = false, + .reverse = false, + .underscore = false }, .width = 1 }; http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/2146200d/src/terminal/terminal/types.h ---------------------------------------------------------------------- diff --git a/src/terminal/terminal/types.h b/src/terminal/terminal/types.h index 7d3cd53..0d054f8 100644 --- a/src/terminal/terminal/types.h +++ b/src/terminal/terminal/types.h @@ -47,6 +47,12 @@ typedef struct guac_terminal_attributes { bool bold; /** + * Whether the character should be rendered with half brightness (faint + * or low intensity). + */ + bool half_bright; + + /** * Whether the character should be rendered with reversed colors * (background becomes foreground and vice-versa). */ http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/2146200d/src/terminal/terminal_handlers.c ---------------------------------------------------------------------- diff --git a/src/terminal/terminal_handlers.c b/src/terminal/terminal_handlers.c index 55fd682..e0be18f 100644 --- a/src/terminal/terminal_handlers.c +++ b/src/terminal/terminal_handlers.c @@ -897,6 +897,10 @@ int guac_terminal_csi(guac_terminal* term, unsigned char c) { else if (value == 1) term->current_attributes.bold = true; + /* Faint (low intensity) */ + else if (value == 2) + term->current_attributes.half_bright = true; + /* Underscore on */ else if (value == 4) term->current_attributes.underscore = true; @@ -906,8 +910,10 @@ int guac_terminal_csi(guac_terminal* term, unsigned char c) { term->current_attributes.reverse = true; /* Normal intensity (not bold) */ - else if (value == 21 || value == 22) + else if (value == 21 || value == 22) { term->current_attributes.bold = false; + term->current_attributes.half_bright = false; + } /* Reset underscore */ else if (value == 24)