{ "id": "153448", "key": "TIMOB-20064", "fields": { "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "17707", "name": "Release 5.3.0", "archived": false, "released": true, "releaseDate": "2016-06-04" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2015-12-22T17:38:02.000+0000", "created": "2015-11-25T18:56:53.000+0000", "epic": { "id": 152412, "key": "TIMOB-19816", "name": "Windows: Support Windows 10 Mobile", "summary": " Windows: Support Windows 10 Mobile", "color": { "key": "color_3" }, "done": false }, "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [], "issuelinks": [ { "id": "50170", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "153980", "key": "TIMOB-20163", "fields": { "summary": "Windows: Add Contact group functionality for Windows 10", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } }, { "id": "50173", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "153981", "key": "TIMOB-20164", "fields": { "summary": "Windows: Investigate UI for Tab/Group in Windows 10", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } } ], "assignee": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-05-12T17:12:55.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "12642", "name": "Windows", "description": "Windows authoring support" } ], "description": "We currently use macros that will effectively compile one block or another depending on whether the code works/is available on phone or desktop.\r\ni.e.\r\n{code:cpp}\r\n#if WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP\r\n{code}\r\n\r\nThis is the right approach for Windows 8, but in Windows 10 a universal app is generated and the check must be done at runtime. We need to convert these checks into a macro and have the macro defined to do different things for 8.1 versus 10.\r\n\r\nSee https://msdn.microsoft.com/en-us/library/windows/apps/mt188202.aspx and https://msdn.microsoft.com/en-us/library/windows/apps/mt188203.aspx#reviewing_conditional_compilation\r\n\r\nI think we can extract a simple macro like:\r\n{code:cpp}\r\n// Only on Win 8.1\r\n#define PHONE_ONLY_START \\\r\n#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP\r\n\r\n#define PHONE_ONLY_END \\\r\n#endif\r\n\r\n// Only on Win 10\r\n#define PHONE_ONLY_START \\\r\nif (Windows::System::Profile::AnalyticsInfo::VersionInfo::DeviceFamily == \"Windows.Mobile\") {\r\n\r\n#define PHONE_ONLY_END \\\r\n}\r\n{code}\r\n\r\nWe may of course need more variants for things where the API is now available in Win10, but was only available for phone or store on 8.1, etc. (i.e. Clipboard was only for store.desktop in 8.1, but is universal in 10)", "attachment": [], "flagged": false, "summary": "Windows: Convert platform-specific (store or phone only) code to using macros to guard", "creator": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "environment": null, "closedSprints": [ { "id": 543, "state": "closed", "name": "2015 Sprint 26 SDK", "startDate": "2015-12-19T01:30:23.690Z", "endDate": "2016-01-02T01:30:00.000Z", "completeDate": "2016-01-04T02:30:59.966Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "372992", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Turns out {{#define xxx #if (xxx)}} is not valid as well as {{#define xxx #endif}}.\r\nI would simply do\r\n\r\n{code}\r\n#if (WINVER >= 0x0A00)\r\n#define IS_WINDOWS_10\r\n#define WINDOWS_PHONE_START if (Windows::System::Profile::AnalyticsInfo::VersionInfo->DeviceFamily == \"Windows.Mobile\") {\r\n#define WINDOWS_PHONE_ELSE } else {\r\n#define WINDOWS_PHONE_END }\r\n#elif (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)\r\n#define IS_WINDOWS_PHONE\r\n#endif\r\n{code}\r\n\r\nand\r\n\r\n{code}\r\n#ifdef IS_WINDOWS_10\r\n WINDOWS_PHONE_START\r\n // Windows 10 Mobile specific code\r\n WINDOWS_PHONE_ELSE\r\n // Windows 10 specific code\r\n WINDOWS_PHONE_END\r\n#else\r\n#ifdef IS_WINDOWS_PHONE\r\n // Windows Phone 8.1 specific code\r\n#else\r\n // Windows 8.1 specific code\r\n#endif\r\n#endif\r\n{code}", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-12-15T10:08:49.000+0000", "updated": "2015-12-15T13:19:17.000+0000" }, { "id": "373333", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "https://github.com/appcelerator/titanium_mobile_windows/pull/512", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-12-21T14:08:45.000+0000", "updated": "2015-12-21T14:08:45.000+0000" }, { "id": "385549", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing as implemented.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-05-12T17:12:49.000+0000", "updated": "2016-05-12T17:12:49.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }