Fixed some dll separation issues.
This commit is contained in:
parent
2f6744b37c
commit
4328e51b1a
|
@ -9,12 +9,12 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "winreg.h"
|
||||||
#include "win16drv.h"
|
#include "win16drv.h"
|
||||||
#include "gdi.h"
|
#include "gdi.h"
|
||||||
#include "bitmap.h"
|
#include "bitmap.h"
|
||||||
#include "heap.h"
|
#include "heap.h"
|
||||||
#include "font.h"
|
#include "font.h"
|
||||||
#include "options.h"
|
|
||||||
#include "debugtools.h"
|
#include "debugtools.h"
|
||||||
|
|
||||||
DEFAULT_DEBUG_CHANNEL(win16drv);
|
DEFAULT_DEBUG_CHANNEL(win16drv);
|
||||||
|
@ -205,8 +205,17 @@ BOOL WIN16DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device, LPCSTR output,
|
||||||
PDEVICE_HEADER *pPDH;
|
PDEVICE_HEADER *pPDH;
|
||||||
WIN16DRV_PDEVICE *physDev;
|
WIN16DRV_PDEVICE *physDev;
|
||||||
char printerEnabled[20];
|
char printerEnabled[20];
|
||||||
PROFILE_GetWineIniString( "wine", "printer", "off",
|
HKEY hkey;
|
||||||
printerEnabled, sizeof(printerEnabled) );
|
|
||||||
|
/* default value */
|
||||||
|
strcpy(printerEnabled, "off");
|
||||||
|
if(!RegOpenKeyA(HKEY_LOCAL_MACHINE, "Software\\Wine\\Wine\\Config\\wine", &hkey))
|
||||||
|
{
|
||||||
|
DWORD type, count = sizeof(printerEnabled);
|
||||||
|
RegQueryValueExA(hkey, "printer", 0, &type, printerEnabled, &count);
|
||||||
|
RegCloseKey(hkey);
|
||||||
|
}
|
||||||
|
|
||||||
if (strcasecmp(printerEnabled,"on"))
|
if (strcasecmp(printerEnabled,"on"))
|
||||||
{
|
{
|
||||||
MESSAGE("Printing disabled in wine.conf or .winerc file\n");
|
MESSAGE("Printing disabled in wine.conf or .winerc file\n");
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
|
|
||||||
#include "windef.h"
|
#include "windef.h"
|
||||||
#include "wingdi.h"
|
#include "wingdi.h"
|
||||||
|
#include "winreg.h"
|
||||||
#include "winerror.h"
|
#include "winerror.h"
|
||||||
#include "wine/winbase16.h"
|
#include "wine/winbase16.h"
|
||||||
|
|
||||||
|
@ -20,7 +21,6 @@
|
||||||
#include "font.h"
|
#include "font.h"
|
||||||
#include "heap.h"
|
#include "heap.h"
|
||||||
#include "local.h"
|
#include "local.h"
|
||||||
#include "options.h"
|
|
||||||
#include "palette.h"
|
#include "palette.h"
|
||||||
#include "pen.h"
|
#include "pen.h"
|
||||||
#include "region.h"
|
#include "region.h"
|
||||||
|
@ -173,6 +173,28 @@ HBITMAP hPseudoStockBitmap; /* 1x1 bitmap for memory DCs */
|
||||||
static SYSLEVEL GDI_level = { CRITICAL_SECTION_INIT, 3 };
|
static SYSLEVEL GDI_level = { CRITICAL_SECTION_INIT, 3 };
|
||||||
static WORD GDI_HeapSel;
|
static WORD GDI_HeapSel;
|
||||||
|
|
||||||
|
static BOOL get_bool(char *buffer, BOOL def_value)
|
||||||
|
{
|
||||||
|
switch(buffer[0])
|
||||||
|
{
|
||||||
|
case 'n':
|
||||||
|
case 'N':
|
||||||
|
case 'f':
|
||||||
|
case 'F':
|
||||||
|
case '0':
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
case 'y':
|
||||||
|
case 'Y':
|
||||||
|
case 't':
|
||||||
|
case 'T':
|
||||||
|
case '1':
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return def_value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
*
|
*
|
||||||
|
@ -203,32 +225,50 @@ static void ReadFontInformation(
|
||||||
int defStrikeOut )
|
int defStrikeOut )
|
||||||
{
|
{
|
||||||
char key[256];
|
char key[256];
|
||||||
|
char buffer[MAX_PATH];
|
||||||
|
HKEY hkey;
|
||||||
|
DWORD type, count;
|
||||||
|
|
||||||
/* In order for the stock fonts to be independent of
|
/* In order for the stock fonts to be independent of
|
||||||
* mapping mode, the height (& width) must be 0
|
* mapping mode, the height (& width) must be 0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* assign defaults */
|
||||||
|
font->logfont.lfHeight = defHeight;
|
||||||
|
font->logfont.lfWeight = defBold;
|
||||||
|
font->logfont.lfItalic = defItalic;
|
||||||
|
font->logfont.lfUnderline = defUnderline;
|
||||||
|
font->logfont.lfStrikeOut = defStrikeOut;
|
||||||
|
|
||||||
|
if(RegOpenKeyA(HKEY_LOCAL_MACHINE, "Software\\Wine\\Wine\\Config\\Tweak.Fonts", &hkey))
|
||||||
|
return;
|
||||||
|
|
||||||
sprintf(key, "%s.Height", fontName);
|
sprintf(key, "%s.Height", fontName);
|
||||||
font->logfont.lfHeight =
|
count = sizeof(buffer);
|
||||||
PROFILE_GetWineIniInt("Tweak.Fonts", key, defHeight);
|
if(!RegQueryValueExA(hkey, key, 0, &type, buffer, &count))
|
||||||
|
font->logfont.lfHeight = atoi(buffer);
|
||||||
|
|
||||||
sprintf(key, "%s.Bold", fontName);
|
sprintf(key, "%s.Bold", fontName);
|
||||||
font->logfont.lfWeight =
|
count = sizeof(buffer);
|
||||||
(PROFILE_GetWineIniBool("Tweak.Fonts", key, defBold)) ?
|
if(!RegQueryValueExA(hkey, key, 0, &type, buffer, &count))
|
||||||
FW_BOLD : FW_NORMAL;
|
font->logfont.lfWeight = get_bool(buffer, defBold) ? FW_BOLD : FW_NORMAL;
|
||||||
|
|
||||||
sprintf(key, "%s.Italic", fontName);
|
sprintf(key, "%s.Italic", fontName);
|
||||||
font->logfont.lfItalic =
|
count = sizeof(buffer);
|
||||||
PROFILE_GetWineIniBool("Tweak.Fonts", key, defItalic);
|
if(!RegQueryValueExA(hkey, key, 0, &type, buffer, &count))
|
||||||
|
font->logfont.lfItalic = get_bool(buffer, defItalic);
|
||||||
|
|
||||||
sprintf(key, "%s.Underline", fontName);
|
sprintf(key, "%s.Underline", fontName);
|
||||||
font->logfont.lfUnderline =
|
count = sizeof(buffer);
|
||||||
PROFILE_GetWineIniBool("Tweak.Fonts", key, defUnderline);
|
if(!RegQueryValueExA(hkey, key, 0, &type, buffer, &count))
|
||||||
|
font->logfont.lfUnderline = get_bool(buffer, defUnderline);
|
||||||
|
|
||||||
sprintf(key, "%s.StrikeOut", fontName);
|
sprintf(key, "%s.StrikeOut", fontName);
|
||||||
font->logfont.lfStrikeOut =
|
count = sizeof(buffer);
|
||||||
PROFILE_GetWineIniBool("Tweak.Fonts", key, defStrikeOut);
|
if(!RegQueryValueExA(hkey, key, 0, &type, buffer, &count))
|
||||||
|
font->logfont.lfStrikeOut = get_bool(buffer, defStrikeOut);
|
||||||
|
|
||||||
return;
|
RegCloseKey(hkey);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|
|
@ -93,15 +93,16 @@ HMETAFILE MF_Create_HMETAFILE(METAHEADER *mh)
|
||||||
HMETAFILE16 MF_Create_HMETAFILE16(METAHEADER *mh)
|
HMETAFILE16 MF_Create_HMETAFILE16(METAHEADER *mh)
|
||||||
{
|
{
|
||||||
HMETAFILE16 hmf;
|
HMETAFILE16 hmf;
|
||||||
DWORD size;
|
DWORD size = mh->mtSize * sizeof(WORD);
|
||||||
|
|
||||||
if(mh->mtType == METAFILE_MEMORY)
|
hmf = GlobalAlloc16(GMEM_MOVEABLE, size);
|
||||||
size = mh->mtSize * sizeof(WORD);
|
if(hmf)
|
||||||
else
|
{
|
||||||
size = sizeof(METAHEADER) + sizeof(METAHEADERDISK);
|
METAHEADER *mh_dest = GlobalLock16(hmf);
|
||||||
|
memcpy(mh_dest, mh, size);
|
||||||
hmf = GLOBAL_CreateBlock( GMEM_MOVEABLE, mh, mh->mtSize * sizeof(WORD),
|
GlobalUnlock16(hmf);
|
||||||
GetCurrentPDB16(), WINE_LDT_FLAGS_DATA );
|
}
|
||||||
|
HeapFree(GetProcessHeap(), 0, mh);
|
||||||
return hmf;
|
return hmf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue