From: <kr_...@us...> - 2003-05-01 20:38:31
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv7327/port/src/cbits/Win32 Modified Files: Frame.c Internals.h Util.c Log Message: Make the Win32 port compatible with new GTK/GNOME port Index: Frame.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Frame.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Frame.c 25 Apr 2003 21:15:31 -0000 1.8 --- Frame.c 1 May 2003 20:38:26 -0000 1.9 *************** *** 28,31 **** --- 28,32 ---- DeleteObject(pData->hControlFont); free(pData->lpszAppName); + free(pData->lpszAppVersion); deleteMenuHandlesMap(pData->pMenuHandlesMap); free(pData); *************** *** 69,72 **** --- 70,74 ---- pData->hControlFont = hControlFont; pData->lpszAppName = NULL; + pData->lpszAppVersion = NULL; pData->pMenuHandlesMap = newMenuHandlesMap(); *************** *** 454,508 **** return result; }; - - char *osGetProcessTitle() - { - FrameData *pFrameData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); - return pFrameData->lpszAppName; - } - - void osSetProcessTitle(char *szAppName) - { - HWND hWnd; - char *s, *title; - int nTextLen; - FrameData *pFrameData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); - - pFrameData->lpszAppName = strdup(szAppName); - - hWnd = pFrameData->hClientWnd; - if (pFrameData->DocumentInterface == 2) - hWnd = (HWND) SendMessage(hWnd, WM_MDIGETACTIVE, 0, 0); - - s = NULL; - if (hWnd) - { - nTextLen = GetWindowTextLength(hWnd); - s = malloc(nTextLen+1); - if (s) GetWindowText(hWnd, s, nTextLen); - } - - if (pFrameData->lpszAppName && *pFrameData->lpszAppName) - { - if (s && *s) - { - title = malloc(strlen(pFrameData->lpszAppName)+nTextLen+6); - - if (title) - { - strcpy(title, pFrameData->lpszAppName); - strcat(title, " - ["); - strcat(title, s); - strcat(title, "]"); - SetWindowText(ghWndFrame, title); - } - - rfree(title); - } - else - SetWindowText(ghWndFrame, pFrameData->lpszAppName); - } - else - SetWindowText(ghWndFrame, s ? s : ""); - - free(s); - } --- 456,457 ---- Index: Internals.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Internals.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Internals.h 23 Apr 2003 21:58:12 -0000 1.1 --- Internals.h 1 May 2003 20:38:26 -0000 1.2 *************** *** 28,31 **** --- 28,32 ---- HFONT hControlFont; LPSTR lpszAppName; + LPSTR lpszAppVersion; MenuHandlesMap *pMenuHandlesMap; } FrameData; Index: Util.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Util.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Util.c 23 Apr 2003 21:48:54 -0000 1.12 --- Util.c 1 May 2003 20:38:26 -0000 1.13 *************** *** 50,54 **** */ ! void osInit(int DocumentInterface) { if (!ghModule) --- 50,54 ---- */ ! void osInit(char *appName, char *appVersion, int DocumentInterface) { if (!ghModule) *************** *** 130,134 **** { ghWndFrame = CreateWindow ( "HSDIFRAME", ! NULL, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT,CW_USEDEFAULT, --- 130,134 ---- { ghWndFrame = CreateWindow ( "HSDIFRAME", ! appName, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT,CW_USEDEFAULT, *************** *** 143,147 **** { ghWndFrame = CreateWindow ( "HMDIFRAME", ! NULL, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT,CW_USEDEFAULT, --- 143,147 ---- { ghWndFrame = CreateWindow ( "HMDIFRAME", ! appName, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT,CW_USEDEFAULT, *************** *** 152,155 **** --- 152,160 ---- NULL ); + } + + { // Store appVersion for future usage + FrameData *pFrameData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); + pFrameData->lpszAppVersion = strdup(appVersion); } |