From b94d53ea57a6c89a3e76d3f7f9bc1a5d202d82c9 Mon Sep 17 00:00:00 2001 From: Jan Zerebecki Date: Fri, 1 May 2009 18:02:42 +0200 Subject: [PATCH] push 46756c23c8ad9edb429a5c7b07633fa443e7b3ef --- dlls/comctl32/listview.c | 3 +- dlls/comdlg32/filedlg.c | 161 ++++++++++++++++++++++- dlls/comdlg32/filedlgbrowser.h | 3 + dlls/msi/msi.c | 150 +++++++++++++++++----- dlls/msi/msi.spec | 4 +- dlls/msi/tests/package.c | 33 +++++ dlls/user32/tests/edit.c | 45 ++++++- dlls/wined3d/baseshader.c | 239 +++++++++++++++++------------------ dlls/wined3d/wined3d_private.h | 212 +++++++++++++++++++++++++++++-- dlls/wined3d/wined3d_private_types.h | 228 --------------------------------- dlls/winex11.drv/clipboard.c | 53 +++++++- include/msi.h | 4 + tools/wine.desktop | 2 +- tools/wine.inf.in | 10 ++ tools/winemaker | 28 +++- tools/winemaker.man.in | 9 +- 16 files changed, 771 insertions(+), 413 deletions(-) delete mode 100644 dlls/wined3d/wined3d_private_types.h diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 169c242f41e..967b8671a19 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -142,7 +142,6 @@ * -- ListView_GetHoverTime, ListView_SetHoverTime * -- ListView_GetISearchString * -- ListView_GetNumberOfWorkAreas - * -- ListView_GetOrigin * -- ListView_GetUnicodeFormat, ListView_SetUnicodeFormat * -- ListView_GetWorkAreas, ListView_SetWorkAreas * @@ -7856,7 +7855,7 @@ static BOOL LISTVIEW_SetTextColor (LISTVIEW_INFO *infoPtr, COLORREF clrText) /*** * DESCRIPTION: - * Determines which listview item is located at the specified position. + * Sets new ToolTip window to ListView control. * * PARAMETER(S): * [I] infoPtr : valid pointer to the listview structure diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c index 8c8e230ea68..b4239425a76 100644 --- a/dlls/comdlg32/filedlg.c +++ b/dlls/comdlg32/filedlg.c @@ -37,7 +37,6 @@ * FIXME: add to recent docs * * FIXME: flags not implemented: OFN_DONTADDTORECENT, - * OFN_ENABLESIZING, * OFN_NODEREFERENCELINKS, OFN_NOREADONLYRETURN, * OFN_NOTESTFILECREATE, OFN_USEMONIKERS * @@ -82,7 +81,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(commdlg); #define UNIMPLEMENTED_FLAGS \ -(OFN_DONTADDTORECENT | OFN_ENABLESIZING |\ +(OFN_DONTADDTORECENT |\ OFN_NODEREFERENCELINKS | OFN_NOREADONLYRETURN |\ OFN_NOTESTFILECREATE /*| OFN_USEMONIKERS*/) @@ -271,6 +270,13 @@ static BOOL GetFileName95(FileOpenDlgInfos *fodInfos) return FALSE; } + if (fodInfos->ofnInfos->Flags & OFN_ENABLESIZING) + { + ((LPDLGTEMPLATEW)template)->style |= WS_SIZEBOX; + fodInfos->sizedlg.cx = fodInfos->sizedlg.cy = 0; + fodInfos->initial_size.x = fodInfos->initial_size.y = 0; + } + /* old style hook messages */ if (IsHooked(fodInfos)) { @@ -979,6 +985,125 @@ static INT_PTR FILEDLG95_HandleCustomDialogMessages(HWND hwnd, UINT uMsg, WPARAM } /*********************************************************************** + * FILEDLG95_OnWMGetMMI + * + * WM_GETMINMAXINFO message handler for resizable dialogs + */ +static LRESULT FILEDLG95_OnWMGetMMI( HWND hwnd, LPMINMAXINFO mmiptr) +{ + FileOpenDlgInfos *fodInfos = GetPropA(hwnd,FileOpenDlgInfosStr); + if( !(fodInfos->ofnInfos->Flags & OFN_ENABLESIZING)) return FALSE; + if( fodInfos->initial_size.x || fodInfos->initial_size.y) + { + mmiptr->ptMinTrackSize = fodInfos->initial_size; + } + return TRUE; +} + +/*********************************************************************** + * FILEDLG95_OnWMSize + * + * WM_SIZE message handler, resize the dialog. Re-arrange controls. + * + * FIXME: this could be made more elaborate. Now use a simple scheme + * where the file view is enlarged and the controls are either moved + * vertically or horizontally to get out of the way. Only the "grip" + * is moved in both directions to stay in the corner. + */ +static LRESULT FILEDLG95_OnWMSize(HWND hwnd, WPARAM wParam, LPARAM lParam) +{ + RECT rc, rcview; + int chgx, chgy; + HWND ctrl; + HDWP hdwp; + FileOpenDlgInfos *fodInfos; + + if( wParam != SIZE_RESTORED) return FALSE; + fodInfos = GetPropA(hwnd,FileOpenDlgInfosStr); + if( !(fodInfos->ofnInfos->Flags & OFN_ENABLESIZING)) return FALSE; + /* get the new dialog rectangle */ + GetWindowRect( hwnd, &rc); + /* not initialized yet */ + if( (fodInfos->sizedlg.cx == 0 && fodInfos->sizedlg.cy == 0) || + ((fodInfos->sizedlg.cx == rc.right -rc.left) && /* no change */ + (fodInfos->sizedlg.cy == rc.bottom -rc.top))) + return FALSE; + chgx = rc.right - rc.left - fodInfos->sizedlg.cx; + chgy = rc.bottom - rc.top - fodInfos->sizedlg.cy; + fodInfos->sizedlg.cx = rc.right - rc.left; + fodInfos->sizedlg.cy = rc.bottom - rc.top; + /* change the size of the view window */ + GetWindowRect( fodInfos->ShellInfos.hwndView, &rcview); + MapWindowPoints( NULL, hwnd, (LPPOINT) &rcview, 2); + hdwp = BeginDeferWindowPos( 10); + DeferWindowPos( hdwp, fodInfos->ShellInfos.hwndView, NULL, 0, 0, + rcview.right - rcview.left + chgx, + rcview.bottom - rcview.top + chgy, + SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER); + /* change position and sizes of the controls */ + for( ctrl = GetWindow( hwnd, GW_CHILD); ctrl ; ctrl = GetWindow( ctrl, GW_HWNDNEXT)) + { + GetWindowRect( ctrl, &rc); + MapWindowPoints( NULL, hwnd, (LPPOINT) &rc, 2); + if( ctrl == fodInfos->DlgInfos.hwndGrip) + { + DeferWindowPos( hdwp, ctrl, NULL, rc.left + chgx, rc.top + chgy, + 0, 0, + SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER); + } + else if( rc.top > rcview.bottom) + { + /* if it was below the shell view + * move to bottom */ + DeferWindowPos( hdwp, ctrl, NULL, rc.left, rc.top + chgy, + rc.right - rc.left, rc.bottom - rc.top, + SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER); + } + else if( rc.left > rcview.right) + { + /* if it was to the right of the shell view + * move to right */ + DeferWindowPos( hdwp, ctrl, NULL, rc.left + chgx, rc.top, + rc.right - rc.left, rc.bottom - rc.top, + SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER); + } + } + if(fodInfos->DlgInfos.hwndCustomDlg && + (fodInfos->ofnInfos->Flags & (OFN_ENABLETEMPLATE | OFN_ENABLETEMPLATEHANDLE))) + { + GetClientRect(hwnd, &rc); + DeferWindowPos( hdwp,fodInfos->DlgInfos.hwndCustomDlg, NULL, + 0, 0, rc.right, rc.bottom, SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER); + for( ctrl = GetWindow( fodInfos->DlgInfos.hwndCustomDlg, GW_CHILD); + ctrl ; ctrl = GetWindow( ctrl, GW_HWNDNEXT)) + { + GetWindowRect( ctrl, &rc); + MapWindowPoints( NULL, hwnd, (LPPOINT) &rc, 2); + if( rc.top > rcview.bottom) + { + /* if it was below the shell view + * move to bottom */ + DeferWindowPos( hdwp, ctrl, NULL, rc.left, rc.top + chgy, + rc.right - rc.left, rc.bottom - rc.top, + SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER); + } + else if( rc.left > rcview.right) + { + /* if it was to the right of the shell view + * move to right */ + DeferWindowPos( hdwp, ctrl, NULL, rc.left + chgx, rc.top, + rc.right - rc.left, rc.bottom - rc.top, + SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER); + } + } + } + EndDeferWindowPos( hdwp); + /* should not be needed */ + RedrawWindow( hwnd, NULL, 0, RDW_ALLCHILDREN | RDW_INVALIDATE ); + return TRUE; +} + +/*********************************************************************** * FileOpenDlgProc95 * * File open dialog procedure @@ -994,6 +1119,9 @@ INT_PTR CALLBACK FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l case WM_INITDIALOG: { FileOpenDlgInfos * fodInfos = (FileOpenDlgInfos *)lParam; + RECT rc; + int gripx = GetSystemMetrics( SM_CYHSCROLL); + int gripy = GetSystemMetrics( SM_CYVSCROLL); /* Adds the FileOpenDlgInfos in the property list of the dialog so it will be easily accessible through a GetPropA(...) */ @@ -1001,17 +1129,46 @@ INT_PTR CALLBACK FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l FILEDLG95_InitControls(hwnd); + if (fodInfos->ofnInfos->Flags & OFN_ENABLESIZING) + { + GetWindowRect( hwnd, &rc); + fodInfos->DlgInfos.hwndGrip = + CreateWindowExA( 0, "SCROLLBAR", NULL, + WS_CHILD | WS_GROUP | WS_VISIBLE | WS_CLIPSIBLINGS | + SBS_SIZEGRIP | SBS_SIZEBOXBOTTOMRIGHTALIGN, + rc.right - gripx, rc.bottom - gripy, + gripx, gripy, hwnd, (HMENU) -1, COMDLG32_hInstance, NULL); + } + fodInfos->DlgInfos.hwndCustomDlg = CreateTemplateDialog((FileOpenDlgInfos *)lParam, hwnd); FILEDLG95_ResizeControls(hwnd, wParam, lParam); FILEDLG95_FillControls(hwnd, wParam, lParam); + if (fodInfos->ofnInfos->Flags & OFN_ENABLESIZING) + { + GetWindowRect( hwnd, &rc); + /* FIXME: should remember sizes of last invocation */ + fodInfos->sizedlg.cx = rc.right - rc.left; + fodInfos->sizedlg.cy = rc.bottom - rc.top; + fodInfos->initial_size.x = fodInfos->sizedlg.cx; + fodInfos->initial_size.y = fodInfos->sizedlg.cy; + GetClientRect( hwnd, &rc); + SetWindowPos( fodInfos->DlgInfos.hwndGrip, NULL, + rc.right - gripx, rc.bottom - gripy, + 0, 0, SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER); + } + SendCustomDlgNotificationMessage(hwnd,CDN_INITDONE); SendCustomDlgNotificationMessage(hwnd,CDN_FOLDERCHANGE); SendCustomDlgNotificationMessage(hwnd,CDN_SELCHANGE); return 0; } + case WM_SIZE: + return FILEDLG95_OnWMSize(hwnd, wParam, lParam); + case WM_GETMINMAXINFO: + return FILEDLG95_OnWMGetMMI( hwnd, (LPMINMAXINFO)lParam); case WM_COMMAND: return FILEDLG95_OnWMCommand(hwnd, wParam, lParam); case WM_DRAWITEM: diff --git a/dlls/comdlg32/filedlgbrowser.h b/dlls/comdlg32/filedlgbrowser.h index f8da75eddf7..ca332ec5f8e 100644 --- a/dlls/comdlg32/filedlgbrowser.h +++ b/dlls/comdlg32/filedlgbrowser.h @@ -58,6 +58,8 @@ typedef struct LPCWSTR defext; LPCWSTR filter; LPCWSTR customfilter; + SIZE sizedlg; /* remember the size of the dialog */ + POINT initial_size; /* remember the initial size of the dialog */ struct { IShellBrowser *FOIShellBrowser; IShellFolder *FOIShellFolder; @@ -78,6 +80,7 @@ typedef struct HWND hwndLookInCB; HWND hwndFileName; HWND hwndTB; + HWND hwndGrip; HWND hwndCustomDlg; DWORD dwDlgProp; } DlgInfos; diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c index bee45b0de48..43436bd757d 100644 --- a/dlls/msi/msi.c +++ b/dlls/msi/msi.c @@ -301,13 +301,13 @@ done: return r; } -UINT WINAPI MsiApplyPatchW(LPCWSTR szPatchPackage, LPCWSTR szInstallPackage, - INSTALLTYPE eInstallType, LPCWSTR szCommandLine) +static UINT MSI_ApplyPatchW(LPCWSTR szPatchPackage, LPCWSTR szProductCode, LPCWSTR szCommandLine) { MSIHANDLE patch, info; UINT r, type; DWORD size = 0; LPCWSTR cmd_ptr = szCommandLine; + LPCWSTR product_code = szProductCode; LPWSTR beg, end; LPWSTR cmd = NULL, codes = NULL; @@ -315,41 +315,36 @@ UINT WINAPI MsiApplyPatchW(LPCWSTR szPatchPackage, LPCWSTR szInstallPackage, static const WCHAR patcheq[] = {'P','A','T','C','H','=',0}; static WCHAR empty[] = {0}; - TRACE("%s %s %d %s\n", debugstr_w(szPatchPackage), debugstr_w(szInstallPackage), - eInstallType, debugstr_w(szCommandLine)); - - if (szInstallPackage || eInstallType == INSTALLTYPE_NETWORK_IMAGE || - eInstallType == INSTALLTYPE_SINGLE_INSTANCE) + if (!szProductCode) { - FIXME("Only reading target products from patch\n"); - return ERROR_CALL_NOT_IMPLEMENTED; - } + r = MsiOpenDatabaseW(szPatchPackage, MSIDBOPEN_READONLY, &patch); + if (r != ERROR_SUCCESS) + return r; - r = MsiOpenDatabaseW(szPatchPackage, MSIDBOPEN_READONLY, &patch); - if (r != ERROR_SUCCESS) - return r; + r = MsiGetSummaryInformationW(patch, NULL, 0, &info); + if (r != ERROR_SUCCESS) + goto done; - r = MsiGetSummaryInformationW(patch, NULL, 0, &info); - if (r != ERROR_SUCCESS) - goto done; + r = MsiSummaryInfoGetPropertyW(info, PID_TEMPLATE, &type, NULL, NULL, empty, &size); + if (r != ERROR_MORE_DATA || !size || type != VT_LPSTR) + { + ERR("Failed to read product codes from patch\n"); + goto done; + } - r = MsiSummaryInfoGetPropertyW(info, PID_TEMPLATE, &type, NULL, NULL, empty, &size); - if (r != ERROR_MORE_DATA || !size || type != VT_LPSTR) - { - ERR("Failed to read product codes from patch\n"); - goto done; - } + codes = msi_alloc(++size * sizeof(WCHAR)); + if (!codes) + { + r = ERROR_OUTOFMEMORY; + goto done; + } - codes = msi_alloc(++size * sizeof(WCHAR)); - if (!codes) - { - r = ERROR_OUTOFMEMORY; - goto done; - } + r = MsiSummaryInfoGetPropertyW(info, PID_TEMPLATE, &type, NULL, NULL, codes, &size); + if (r != ERROR_SUCCESS) + goto done; - r = MsiSummaryInfoGetPropertyW(info, PID_TEMPLATE, &type, NULL, NULL, codes, &size); - if (r != ERROR_SUCCESS) - goto done; + product_code = codes; + } if (!szCommandLine) cmd_ptr = empty; @@ -389,6 +384,99 @@ done: return r; } +UINT WINAPI MsiApplyPatchW(LPCWSTR szPatchPackage, LPCWSTR szInstallPackage, + INSTALLTYPE eInstallType, LPCWSTR szCommandLine) +{ + TRACE("%s %s %d %s\n", debugstr_w(szPatchPackage), debugstr_w(szInstallPackage), + eInstallType, debugstr_w(szCommandLine)); + + if (szInstallPackage || eInstallType == INSTALLTYPE_NETWORK_IMAGE || + eInstallType == INSTALLTYPE_SINGLE_INSTANCE) + { + FIXME("Only reading target products from patch\n"); + return ERROR_CALL_NOT_IMPLEMENTED; + } + + return MSI_ApplyPatchW(szPatchPackage, NULL, szCommandLine); +} + +UINT WINAPI MsiApplyMultiplePatchesA(LPCSTR szPatchPackages, + LPCSTR szProductCode, LPCSTR szPropertiesList) +{ + LPWSTR patch_packages = NULL; + LPWSTR product_code = NULL; + LPWSTR properties_list = NULL; + UINT r = ERROR_OUTOFMEMORY; + + TRACE("%s %s %s\n", debugstr_a(szPatchPackages), debugstr_a(szProductCode), + debugstr_a(szPropertiesList)); + + if (!szPatchPackages || !szPatchPackages[0]) + return ERROR_INVALID_PARAMETER; + + if (!(patch_packages = strdupAtoW(szPatchPackages))) + return ERROR_OUTOFMEMORY; + + if (szProductCode && !(product_code = strdupAtoW(szProductCode))) + goto done; + + if (szPropertiesList && !(properties_list = strdupAtoW(szPropertiesList))) + goto done; + + r = MsiApplyMultiplePatchesW(patch_packages, product_code, properties_list); + +done: + msi_free(patch_packages); + msi_free(product_code); + msi_free(properties_list); + + return r; +} + +UINT WINAPI MsiApplyMultiplePatchesW(LPCWSTR szPatchPackages, + LPCWSTR szProductCode, LPCWSTR szPropertiesList) +{ + UINT r = ERROR_SUCCESS; + LPCWSTR beg, end; + + TRACE("%s %s %s\n", debugstr_w(szPatchPackages), debugstr_w(szProductCode), + debugstr_w(szPropertiesList)); + + if (!szPatchPackages || !szPatchPackages[0]) + return ERROR_INVALID_PARAMETER; + + beg = end = szPatchPackages; + while (*beg) + { + DWORD len; + LPWSTR patch; + + while (*beg == ' ') beg++; + while (*end && *end != ';') end++; + + len = end - beg; + while (len && beg[len - 1] == ' ') len--; + + if (!len) return ERROR_INVALID_NAME; + + patch = msi_alloc((len + 1) * sizeof(WCHAR)); + if (!patch) + return ERROR_OUTOFMEMORY; + + memcpy(patch, beg, len * sizeof(WCHAR)); + patch[len] = '\0'; + + r = MSI_ApplyPatchW(patch, szProductCode, szPropertiesList); + msi_free(patch); + + if (r != ERROR_SUCCESS) + break; + + beg = ++end; + } + return r; +} + UINT WINAPI MsiDetermineApplicablePatchesA(LPCSTR szProductPackagePath, DWORD cPatchInfo, PMSIPATCHSEQUENCEINFOA pPatchInfo) { diff --git a/dlls/msi/msi.spec b/dlls/msi/msi.spec index 14178e83113..147502811be 100644 --- a/dlls/msi/msi.spec +++ b/dlls/msi/msi.spec @@ -232,8 +232,8 @@ 236 stub Migrate10CachedPackagesW 237 stub MsiRemovePatchesA 238 stub MsiRemovePatchesW -239 stub MsiApplyMultiplePatchesA -240 stub MsiApplyMultiplePatchesW +239 stdcall MsiApplyMultiplePatchesA(str str str) +240 stdcall MsiApplyMultiplePatchesW(wstr wstr wstr) 241 stub MsiExtractPatchXMLDataA 242 stub MsiExtractPatchXMLDataW 243 stdcall MsiGetPatchInfoExA(str str str long str ptr ptr) diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c index ccc92083534..35a22dec6b5 100644 --- a/dlls/msi/tests/package.c +++ b/dlls/msi/tests/package.c @@ -11533,6 +11533,38 @@ static void test_MsiSetProperty(void) DeleteFileA(msifile); } +static void test_MsiApplyMultiplePatches(void) +{ + UINT r; + + r = MsiApplyMultiplePatchesA(NULL, NULL, NULL); + ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r); + + r = MsiApplyMultiplePatchesA("", NULL, NULL); + ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r); + + r = MsiApplyMultiplePatchesA(";", NULL, NULL); + ok(r == ERROR_INVALID_NAME, "Expected ERROR_INVALID_NAME, got %u\n", r); + + r = MsiApplyMultiplePatchesA(" ;", NULL, NULL); + ok(r == ERROR_INVALID_NAME, "Expected ERROR_INVALID_NAME, got %u\n", r); + + r = MsiApplyMultiplePatchesA(";;", NULL, NULL); + ok(r == ERROR_INVALID_NAME, "Expected ERROR_INVALID_NAME, got %u\n", r); + + r = MsiApplyMultiplePatchesA("nosuchpatchpackage;", NULL, NULL); + todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r); + + r = MsiApplyMultiplePatchesA(";nosuchpatchpackage", NULL, NULL); + ok(r == ERROR_INVALID_NAME, "Expected ERROR_INVALID_NAME, got %u\n", r); + + r = MsiApplyMultiplePatchesA("nosuchpatchpackage;nosuchpatchpackage", NULL, NULL); + todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r); + + r = MsiApplyMultiplePatchesA(" nosuchpatchpackage ; nosuchpatchpackage ", NULL, NULL); + todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r); +} + START_TEST(package) { GetCurrentDirectoryA(MAX_PATH, CURR_DIR); @@ -11566,4 +11598,5 @@ START_TEST(package) test_emptypackage(); test_MsiGetProductProperty(); test_MsiSetProperty(); + test_MsiApplyMultiplePatches(); } diff --git a/dlls/user32/tests/edit.c b/dlls/user32/tests/edit.c index ecc50ab2dbb..8bcd6341919 100644 --- a/dlls/user32/tests/edit.c +++ b/dlls/user32/tests/edit.c @@ -1177,9 +1177,13 @@ static void test_edit_control_4(void) static void test_edit_control_5(void) { static const char *str = "test\r\ntest"; + HWND parentWnd; HWND hWnd; int len; + RECT rc1 = { 10, 10, 11, 11}; + RECT rc; + /* first show that a non-child won't do for this test */ hWnd = CreateWindowEx(0, "EDIT", str, @@ -1187,19 +1191,48 @@ static void test_edit_control_5(void) 10, 10, 1, 1, NULL, NULL, NULL, NULL); assert(hWnd); - + /* size of non-child edit control is (much) bigger then requested */ + GetWindowRect( hWnd, &rc); + ok( rc.right - rc.left > 20, "size of the window (%d) is smaller then expected\n", + rc.right - rc.left); + DestroyWindow(hWnd); + /* so create a parent, and give it edit controls children to test with */ + parentWnd = CreateWindowEx(0, + szEditTextPositionClass, + "Edit Test", WS_VISIBLE | + WS_OVERLAPPEDWINDOW, + CW_USEDEFAULT, CW_USEDEFAULT, + 250, 250, + NULL, NULL, hinst, NULL); + assert(parentWnd); + ShowWindow( parentWnd, SW_SHOW); + /* single line */ + hWnd = CreateWindowEx(0, + "EDIT", + str, WS_VISIBLE | WS_BORDER | + WS_CHILD, + rc1.left, rc1.top, rc1.right - rc1.left, rc1.bottom - rc1.top, + parentWnd, NULL, NULL, NULL); + assert(hWnd); + GetClientRect( hWnd, &rc); + ok( rc.right == rc1.right - rc1.left && rc.bottom == rc1.bottom - rc1.top, + "Client rectangle not the expected size (%d,%d,%d,%d)\n", + rc.left, rc.top, rc.right, rc.bottom); len = SendMessageA(hWnd, WM_GETTEXTLENGTH, 0, 0); ok(lstrlenA(str) == len, "text shouldn't have been truncated\n"); DestroyWindow(hWnd); - + /* multi line */ hWnd = CreateWindowEx(0, "EDIT", str, - ES_MULTILINE, - 10, 10, 1, 1, - NULL, NULL, NULL, NULL); + WS_CHILD | ES_MULTILINE, + rc1.left, rc1.top, rc1.right - rc1.left, rc1.bottom - rc1.top, + parentWnd, NULL, NULL, NULL); assert(hWnd); - + GetClientRect( hWnd, &rc); + ok( rc.right == rc1.right - rc1.left && rc.bottom == rc1.bottom - rc1.top, + "Client rectangle not the expected size (%d,%d,%d,%d)\n", + rc.left, rc.top, rc.right, rc.bottom); len = SendMessageA(hWnd, WM_GETTEXTLENGTH, 0, 0); ok(lstrlenA(str) == len, "text shouldn't have been truncated\n"); DestroyWindow(hWnd); diff --git a/dlls/wined3d/baseshader.c b/dlls/wined3d/baseshader.c index acc4b71ad36..9bdad174664 100644 --- a/dlls/wined3d/baseshader.c +++ b/dlls/wined3d/baseshader.c @@ -296,6 +296,20 @@ static void shader_sm1_read_semantic(const DWORD **ptr, struct wined3d_shader_se shader_parse_dst_param(dst_token, NULL, &semantic->reg); } +static void shader_sm1_read_comment(const DWORD **ptr, const char **comment) +{ + DWORD token = **ptr; + + if ((token & WINED3DSI_OPCODE_MASK) != WINED3DSIO_COMMENT) + { + *comment = NULL; + return; + } + + *comment = (const char *)++(*ptr); + *ptr += (token & WINED3DSI_COMMENTSIZE_MASK) >> WINED3DSI_COMMENTSIZE_SHIFT; +} + static const char *shader_opcode_names[] = { /* WINED3DSIH_ABS */ "abs", @@ -454,22 +468,6 @@ void shader_init(struct IWineD3DBaseShaderClass *shader, list_init(&shader->linked_programs); } -static inline WINED3DSHADER_PARAM_REGISTER_TYPE shader_get_regtype(DWORD param) -{ - return ((param & WINED3DSP_REGTYPE_MASK) >> WINED3DSP_REGTYPE_SHIFT) - | ((param & WINED3DSP_REGTYPE_MASK2) >> WINED3DSP_REGTYPE_SHIFT2); -} - -static inline DWORD shader_get_writemask(DWORD param) -{ - return param & WINED3DSP_WRITEMASK_ALL; -} - -static inline BOOL shader_is_comment(DWORD token) -{ - return WINED3DSIO_COMMENT == (token & WINED3DSI_OPCODE_MASK); -} - /* Convert floating point offset relative * to a register file to an absolute offset for float constants */ static unsigned int shader_get_float_offset(WINED3DSHADER_PARAM_REGISTER_TYPE register_type, UINT register_idx) @@ -608,16 +606,12 @@ HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, struct shader_reg_m while (WINED3DVS_END() != *pToken) { struct wined3d_shader_instruction ins; + const char *comment; UINT param_size; /* Skip comments */ - if (shader_is_comment(*pToken)) - { - DWORD comment_len = (*pToken & WINED3DSI_COMMENTSIZE_MASK) >> WINED3DSI_COMMENTSIZE_SHIFT; - ++pToken; - pToken += comment_len; - continue; - } + shader_sm1_read_comment(&pToken, &comment); + if (comment) continue; /* Fetch opcode */ shader_sm1_read_opcode(&pToken, &ins, ¶m_size, shader_ins, shader_version); @@ -666,10 +660,17 @@ HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, struct shader_reg_m } else if (ins.handler_idx == WINED3DSIH_DEF) { + struct wined3d_shader_dst_param dst; + struct wined3d_shader_src_param rel_addr; + local_constant* lconst = HeapAlloc(GetProcessHeap(), 0, sizeof(local_constant)); if (!lconst) return E_OUTOFMEMORY; - lconst->idx = *pToken & WINED3DSP_REGNUM_MASK; - memcpy(lconst->value, pToken + 1, 4 * sizeof(DWORD)); + + shader_sm1_read_dst_param(&pToken, &dst, &rel_addr, shader_version); + lconst->idx = dst.register_idx; + + memcpy(lconst->value, pToken, 4 * sizeof(DWORD)); + pToken += 4; /* In pixel shader 1.X shaders, the constants are clamped between [-1;1] */ if (WINED3DSHADER_VERSION_MAJOR(shader_version) == 1 && pshader) @@ -686,25 +687,38 @@ HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, struct shader_reg_m } list_add_head(&This->baseShader.constantsF, &lconst->entry); - pToken += param_size; } else if (ins.handler_idx == WINED3DSIH_DEFI) { + struct wined3d_shader_dst_param dst; + struct wined3d_shader_src_param rel_addr; + local_constant* lconst = HeapAlloc(GetProcessHeap(), 0, sizeof(local_constant)); if (!lconst) return E_OUTOFMEMORY; - lconst->idx = *pToken & WINED3DSP_REGNUM_MASK; - memcpy(lconst->value, pToken + 1, 4 * sizeof(DWORD)); + + shader_sm1_read_dst_param(&pToken, &dst, &rel_addr, shader_version); + lconst->idx = dst.register_idx; + + memcpy(lconst->value, pToken, 4 * sizeof(DWORD)); + pToken += 4; + list_add_head(&This->baseShader.constantsI, &lconst->entry); - pToken += param_size; } else if (ins.handler_idx == WINED3DSIH_DEFB) { + struct wined3d_shader_dst_param dst; + struct wined3d_shader_src_param rel_addr; + local_constant* lconst = HeapAlloc(GetProcessHeap(), 0, sizeof(local_constant)); if (!lconst) return E_OUTOFMEMORY; - lconst->idx = *pToken & WINED3DSP_REGNUM_MASK; - memcpy(lconst->value, pToken + 1, 1 * sizeof(DWORD)); + + shader_sm1_read_dst_param(&pToken, &dst, &rel_addr, shader_version); + lconst->idx = dst.register_idx; + + memcpy(lconst->value, pToken, sizeof(DWORD)); + ++pToken; + list_add_head(&This->baseShader.constantsB, &lconst->entry); - pToken += param_size; } /* If there's a loop in the shader */ else if (ins.handler_idx == WINED3DSIH_LOOP @@ -911,34 +925,21 @@ static void shader_dump_decl_usage(const struct wined3d_shader_semantic *semanti } } -static void shader_dump_arr_entry(const struct wined3d_shader_src_param *rel_addr, - UINT register_idx, DWORD shader_version) -{ - if (rel_addr) - { - TRACE("["); - shader_dump_src_param(rel_addr, shader_version); - TRACE(" + "); - } - TRACE("%u", register_idx); - if (rel_addr) TRACE("]"); -} - static void shader_dump_register(WINED3DSHADER_PARAM_REGISTER_TYPE register_type, UINT register_idx, const struct wined3d_shader_src_param *rel_addr, DWORD shader_version) { static const char * const rastout_reg_names[] = {"oPos", "oFog", "oPts"}; static const char * const misctype_reg_names[] = {"vPos", "vFace"}; + UINT offset = register_idx; switch (register_type) { case WINED3DSPR_TEMP: - TRACE("r%u", register_idx); + TRACE("r"); break; case WINED3DSPR_INPUT: TRACE("v"); - shader_dump_arr_entry(rel_addr, register_idx, shader_version); break; case WINED3DSPR_CONST: @@ -946,11 +947,11 @@ static void shader_dump_register(WINED3DSHADER_PARAM_REGISTER_TYPE register_type case WINED3DSPR_CONST3: case WINED3DSPR_CONST4: TRACE("c"); - shader_dump_arr_entry(rel_addr, shader_get_float_offset(register_type, register_idx), shader_version); + offset = shader_get_float_offset(register_type, register_idx); break; case WINED3DSPR_TEXTURE: /* vs: case WINED3DSPR_ADDR */ - TRACE("%c%u", (shader_is_pshader_version(shader_version) ? 't' : 'a'), register_idx); + TRACE("%c", shader_is_pshader_version(shader_version) ? 't' : 'a'); break; case WINED3DSPR_RASTOUT: @@ -958,7 +959,7 @@ static void shader_dump_register(WINED3DSHADER_PARAM_REGISTER_TYPE register_type break; case WINED3DSPR_COLOROUT: - TRACE("oC%u", register_idx); + TRACE("oC"); break; case WINED3DSPR_DEPTHOUT: @@ -966,35 +967,26 @@ static void shader_dump_register(WINED3DSHADER_PARAM_REGISTER_TYPE register_type break; case WINED3DSPR_ATTROUT: - TRACE("oD%u", register_idx); + TRACE("oD"); break; case WINED3DSPR_TEXCRDOUT: /* Vertex shaders >= 3.0 use general purpose output registers * (WINED3DSPR_OUTPUT), which can include an address token */ - if (WINED3DSHADER_VERSION_MAJOR(shader_version) >= 3) - { - TRACE("o"); - shader_dump_arr_entry(rel_addr, register_idx, shader_version); - } - else - { - TRACE("oT%u", register_idx); - } + if (WINED3DSHADER_VERSION_MAJOR(shader_version) >= 3) TRACE("o"); + else TRACE("oT"); break; case WINED3DSPR_CONSTINT: TRACE("i"); - shader_dump_arr_entry(rel_addr, register_idx, shader_version); break; case WINED3DSPR_CONSTBOOL: TRACE("b"); - shader_dump_arr_entry(rel_addr, register_idx, shader_version); break; case WINED3DSPR_LABEL: - TRACE("l%u", register_idx); + TRACE("l"); break; case WINED3DSPR_LOOP: @@ -1002,7 +994,7 @@ static void shader_dump_register(WINED3DSHADER_PARAM_REGISTER_TYPE register_type break; case WINED3DSPR_SAMPLER: - TRACE("s%u", register_idx); + TRACE("s"); break; case WINED3DSPR_MISCTYPE: @@ -1011,13 +1003,25 @@ static void shader_dump_register(WINED3DSHADER_PARAM_REGISTER_TYPE register_type break; case WINED3DSPR_PREDICATE: - TRACE("p%u", register_idx); + TRACE("p"); break; default: TRACE("unhandled_rtype(%#x)", register_type); break; } + + if (register_type != WINED3DSPR_RASTOUT && register_type != WINED3DSPR_MISCTYPE) + { + if (rel_addr) + { + TRACE("["); + shader_dump_src_param(rel_addr, shader_version); + TRACE(" + "); + } + TRACE("%u", offset); + if (rel_addr) TRACE("]"); + } } static void shader_dump_dst_param(const struct wined3d_shader_dst_param *param, DWORD shader_version) @@ -1142,15 +1146,12 @@ void shader_generate_main(IWineD3DBaseShader *iface, SHADER_BUFFER* buffer, while (WINED3DPS_END() != *pToken) { + const char *comment; UINT param_size; /* Skip comment tokens */ - if (shader_is_comment(*pToken)) - { - pToken += (*pToken & WINED3DSI_COMMENTSIZE_MASK) >> WINED3DSI_COMMENTSIZE_SHIFT; - ++pToken; - continue; - } + shader_sm1_read_comment(&pToken, &comment); + if (comment) continue; /* Read opcode */ shader_sm1_read_opcode(&pToken, &ins, ¶m_size, opcode_table, shader_version); @@ -1255,14 +1256,14 @@ void shader_trace_init(const DWORD *pFunction, const SHADER_OPCODE *opcode_table while (WINED3DVS_END() != *pToken) { struct wined3d_shader_instruction ins; + const char *comment; UINT param_size; - if (shader_is_comment(*pToken)) /* comment */ + /* comment */ + shader_sm1_read_comment(&pToken, &comment); + if (comment) { - DWORD comment_len = (*pToken & WINED3DSI_COMMENTSIZE_MASK) >> WINED3DSI_COMMENTSIZE_SHIFT; - ++pToken; - TRACE("//%s\n", (const char*)pToken); - pToken += comment_len; + TRACE("//%s\n", comment); continue; } @@ -1287,46 +1288,60 @@ void shader_trace_init(const DWORD *pFunction, const SHADER_OPCODE *opcode_table } else if (ins.handler_idx == WINED3DSIH_DEF) { - unsigned int offset = shader_get_float_offset(shader_get_regtype(*pToken), - *pToken & WINED3DSP_REGNUM_MASK); + struct wined3d_shader_dst_param dst; + struct wined3d_shader_src_param rel_addr; + + shader_sm1_read_dst_param(&pToken, &dst, &rel_addr, shader_version); - TRACE("def c%u = %f, %f, %f, %f", offset, + TRACE("def c%u = %f, %f, %f, %f", shader_get_float_offset(dst.register_type, dst.register_idx), + *(const float *)(pToken), *(const float *)(pToken + 1), *(const float *)(pToken + 2), - *(const float *)(pToken + 3), - *(const float *)(pToken + 4)); - pToken += 5; + *(const float *)(pToken + 3)); + pToken += 4; } else if (ins.handler_idx == WINED3DSIH_DEFI) { - TRACE("defi i%u = %d, %d, %d, %d", *pToken & WINED3DSP_REGNUM_MASK, + struct wined3d_shader_dst_param dst; + struct wined3d_shader_src_param rel_addr; + + shader_sm1_read_dst_param(&pToken, &dst, &rel_addr, shader_version); + + TRACE("defi i%u = %d, %d, %d, %d", dst.register_idx, + *(pToken), *(pToken + 1), *(pToken + 2), - *(pToken + 3), - *(pToken + 4)); - pToken += 5; + *(pToken + 3)); + pToken += 4; } else if (ins.handler_idx == WINED3DSIH_DEFB) { - TRACE("defb b%u = %s", *pToken & WINED3DSP_REGNUM_MASK, - *(pToken + 1)? "true": "false"); - pToken += 2; + struct wined3d_shader_dst_param dst; + struct wined3d_shader_src_param rel_addr; + + shader_sm1_read_dst_param(&pToken, &dst, &rel_addr, shader_version); + + TRACE("defb b%u = %s", dst.register_idx, *pToken ? "true" : "false"); + ++pToken; } else { - DWORD param, addr_token = 0; - int tokens_read; + struct wined3d_shader_src_param dst_rel_addr, src_rel_addr; + struct wined3d_shader_dst_param dst_param; + struct wined3d_shader_src_param src_param; + + if (ins.dst_count) + { + shader_sm1_read_dst_param(&pToken, &dst_param, &dst_rel_addr, shader_version); + } /* Print out predication source token first - it follows * the destination token. */ if (ins.predicate) { - struct wined3d_shader_src_param pred; - - shader_parse_src_param(*(pToken + 2), NULL, &pred); - + shader_sm1_read_src_param(&pToken, &src_param, &src_rel_addr, shader_version); TRACE("("); - shader_dump_src_param(&pred, shader_version); + shader_dump_src_param(&src_param, shader_version); TRACE(") "); } @@ -1356,42 +1371,20 @@ void shader_trace_init(const DWORD *pFunction, const SHADER_OPCODE *opcode_table TRACE("p"); } - /* Destination token */ + /* We already read the destination token, print it. */ if (ins.dst_count) { - struct wined3d_shader_dst_param dst; - struct wined3d_shader_src_param rel_addr; - - shader_sm1_read_dst_param(&pToken, &dst, &rel_addr, shader_version); - - shader_dump_ins_modifiers(&dst); + shader_dump_ins_modifiers(&dst_param); TRACE(" "); - shader_dump_dst_param(&dst, shader_version); + shader_dump_dst_param(&dst_param, shader_version); } - /* Predication token - already printed out, just skip it */ - if (ins.predicate) ++pToken; - /* Other source tokens */ for (i = ins.dst_count; i < (ins.dst_count + ins.src_count); ++i) { - struct wined3d_shader_src_param src, rel_addr; - - tokens_read = shader_get_param(pToken, shader_version, ¶m, &addr_token); - pToken += tokens_read; - - if (param & WINED3DSHADER_ADDRMODE_RELATIVE) - { - shader_parse_src_param(addr_token, NULL, &rel_addr); - shader_parse_src_param(param, &rel_addr, &src); - } - else - { - shader_parse_src_param(param, NULL, &src); - } - + shader_sm1_read_src_param(&pToken, &src_param, &src_rel_addr, shader_version); TRACE(!i ? " " : ", "); - shader_dump_src_param(&src, shader_version); + shader_dump_src_param(&src_param, shader_version); } } TRACE("\n"); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 16512cc4532..faecf2e2297 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3,7 +3,7 @@ * * Copyright 2002-2003 The wine-d3d team * Copyright 2002-2003 Raphael Junqueira - * Copyright 2004 Jason Edmeades + * Copyright 2002-2003, 2004 Jason Edmeades * Copyright 2005 Oliver Stieber * * This library is free software; you can redistribute it and/or @@ -38,7 +38,6 @@ #include "wine/unicode.h" #include "objbase.h" -#include "wined3d_private_types.h" #include "wine/wined3d.h" #include "wined3d_gl.h" #include "wine/list.h" @@ -290,6 +289,195 @@ typedef struct wined3d_settings_s { extern wined3d_settings_t wined3d_settings; +typedef enum _WINED3DSAMPLER_TEXTURE_TYPE +{ + WINED3DSTT_UNKNOWN = 0, + WINED3DSTT_1D = 1, + WINED3DSTT_2D = 2, + WINED3DSTT_CUBE = 3, + WINED3DSTT_VOLUME = 4, +} WINED3DSAMPLER_TEXTURE_TYPE; + +typedef enum _WINED3DSHADER_PARAM_REGISTER_TYPE +{ + WINED3DSPR_TEMP = 0, + WINED3DSPR_INPUT = 1, + WINED3DSPR_CONST = 2, + WINED3DSPR_ADDR = 3, + WINED3DSPR_TEXTURE = 3, + WINED3DSPR_RASTOUT = 4, + WINED3DSPR_ATTROUT = 5, + WINED3DSPR_TEXCRDOUT = 6, + WINED3DSPR_OUTPUT = 6, + WINED3DSPR_CONSTINT = 7, + WINED3DSPR_COLOROUT = 8, + WINED3DSPR_DEPTHOUT = 9, + WINED3DSPR_SAMPLER = 10, + WINED3DSPR_CONST2 = 11, + WINED3DSPR_CONST3 = 12, + WINED3DSPR_CONST4 = 13, + WINED3DSPR_CONSTBOOL = 14, + WINED3DSPR_LOOP = 15, + WINED3DSPR_TEMPFLOAT16 = 16, + WINED3DSPR_MISCTYPE = 17, + WINED3DSPR_LABEL = 18, + WINED3DSPR_PREDICATE = 19, +} WINED3DSHADER_PARAM_REGISTER_TYPE; + +typedef enum _WINED3DVS_RASTOUT_OFFSETS +{ + WINED3DSRO_POSITION = 0, + WINED3DSRO_FOG = 1, + WINED3DSRO_POINT_SIZE = 2, +} WINED3DVS_RASTOUT_OFFSETS; + +#define WINED3DSP_NOSWIZZLE (0 | (1 << 2) | (2 << 4) | (3 << 6)) + +typedef enum _WINED3DSHADER_PARAM_SRCMOD_TYPE +{ + WINED3DSPSM_NONE = 0, + WINED3DSPSM_NEG = 1, + WINED3DSPSM_BIAS = 2, + WINED3DSPSM_BIASNEG = 3, + WINED3DSPSM_SIGN = 4, + WINED3DSPSM_SIGNNEG = 5, + WINED3DSPSM_COMP = 6, + WINED3DSPSM_X2 = 7, + WINED3DSPSM_X2NEG = 8, + WINED3DSPSM_DZ = 9, + WINED3DSPSM_DW = 10, + WINED3DSPSM_ABS = 11, + WINED3DSPSM_ABSNEG = 12, + WINED3DSPSM_NOT = 13, +} WINED3DSHADER_PARAM_SRCMOD_TYPE; + +#define WINED3DSP_WRITEMASK_0 0x00010000 /* .x r */ +#define WINED3DSP_WRITEMASK_1 0x00020000 /* .y g */ +#define WINED3DSP_WRITEMASK_2 0x00040000 /* .z b */ +#define WINED3DSP_WRITEMASK_3 0x00080000 /* .w a */ +#define WINED3DSP_WRITEMASK_ALL 0x000F0000 /* all */ + +typedef enum _WINED3DSHADER_PARAM_DSTMOD_TYPE +{ + WINED3DSPDM_NONE = 0, + WINED3DSPDM_SATURATE = 1, + WINED3DSPDM_PARTIALPRECISION = 2, + WINED3DSPDM_MSAMPCENTROID = 4, +} WINED3DSHADER_PARAM_DSTMOD_TYPE; + +typedef enum _WINED3DSHADER_INSTRUCTION_OPCODE_TYPE +{ + WINED3DSIO_NOP = 0, + WINED3DSIO_MOV = 1, + WINED3DSIO_ADD = 2, + WINED3DSIO_SUB = 3, + WINED3DSIO_MAD = 4, + WINED3DSIO_MUL = 5, + WINED3DSIO_RCP = 6, + WINED3DSIO_RSQ = 7, + WINED3DSIO_DP3 = 8, + WINED3DSIO_DP4 = 9, + WINED3DSIO_MIN = 10, + WINED3DSIO_MAX = 11, + WINED3DSIO_SLT = 12, + WINED3DSIO_SGE = 13, + WINED3DSIO_EXP = 14, + WINED3DSIO_LOG = 15, + WINED3DSIO_LIT = 16, + WINED3DSIO_DST = 17, + WINED3DSIO_LRP = 18, + WINED3DSIO_FRC = 19, + WINED3DSIO_M4x4 = 20, + WINED3DSIO_M4x3 = 21, + WINED3DSIO_M3x4 = 22, + WINED3DSIO_M3x3 = 23, + WINED3DSIO_M3x2 = 24, + WINED3DSIO_CALL = 25, + WINED3DSIO_CALLNZ = 26, + WINED3DSIO_LOOP = 27, + WINED3DSIO_RET = 28, + WINED3DSIO_ENDLOOP = 29, + WINED3DSIO_LABEL = 30, + WINED3DSIO_DCL = 31, + WINED3DSIO_POW = 32, + WINED3DSIO_CRS = 33, + WINED3DSIO_SGN = 34, + WINED3DSIO_ABS = 35, + WINED3DSIO_NRM = 36, + WINED3DSIO_SINCOS = 37, + WINED3DSIO_REP = 38, + WINED3DSIO_ENDREP = 39, + WINED3DSIO_IF = 40, + WINED3DSIO_IFC = 41, + WINED3DSIO_ELSE = 42, + WINED3DSIO_ENDIF = 43, + WINED3DSIO_BREAK = 44, + WINED3DSIO_BREAKC = 45, + WINED3DSIO_MOVA = 46, + WINED3DSIO_DEFB = 47, + WINED3DSIO_DEFI = 48, + + WINED3DSIO_TEXCOORD = 64, + WINED3DSIO_TEXKILL = 65, + WINED3DSIO_TEX = 66, + WINED3DSIO_TEXBEM = 67, + WINED3DSIO_TEXBEML = 68, + WINED3DSIO_TEXREG2AR = 69, + WINED3DSIO_TEXREG2GB = 70, + WINED3DSIO_TEXM3x2PAD = 71, + WINED3DSIO_TEXM3x2TEX = 72, + WINED3DSIO_TEXM3x3PAD = 73, + WINED3DSIO_TEXM3x3TEX = 74, + WINED3DSIO_TEXM3x3DIFF = 75, + WINED3DSIO_TEXM3x3SPEC = 76, + WINED3DSIO_TEXM3x3VSPEC = 77, + WINED3DSIO_EXPP = 78, + WINED3DSIO_LOGP = 79, + WINED3DSIO_CND = 80, + WINED3DSIO_DEF = 81, + WINED3DSIO_TEXREG2RGB = 82, + WINED3DSIO_TEXDP3TEX = 83, + WINED3DSIO_TEXM3x2DEPTH = 84, + WINED3DSIO_TEXDP3 = 85, + WINED3DSIO_TEXM3x3 = 86, + WINED3DSIO_TEXDEPTH = 87, + WINED3DSIO_CMP = 88, + WINED3DSIO_BEM = 89, + WINED3DSIO_DP2ADD = 90, + WINED3DSIO_DSX = 91, + WINED3DSIO_DSY = 92, + WINED3DSIO_TEXLDD = 93, + WINED3DSIO_SETP = 94, + WINED3DSIO_TEXLDL = 95, + WINED3DSIO_BREAKP = 96, + + WINED3DSIO_PHASE = 0xfffd, + WINED3DSIO_COMMENT = 0xfffe, + WINED3DSIO_END = 0Xffff, +} WINED3DSHADER_INSTRUCTION_OPCODE_TYPE; + +/* Undocumented opcode control to identify projective texture lookups in ps 2.0 and later */ +#define WINED3DSI_TEXLD_PROJECT 1 +#define WINED3DSI_TEXLD_BIAS 2 + +typedef enum COMPARISON_TYPE +{ + COMPARISON_GT = 1, + COMPARISON_EQ = 2, + COMPARISON_GE = 3, + COMPARISON_LT = 4, + COMPARISON_NE = 5, + COMPARISON_LE = 6, +} COMPARISON_TYPE; + +/* Shader version tokens, and shader end tokens */ +#define WINED3DPS_VERSION(major, minor) (0xffff0000 | ((major) << 8) | (minor)) +#define WINED3DVS_VERSION(major, minor) (0xfffe0000 | ((major) << 8) | (minor)) +#define WINED3DSHADER_VERSION_MAJOR(version) (((version) >> 8) & 0xff) +#define WINED3DSHADER_VERSION_MINOR(version) (((version) >> 0) & 0xff) +#define WINED3DPS_END() 0x0000ffff +#define WINED3DVS_END() 0x0000ffff + /* Shader backends */ /* TODO: Make this dynamic, based on shader limits ? */ @@ -1190,6 +1378,9 @@ void dumpResources(struct list *list); */ #define WINED3D_UNMAPPED_STAGE ~0U +/* Multithreaded flag. Removed from the public header to signal that IWineD3D::CreateDevice ignores it */ +#define WINED3DCREATE_MULTITHREADED 0x00000004 + struct IWineD3DDeviceImpl { /* IUnknown fields */ @@ -2251,15 +2442,6 @@ typedef struct local_constant { DWORD value[4]; } local_constant; -typedef enum COMPARISON_TYPE { - COMPARISON_GT = 1, - COMPARISON_EQ = 2, - COMPARISON_GE = 3, - COMPARISON_LT = 4, - COMPARISON_NE = 5, - COMPARISON_LE = 6 -} COMPARISON_TYPE; - typedef struct SHADER_LIMITS { unsigned int temporary; unsigned int texcoord; @@ -2531,6 +2713,14 @@ extern WINED3DFORMAT pixelformat_for_depth(DWORD depth); * Pixel format management */ +/* WineD3D pixel format flags */ +#define WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING 0x1 +#define WINED3DFMT_FLAG_FILTERING 0x2 +#define WINED3DFMT_FLAG_DEPTH 0x4 +#define WINED3DFMT_FLAG_STENCIL 0x8 +#define WINED3DFMT_FLAG_RENDERTARGET 0x10 +#define WINED3DFMT_FLAG_FOURCC 0x20 + struct GlPixelFormatDesc { WINED3DFORMAT format; diff --git a/dlls/wined3d/wined3d_private_types.h b/dlls/wined3d/wined3d_private_types.h deleted file mode 100644 index 30d6900f0f4..00000000000 --- a/dlls/wined3d/wined3d_private_types.h +++ /dev/null @@ -1,228 +0,0 @@ -/* - * Direct3D wine internal header: D3D equivalent types - * - * Copyright 2002-2003 Jason Edmeades - * Copyright 2002-2003 Raphael Junqueira - * Copyright 2005 Oliver Stieber - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __WINE_WINED3D_TYPES_INTERNAL_H -#define __WINE_WINED3D_TYPES_INTERNAL_H - -/* WineD3D pixel format flags */ -#define WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING 0x1 -#define WINED3DFMT_FLAG_FILTERING 0x2 -#define WINED3DFMT_FLAG_DEPTH 0x4 -#define WINED3DFMT_FLAG_STENCIL 0x8 -#define WINED3DFMT_FLAG_RENDERTARGET 0x10 -#define WINED3DFMT_FLAG_FOURCC 0x20 - -typedef enum _WINED3DSAMPLER_TEXTURE_TYPE -{ - WINED3DSTT_UNKNOWN = 0, - WINED3DSTT_1D = 1, - WINED3DSTT_2D = 2, - WINED3DSTT_CUBE = 3, - WINED3DSTT_VOLUME = 4, - - WINED3DSTT_FORCE_DWORD = 0x7FFFFFFF -} WINED3DSAMPLER_TEXTURE_TYPE; - -/** Register types **/ -typedef enum _WINED3DSHADER_PARAM_REGISTER_TYPE { - WINED3DSPR_TEMP = 0, - WINED3DSPR_INPUT = 1, - WINED3DSPR_CONST = 2, - WINED3DSPR_ADDR = 3, - WINED3DSPR_TEXTURE = 3, - WINED3DSPR_RASTOUT = 4, - WINED3DSPR_ATTROUT = 5, - WINED3DSPR_TEXCRDOUT = 6, - WINED3DSPR_OUTPUT = 6, - WINED3DSPR_CONSTINT = 7, - WINED3DSPR_COLOROUT = 8, - WINED3DSPR_DEPTHOUT = 9, - WINED3DSPR_SAMPLER = 10, - WINED3DSPR_CONST2 = 11, - WINED3DSPR_CONST3 = 12, - WINED3DSPR_CONST4 = 13, - WINED3DSPR_CONSTBOOL = 14, - WINED3DSPR_LOOP = 15, - WINED3DSPR_TEMPFLOAT16 = 16, - WINED3DSPR_MISCTYPE = 17, - WINED3DSPR_LABEL = 18, - WINED3DSPR_PREDICATE = 19, - - WINED3DSPR_FORCE_DWORD = 0x7FFFFFFF -} WINED3DSHADER_PARAM_REGISTER_TYPE; - -/* RASTOUT register offsets */ -typedef enum _WINED3DVS_RASTOUT_OFFSETS { - WINED3DSRO_POSITION = 0, - WINED3DSRO_FOG = 1, - WINED3DSRO_POINT_SIZE = 2, - - WINED3DSRO_FORCE_DWORD = 0x7FFFFFFF -} WINED3DVS_RASTOUT_OFFSETS; - -#define WINED3DSP_NOSWIZZLE (0 | (1 << 2) | (2 << 4) | (3 << 6)) - -typedef enum _WINED3DSHADER_PARAM_SRCMOD_TYPE { - WINED3DSPSM_NONE = 0, - WINED3DSPSM_NEG = 1, - WINED3DSPSM_BIAS = 2, - WINED3DSPSM_BIASNEG = 3, - WINED3DSPSM_SIGN = 4, - WINED3DSPSM_SIGNNEG = 5, - WINED3DSPSM_COMP = 6, - WINED3DSPSM_X2 = 7, - WINED3DSPSM_X2NEG = 8, - WINED3DSPSM_DZ = 9, - WINED3DSPSM_DW = 10, - WINED3DSPSM_ABS = 11, - WINED3DSPSM_ABSNEG = 12, - WINED3DSPSM_NOT = 13, - - WINED3DSPSM_FORCE_DWORD = 0x7FFFFFFF -} WINED3DSHADER_PARAM_SRCMOD_TYPE; - -/** Destination register modifiers **/ -#define WINED3DSP_WRITEMASK_0 0x00010000 /* .x r */ -#define WINED3DSP_WRITEMASK_1 0x00020000 /* .y g */ -#define WINED3DSP_WRITEMASK_2 0x00040000 /* .z b */ -#define WINED3DSP_WRITEMASK_3 0x00080000 /* .w a */ -#define WINED3DSP_WRITEMASK_ALL 0x000F0000 /* all */ - -typedef enum _WINED3DSHADER_PARAM_DSTMOD_TYPE { - WINED3DSPDM_NONE = 0, - WINED3DSPDM_SATURATE = 1, - WINED3DSPDM_PARTIALPRECISION = 2, - WINED3DSPDM_MSAMPCENTROID = 4, - - WINED3DSPDM_FORCE_DWORD = 0x7FFFFFFF -} WINED3DSHADER_PARAM_DSTMOD_TYPE; - -/** Opcode types */ -typedef enum _WINED3DSHADER_INSTRUCTION_OPCODE_TYPE { - WINED3DSIO_NOP = 0, - WINED3DSIO_MOV = 1, - WINED3DSIO_ADD = 2, - WINED3DSIO_SUB = 3, - WINED3DSIO_MAD = 4, - WINED3DSIO_MUL = 5, - WINED3DSIO_RCP = 6, - WINED3DSIO_RSQ = 7, - WINED3DSIO_DP3 = 8, - WINED3DSIO_DP4 = 9, - WINED3DSIO_MIN = 10, - WINED3DSIO_MAX = 11, - WINED3DSIO_SLT = 12, - WINED3DSIO_SGE = 13, - WINED3DSIO_EXP = 14, - WINED3DSIO_LOG = 15, - WINED3DSIO_LIT = 16, - WINED3DSIO_DST = 17, - WINED3DSIO_LRP = 18, - WINED3DSIO_FRC = 19, - WINED3DSIO_M4x4 = 20, - WINED3DSIO_M4x3 = 21, - WINED3DSIO_M3x4 = 22, - WINED3DSIO_M3x3 = 23, - WINED3DSIO_M3x2 = 24, - WINED3DSIO_CALL = 25, - WINED3DSIO_CALLNZ = 26, - WINED3DSIO_LOOP = 27, - WINED3DSIO_RET = 28, - WINED3DSIO_ENDLOOP = 29, - WINED3DSIO_LABEL = 30, - WINED3DSIO_DCL = 31, - WINED3DSIO_POW = 32, - WINED3DSIO_CRS = 33, - WINED3DSIO_SGN = 34, - WINED3DSIO_ABS = 35, - WINED3DSIO_NRM = 36, - WINED3DSIO_SINCOS = 37, - WINED3DSIO_REP = 38, - WINED3DSIO_ENDREP = 39, - WINED3DSIO_IF = 40, - WINED3DSIO_IFC = 41, - WINED3DSIO_ELSE = 42, - WINED3DSIO_ENDIF = 43, - WINED3DSIO_BREAK = 44, - WINED3DSIO_BREAKC = 45, - WINED3DSIO_MOVA = 46, - WINED3DSIO_DEFB = 47, - WINED3DSIO_DEFI = 48, - - WINED3DSIO_TEXCOORD = 64, - WINED3DSIO_TEXKILL = 65, - WINED3DSIO_TEX = 66, - WINED3DSIO_TEXBEM = 67, - WINED3DSIO_TEXBEML = 68, - WINED3DSIO_TEXREG2AR = 69, - WINED3DSIO_TEXREG2GB = 70, - WINED3DSIO_TEXM3x2PAD = 71, - WINED3DSIO_TEXM3x2TEX = 72, - WINED3DSIO_TEXM3x3PAD = 73, - WINED3DSIO_TEXM3x3TEX = 74, - WINED3DSIO_TEXM3x3DIFF = 75, - WINED3DSIO_TEXM3x3SPEC = 76, - WINED3DSIO_TEXM3x3VSPEC = 77, - WINED3DSIO_EXPP = 78, - WINED3DSIO_LOGP = 79, - WINED3DSIO_CND = 80, - WINED3DSIO_DEF = 81, - WINED3DSIO_TEXREG2RGB = 82, - WINED3DSIO_TEXDP3TEX = 83, - WINED3DSIO_TEXM3x2DEPTH = 84, - WINED3DSIO_TEXDP3 = 85, - WINED3DSIO_TEXM3x3 = 86, - WINED3DSIO_TEXDEPTH = 87, - WINED3DSIO_CMP = 88, - WINED3DSIO_BEM = 89, - WINED3DSIO_DP2ADD = 90, - WINED3DSIO_DSX = 91, - WINED3DSIO_DSY = 92, - WINED3DSIO_TEXLDD = 93, - WINED3DSIO_SETP = 94, - WINED3DSIO_TEXLDL = 95, - WINED3DSIO_BREAKP = 96, - - WINED3DSIO_PHASE = 0xFFFD, - WINED3DSIO_COMMENT = 0xFFFE, - WINED3DSIO_END = 0XFFFF, - - WINED3DSIO_FORCE_DWORD = 0X7FFFFFFF /** for 32-bit alignment */ -} WINED3DSHADER_INSTRUCTION_OPCODE_TYPE; - -/* Undocumented opcode control to identify projective texture lookups in ps 2.0 and later */ -#define WINED3DSI_TEXLD_PROJECT 1 -#define WINED3DSI_TEXLD_BIAS 2 - -/** Shader version tokens, and shader end tokens **/ - -#define WINED3DPS_VERSION(major, minor) (0xFFFF0000 | ((major) << 8) | (minor)) -#define WINED3DVS_VERSION(major, minor) (0xFFFE0000 | ((major) << 8) | (minor)) -#define WINED3DSHADER_VERSION_MAJOR(version) (((version) >> 8) & 0xFF) -#define WINED3DSHADER_VERSION_MINOR(version) (((version) >> 0) & 0xFF) -#define WINED3DPS_END() 0x0000FFFF -#define WINED3DVS_END() 0x0000FFFF - -/* Multithreaded flag. Removed from the public header to signal that IWineD3D::CreateDevice ignores it */ -#define WINED3DCREATE_MULTITHREADED 0x00000004 - -#endif diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c index bb29b8240f8..5a042f6ab1c 100644 --- a/dlls/winex11.drv/clipboard.c +++ b/dlls/winex11.drv/clipboard.c @@ -151,6 +151,7 @@ static HANDLE X11DRV_CLIPBOARD_ImportClipboardData(Display *d, Window w, Atom pr static HANDLE X11DRV_CLIPBOARD_ImportEnhMetaFile(Display *d, Window w, Atom prop); static HANDLE X11DRV_CLIPBOARD_ImportMetaFilePict(Display *d, Window w, Atom prop); static HANDLE X11DRV_CLIPBOARD_ImportXAPIXMAP(Display *d, Window w, Atom prop); +static HANDLE X11DRV_CLIPBOARD_ImportImageBmp(Display *d, Window w, Atom prop); static HANDLE X11DRV_CLIPBOARD_ImportXAString(Display *d, Window w, Atom prop); static HANDLE X11DRV_CLIPBOARD_ImportUTF8(Display *d, Window w, Atom prop); static HANDLE X11DRV_CLIPBOARD_ImportCompoundText(Display *d, Window w, Atom prop); @@ -192,6 +193,7 @@ static const WCHAR wszCF_DIF[] = {'W','C','F','_','D','I','F',0}; static const WCHAR wszCF_TIFF[] = {'W','C','F','_','T','I','F','F',0}; static const WCHAR wszCF_OEMTEXT[] = {'W','C','F','_','O','E','M','T','E','X','T',0}; static const WCHAR wszCF_DIB[] = {'W','C','F','_','D','I','B',0}; +static const WCHAR wszIMAGEBMP[] = {'i','m','a','g','e','/','b','m','p',0}; static const WCHAR wszCF_PALETTE[] = {'W','C','F','_','P','A','L','E','T','T','E',0}; static const WCHAR wszCF_PENDATA[] = {'W','C','F','_','P','E','N','D','A','T','A',0}; static const WCHAR wszCF_RIFF[] = {'W','C','F','_','R','I','F','F',0}; @@ -278,7 +280,10 @@ static WINE_CLIPFORMAT ClipFormats[] = X11DRV_CLIPBOARD_ExportClipboardData, &ClipFormats[20], &ClipFormats[22]}, { CF_DSPENHMETAFILE, wszCF_DSPENHMETAFILE, 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportClipboardData, - X11DRV_CLIPBOARD_ExportClipboardData, &ClipFormats[21], NULL} + X11DRV_CLIPBOARD_ExportClipboardData, &ClipFormats[21], &ClipFormats[23]}, + + { CF_DIB, wszIMAGEBMP, 0, CF_FLAG_BUILTINFMT, X11DRV_CLIPBOARD_ImportImageBmp, + NULL, &ClipFormats[22], NULL}, }; #define GET_ATOM(prop) (((prop) < FIRST_XATOM) ? (Atom)(prop) : X11DRV_Atoms[(prop) - FIRST_XATOM]) @@ -1318,6 +1323,52 @@ static HANDLE X11DRV_CLIPBOARD_ImportXAPIXMAP(Display *display, Window w, Atom p /************************************************************************** + * X11DRV_CLIPBOARD_ImportImageBmp + * + * Import image/bmp, converting the image to CF_DIB. + */ +static HANDLE X11DRV_CLIPBOARD_ImportImageBmp(Display *display, Window w, Atom prop) +{ + LPBYTE lpdata; + unsigned long cbytes; + HANDLE hClipData = 0; + + if (X11DRV_CLIPBOARD_ReadProperty(display, w, prop, &lpdata, &cbytes)) + { + BITMAPFILEHEADER *bfh = (BITMAPFILEHEADER*)lpdata; + + if (cbytes >= sizeof(BITMAPFILEHEADER)+sizeof(BITMAPCOREHEADER) && + bfh->bfType == 0x4d42 /* "BM" */) + { + BITMAPINFO *bmi = (BITMAPINFO*)(bfh+1); + HBITMAP hbmp; + HDC hdc; + + hdc = GetDC(0); + hbmp = CreateDIBitmap( + hdc, + &(bmi->bmiHeader), + CBM_INIT, + lpdata+bfh->bfOffBits, + bmi, + DIB_RGB_COLORS + ); + + hClipData = X11DRV_DIB_CreateDIBFromBitmap(hdc, hbmp); + + DeleteObject(hbmp); + ReleaseDC(0, hdc); + } + + /* Free the retrieved property data */ + HeapFree(GetProcessHeap(), 0, lpdata); + } + + return hClipData; +} + + +/************************************************************************** * X11DRV_CLIPBOARD_ImportMetaFilePict * * Import MetaFilePict. diff --git a/include/msi.h b/include/msi.h index a6a5f3d552c..5e68fdc278c 100644 --- a/include/msi.h +++ b/include/msi.h @@ -649,6 +649,10 @@ UINT WINAPI MsiDetermineApplicablePatchesA(LPCSTR, DWORD, PMSIPATCHSEQUENCEINFOA UINT WINAPI MsiDetermineApplicablePatchesW(LPCWSTR, DWORD, PMSIPATCHSEQUENCEINFOW); #define MsiDetermineApplicablePatches WINELIB_NAME_AW(MsiDetermineApplicablePatches) +UINT WINAPI MsiApplyMultiplePatchesA(LPCSTR, LPCSTR, LPCSTR); +UINT WINAPI MsiApplyMultiplePatchesW(LPCWSTR, LPCWSTR, LPCWSTR); +#define MsiApplyMultiplePatches WINELIB_NAME_AW(MsiApplyMultiplePatches) + /* Non Unicode */ UINT WINAPI MsiCloseHandle(MSIHANDLE); UINT WINAPI MsiCloseAllHandles(void); diff --git a/tools/wine.desktop b/tools/wine.desktop index 0d69cc81755..52f91c6d24c 100644 --- a/tools/wine.desktop +++ b/tools/wine.desktop @@ -16,6 +16,6 @@ Name[da]=Wine, Programstarter til Windows-programmer Name[nb]=Wine Programlaster for Windowsapplikasjoner Name[nn]=Wine Programlaster for Windowsapplikasjoner Exec=wine start /unix %f -MimeType=application/x-ms-dos-executable;application/x-msdos-program;application/x-msdownload;application/exe;application/x-exe;application/dos-exe;vms/exe;application/x-winexe;application/msdos-windows;application/x-zip-compressed;application/x-executable;application/x-msi; +MimeType=application/x-ms-dos-executable;application/x-msi; NoDisplay=true StartupNotify=true diff --git a/tools/wine.inf.in b/tools/wine.inf.in index fb7c68c1b4d..f42dea8a72e 100644 --- a/tools/wine.inf.in +++ b/tools/wine.inf.in @@ -121,21 +121,27 @@ HKCR,.wav,"Content Type",2,"audio/wav" HKCR,.xml,,2,"xmlfile" HKCR,.xml,"Content Type",2,"text/xml" HKCR,.xsl,"Content Type",2,"text/xsl" +HKCR,chm.file,,2,"Compiled HTML Help File" HKCR,chm.file\shell\open\command,,2,"%11%\hh.exe %1" +HKCR,cplfile,,2,"Control Panel Item" HKCR,cplfile\shell\cplopen,,2,"Open with Control Panel" HKCR,cplfile\shell\cplopen\command,,2,"rundll32.exe shell32.dll,Control_RunDLL ""%1"",%*" +HKCR,exefile,,2,"Application" HKCR,exefile\DefaultIcon,,2,"%1" HKCR,exefile\shell\open\command,,2,"""%1"" %*" HKCR,folder\shell\open\ddeexec,,2,"[ViewFolder("%l", %I, %S)]" HKCR,folder\shell\open\ddeexec,"NoActivateHandler",2,"" HKCR,folder\shell\open\ddeexec\application,,2,"Folders" +HKCR,hlpfile,,2,"Help File" HKCR,hlpfile\shell\open\command,,2,"%11%\winhlp32.exe %1" HKCR,htmlfile\shell\open\command,,2,"%11%\winebrowser.exe -nohome" HKCR,htmlfile\shell\open\ddeexec,,2,"""%1"",,-1,0,,,," HKCR,htmlfile\shell\open\ddeexec,"NoActivateHandler",2,"" HKCR,htmlfile\shell\open\ddeexec\Application,,2,"IExplore" HKCR,htmlfile\shell\open\ddeexec\Topic,,2,"WWW_OpenURL" +HKCR,inffile,,2,"Setup Information" HKCR,inffile\shell\install\command,,2,"%11%\rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 %1" +HKCR,inifile,,2,"Configuration Settings" HKCR,inifile\shell\open\command,,2,"%11%\notepad.exe %1" HKCR,inifile\shell\print\command,,2,"%11%\notepad.exe /p %1" HKCR,lnkfile,,2,"Shortcut" @@ -144,16 +150,20 @@ HKCR,lnkfile,"IsShortcut",2,"yes" HKCR,lnkfile\CLSID,,2,"{00021401-0000-0000-C000-000000000046}" HKCR,lnkfile\shellex\IconHandler,,2,"{00021401-0000-0000-C000-000000000046}" HKCR,lnkfile\shellex\ContextMenuHandlers\{00021401-0000-0000-C000-000000000046},,0x10, +HKCR,Msi.Package,,2,"Windows Installer Package" HKCR,Msi.Package\DefaultIcon,,2,"msiexec.exe" HKCR,Msi.Package\shell\Open\command,,2,"msiexec /i ""%1""" HKCR,Msi.Package\shell\Repair\command,,2,"msiexec /f ""%1""" HKCR,Msi.Package\shell\Uninstall\command,,2,"msiexec /x ""%1""" +HKCR,rtffile,,2,"Rich Text Document" HKCR,rtffile\shell\open\command,,2,"%11%\wordpad.exe %1" HKCR,rtffile\shell\print\command,,2,"%11%\wordpad.exe /p %1" +HKCR,txtfile,,2,"Text Document" HKCR,txtfile\shell\open\command,,2,"%11%\notepad.exe %1" HKCR,txtfile\shell\print\command,,2,"%11%\notepad.exe /p %1" HKCR,wrifile\shell\open\command,,2,"%11%\wordpad.exe %1" HKCR,wrifile\shell\print\command,,2,"%11%\wordpad.exe /p %1" +HKCR,xmlfile,,2,"XML Document" HKCR,xmlfile\shell\open\command,,2,"%11%\winebrowser.exe -nohome" HKCR,xmlfile\shell\open\ddeexec,,2,"""%1"",,-1,0,,,," HKCR,xmlfile\shell\open\ddeexec,"NoActivateHandler",2,"" diff --git a/tools/winemaker b/tools/winemaker index 5300e15918b..81707205bae 100755 --- a/tools/winemaker +++ b/tools/winemaker @@ -20,7 +20,7 @@ use strict; # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA # -my $version="0.7.0"; +my $version="0.7.1"; use Cwd; use File::Basename; @@ -64,6 +64,17 @@ my $OPT_ASK_YES=1; my $OPT_ASK_SKIP=-1; +# The following constants define the architecture + +## +# 32-Bit Target +my $OPT_ARCH_32=32; + +## +# 64-Bit Target +my $OPT_ARCH_64=64; + + # General options ## @@ -113,6 +124,10 @@ my $opt_target_type; my $opt_flags; ## +# Contains 32 for 32-Bit-Targets and 64 for 64-Bit-Targets +my $opt_arch; + +## # If true then winemaker should ask questions to the user as it goes # along. my $opt_is_interactive; @@ -974,7 +989,7 @@ sub source_scan_project_file($$$) } if ((@$target[$T_FLAGS] & $TF_NOMSVCRT) == 0) { push @{@$target[$T_LDFLAGS]},"-mno-cygwin"; - push @{@$target[$T_LDFLAGS]},"-m32"; + push @{@$target[$T_LDFLAGS]},"-m$opt_arch"; } push @{@$project[$P_TARGETS]},$target; @@ -1103,10 +1118,9 @@ sub source_scan_workspace_file($) s/\r\n$/\n/; # catch a project definition - if (/^Project:\s\"(.*)\"=\"?(.*)\s-/) { + if (/^Project:\s\"(.*)\"=(.*)\s-/) { $prj_name=$1; $prj_path=$2; - $prj_path=~s/\"$//; @components=split /[\/\\]+/, $prj_path; $prj_path=search_from($path, \@components); print "Name: $prj_name\nPath: $prj_path\n"; @@ -1467,7 +1481,7 @@ sub source_scan_directory($$$$) } if ((@$target[$T_FLAGS] & $TF_NOMSVCRT) == 0) { push @{@$target[$T_LDFLAGS]},"-mno-cygwin"; - push @{@$target[$T_LDFLAGS]},"-m32"; + push @{@$target[$T_LDFLAGS]},"-m$opt_arch"; } push @{@$project[$P_TARGETS]},$target; @@ -2456,6 +2470,7 @@ $opt_work_dir=undef; $opt_single_target=undef; $opt_target_type=$TT_GUIEXE; $opt_flags=0; +$opt_arch=$OPT_ARCH_32; $opt_is_interactive=$OPT_ASK_NO; $opt_ask_project_options=$OPT_ASK_NO; $opt_ask_target_options=$OPT_ASK_NO; @@ -2489,6 +2504,7 @@ sub usage() print STDERR " [-Dmacro[=defn]] [-Idir] [-Pdir] [-idll] [-Ldir] [-llibrary]\n"; print STDERR " [--nodlls] [--nomsvcrt] [--interactive] [--single-target name]\n"; print STDERR " [--generated-files|--nogenerated-files]\n"; + print STDERR " [--wine64]\n"; print STDERR " work_directory|project_file|workspace_file\n"; print STDERR "\nWinemaker is designed to recursively convert all the Windows sources found in\n"; print STDERR "the specified directory so that they can be compiled with Winelib. During this\n"; @@ -2526,6 +2542,8 @@ while (@ARGV>0) { $opt_no_generated_files=0; } elsif ($arg eq "--nogenerated-files") { $opt_no_generated_files=1; + } elsif ($arg eq "--wine64") { + $opt_arch=$OPT_ARCH_64; } elsif ($arg =~ /^-D/) { push @{$global_settings[$T_DEFINES]},$arg; } elsif ($arg =~ /^-I/) { diff --git a/tools/winemaker.man.in b/tools/winemaker.man.in index e8afb2d73a5..9ae28748119 100644 --- a/tools/winemaker.man.in +++ b/tools/winemaker.man.in @@ -1,5 +1,5 @@ .\" -*- nroff -*- -.TH WINEMAKER 1 "February 2009" "@PACKAGE_STRING@" "Wine Developers Manual" +.TH WINEMAKER 1 "May 2009" "@PACKAGE_STRING@" "Wine Developers Manual" .SH NAME winemaker \- generate a build infrastructure for compiling Windows programs on Unix .SH SYNOPSIS @@ -30,6 +30,10 @@ winemaker \- generate a build infrastructure for compiling Windows programs on U .br [ .IR "--generated-files " "] [ " "--nogenerated-files " "] +] +.br + [ +.IR "--wine64 " "] .br .IR "work_directory" "| " "project_file" "| " "workspace_file" @@ -167,6 +171,9 @@ Tells winemaker to generate the build the Makefile. This is the default. .TP .I --nogenerated-files Tells winemaker not to generate the Makefile. +.TP +.I --wine64 +Tells winemaker to generate a 64-bit Makefile. .SH EXAMPLES .PP -- 2.11.4.GIT