Ignore:
Timestamp:
Dec 18, 2011, 10:28:22 PM (14 years ago)
Author:
dmik
Message:

Merge branch gcc-kmk to trunk.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1 bin
        2 Makefile.inc
         1env.cmd
         2LocalConfig.kmk
    • Property svn:mergeinfo set to
      /branches/gcc-kmkmergedeligible
  • trunk/src/comdlg32/filedlg.c

    r9522 r21916  
    2222
    2323#ifdef __WIN32OS2__
    24 #include <win\cursoricon.h>
     24#include <win/cursoricon.h>
    2525#include <heapstring.h>
    2626
     
    4242
    4343#define BUFFILE 512
    44 #define BUFFILEALLOC 512 * sizeof(WCHAR)   
    45 
    46 struct FSPRIVATE 
     44#define BUFFILEALLOC 512 * sizeof(WCHAR)
     45
     46struct FSPRIVATE
    4747{
    4848    HWND hwnd; /* file dialog window handle */
     
    7575#define LFS32A 2
    7676#define LFS32W 3
    77  
     77
    7878static const WCHAR FILE_star[] = {'*','.','*', 0};
    7979static const WCHAR FILE_bslash[] = {'\\', 0};
     
    125125    static BOOL initialized = 0;
    126126    CURSORICONINFO *fldrInfo;
    127    
     127
    128128    if (!initialized) {
    129129#ifdef __WIN32OS2__
     
    148148        hNet     = LoadImageA( inst, "NETWORK", IMAGE_ICON, 16, 16, LR_SHARED );
    149149#endif
    150         if (hFolder == 0 || hFolder2 == 0 || hFloppy == 0 || 
     150        if (hFolder == 0 || hFolder2 == 0 || hFloppy == 0 ||
    151151            hHDisk == 0 || hCDRom == 0 || hNet == 0)
    152152        {
     
    160160        fldrInfo = (CURSORICONINFO *) GlobalLock16( hFolder2 );
    161161        if (!fldrInfo)
    162         {       
     162        {
    163163            ERR("Error measuring icons !\n");
    164164            return FALSE;
     
    219219    } else { /* get it from internal Wine resource */
    220220        HANDLE hResInfo;
    221         if (!(hResInfo = FindResourceA(COMMDLG_hInstance32, 
     221        if (!(hResInfo = FindResourceA(COMMDLG_hInstance32,
    222222             lfs->open? "OPEN_FILE":"SAVE_FILE", RT_DIALOGA)))
    223223        {
     
    274274        DWORD size;
    275275
    276         if (!(hResInfo = FindResourceA(COMMDLG_hInstance32, 
     276        if (!(hResInfo = FindResourceA(COMMDLG_hInstance32,
    277277               lfs->open ? "OPEN_FILE":"SAVE_FILE", RT_DIALOGA)))
    278278        {
     
    424424  i = 0;
    425425  if (cfptr)
    426     for ( ;(n = lstrlenW(cfptr)) != 0; i++) 
     426    for ( ;(n = lstrlenW(cfptr)) != 0; i++)
    427427      {
    428428        cfptr += n + 1;
     
    432432      }
    433433  if (fptr)
    434     for ( ;(n = lstrlenW(fptr)) != 0; i++) 
     434    for ( ;(n = lstrlenW(fptr)) != 0; i++)
    435435      {
    436436        fptr += n + 1;
     
    455455    {
    456456        if (!(str = HeapAlloc(GetProcessHeap(), 0, BUFFILEALLOC))) return FALSE;
    457         SendMessageW(lpdis->hwndItem, LB_GETTEXT, lpdis->itemID, 
     457        SendMessageW(lpdis->hwndItem, LB_GETTEXT, lpdis->itemID,
    458458                      (LPARAM)str);
    459459
     
    486486        if (!(str = HeapAlloc(GetProcessHeap(), 0, BUFFILEALLOC)))
    487487            return FALSE;
    488         SendMessageW(lpdis->hwndItem, LB_GETTEXT, lpdis->itemID, 
     488        SendMessageW(lpdis->hwndItem, LB_GETTEXT, lpdis->itemID,
    489489                      (LPARAM)str);
    490490
     
    515515        if (!(str = HeapAlloc(GetProcessHeap(), 0, BUFFILEALLOC)))
    516516            return FALSE;
    517         SendMessageW(lpdis->hwndItem, CB_GETLBTEXT, lpdis->itemID, 
     517        SendMessageW(lpdis->hwndItem, CB_GETLBTEXT, lpdis->itemID,
    518518                      (LPARAM)str);
    519519        root[0] += str[2] - 'a';
     
    550550 *                              FILEDLG_WMMeasureItem           [internal]
    551551 */
    552 static LONG FILEDLG_WMMeasureItem(HWND hWnd, WPARAM wParam, LPARAM lParam) 
     552static LONG FILEDLG_WMMeasureItem(HWND hWnd, WPARAM wParam, LPARAM lParam)
    553553{
    554554    LPMEASUREITEMSTRUCT lpmeasure;
    555    
     555
    556556    lpmeasure = (LPMEASUREITEMSTRUCT)lParam;
    557557    lpmeasure->itemHeight = fldrHeight;
     
    562562 */
    563563#ifdef __WIN32OS2__
    564 static LONG FILEDLG_WMMeasureItem16(HWND hWnd, WPARAM wParam, LPARAM lParam) 
     564static LONG FILEDLG_WMMeasureItem16(HWND hWnd, WPARAM wParam, LPARAM lParam)
    565565{
    566566    LPMEASUREITEMSTRUCT lpmeasure;
    567    
     567
    568568    lpmeasure = (LPMEASUREITEMSTRUCT)lParam;
    569569    lpmeasure->itemHeight = fldrHeight;
     
    571571}
    572572#else
    573 static LONG FILEDLG_WMMeasureItem16(HWND16 hWnd, WPARAM16 wParam, LPARAM lParam) 
     573static LONG FILEDLG_WMMeasureItem16(HWND16 hWnd, WPARAM16 wParam, LPARAM lParam)
    574574{
    575575    LPMEASUREITEMSTRUCT16 lpmeasure;
    576    
     576
    577577    lpmeasure = MapSL(lParam);
    578578    lpmeasure->itemHeight = fldrHeight;
     
    641641  if (ofn->nFilterIndex == 0 && ofn->lpstrCustomFilter == NULL)
    642642        ofn->nFilterIndex = 1;
    643   SendDlgItemMessageW(hWnd, cmb1, CB_SETCURSEL, ofn->nFilterIndex - 1, 0);   
     643  SendDlgItemMessageW(hWnd, cmb1, CB_SETCURSEL, ofn->nFilterIndex - 1, 0);
    644644  lstrcpynW(tmpstr, FILEDLG_GetFileType(ofn->lpstrCustomFilter,
    645645             (LPWSTR)ofn->lpstrFilter, ofn->nFilterIndex - 1),BUFFILE);
    646   TRACE("nFilterIndex = %ld, SetText of edt1 to '%s'\n", 
     646  TRACE("nFilterIndex = %ld, SetText of edt1 to '%s'\n",
    647647                        ofn->nFilterIndex, debugstr_w(tmpstr));
    648648  SetDlgItemTextW( hWnd, edt1, tmpstr );
     
    651651  DlgDirListComboBoxW(hWnd, tmpstr, cmb2, 0, DDL_DRIVES | DDL_EXCLUSIVE);
    652652  /* read initial directory */
    653   if (ofn->lpstrInitialDir != NULL) 
     653  if (ofn->lpstrInitialDir != NULL)
    654654    {
    655655      int len;
     
    720720/***********************************************************************
    721721 *                              FILEDLG_UpdateResult            [internal]
    722  *      update the displayed file name (with path) 
     722 *      update the displayed file name (with path)
    723723 */
    724724void FILEDLG_UpdateResult(LFSPRIVATE lfs, WCHAR *tmpstr)
     
    779779/***********************************************************************
    780780 *                              FILEDLG_UpdateFileTitle         [internal]
    781  *      update the displayed file name (without path) 
     781 *      update the displayed file name (without path)
    782782 */
    783783void FILEDLG_UpdateFileTitle(LFSPRIVATE lfs)
     
    785785  LONG lRet;
    786786  LPOPENFILENAMEW ofnW = lfs->ofnW;
    787   if (ofnW->lpstrFileTitle != NULL) 
     787  if (ofnW->lpstrFileTitle != NULL)
    788788  {
    789789    lRet = SendDlgItemMessageW(lfs->hwnd, lst1, LB_GETCURSEL, 0, 0);
     
    997997        lRet = (BOOL)FILEDLG_CallWindowProc(lfs, lfs->fileokstring,
    998998                  0, lfs->lParam );
    999         if (lRet)       
     999        if (lRet)
    10001000        {
    10011001            *ofnW = ofnsav; /* restore old state */
     
    10351035                         (LPARAM)pstr);
    10361036    wsprintfW(diskname, FILE_specc, pstr[2]);
    1037     HeapFree(GetProcessHeap(), 0, pstr);   
     1037    HeapFree(GetProcessHeap(), 0, pstr);
    10381038
    10391039    return FILEDLG_Validate( lfs, diskname, cmb2, lRet, TRUE );
     
    10671067 */
    10681068static LRESULT FILEDLG_WMCommand(HWND hWnd, LPARAM lParam, UINT notification,
    1069        UINT control, LFSPRIVATE lfs ) 
     1069       UINT control, LFSPRIVATE lfs )
    10701070{
    10711071    switch (control)
     
    10901090
    10911091        case cmb1: /* file type drop list */
    1092         if (notification == CBN_SELCHANGE) 
     1092        if (notification == CBN_SELCHANGE)
    10931093            return FILEDLG_FileTypeChange( lfs );
    10941094        break;
     
    12151215    if (ofnA->lpstrTitle)
    12161216        str = ofnA->lpstrTitle;
    1217     else 
     1217    else
    12181218        /* Allocates default title (FIXME : get it from resource) */
    12191219        str = open ? defaultopen:defaultsave;
     
    12721272/************************************************************************
    12731273 *                              FILEDLG_DestroyPrivate            [internal]
    1274  *      destroys the private object 
     1274 *      destroys the private object
    12751275 */
    12761276void FILEDLG_DestroyPrivate(LFSPRIVATE lfs)
     
    13111311/************************************************************************
    13121312 *                              FILEDLG_AllocPrivate            [internal]
    1313  *      allocate a private object to hold 32 bits Unicode 
     1313 *      allocate a private object to hold 32 bits Unicode
    13141314 *      structure that will be used throughtout the calls, while
    13151315 *      keeping available the original structures and a few variables
     
    13691369                FILEDLG_MapOfnStructA(lfs->ofnA, lfs->ofnW, lfs->open);
    13701370        }
    1371         else 
     1371        else
    13721372            ret = NULL;
    13731373    }
     
    13901390 * Creates a win31 style dialog box for the user to select a file to open/save.
    13911391 */
    1392 BOOL WINAPI GetFileName31A( 
     1392BOOL WINAPI GetFileName31A(
    13931393                           LPOPENFILENAMEA lpofn, /* addess of structure with data*/
    13941394                           UINT dlgType /* type dialogue : open/save */
     
    14051405    {
    14061406        hInst = GetWindowLongA( lpofn->hwndOwner, GWL_HINSTANCE );
    1407         bRet = DialogBoxIndirectParamA( hInst, lfs->template, lpofn->hwndOwner, 
     1407        bRet = DialogBoxIndirectParamA( hInst, lfs->template, lpofn->hwndOwner,
    14081408             (DLGPROC) FileOpenDlgProc, (DWORD) lfs);
    14091409        FILEDLG_DestroyPrivate(lfs);
     
    14201420 * Creates a win31 style dialog box for the user to select a file to open/save
    14211421 */
    1422 BOOL WINAPI GetFileName31W( 
     1422BOOL WINAPI GetFileName31W(
    14231423                           LPOPENFILENAMEW lpofn, /* addess of structure with data*/
    14241424                           UINT dlgType /* type dialogue : open/save */
     
    14351435    {
    14361436        hInst = GetWindowLongA( lpofn->hwndOwner, GWL_HINSTANCE );
    1437         bRet = DialogBoxIndirectParamW( hInst, lfs->template, lpofn->hwndOwner, 
     1437        bRet = DialogBoxIndirectParamW( hInst, lfs->template, lpofn->hwndOwner,
    14381438             (DLGPROC) FileOpenDlgProc, (DWORD) lfs);
    14391439        FILEDLG_DestroyPrivate(lfs);
     
    14531453LRESULT WINAPI FileOpenDlgProc16(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam,
    14541454                               LPARAM lParam)
    1455 { 
     1455{
    14561456    LFSPRIVATE lfs = (LFSPRIVATE)GetPropA(hWnd,OFN_PROP);
    14571457    DRAWITEMSTRUCT dis;
    1458  
     1458
    14591459    TRACE("msg=%x wparam=%x lParam=%lx\n", wMsg, wParam, lParam);
    14601460    if ((wMsg != WM_INITDIALOG) && lfs && lfs->hook)
    14611461        {
    14621462            LRESULT lRet = (BOOL16)FILEDLG_CallWindowProc(lfs, wMsg, wParam, lParam);
    1463             if (lRet)   
     1463            if (lRet)
    14641464                return lRet;         /* else continue message processing */
    14651465        }
     
    15101510   LRESULT  lRet;
    15111511   lRet = (BOOL16)FILEDLG_CallWindowProc(lfs, wMsg, wParam, lParam);
    1512    if (lRet)   
     1512   if (lRet)
    15131513    return lRet;         /* else continue message processing */
    1514   }             
     1514  }
    15151515  switch (wMsg) {
    15161516   case WM_INITDIALOG:
    15171517      return FILEDLG_WMInitDialog(hWnd, wParam, lParam);
    1518      
     1518
    15191519   case WM_MEASUREITEM:
    15201520      return FILEDLG_WMMeasureItem16(hWnd, wParam, lParam);
    1521    
     1521
    15221522   case WM_DRAWITEM:
    15231523      FILEDLG_MapDrawItemStruct(MapSL(lParam), &dis);
     
    15271527      return FILEDLG_WMCommand(hWnd, lParam, HIWORD(lParam), wParam, lfs);
    15281528  }
    1529  
     1529
    15301530  /*
    15311531  case WM_CTLCOLOR:
     
    15411541   }
    15421542   return FALSE;
    1543    
     1543
    15441544   */
    15451545  return FALSE;
     
    15491549/***********************************************************************
    15501550 *           FileOpenDlgProc                                    [internal]
    1551  *      Used for open and save, in fact.   
     1551 *      Used for open and save, in fact.
    15521552 */
    15531553static LRESULT WINAPI FileOpenDlgProc(HWND hWnd, UINT wMsg,
     
    15611561            LRESULT lRet;
    15621562            lRet  = (BOOL)FILEDLG_CallWindowProc(lfs, wMsg, wParam, lParam);
    1563             if (lRet)   
     1563            if (lRet)
    15641564                return lRet;         /* else continue message processing */
    15651565        }
     
    15951595}
    15961596
    1597 /* ------------------ APIs ---------------------- */ 
     1597/* ------------------ APIs ---------------------- */
    15981598#ifndef __WIN32OS2__
    15991599/***********************************************************************
     
    16091609 *    unknown, there are some FIXME's left.
    16101610 */
    1611 BOOL16 WINAPI GetOpenFileName16( 
     1611BOOL16 WINAPI GetOpenFileName16(
    16121612                                SEGPTR ofn /* [in/out] address of structure with data*/
    16131613                                )
     
    16261626        hInst = GetWindowLongA( lpofn->hwndOwner, GWL_HINSTANCE );
    16271627        ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (LPCSTR) 6);
    1628         bRet = DialogBoxIndirectParam16( hInst, lfs->hDlgTmpl16, lpofn->hwndOwner, 
     1628        bRet = DialogBoxIndirectParam16( hInst, lfs->hDlgTmpl16, lpofn->hwndOwner,
    16291629             (DLGPROC16) ptr, (DWORD) lfs);
    16301630        FILEDLG_DestroyPrivate(lfs);
     
    16471647 *    unknown. There are some FIXME's left.
    16481648 */
    1649 BOOL16 WINAPI GetSaveFileName16( 
     1649BOOL16 WINAPI GetSaveFileName16(
    16501650                                SEGPTR ofn /* [in/out] addess of structure with data*/
    16511651                                )
     
    16641664        hInst = GetWindowLongA( lpofn->hwndOwner, GWL_HINSTANCE );
    16651665        ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (LPCSTR) 7);
    1666         bRet = DialogBoxIndirectParam16( hInst, lfs->hDlgTmpl16, lpofn->hwndOwner, 
     1666        bRet = DialogBoxIndirectParam16( hInst, lfs->hDlgTmpl16, lpofn->hwndOwner,
    16671667             (DLGPROC16) ptr, (DWORD) lfs);
    16681668        FILEDLG_DestroyPrivate(lfs);
    1669     } 
     1669    }
    16701670
    16711671    TRACE("return lpstrFile='%s' !\n", (char *)MapSL(lpofn->lpstrFile));
     
    17751775    {
    17761776        return GetFileDialog95A(ofn, SAVE_DIALOG);
    1777     } 
     1777    }
    17781778    else
    17791779    {
     
    18111811    {
    18121812        return GetFileDialog95W(ofn, SAVE_DIALOG);
    1813     } 
     1813    }
    18141814    else
    18151815    {
Note: See TracChangeset for help on using the changeset viewer.