Ignore:
Timestamp:
Nov 19, 2000, 12:51:48 PM (25 years ago)
Author:
sandervl
Message:

Resynched with Christoph's changes for unicode handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/comctl32/animate.c

    r4611 r4627  
    2222#include "services.h"
    2323#include "debugtools.h"
     24#ifdef __WIN32OS2__
     25#include "ccbase.h"
     26#endif
    2427
    2528DEFAULT_DEBUG_CHANNEL(animate);
     
    4043
    4144    HMMIO (* WINAPI fnmmioOpenA)(LPSTR,MMIOINFO*,DWORD);
     45    HMMIO (* WINAPI fnmmioOpenW)(LPSTR,MMIOINFO*,DWORD);
    4246    MMRESULT (* WINAPI fnmmioClose)(HMMIO,UINT);
    4347    UINT  (* WINAPI fnmmioAscend)(HMMIO,MMCKINFO*,UINT);
     
    100104}
    101105
     106#ifdef __WIN32OS2__
     107static BOOL ANIMATE_LoadRes(ANIMATE_INFO *infoPtr,HINSTANCE hInst,LPWSTR lpName,BOOL unicode)
     108#else
    102109static BOOL ANIMATE_LoadResA(ANIMATE_INFO *infoPtr, HINSTANCE hInst, LPSTR lpName)
     110#endif
    103111{
    104112    HRSRC   hrsrc;
     
    106114    LPVOID  lpAvi;
    107115
     116#ifdef __WIN32OS2__
     117    if (unicode)
     118      hrsrc = FindResourceW(hInst,lpName,(LPWSTR)L"AVI");
     119    else
     120      hrsrc = FindResourceA(hInst,(LPCSTR)lpName,"AVI");
     121#else
    108122    hrsrc = FindResourceA(hInst, lpName, "AVI");
     123#endif
    109124    if (!hrsrc)
    110125    return FALSE;
     
    133148
    134149
     150#ifdef __WIN32OS2__
     151static BOOL ANIMATE_LoadFile(ANIMATE_INFO *infoPtr,LPWSTR lpName,BOOL unicode)
     152#else
    135153static BOOL ANIMATE_LoadFileA(ANIMATE_INFO *infoPtr, LPSTR lpName)
    136 {
     154#endif
     155{
     156#ifdef __WIN32OS2__
     157    if (unicode)
     158      infoPtr->hMMio = infoPtr->fnmmioOpenW(lpName,NULL,MMIO_ALLOCBUF | MMIO_READ | MMIO_DENYWRITE);
     159    else
     160      infoPtr->hMMio = infoPtr->fnmmioOpenA((LPSTR)lpName,NULL,MMIO_ALLOCBUF | MMIO_READ | MMIO_DENYWRITE);
     161#else
    137162    infoPtr->hMMio = infoPtr->fnmmioOpenA((LPSTR)lpName, NULL,
    138163                   MMIO_ALLOCBUF | MMIO_READ | MMIO_DENYWRITE);
     164#endif
    139165
    140166    if (!infoPtr->hMMio)
     
    684710}
    685711
     712#ifdef __WIN32OS2__
     713static LRESULT ANIMATE_Open(HWND hWnd, WPARAM wParam, LPARAM lParam,BOOL unicode)
     714#else
    686715static LRESULT ANIMATE_OpenA(HWND hWnd, WPARAM wParam, LPARAM lParam)
     716#endif
    687717{
    688718    ANIMATE_INFO *infoPtr = ANIMATE_GetInfoPtr(hWnd);
     
    702732    TRACE("(\"%s\");\n", (LPSTR)lParam);
    703733
     734#ifdef __WIN32OS2__
     735    if (HIWORD(lParam)) {
     736        //TRACE("(\"%s\");\n", (LPSTR)lParam);
     737
     738        if (!ANIMATE_LoadRes(infoPtr, hInstance, (LPWSTR)lParam,unicode)) {
     739            //TRACE("No AVI resource found!\n");
     740            if (!ANIMATE_LoadFile(infoPtr, (LPWSTR)lParam,unicode)) {
     741                //WARN("No AVI file found!\n");
     742                return FALSE;
     743            }
     744        }
     745    } else {
     746        //TRACE("(%u);\n", (WORD)LOWORD(lParam));
     747
     748        if (!ANIMATE_LoadRes(infoPtr,hInstance,unicode ? MAKEINTRESOURCEW((INT)lParam):(LPWSTR)MAKEINTRESOURCEA((INT)lParam),unicode)) {
     749            //WARN("No AVI resource found!\n");
     750            return FALSE;
     751        }
     752    }
     753#else
    704754    if (!ANIMATE_LoadResA(infoPtr, hInstance, (LPSTR)lParam)) {
    705755        TRACE("No AVI resource found!\n");
     
    717767        return FALSE;
    718768    }
     769#endif
    719770    }
    720771
     
    790841
    791842    infoPtr->fnmmioOpenA = (void*)GetProcAddress(hModWinmm, "mmioOpenA");
     843#ifdef __WIN32OS2__
     844    infoPtr->fnmmioOpenW = (void*)GetProcAddress(hModWinmm, "mmioOpenW");
     845#endif
    792846    infoPtr->fnmmioClose = (void*)GetProcAddress(hModWinmm, "mmioClose");
    793847    infoPtr->fnmmioAscend = (void*)GetProcAddress(hModWinmm, "mmioAscend");
     
    850904    switch (uMsg)
    851905    {
     906#ifdef __WIN32OS2__
     907        case ACM_OPENA:
     908          return ANIMATE_Open(hWnd,wParam,lParam,FALSE);
     909
     910        case ACM_OPENW:
     911          return ANIMATE_Open(hWnd,wParam,lParam,TRUE);
     912#else
    852913    case ACM_OPENA:
    853914    return ANIMATE_OpenA(hWnd, wParam, lParam);
     
    855916    /*  case ACM_OPEN32W: FIXME!! */
    856917    /*      return ANIMATE_Open32W(hWnd, wParam, lParam); */
     918#endif
    857919
    858920    case ACM_PLAY:
     
    932994        ERR("unknown msg %04x wp=%08x lp=%08lx\n", uMsg, wParam, lParam);
    933995
     996#ifdef __WIN32OS2__
     997            return defComCtl32ProcA (hWnd, uMsg, wParam, lParam);
     998#else
    934999    return DefWindowProcA(hWnd, uMsg, wParam, lParam);
     1000#endif
    9351001    }
    9361002    return 0;
Note: See TracChangeset for help on using the changeset viewer.