Ignore:
Timestamp:
Aug 14, 1999, 6:13:16 PM (26 years ago)
Author:
cbratschi
Message:

wine-990731 update

File:
1 edited

Legend:

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

    r94 r496  
    1 /* $Id: animate.c,v 1.3 1999-06-10 16:21:57 achimha Exp $ */
     1/* $Id: animate.c,v 1.4 1999-08-14 16:13:09 cbratschi Exp $ */
    22/*
    33 * Animation control
     
    3434    hrsrc = FindResourceA (hInst, lpName, "AVI");
    3535    if (!hrsrc)
    36         return FALSE;
     36        return FALSE;
    3737
    3838    handle = LoadResource (hInst, hrsrc);
    3939    if (!handle)
    40         return FALSE;
     40        return FALSE;
    4141
    4242    infoPtr->lpAvi = LockResource (handle);
    4343    if (!infoPtr->lpAvi)
    44         return FALSE;
     44        return FALSE;
    4545
    4646    return TRUE;
     
    5454
    5555    infoPtr->hFile =
    56         CreateFileA (lpName, GENERIC_READ, 0, NULL, OPEN_EXISTING,
    57                        FILE_ATTRIBUTE_NORMAL, 0);
     56        CreateFileA (lpName, GENERIC_READ, 0, NULL, OPEN_EXISTING,
     57                       FILE_ATTRIBUTE_NORMAL, 0);
    5858    if (!infoPtr->hFile)
    59         return FALSE;
     59        return FALSE;
    6060
    6161    handle =
    62         CreateFileMappingA (infoPtr->hFile, NULL, PAGE_READONLY | SEC_COMMIT,
    63                               0, 0, NULL);
     62        CreateFileMappingA (infoPtr->hFile, NULL, PAGE_READONLY | SEC_COMMIT,
     63                              0, 0, NULL);
    6464    if (!handle) {
    65         CloseHandle (infoPtr->hFile);
    66         infoPtr->hFile = 0;
    67         return FALSE;
     65        CloseHandle (infoPtr->hFile);
     66        infoPtr->hFile = 0;
     67        return FALSE;
    6868    }
    6969
    7070    infoPtr->lpAvi = MapViewOfFile (handle, FILE_MAP_READ, 0, 0, 0);
    7171    if (!infoPtr->lpAvi) {
    72         CloseHandle (infoPtr->hFile);
    73         infoPtr->hFile = 0;
    74         return FALSE;
     72        CloseHandle (infoPtr->hFile);
     73        infoPtr->hFile = 0;
     74        return FALSE;
    7575    }
    7676
     
    8383{
    8484    if (infoPtr->hFile) {
    85         UnmapViewOfFile (infoPtr->lpAvi);
    86         CloseHandle (infoPtr->hFile);
    87         infoPtr->lpAvi = NULL;
     85        UnmapViewOfFile (infoPtr->lpAvi);
     86        CloseHandle (infoPtr->hFile);
     87        infoPtr->lpAvi = NULL;
    8888    }
    8989    else {
    90         GlobalFree ((HGLOBAL)infoPtr->lpAvi);
    91         infoPtr->lpAvi = NULL;
     90        GlobalFree ((HGLOBAL)infoPtr->lpAvi);
     91        infoPtr->lpAvi = NULL;
    9292    }
    9393}
     
    111111
    112112    if (!lParam) {
    113 //      TRACE (animate, "closing avi!\n");
    114         return TRUE;
    115     }
    116    
     113//      TRACE (animate, "closing avi!\n");
     114        return TRUE;
     115    }
     116
    117117    if (HIWORD(lParam)) {
    118 //      FIXME (animate, "(\"%s\") empty stub!\n", (LPSTR)lParam);
    119 
    120         if (ANIMATE_LoadResA (infoPtr, hInstance, (LPSTR)lParam)) {
    121 
    122 //          FIXME (animate, "AVI resource found!\n");
    123 
    124         }
    125         else {
    126 //          FIXME (animate, "No AVI resource found!\n");
    127             if (ANIMATE_LoadFileA (infoPtr, (LPSTR)lParam)) {
    128 //              FIXME (animate, "AVI file found!\n");
    129             }
    130             else {
    131 //              FIXME (animate, "No AVI file found!\n");
    132                 return FALSE;
    133             }
    134         }
     118//      FIXME (animate, "(\"%s\") empty stub!\n", (LPSTR)lParam);
     119
     120        if (ANIMATE_LoadResA (infoPtr, hInstance, (LPSTR)lParam)) {
     121
     122//          FIXME (animate, "AVI resource found!\n");
     123
     124        }
     125        else {
     126//          FIXME (animate, "No AVI resource found!\n");
     127            if (ANIMATE_LoadFileA (infoPtr, (LPSTR)lParam)) {
     128//              FIXME (animate, "AVI file found!\n");
     129            }
     130            else {
     131//              FIXME (animate, "No AVI file found!\n");
     132                return FALSE;
     133            }
     134        }
    135135    }
    136136    else {
    137 //      FIXME (animate, "(%u) empty stub!\n", (WORD)LOWORD(lParam));
    138 
    139         if (ANIMATE_LoadResA (infoPtr, hInstance,
    140                                 MAKEINTRESOURCEA((INT)lParam))) {
    141 //          FIXME (animate, "AVI resource found!\n");
    142         }
    143         else {
    144 //          FIXME (animate, "No AVI resource found!\n");
    145             return FALSE;
    146         }
     137//      FIXME (animate, "(%u) empty stub!\n", (WORD)LOWORD(lParam));
     138
     139        if (ANIMATE_LoadResA (infoPtr, hInstance,
     140                                MAKEINTRESOURCEA((INT)lParam))) {
     141//          FIXME (animate, "AVI resource found!\n");
     142        }
     143        else {
     144//          FIXME (animate, "No AVI resource found!\n");
     145            return FALSE;
     146        }
    147147    }
    148148
     
    167167    /* nothing opened */
    168168    if (...)
    169         return FALSE;
     169        return FALSE;
    170170#endif
    171    
     171
    172172    if (nRepeat == -1) {
    173173
    174 //      FIXME (animate, "(loop from=%d to=%d) empty stub!\n",
    175 //             nFrom, nTo);
     174//      FIXME (animate, "(loop from=%d to=%d) empty stub!\n",
     175//             nFrom, nTo);
    176176
    177177    }
    178178    else {
    179179
    180 //      FIXME (animate, "(repeat=%d from=%d to=%d) empty stub!\n",
    181 //             nRepeat, nFrom, nTo);
     180//      FIXME (animate, "(repeat=%d from=%d to=%d) empty stub!\n",
     181//             nRepeat, nFrom, nTo);
    182182
    183183    }
     
    196196    /* nothing opened */
    197197    if (...)
    198         return FALSE;
     198        return FALSE;
    199199#endif
    200    
     200
    201201    return TRUE;
    202202}
     
    212212    infoPtr = (ANIMATE_INFO *)COMCTL32_Alloc (sizeof(ANIMATE_INFO));
    213213    if (!infoPtr) {
    214 //      ERR (animate, "could not allocate info memory!\n");
    215         return 0;
     214//      ERR (animate, "could not allocate info memory!\n");
     215        return 0;
    216216    }
    217217
     
    262262
    263263
    264 LRESULT WINAPI
     264static LRESULT WINAPI
    265265ANIMATE_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
    266266{
    267267    switch (uMsg)
    268268    {
    269         case ACM_OPENA:
    270             return ANIMATE_OpenA (hwnd, wParam, lParam);
    271 
    272 /*      case ACM_OPEN32W: */
    273 /*          return ANIMATE_Open32W (hwnd, wParam, lParam); */
     269        case ACM_OPENA:
     270            return ANIMATE_OpenA (hwnd, wParam, lParam);
     271
     272/*      case ACM_OPEN32W: */
     273/*          return ANIMATE_Open32W (hwnd, wParam, lParam); */
    274274
    275275        case ACM_PLAY:
    276276            return ANIMATE_Play (hwnd, wParam, lParam);
    277277
    278         case ACM_STOP:
    279             return ANIMATE_Stop (hwnd, wParam, lParam);
    280 
    281 
    282         case WM_CREATE:
    283             return ANIMATE_Create (hwnd, wParam, lParam);
    284 
    285         case WM_DESTROY:
    286             return ANIMATE_Destroy (hwnd, wParam, lParam);
    287 
    288 /*      case WM_ERASEBKGND: */
    289 /*          return ANIMATE_EraseBackground (hwnd, wParam, lParam); */
    290 
    291 /*      case WM_NCCREATE: */
    292 /*      case WM_NCHITTEST: */
    293 /*      case WM_PAINT: */
    294 /*      case WM_SIZE: */
    295 /*      case WM_STYLECHANGED: */
    296 /*      case WM_TIMER: */
    297 
    298         default:
    299 //          if (uMsg >= WM_USER)
    300 //              ERR (animate, "unknown msg %04x wp=%08x lp=%08lx\n",
    301 //                   uMsg, wParam, lParam);
    302             return DefWindowProcA (hwnd, uMsg, wParam, lParam);
     278        case ACM_STOP:
     279            return ANIMATE_Stop (hwnd, wParam, lParam);
     280
     281
     282        case WM_CREATE:
     283            return ANIMATE_Create (hwnd, wParam, lParam);
     284
     285        case WM_DESTROY:
     286            return ANIMATE_Destroy (hwnd, wParam, lParam);
     287
     288/*      case WM_ERASEBKGND: */
     289/*          return ANIMATE_EraseBackground (hwnd, wParam, lParam); */
     290
     291/*      case WM_NCCREATE: */
     292/*      case WM_NCHITTEST: */
     293/*      case WM_PAINT: */
     294/*      case WM_SIZE: */
     295/*      case WM_STYLECHANGED: */
     296/*      case WM_TIMER: */
     297
     298        default:
     299//          if (uMsg >= WM_USER)
     300//              ERR (animate, "unknown msg %04x wp=%08x lp=%08lx\n",
     301//                   uMsg, wParam, lParam);
     302            return DefWindowProcA (hwnd, uMsg, wParam, lParam);
    303303    }
    304304    return 0;
     
    321321    wndClass.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
    322322    wndClass.lpszClassName = ANIMATE_CLASSA;
    323  
     323
    324324    RegisterClassA (&wndClass);
    325325}
     
    330330{
    331331    if (GlobalFindAtomA (ANIMATE_CLASSA))
    332         UnregisterClassA (ANIMATE_CLASSA, (HINSTANCE)NULL);
    333 }
    334 
     332        UnregisterClassA (ANIMATE_CLASSA, (HINSTANCE)NULL);
     333}
     334
Note: See TracChangeset for help on using the changeset viewer.