Re: [PATCH 2/3] server: add calls to get/set menu info
On 6/19/06, Robert Shearman [EMAIL PROTECTED] wrote: This needs to be cleaned up a lot more before it will be accepted. For a start, the members of this structure need to be cleaned up. Some of the members of the POPUPMENU structure are for keeping track of the menu while it's in use (bTimeToHide, bScrolling, nScrollPos, FocusedItem), so these could be kept on the client side. Also, everything needs to be converted to wineserver types. It should become clear what needs to change as menu item handling is moved into the server, so I would urge you to work on that and then rework these patches. Hi Rob, Thanks for your input. I've reworked the first set of patches with your suggestions and moved menu item data into the server. The patch series (11 of them) are at http://silenceisdefeat.org/~tkho/seas/wine/patches/menu-0627-8/. I tried to make as little changes as possible, and most of the code is still client-side. Apps seem just as responsive, and all conformance tests still pass. Should I try to integrate more functionality into the server, or get these 11 patches committed? Tommy
Re: [PATCH 2/3] server: add calls to get/set menu info
[EMAIL PROTECTED] wrote: +typedef struct { +/* --- MENUITEMINFO Stuff --- */ +UINT fType;/* Item type. */ +UINT fState; /* Item state. */ +UINT_PTR wID; /* Item id. */ +HMENU hSubMenu;/* Pop-up menu. */ +HBITMAP hCheckBit; /* Bitmap when checked. */ +HBITMAP hUnCheckBit; /* Bitmap when unchecked. */ +LPWSTR text; /* Item text. */ +ULONG_PTR dwItemData; /* Application defined. */ +LPWSTR dwTypeData; /* depends on fMask */ +HBITMAP hbmpItem; /* bitmap */ +/* --- Wine stuff --- */ +RECT rect;/* Item area (relative to menu window) */ +UINT xTab;/* X position of text after Tab */ +SIZE bmpsize; /* size needed for the HBMMENU_CALLBACK + * bitmap */ +} MENUITEM; + +/* Popup menu structure */ +typedef struct { +WORDwFlags; /* Menu flags (MF_POPUP, MF_SYSMENU) */ +WORDwMagic; /* Magic number */ +WORD Width;/* Width of the whole menu */ +WORD Height; /* Height of the whole menu */ +UINTnItems; /* Number of items in the menu */ +HWNDhWnd; /* Window containing the menu */ +MENUITEM*items; /* Array of menu items */ +UINTFocusedItem; /* Currently focused item */ +HWND hwndOwner;/* window receiving the messages for ownerdraw */ +BOOLbTimeToHide; /* Request hiding when receiving a second click in the top-level menu item */ +BOOLbScrolling; /* Scroll arrows are active */ +UINTnScrollPos; /* Current scroll position */ +UINTnTotalHeight; /* Total height of menu items inside menu */ +/* MENUINFO members -- */ +DWORD dwStyle;/* Extended menu style */ +UINT cyMax; /* max height of the whole menu, 0 is screen height */ +HBRUSH hbrBack;/* brush for menu background */ +DWORD dwContextHelpID; +DWORD dwMenuData; /* application defined value */ +HMENU hSysMenuOwner; /* Handle to the dummy sys menu holder */ +SIZEmaxBmpSize; /* Maximum size of the bitmap items */ +} POPUPMENU, *LPPOPUPMENU; Hi Thomas, This needs to be cleaned up a lot more before it will be accepted. For a start, the members of this structure need to be cleaned up. Some of the members of the POPUPMENU structure are for keeping track of the menu while it's in use (bTimeToHide, bScrolling, nScrollPos, FocusedItem), so these could be kept on the client side. Also, everything needs to be converted to wineserver types. It should become clear what needs to change as menu item handling is moved into the server, so I would urge you to work on that and then rework these patches. Thanks, -- Rob Shearman