Ignore:
Timestamp:
Sep 16, 1999, 1:39:08 AM (26 years ago)
Author:
sandervl
Message:

Rewrite for new win32 image classes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/winres.cpp

    r933 r956  
    1 /* $Id: winres.cpp,v 1.18 1999-09-14 16:56:08 sandervl Exp $ */
     1/* $Id: winres.cpp,v 1.19 1999-09-15 23:38:02 sandervl Exp $ */
    22
    33/*
     
    2828#include <winres.h>
    2929#include <misc.h>
    30 #include <nameid.h>
    31 #include <winexe.h>
     30#include <winexepe2lx.h>
     31#include <windllpe2lx.h>
    3232#include "cvtresource.h"
    3333#include <vmutex.h>
    3434
    3535VMutex resmutex;
     36
     37char *ResTypes[MAX_RES] =
     38      {"niks", "CURSOR", "BITMAP", "ICON", "MENU", "DIALOG", "STRING",
     39       "FONTDIR", "FONT", "ACCELERATOR", "RCDATA",  "MESSAGETABLE",
     40       "GROUP_CURSOR", "niks", "GROUP_ICON", "niks", "VERSION"};
    3641
    3742//******************************************************************************
     
    9297        os2resdata(NULL), winresdata(NULL), resType(RSRC_CUSTOMNODATA)
    9398{
    94   resmutex.enter();
    95   next           = module->winres;
    96   module->winres = this;
    97   resmutex.leave();
    98 
     99  next       = NULL;
    99100  module     = NULL;
     101
    100102  id         = -1;
    101103  type       = -1;
     
    109111//******************************************************************************
    110112//******************************************************************************
    111 Win32Resource::Win32Resource(Win32Image *module, HRSRC hRes, ULONG id, ULONG type) :
     113Win32Resource::Win32Resource(Win32ImageBase *module, HRSRC hRes, ULONG id, ULONG type) :
    112114        os2resdata(NULL), winresdata(NULL), resType(RSRC_PE2LX)
    113115{
     
    168170//******************************************************************************
    169171//******************************************************************************
    170 Win32Resource::Win32Resource(Win32Image *module, ULONG id, ULONG type,
     172Win32Resource::Win32Resource(Win32ImageBase *module, ULONG id, ULONG type,
    171173                 ULONG size, char *resdata) : hres(NULL),
    172174        os2resdata(NULL), winresdata(NULL), resType(RSRC_PELOADER)
     
    246248    case NTRT_MENU:
    247249    case NTRT_DIALOG:
    248         newid = module->getWin32ResourceId(id);
     250    {
     251//TODO->!!!!
     252//        newid = ((Win32Pe2LxImage *)module)->getWin32ResourceId(id);
     253//TODO->!!!!
    249254
    250255        rc = DosGetResource((HMODULE)module->hinstance, RT_RCDATA, (int)newid, (PPVOID)&resdata);
     
    256261        memcpy(winresdata, resdata, ressize);
    257262        break;
     263    }
    258264
    259265    //TODO:not yet implemented
     
    329335   }
    330336   return os2resdata;
     337}
     338//******************************************************************************
     339//return size of converted win32 resource
     340//******************************************************************************
     341ULONG Win32Resource::getOS2Size()
     342{
     343  switch(type) {
     344    case NTRT_NEWBITMAP:
     345    case NTRT_BITMAP:
     346        return QueryConvertedBitmapSize((WINBITMAPINFOHEADER *)winresdata, ressize);
     347
     348    case NTRT_CURSOR:
     349        return QueryConvertedCursorSize((CursorComponent *)winresdata, ressize);
     350
     351    case NTRT_ICON:
     352        return QueryConvertedIconSize((WINBITMAPINFOHEADER *)winresdata, ressize);
     353
     354    case NTRT_GROUP_ICON:
     355    case NTRT_GROUP_CURSOR:
     356    case NTRT_ACCELERATORS:
     357    case NTRT_NEWMENU:
     358    case NTRT_MENU:
     359    case NTRT_NEWDIALOG:
     360    case NTRT_DIALOG:
     361    case NTRT_FONTDIR:
     362    case NTRT_FONT:
     363    case NTRT_MESSAGETABLE:
     364    case NTRT_RCDATA:
     365    case NTRT_VERSION:
     366    case NTRT_STRING:
     367    default:
     368        dprintf(("Win32Resource::getOS2Size SHOULDN'T BE CALLED for this resource type (%d) (NOT IMPLEMENTED)!!", type));
     369        break;
     370  }
     371  return 0;
    331372}
    332373//******************************************************************************
     
    435476//******************************************************************************
    436477//******************************************************************************
    437 void Win32Resource::destroyAll(Win32Image *module)
     478void Win32Resource::destroyAll(Win32ImageBase *module)
    438479{
    439480 Win32Resource *res = module->winres, *next;
Note: See TracChangeset for help on using the changeset viewer.