From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web10.10059.1632806284294458145 for ; Mon, 27 Sep 2021 22:18:05 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=kFY8rM64; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: zhichao.gao@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10120"; a="224656128" X-IronPort-AV: E=Sophos;i="5.85,328,1624345200"; d="scan'208";a="224656128" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2021 22:17:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,328,1624345200"; d="scan'208";a="437953719" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by orsmga003.jf.intel.com with ESMTP; 27 Sep 2021 22:17:56 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 27 Sep 2021 22:17:56 -0700 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 27 Sep 2021 22:17:56 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Mon, 27 Sep 2021 22:17:56 -0700 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.42) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Mon, 27 Sep 2021 22:17:55 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nVlrkhEs6Do52ocTUdMh5U7wclAV/gAkH/Jdirn84kAlMby4WVPg3UI3o+FnTFRBx1UAM2kIqHtCniLNLvHRkoj/RY0ac7PEIVLRCpmHzBqQpPDhOVe/SCSiykIxBGLywOx8IzHW0oAneKfMyVcIMTDBgb5Frzfhz+zKU+qdxOw5Hhdu79EzZa+1Og050ASQ+aLt6+AKz5pnzWP5v4n+U4T4/wC1ESyjjlRLg6D111cxAVFF81uUGy2Odjfuv49SuzqluacWHXgG+1RAzbAbad1pBBjUtGm6i2w5bS+hGHbOT6mKnDSpinw1neVH4osq1IS49caXjie2ZUyeK+J82Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Kd14Z9s95ToVYeXfeuZQIoPYmXIyPI01ZL/J+kINiFo=; b=PFm7tMiVD3c0rMos+Uc0bdGSwc78Tg8D9YNWLw3LWzRq4QqVArV2wcg/T/dNViQPUgv3X/PAXBBXszh/dXUpibkexP4sIyWsFGm3DC8gDf8drSjAJan4FTT14zNfq9KwFf2uWWLMw7stf3GJx82nwU73BgXVJi48XyC2c/Vq971Yd4r41mzvFgFZzYTEaC/POvSDnz5LQHELtL8fVaRxRu8w+ArvWqxRFtlcSqdfdTDym2A5bQly78oyQU8mxvlL9e3hXDry7nY4NRMlWMCGgaSPRtutdIfTDv+qWpt+ufAB3StsMzsyrRnfzOjYDi9la1vqOrn46fbvlQd6rh+iCw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Kd14Z9s95ToVYeXfeuZQIoPYmXIyPI01ZL/J+kINiFo=; b=kFY8rM64NMHttH/MGtUMyjk+J2QlUh8cHUz3XCDNDyyBY8rkkNrpGTGi1Veno0f6gn8u6drSTk0rz9u4WbTSG0+y2PBrpfEzXYI8l+Ig9E1RRFCDVakrAh3gQWi/6BDUtgXujglOYGO62iCJ1TntzE6XZCvP3VuGKKprnUV1zRQ= Received: from DM4PR11MB5277.namprd11.prod.outlook.com (2603:10b6:5:388::23) by DM6PR11MB3993.namprd11.prod.outlook.com (2603:10b6:5:19c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15; Tue, 28 Sep 2021 05:17:54 +0000 Received: from DM4PR11MB5277.namprd11.prod.outlook.com ([fe80::fcab:50dd:7598:3b40]) by DM4PR11MB5277.namprd11.prod.outlook.com ([fe80::fcab:50dd:7598:3b40%4]) with mapi id 15.20.4544.022; Tue, 28 Sep 2021 05:17:54 +0000 From: "Gao, Zhichao" To: "devel@edk2.groups.io" , "Gao, Zhichao" CC: "Wang, Jian J" , Liming Gao , "Ni, Ray" Subject: Re: [edk2-devel] [PATCH V3] MdeModulePkg/BootManagerMenuApp: Limit string drawing within one line Thread-Topic: [edk2-devel] [PATCH V3] MdeModulePkg/BootManagerMenuApp: Limit string drawing within one line Thread-Index: AQHXs27BJjwYrtOnXEOmUFepIXsuNau44hQw Date: Tue, 28 Sep 2021 05:17:54 +0000 Message-ID: References: <16A89C34DEA6347B.26412@groups.io> In-Reply-To: <16A89C34DEA6347B.26412@groups.io> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 37105632-8fd7-4026-5461-08d9823f5387 x-ms-traffictypediagnostic: DM6PR11MB3993: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:115; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: JLgVdvEpg7OYbObnqDLEKA68SCgzqOtjhJigCKebdSRwxDt+/hmYycTdxELnUIW3XA/tkDua50GB5+qO1/ENLmANdO0aT37oKRL3s31mBoVCob33CEIBi/VrZGb5DbGxINRYXVvhzd7WjtZjgkQZX++GjORqrHLGSFiDGKoH3Gy2KPs0qrhVqfgGqj+g0LwqucRrsrTX+xVNOmlsbkaALkVO/dRce8YtBMposMAoTYG4C5E2RCdioLy53lZZqxTPhHVTNPp9OHnpkgBEDePyi3n7jTlcRO2v570R3luWNQAzxefIlmcrhzl8ECYpisDG+khWqy3petdudEU73dAvKGgsxvv6e+ryLvrk4DQm5o7P4v8oi03kst5q2kgzVFwKcKFU7UKUhPUoirArjtZShlO2V8GvlPUVVrfBGYMijbbi0G+clHFQOgbv9DG8EL02Pjg2486sYISwLpbqXIgRhv9o8j2cDwQYbf34CvdgPN27zavFFDFcuYjPJnLc5+G4maaBLoC6JF9rGVV7HvsF2bymY5/hy23m/67ltSmhkjbvtJmJNP54ZEO3qeUSltJi0aoTTeASiCtWd/FKOZmJY1aFSRl34SKFRJ8CkaCjMmtd7V52kgLP4q8KOuQY+gjQq6e/2qi5XbNtOXFFO83NEG64mwRQkljzamCykp0NIR74xjCE+XtgLxTDese++NPeatCms5dBkh4l6SsZKoc1lOvvTaWVBWBAwsQQdqCLvYmBzKwp9drkqJr21cbBCMQT8xLLJBjFp4JWHRUwbebSKeJWqc8RjFn2EQkJ/jCt5dXCx5cDqg4Qq6PLzAoxJZ2uHjK00EyXWbDYcPMgCohtCg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR11MB5277.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(86362001)(2906002)(4326008)(6506007)(52536014)(8936002)(33656002)(83380400001)(26005)(9686003)(7696005)(5660300002)(186003)(38070700005)(53546011)(55016002)(71200400001)(54906003)(122000001)(64756008)(66446008)(66556008)(8676002)(66946007)(76116006)(966005)(107886003)(316002)(38100700002)(508600001)(110136005)(66476007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?NE/TeZa6aes2vJ6g9nHY2t5XFmKFO/au8DwMjENDe8LAHGTzb0Ak10IiV4I7?= =?us-ascii?Q?AStdvQRDjezkqLsz1VJnry3ciBBrbCLrOd/ALtu6VLCnfResHEKtDAPGbsag?= =?us-ascii?Q?dZgqe85Bmdv0K80P9v45PAnp4yuaaSK5zPmVDLxpZuZD6gOwbU7liYGxdKVc?= =?us-ascii?Q?FHst3l0gHCfKMpirWWku7NgCnZgxj0Po+vn/r/hcVYlbEwAXs/no6zX05/I4?= =?us-ascii?Q?9hMtB9/fy3rlasPdyINfRwQm6n29GZjRALqg6DE/kEOGIq2wy6ZCPg5Blk74?= =?us-ascii?Q?ejVKsZSPYxqZyOybXRJn30aSfm6w6+oYj+Ts+tLjnmf+ohv5t+eyig4pyXqq?= =?us-ascii?Q?dflfjmAiXYToEFNg2rckw3bur5rNHzKRz7KIg9e3aYkao5roGbcX50RGXD9u?= =?us-ascii?Q?4PzXK9rx4uDC/z1OUoqXXiK4CoSTQaJdQTdAAysyokGze7G4j/f0adub7hDT?= =?us-ascii?Q?T14afZcoVw4/xRj6YPewW8v98vmgdPlvp1Bkn7MxhALj7Ww7LU3PYSm53fhu?= =?us-ascii?Q?DGi9opFEZcrW9mjEdKthgmMPFeHLZAhFJOIvoXBgnO7I2B0DyR3jIJUZVhpr?= =?us-ascii?Q?qtaJ0jWSms98r+REriqa999FgaypK7fyJnSjo7j93ZDnES6csEvqEsLPd+C+?= =?us-ascii?Q?B2qjrykmPQczpmkqpayUqsf/9oZqUogcgzP0wPIPnJFfLQPr5STgUrEE/7MJ?= =?us-ascii?Q?qNLOStd2dqxNaDfxlkg1qWKa6r2J5MuIwn5UJKOzFvfzSWu3X3Vih9LCI06P?= =?us-ascii?Q?bY6LGPYiGXBJdXOTX09Ppnnz2l+/vSeq5NEWEoOX+bjE2jsyA5qO3PukD2O1?= =?us-ascii?Q?NFSATLMDxE9cZ+0yHd4eExoKLFoiAdYzK/xpSkCZrktbGml4kY710OxjnguZ?= =?us-ascii?Q?P2cAjj4ZaFAW3NZzhXnuqMWVBseoz4ESwkf/Xjd3PV/pFSWnw2KVbSp+Uzyl?= =?us-ascii?Q?Qos9kvCWWZoCWlnninVmbmwj/eK80dUCyNC7LOP2GYHqyjVlYQAhz5O3dzom?= =?us-ascii?Q?oxyP04Q1fmcHHaKuh1oqYM3Q0gohqzhnVHDqrIenaSUJuffGB+BgJw5IrvTH?= =?us-ascii?Q?bhbfyiT51TpkYT4PSytYyol49rqPzYHd+oHCfPVwWEIsisGtTZfyuIArZgvr?= =?us-ascii?Q?8wk+CYRLglBGgk4XpPZuTtSRR0trDPa252+5fWn5dA6vwpuHsMV6pxZS17F4?= =?us-ascii?Q?xOvLaL159QLXFHjuKALqBUDY/CKg21+0qahyuWsEpYZ/KLgHjXCs+xpjD/hB?= =?us-ascii?Q?LaEFFF2p9SuVgYZXxnYb6XAYlWowJMwWb4AUNXd6wxHec0T/VrKfSCLKF0t8?= =?us-ascii?Q?EpTzmjFoQmMTAaabyviup/2v?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5277.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 37105632-8fd7-4026-5461-08d9823f5387 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Sep 2021 05:17:54.4727 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: isdGKqlQ/68kDO9PgR2STAdbUc326Uk78YSGjSL4pD7xKppq0cT8EYv+zhmJs1hocdDOKCePbqs4jf/ZlbcSFA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3993 Return-Path: zhichao.gao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Liming/Ray, I have updated the commit message and the BZ comments. Do you agree to merg= e the code? Thanks, Zhichao > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Gao, > Zhichao > Sent: Monday, September 27, 2021 3:10 PM > To: devel@edk2.groups.io > Cc: Wang, Jian J ; Liming Gao > ; Ni, Ray > Subject: [edk2-devel] [PATCH V3] MdeModulePkg/BootManagerMenuApp: > Limit string drawing within one line >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3590 >=20 > Limit the draw box always within the screen's column and row. > Limit the string drawing within one line.For the incompleted string the l= ast 3 > characters in one line wouldbe replaced with "...". >=20 > Cc: Jian J Wang > Cc: Liming Gao > Cc: Ray Ni > Signed-off-by: Zhichao Gao Reviewed-by: Ray Ni > ---V2:Drop the change in UefiBootManagerLib in V1.Add > the limitation in BootManagerMenuApp instead.V3:Update the commit > message only. > .../BootManagerMenuApp/BootManagerMenu.c | 72 > ++++++++++++++++++- > 1 file changed, 69 insertions(+), 3 deletions(-) >=20 > diff --git > a/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu. > c > b/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu. > c > index 9e729074ec..d4bdeba073 100644 > --- > a/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu. > c > +++ > b/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu. > c > @@ -1,7 +1,7 @@ > /** @file The application to show the Boot Manager Menu. -Copyright (c= ) > 2011 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 20= 11 - > 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier= : > BSD-2-Clause-Patent **/@@ -45,9 +45,56 @@ PrintStringAt ( > IN CHAR16 *String ) {+ UINTN ScreenWidth;+ UINTN > ScreenRows;+ CHAR16 *TurncateString;+ EFI_STATUS Status;+ UI= NTN > ShowingLength; gST->ConOut->SetCursorPosition (gST->ConOut, Column, > Row);- return Print (L"%s", String);++ gST->ConOut->QueryMode (+ > gST->ConOut,+ gST->ConOut->Mode->Mode,+ > &ScreenWidth,+ &ScreenRows+ );++ if (Col= umn > > (ScreenWidth - 1) || Row > (ScreenRows - 1)) {+ return 0;+ }++ if ((= StrLen > (String) + Column) > (ScreenWidth - 1)) {+ //+ // | - ScreenWi= dth - |+ > // ...Column.....................+ // TurncateString length should lea= ve one > character for draw box and+ // require one character for string end.+ = //+ > ShowingLength =3D ScreenWidth - Column - 1;+ TurncateString =3D Alloca= tePool > ((ShowingLength + 1) * sizeof (CHAR16));++ if (TurncateString =3D=3D N= ULL) {+ > return 0;+ }++ Status =3D StrnCpyS (TurncateString, ShowingLength += 1, > String, ShowingLength - 3);++ if (EFI_ERROR (Status)) {+ FreePool > (TurncateString);+ return 0;+ }++ *(TurncateString + ShowingLe= ngth - 3) > =3D L'.';+ *(TurncateString + ShowingLength - 2) =3D L'.';+ *(Turnc= ateString + > ShowingLength - 1) =3D L'.';+ *(TurncateString + ShowingLength) = =3D L'\0';+ > ShowingLength =3D Print (L"%s", TurncateString);+ FreePool > (TurncateString);+ return ShowingLength;+ } else {+ return Print (= L"%s", > String);+ } } /**@@ -68,7 +115,22 @@ PrintCharAt ( > CHAR16 Character ) {+ UINTN ScreenWidth;+ UINTN > ScreenRows;+ gST->ConOut->SetCursorPosition (gST->ConOut, Column, > Row);++ gST->ConOut->QueryMode (+ gST->ConOut,+ = gST- > >ConOut->Mode->Mode,+ &ScreenWidth,+ > &ScreenRows+ );++ if (Column > (ScreenWidth - 1) || Row = > > (ScreenRows - 1)) {+ return 0;+ }+ return Print (L"%c", Character);= } @@ - > 193,7 +255,11 @@ InitializeBootMenuScreen ( > MaxPrintRows =3D Row - 6; UnSelectableItmes =3D TITLE_TOKEN_COUNT += 2 + > HELP_TOKEN_COUNT + 2;- BootMenuData->MenuScreen.Width =3D > MaxStrWidth + 8;+ if (MaxStrWidth + 8 > Column) {+ BootMenuData- > >MenuScreen.Width =3D Column;+ } else {+ BootMenuData- > >MenuScreen.Width =3D MaxStrWidth + 8;+ } if (BootMenuData->ItemCount > + UnSelectableItmes > MaxPrintRows) { BootMenuData- > >MenuScreen.Height =3D MaxPrintRows; BootMenuData- > >ScrollBarControl.HasScrollBar =3D TRUE;-- > 2.31.1.windows.1 >=20 >=20 >=20 > -=3D-=3D-=3D-=3D-=3D-=3D > Groups.io Links: You receive all messages sent to this group. > View/Reply Online (#81153): https://edk2.groups.io/g/devel/message/81153 > Mute This Topic: https://groups.io/mt/85895022/1768756 > Group Owner: devel+owner@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub [zhichao.gao@intel.com] > -=3D-=3D-=3D-=3D-=3D-=3D >=20