{"action":"created","issue":{"url":"https://api.github.com/repos/fontforge/fontforge/issues/2734","repository_url":"https://api.github.com/repos/fontforge/fontforge","labels_url":"https://api.github.com/repos/fontforge/fontforge/issues/2734/labels{/name}","comments_url":"https://api.github.com/repos/fontforge/fontforge/issues/2734/comments","events_url":"https://api.github.com/repos/fontforge/fontforge/issues/2734/events","html_url":"https://github.com/fontforge/fontforge/issues/2734","id":162277071,"number":2734,"title":"Menu unification and rally to push mainline.","user":{"login":"monkeyiq","id":387108,"avatar_url":"https://avatars.githubusercontent.com/u/387108?v=3","gravatar_id":"","url":"https://api.github.com/users/monkeyiq","html_url":"https://github.com/monkeyiq","followers_url":"https://api.github.com/users/monkeyiq/followers","following_url":"https://api.github.com/users/monkeyiq/following{/other_user}","gists_url":"https://api.github.com/users/monkeyiq/gists{/gist_id}","starred_url":"https://api.github.com/users/monkeyiq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monkeyiq/subscriptions","organizations_url":"https://api.github.com/users/monkeyiq/orgs","repos_url":"https://api.github.com/users/monkeyiq/repos","events_url":"https://api.github.com/users/monkeyiq/events{/privacy}","received_events_url":"https://api.github.com/users/monkeyiq/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/fontforge/fontforge/labels/UI","name":"UI","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-06-25T11:31:28Z","updated_at":"2016-07-01T04:36:52Z","closed_at":null,"body":"This is to track an update to https://github.com/fontforge/fontforge/issues/2257 for a menu unification for the charview, fontview, and metricsview. \r\n\r\nInterested parties are invited to explore the code in my public branch at https://github.com/monkeyiq/fontforge-fork/tree/2016menus\r\n\r\nFrom a developer perspective this code introduces the new sharedmenu.c which contains the unification of the menu code from all three files: charview.c, fontview.c and metricsview.c. There is a crude type system and a new vtable (contained in sharedmenu_funcs) to allow each type of window to service the menu calls as is best done by the window. Some calls, such as almost all of the entries in the \"File\" menu can be serviced by a single code path. That code gets around being called with a 'gw' containing the userdata pointer for different window types by using the new type system and calls from classtypeui.h such as tryObtainGDataFontView(). This call will convert a CharView* to a FontView* by returning the delegated fv pointer contained in the charview. The calling code doesn't need to care, it just gets a correct fontview pointer from all three window types and can operate from there. All cv, mv, and fv can be converted to a fontview because all either are a fontview or contain a pointer to one.\r\n\r\nWindow types that allow zero, one, or more characters to be selected can implement the getActiveSplineChar() virtual function to tell the caller if 1+ chars are selected. This way, menu code and other interested callers can check/find the active character without needing to care what window or class type they are dealing with.\r\n\r\nThe type system, object coercion, and virtual table functions setup the code base to allow single functions to be applied to multiple window types. At the moment, there are some menuitems in some windows which are disabled. Some of these do not really have to be disabled, the code behind that menu item could possibly be updated to work across more window types than it was originally created for. For example, something that used to only be offered on the charview window might be enabled in the menu for the fontview window. Selecting that item in the fontview window would simply apply the same function that the charview menu item does, but for all chars that are selected in the fontview window that the menu item was selected from. This case is exactly what the new visitor mechanism visitAllCharViews() in fontview.c has been created to assist with. Guidance is requested as to which menu items should be enabled in which window for what menu items first. Some things are likely to be more urgent than others.\r\n\r\nI have gone through the menus on the three window types checking for crashes but might have missed some, especially when the menu item is contingent on previous setup. I have also tried to unify the code that disables the menu items depending on if they should be made available in that window (ie, the code supports their use and they made sense).\r\n\r\n### TODO\r\n- [ ] maybe enable some more menuitems which are currently disabled.\r\n- [ ] update code for some menu items which no longer work for some window+menu combinations\r\n- [ ] Update the hotkeys to work with the new menu layout\r\n- [ ] context menus\r\n- [ ] I notice the right click context menu in charview window doesn't show point types properly for spiro mode.\r\n"},"comment":{"url":"https://api.github.com/repos/fontforge/fontforge/issues/comments/229852090","html_url":"https://github.com/fontforge/fontforge/issues/2734#issuecomment-229852090","issue_url":"https://api.github.com/repos/fontforge/fontforge/issues/2734","id":229852090,"user":{"login":"davelab6","id":261579,"avatar_url":"https://avatars.githubusercontent.com/u/261579?v=3","gravatar_id":"","url":"https://api.github.com/users/davelab6","html_url":"https://github.com/davelab6","followers_url":"https://api.github.com/users/davelab6/followers","following_url":"https://api.github.com/users/davelab6/following{/other_user}","gists_url":"https://api.github.com/users/davelab6/gists{/gist_id}","starred_url":"https://api.github.com/users/davelab6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davelab6/subscriptions","organizations_url":"https://api.github.com/users/davelab6/orgs","repos_url":"https://api.github.com/users/davelab6/repos","events_url":"https://api.github.com/users/davelab6/events{/privacy}","received_events_url":"https://api.github.com/users/davelab6/received_events","type":"User","site_admin":false},"created_at":"2016-07-01T04:36:52Z","updated_at":"2016-07-01T04:36:52Z","body":"@pathumego when you have some spare time, I hope you can test Ben's branch for crashes as he mentions. Please post here if you need help getting his branch to run :) "}}
{"actor":{"display_login":"davelab6"}}