early-access version 2281
This commit is contained in:
+2
-2
@@ -302,10 +302,10 @@ static BOOL voUpdate(PVODATA pVOData, HWND hwnd, SDL_Rect *pSDLRects,
|
||||
debug_os2("Not enough stack size");
|
||||
return FALSE;
|
||||
}
|
||||
memset(pbLineMask, 0, pVOData->ulHeight);
|
||||
SDL_memset(pbLineMask, 0, pVOData->ulHeight);
|
||||
|
||||
for ( ; ((LONG)cSDLRects) > 0; cSDLRects--, pSDLRects++) {
|
||||
memset(&pbLineMask[pSDLRects->y], 1, pSDLRects->h);
|
||||
SDL_memset(&pbLineMask[pSDLRects->y], 1, pSDLRects->h);
|
||||
}
|
||||
|
||||
ulRC = DiveBlitImageLines(pVOData->hDive, pVOData->ulDIVEBufNum,
|
||||
|
||||
+32
-26
@@ -57,8 +57,8 @@ static VOID _wmInitDlg(HWND hwnd, MSGBOXDLGDATA *pDlgData)
|
||||
HWND hwnd; /* Button window handle. */
|
||||
ULONG ulCX; /* Button width in dialog coordinates. */
|
||||
} aButtons[32];
|
||||
RECTL rectlItem;
|
||||
HAB hab = WinQueryAnchorBlock(hwnd);
|
||||
RECTL rectlItem;
|
||||
HAB hab = WinQueryAnchorBlock(hwnd);
|
||||
|
||||
/* --- Align the buttons to the right/bottom. --- */
|
||||
|
||||
@@ -66,10 +66,10 @@ static VOID _wmInitDlg(HWND hwnd, MSGBOXDLGDATA *pDlgData)
|
||||
hEnum = WinBeginEnumWindows(hwnd);
|
||||
|
||||
while ((hWndNext = WinGetNextWindow(hEnum)) != NULLHANDLE) {
|
||||
if (WinQueryClassName(hWndNext, sizeof(acBuf), acBuf) == 0)
|
||||
if (WinQueryClassName(hWndNext, sizeof(acBuf), acBuf) == 0) {
|
||||
continue;
|
||||
|
||||
if (strcmp(acBuf, "#3") == 0) { /* Class name of button. */
|
||||
}
|
||||
if (SDL_strcmp(acBuf, "#3") == 0) { /* Class name of button. */
|
||||
if (cButtons < sizeof(aButtons) / sizeof(struct _BUTTON)) {
|
||||
aButtons[cButtons].hwnd = hWndNext;
|
||||
cButtons++;
|
||||
@@ -92,7 +92,7 @@ static VOID _wmInitDlg(HWND hwnd, MSGBOXDLGDATA *pDlgData)
|
||||
/* Convert text size to dialog coordinates. */
|
||||
WinMapDlgPoints(hwnd, &aptText[TXTBOX_TOPRIGHT], 1, FALSE);
|
||||
/* Add vertical and horizontal space for button's frame (dialog coord.). */
|
||||
if (aptText[TXTBOX_TOPRIGHT].x < 30) {/* Minimal button width. */
|
||||
if (aptText[TXTBOX_TOPRIGHT].x < 30) { /* Minimal button width. */
|
||||
aptText[TXTBOX_TOPRIGHT].x = 30;
|
||||
} else {
|
||||
aptText[TXTBOX_TOPRIGHT].x += 4;
|
||||
@@ -176,7 +176,7 @@ static VOID _wmInitDlg(HWND hwnd, MSGBOXDLGDATA *pDlgData)
|
||||
SWP_MOVE | SWP_SIZE);
|
||||
}
|
||||
|
||||
MRESULT EXPENTRY DynDlgProc(HWND hwnd, USHORT message, MPARAM mp1, MPARAM mp2)
|
||||
static MRESULT EXPENTRY DynDlgProc(HWND hwnd, USHORT message, MPARAM mp1, MPARAM mp2)
|
||||
{
|
||||
switch (message) {
|
||||
case WM_INITDLG:
|
||||
@@ -206,9 +206,9 @@ static HWND _makeDlg(const SDL_MessageBoxData *messageboxdata)
|
||||
ULONG cSDLBtnData = messageboxdata->numbuttons;
|
||||
|
||||
PSZ pszTitle = OS2_UTF8ToSys((PSZ) messageboxdata->title);
|
||||
ULONG cbTitle = (pszTitle == NULL)? 0 : strlen(pszTitle);
|
||||
PSZ pszText = OS2_UTF8ToSys((PSZ) messageboxdata->message);
|
||||
ULONG cbText = (pszText == NULL)? 0 : strlen(pszText);
|
||||
ULONG cbTitle = (pszTitle == NULL)? 1 : (SDL_strlen(pszTitle) + 1);
|
||||
PSZ pszText = OS2_UTF8ToSys((PSZ) messageboxdata->message);
|
||||
ULONG cbText = (pszText == NULL)? 1 : (SDL_strlen(pszText) + 1);
|
||||
|
||||
PDLGTEMPLATE pTemplate;
|
||||
ULONG cbTemplate;
|
||||
@@ -218,28 +218,34 @@ static HWND _makeDlg(const SDL_MessageBoxData *messageboxdata)
|
||||
PSZ pszBtnText;
|
||||
ULONG cbBtnText;
|
||||
HWND hwnd;
|
||||
|
||||
const SDL_MessageBoxColor* pSDLColors = (messageboxdata->colorScheme == NULL)?
|
||||
NULL : messageboxdata->colorScheme->colors;
|
||||
const SDL_MessageBoxColor* pSDLColor;
|
||||
|
||||
MSGBOXDLGDATA stDlgData;
|
||||
|
||||
/* Build a dialog tamplate in memory */
|
||||
|
||||
/* Size of template (cbTemplate). */
|
||||
/* Size of template */
|
||||
cbTemplate = sizeof(DLGTEMPLATE) + ((2 + cSDLBtnData) * sizeof(DLGTITEM)) +
|
||||
sizeof(ULONG) + /* First item data - frame control data. */
|
||||
cbTitle + 1 + /* First item data - frame title + ZERO. */
|
||||
cbText + 1 + /* Second item data - ststic text + ZERO.*/
|
||||
cbTitle + /* First item data - frame title + ZERO. */
|
||||
cbText + /* Second item data - ststic text + ZERO.*/
|
||||
3; /* Third item data - system icon Id. */
|
||||
|
||||
/* Button items datas - text for buttons. */
|
||||
for (ulIdx = 0; ulIdx < cSDLBtnData; ulIdx++) {
|
||||
pszBtnText = (PSZ)pSDLBtnData[ulIdx].text;
|
||||
cbTemplate += (pszBtnText == NULL)? 1 : (strlen(pszBtnText) + 1);
|
||||
cbTemplate += (pszBtnText == NULL)? 1 : (SDL_strlen(pszBtnText) + 1);
|
||||
}
|
||||
|
||||
/* Presentation parameter space. */
|
||||
if (pSDLColors != NULL)
|
||||
cbTemplate += 26 /* PP for frame. */ + 26 /* PP for static text. */ +
|
||||
if (pSDLColors != NULL) {
|
||||
cbTemplate += 26 /* PP for frame. */ +
|
||||
26 /* PP for static text. */ +
|
||||
(48 * cSDLBtnData); /* PP for buttons. */
|
||||
}
|
||||
|
||||
/* Allocate memory for the dialog template. */
|
||||
pTemplate = (PDLGTEMPLATE) SDL_malloc(cbTemplate);
|
||||
@@ -268,11 +274,11 @@ static HWND _makeDlg(const SDL_MessageBoxData *messageboxdata)
|
||||
pDlgItem->cchClassName = 0;
|
||||
pDlgItem->offClassName = (USHORT)WC_FRAME;
|
||||
/* Length of text. */
|
||||
pDlgItem->cchText = cbTitle + 1; /* +1 - trailing ZERO. */
|
||||
pDlgItem->cchText = cbTitle;
|
||||
pDlgItem->offText = pcDlgData - (PCHAR)pTemplate; /* Offset to title text. */
|
||||
/* Copy text for the title into the dialog template. */
|
||||
if (pszTitle != NULL) {
|
||||
strcpy(pcDlgData, pszTitle);
|
||||
SDL_memcpy(pcDlgData, pszTitle, cbTitle);
|
||||
} else {
|
||||
*pcDlgData = '\0';
|
||||
}
|
||||
@@ -322,13 +328,13 @@ static HWND _makeDlg(const SDL_MessageBoxData *messageboxdata)
|
||||
pDlgItem->cchClassName = 0;
|
||||
pDlgItem->offClassName = (USHORT)WC_STATIC;
|
||||
|
||||
pDlgItem->cchText = cbText + 1;
|
||||
pDlgItem->cchText = cbText;
|
||||
pDlgItem->offText = pcDlgData - (PCHAR)pTemplate; /* Offset to the text. */
|
||||
/* Copy message text into the dialog template. */
|
||||
if (pszText != NULL) {
|
||||
strcpy(pcDlgData, pszText);
|
||||
SDL_memcpy(pcDlgData, pszText, cbText);
|
||||
} else {
|
||||
*pcDlgData = '\0';
|
||||
*pcDlgData = '\0';
|
||||
}
|
||||
pcDlgData += pDlgItem->cchText;
|
||||
|
||||
@@ -339,7 +345,7 @@ static HWND _makeDlg(const SDL_MessageBoxData *messageboxdata)
|
||||
pDlgItem->cx = 147;
|
||||
pDlgItem->cy = 62; /* It will be used. */
|
||||
|
||||
pDlgItem->id = IDD_TEXT_MESSAGE; /* an ID value */
|
||||
pDlgItem->id = IDD_TEXT_MESSAGE; /* an ID value */
|
||||
if (pSDLColors == NULL)
|
||||
pDlgItem->offPresParams = 0;
|
||||
else {
|
||||
@@ -401,12 +407,12 @@ static HWND _makeDlg(const SDL_MessageBoxData *messageboxdata)
|
||||
pDlgItem->offClassName = (USHORT)WC_BUTTON;
|
||||
|
||||
pszBtnText = OS2_UTF8ToSys((PSZ)pSDLBtnData[ulIdx].text);
|
||||
cbBtnText = (pszBtnText == NULL)? 0 : strlen(pszBtnText);
|
||||
pDlgItem->cchText = cbBtnText + 1;
|
||||
cbBtnText = (pszBtnText == NULL)? 1 : (SDL_strlen(pszBtnText) + 1);
|
||||
pDlgItem->cchText = cbBtnText;
|
||||
pDlgItem->offText = pcDlgData - (PCHAR)pTemplate; /* Offset to the text. */
|
||||
/* Copy text for the button into the dialog template. */
|
||||
if (pszBtnText != NULL) {
|
||||
strcpy(pcDlgData, pszBtnText);
|
||||
SDL_memcpy(pcDlgData, pszBtnText, cbBtnText);
|
||||
} else {
|
||||
*pcDlgData = '\0';
|
||||
}
|
||||
@@ -430,7 +436,7 @@ static HWND _makeDlg(const SDL_MessageBoxData *messageboxdata)
|
||||
|
||||
pDlgItem->id = IDD_PB_FIRST + ulIdx; /* an ID value */
|
||||
if (pSDLColors == NULL)
|
||||
pDlgItem->offPresParams = 0;
|
||||
pDlgItem->offPresParams = 0;
|
||||
else {
|
||||
/* Presentation parameter for the button - dialog colors. */
|
||||
pDlgItem->offPresParams = pcDlgData - (PCHAR)pTemplate;
|
||||
|
||||
+10
-10
@@ -133,7 +133,7 @@ static BOOL _getSDLPixelFormatData(SDL_PixelFormat *pSDLPixelFormat,
|
||||
|
||||
default:
|
||||
/* printf("Unknown color encoding: %.4s\n", fccColorEncoding);*/
|
||||
memset(pSDLPixelFormat, 0, sizeof(SDL_PixelFormat));
|
||||
SDL_memset(pSDLPixelFormat, 0, sizeof(SDL_PixelFormat));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -403,7 +403,7 @@ static MRESULT _wmDrop(WINDATA *pWinData, PDRAGINFO pDragInfo)
|
||||
pDragItem->hstrSourceName != NULLHANDLE) {
|
||||
/* Get file name from the item. */
|
||||
DrgQueryStrName(pDragItem->hstrContainerName, sizeof(acFName), acFName);
|
||||
pcFName = strchr(acFName, '\0');
|
||||
pcFName = SDL_strchr(acFName, '\0');
|
||||
DrgQueryStrName(pDragItem->hstrSourceName,
|
||||
sizeof(acFName) - (pcFName - acFName), pcFName);
|
||||
|
||||
@@ -428,7 +428,7 @@ static MRESULT _wmDrop(WINDATA *pWinData, PDRAGINFO pDragInfo)
|
||||
return (MRESULT)FALSE;
|
||||
}
|
||||
|
||||
MRESULT EXPENTRY wndFrameProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
||||
static MRESULT EXPENTRY wndFrameProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
||||
{
|
||||
HWND hwndClient = WinQueryWindow(hwnd, QW_BOTTOM);
|
||||
WINDATA * pWinData = (WINDATA *)WinQueryWindowULong(hwndClient, 0);
|
||||
@@ -535,7 +535,7 @@ MRESULT EXPENTRY wndFrameProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
||||
return pWinData->fnWndFrameProc(hwnd, msg, mp1, mp2);
|
||||
}
|
||||
|
||||
MRESULT EXPENTRY wndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
||||
static MRESULT EXPENTRY wndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
||||
{
|
||||
WINDATA *pWinData = (WINDATA *)WinQueryWindowULong(hwnd, 0);
|
||||
|
||||
@@ -589,7 +589,7 @@ MRESULT EXPENTRY wndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
||||
WinQueryPointerPos(HWND_DESKTOP, &pointl);
|
||||
WinMapWindowPoints(HWND_DESKTOP, pWinData->hwnd, &pointl, 1);
|
||||
SDL_SendMouseMotion(pWinData->window, 0, 0,
|
||||
pointl.x, pWinData->window->h - pointl.y - 1);
|
||||
pointl.x, pWinData->window->h - pointl.y - 1);
|
||||
} else {
|
||||
if (SDL_GetKeyboardFocus() == pWinData->window)
|
||||
SDL_SetKeyboardFocus(NULL);
|
||||
@@ -691,7 +691,7 @@ MRESULT EXPENTRY wndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
||||
}
|
||||
|
||||
|
||||
/* SDL routnes.
|
||||
/* SDL routines.
|
||||
* ------------
|
||||
*/
|
||||
|
||||
@@ -1343,9 +1343,9 @@ static int OS2_SetClipboardText(_THIS, const char *text)
|
||||
debug_os2("Enter");
|
||||
if (pszText == NULL)
|
||||
return -1;
|
||||
cbText = SDL_strlen(pszText);
|
||||
cbText = SDL_strlen(pszText) + 1;
|
||||
|
||||
ulRC = DosAllocSharedMem((PPVOID)&pszClipboard, 0, cbText + 1,
|
||||
ulRC = DosAllocSharedMem((PPVOID)&pszClipboard, 0, cbText,
|
||||
PAG_COMMIT | PAG_READ | PAG_WRITE |
|
||||
OBJ_GIVEABLE | OBJ_GETTABLE | OBJ_TILE);
|
||||
if (ulRC != NO_ERROR) {
|
||||
@@ -1354,7 +1354,7 @@ static int OS2_SetClipboardText(_THIS, const char *text)
|
||||
return -1;
|
||||
}
|
||||
|
||||
strcpy(pszClipboard, pszText);
|
||||
SDL_memcpy(pszClipboard, pszText, cbText);
|
||||
SDL_free(pszText);
|
||||
|
||||
if (!WinOpenClipbrd(pVData->hab)) {
|
||||
@@ -1444,7 +1444,7 @@ static int OS2_VideoInit(_THIS)
|
||||
return SDL_SetError("Window class not successfully registered.");
|
||||
}
|
||||
|
||||
if (stricmp(_this->name, OS2DRIVER_NAME_VMAN) == 0)
|
||||
if (SDL_strcasecmp(_this->name, OS2DRIVER_NAME_VMAN) == 0)
|
||||
pVData->pOutput = &voVMan;
|
||||
else
|
||||
pVData->pOutput = &voDive;
|
||||
|
||||
+1
-1
@@ -78,7 +78,7 @@ static HMODULE hmodVMan = NULLHANDLE;
|
||||
static FNVMIENTRY *pfnVMIEntry = NULL;
|
||||
static ULONG ulVRAMAddress = 0;
|
||||
|
||||
VOID APIENTRY ExitVMan(VOID)
|
||||
static VOID APIENTRY ExitVMan(VOID)
|
||||
{
|
||||
if (ulVRAMAddress != 0 && hmodVMan != NULLHANDLE) {
|
||||
pfnVMIEntry(0, VMI_CMD_TERMPROC, NULL, NULL);
|
||||
|
||||
Reference in New Issue
Block a user