From 84bde6a4a40263bc8a1cba4ee72dc9a2647e84d4 Mon Sep 17 00:00:00 2001 From: "Dimitrie O. Paun" Date: Tue, 30 May 2000 20:27:23 +0000 Subject: [PATCH] Separate wineps out of Wine's core. --- Make.rules.in | 1 + Makefile.in | 2 -- configure | 4 +-- configure.in | 2 +- dlls/Makefile.in | 3 +- dlls/gdi/gdi_main.c | 3 +- dlls/wineps/.cvsignore | 4 +++ {graphics/psdrv => dlls/wineps}/Makefile.in | 11 ++++--- {graphics/psdrv => dlls/wineps}/afm.c | 0 {graphics/psdrv => dlls/wineps}/bitblt.c | 0 {graphics/psdrv => dlls/wineps}/bitmap.c | 0 {graphics/psdrv => dlls/wineps}/brush.c | 0 {graphics/psdrv => dlls/wineps}/clipping.c | 0 {graphics/psdrv => dlls/wineps}/color.c | 0 {graphics/psdrv => dlls/wineps}/driver.c | 0 {graphics/psdrv => dlls/wineps}/escape.c | 0 {graphics/psdrv => dlls/wineps}/font.c | 0 {graphics/psdrv => dlls/wineps}/graphics.c | 0 {graphics/psdrv => dlls/wineps}/init.c | 32 +++++++++++++++---- {graphics/psdrv => dlls/wineps}/objects.c | 0 {graphics/psdrv => dlls/wineps}/pen.c | 0 {graphics/psdrv => dlls/wineps}/ppd.c | 0 {graphics/psdrv => dlls/wineps}/ps.c | 0 {include => dlls/wineps}/psdrv.h | 2 +- {graphics/psdrv => dlls/wineps}/text.c | 0 dlls/wineps/wineps.spec | 4 +++ .../wineps.spec => dlls/wineps/wineps16.spec | 2 +- graphics/psdrv/.cvsignore | 1 - if1632/.cvsignore | 8 +---- if1632/Makefile.in | 1 + loader/main.c | 1 - 31 files changed, 50 insertions(+), 31 deletions(-) create mode 100644 dlls/wineps/.cvsignore rename {graphics/psdrv => dlls/wineps}/Makefile.in (72%) rename {graphics/psdrv => dlls/wineps}/afm.c (100%) rename {graphics/psdrv => dlls/wineps}/bitblt.c (100%) rename {graphics/psdrv => dlls/wineps}/bitmap.c (100%) rename {graphics/psdrv => dlls/wineps}/brush.c (100%) rename {graphics/psdrv => dlls/wineps}/clipping.c (100%) rename {graphics/psdrv => dlls/wineps}/color.c (100%) rename {graphics/psdrv => dlls/wineps}/driver.c (100%) rename {graphics/psdrv => dlls/wineps}/escape.c (100%) rename {graphics/psdrv => dlls/wineps}/font.c (100%) rename {graphics/psdrv => dlls/wineps}/graphics.c (100%) rename {graphics/psdrv => dlls/wineps}/init.c (95%) rename {graphics/psdrv => dlls/wineps}/objects.c (100%) rename {graphics/psdrv => dlls/wineps}/pen.c (100%) rename {graphics/psdrv => dlls/wineps}/ppd.c (100%) rename {graphics/psdrv => dlls/wineps}/ps.c (100%) rename {include => dlls/wineps}/psdrv.h (99%) rename {graphics/psdrv => dlls/wineps}/text.c (100%) create mode 100644 dlls/wineps/wineps.spec rename if1632/wineps.spec => dlls/wineps/wineps16.spec (94%) delete mode 100644 graphics/psdrv/.cvsignore diff --git a/Make.rules.in b/Make.rules.in index d762710ac6f..9db59aaadf7 100644 --- a/Make.rules.in +++ b/Make.rules.in @@ -140,6 +140,7 @@ DLLS = \ win87em \ windebug \ wineoss.drv \ + wineps \ wing \ wininet \ winmm \ diff --git a/Makefile.in b/Makefile.in index ebfa2c26e9a..901f06e3481 100644 --- a/Makefile.in +++ b/Makefile.in @@ -37,7 +37,6 @@ LIBSUBDIRS = \ graphics \ graphics/enhmetafiledrv \ graphics/metafiledrv \ - graphics/psdrv \ graphics/win16drv \ if1632 \ library \ @@ -105,7 +104,6 @@ LIBOBJS = \ graphics/graphics.o \ graphics/enhmetafiledrv/enhmetafiledrv.o \ graphics/metafiledrv/metafiledrv.o \ - graphics/psdrv/psdrv.o \ graphics/win16drv/win16drv.o \ if1632/if1632.o \ loader/loader.o \ diff --git a/configure b/configure index 6bc80ebf503..25f92a5422b 100755 --- a/configure +++ b/configure @@ -6239,6 +6239,7 @@ dlls/win32s/Makefile dlls/win87em/Makefile dlls/winaspi/Makefile dlls/windebug/Makefile +dlls/wineps/Makefile dlls/wing/Makefile dlls/wininet/Makefile dlls/winmm/Makefile @@ -6262,7 +6263,6 @@ files/Makefile graphics/Makefile graphics/enhmetafiledrv/Makefile graphics/metafiledrv/Makefile -graphics/psdrv/Makefile graphics/ttydrv/Makefile graphics/win16drv/Makefile graphics/x11drv/Makefile @@ -6473,6 +6473,7 @@ dlls/win32s/Makefile dlls/win87em/Makefile dlls/winaspi/Makefile dlls/windebug/Makefile +dlls/wineps/Makefile dlls/wing/Makefile dlls/wininet/Makefile dlls/winmm/Makefile @@ -6496,7 +6497,6 @@ files/Makefile graphics/Makefile graphics/enhmetafiledrv/Makefile graphics/metafiledrv/Makefile -graphics/psdrv/Makefile graphics/ttydrv/Makefile graphics/win16drv/Makefile graphics/x11drv/Makefile diff --git a/configure.in b/configure.in index 71ed2bdaaff..8a7829d2f9c 100644 --- a/configure.in +++ b/configure.in @@ -1033,6 +1033,7 @@ dlls/win32s/Makefile dlls/win87em/Makefile dlls/winaspi/Makefile dlls/windebug/Makefile +dlls/wineps/Makefile dlls/wing/Makefile dlls/wininet/Makefile dlls/winmm/Makefile @@ -1056,7 +1057,6 @@ files/Makefile graphics/Makefile graphics/enhmetafiledrv/Makefile graphics/metafiledrv/Makefile -graphics/psdrv/Makefile graphics/ttydrv/Makefile graphics/win16drv/Makefile graphics/x11drv/Makefile diff --git a/dlls/Makefile.in b/dlls/Makefile.in index daac70b58f2..ef95561df60 100644 --- a/dlls/Makefile.in +++ b/dlls/Makefile.in @@ -75,7 +75,6 @@ EXTRADLLNAMES = \ commdlg \ compobj \ ddeml \ - dispdib \ dplay \ gdi \ keyboard \ @@ -183,7 +182,7 @@ libdplayx.@LIBEXT@ libdplay.@LIBEXT@: dplayx/libdplayx.@LIBEXT@ libdsound.@LIBEXT@: dsound/libdsound.@LIBEXT@ $(RM) $@ && $(LN_S) dsound/libdsound.@LIBEXT@ $@ -libgdi32.@LIBEXT@ libgdi.@LIBEXT@ libdispdib.@LIBEXT@: gdi/libgdi32.@LIBEXT@ +libgdi32.@LIBEXT@ libgdi.@LIBEXT@: gdi/libgdi32.@LIBEXT@ $(RM) $@ && $(LN_S) gdi/libgdi32.@LIBEXT@ $@ libicmp.@LIBEXT@: icmp/libicmp.@LIBEXT@ diff --git a/dlls/gdi/gdi_main.c b/dlls/gdi/gdi_main.c index af40d4cee63..6bc394e2e6c 100644 --- a/dlls/gdi/gdi_main.c +++ b/dlls/gdi/gdi_main.c @@ -8,7 +8,6 @@ #include "gdi.h" #include "global.h" -#include "psdrv.h" #include "tweak.h" #include "win16drv.h" @@ -35,7 +34,7 @@ BOOL WINAPI MAIN_GdiInit(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved if (!WIN16DRV_Init()) return FALSE; /* PSDRV initialization */ - if(!PSDRV_Init()) return FALSE; + if (!LoadLibraryA( "wineps" )) return FALSE; return TRUE; } diff --git a/dlls/wineps/.cvsignore b/dlls/wineps/.cvsignore new file mode 100644 index 00000000000..9722db78b6d --- /dev/null +++ b/dlls/wineps/.cvsignore @@ -0,0 +1,4 @@ +Makefile +libwineps.so.1.0 +wineps.spec.c +wineps16.spec.c diff --git a/graphics/psdrv/Makefile.in b/dlls/wineps/Makefile.in similarity index 72% rename from graphics/psdrv/Makefile.in rename to dlls/wineps/Makefile.in index f55dbcdd8b2..263d309778c 100644 --- a/graphics/psdrv/Makefile.in +++ b/dlls/wineps/Makefile.in @@ -1,9 +1,12 @@ -DEFS = @DLLFLAGS@ -D__WINE__ TOPSRCDIR = @top_srcdir@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ VPATH = @srcdir@ -MODULE = psdrv +MODULE = wineps +SOVERSION = 1.0 +ALTNAMES = wineps16 + +SPEC_SRCS = wineps.spec wineps16.spec C_SRCS = \ afm.c \ @@ -23,8 +26,6 @@ C_SRCS = \ ps.c \ text.c -all: $(MODULE).o - -@MAKE_RULES@ +@MAKE_DLL_RULES@ ### Dependencies: diff --git a/graphics/psdrv/afm.c b/dlls/wineps/afm.c similarity index 100% rename from graphics/psdrv/afm.c rename to dlls/wineps/afm.c diff --git a/graphics/psdrv/bitblt.c b/dlls/wineps/bitblt.c similarity index 100% rename from graphics/psdrv/bitblt.c rename to dlls/wineps/bitblt.c diff --git a/graphics/psdrv/bitmap.c b/dlls/wineps/bitmap.c similarity index 100% rename from graphics/psdrv/bitmap.c rename to dlls/wineps/bitmap.c diff --git a/graphics/psdrv/brush.c b/dlls/wineps/brush.c similarity index 100% rename from graphics/psdrv/brush.c rename to dlls/wineps/brush.c diff --git a/graphics/psdrv/clipping.c b/dlls/wineps/clipping.c similarity index 100% rename from graphics/psdrv/clipping.c rename to dlls/wineps/clipping.c diff --git a/graphics/psdrv/color.c b/dlls/wineps/color.c similarity index 100% rename from graphics/psdrv/color.c rename to dlls/wineps/color.c diff --git a/graphics/psdrv/driver.c b/dlls/wineps/driver.c similarity index 100% rename from graphics/psdrv/driver.c rename to dlls/wineps/driver.c diff --git a/graphics/psdrv/escape.c b/dlls/wineps/escape.c similarity index 100% rename from graphics/psdrv/escape.c rename to dlls/wineps/escape.c diff --git a/graphics/psdrv/font.c b/dlls/wineps/font.c similarity index 100% rename from graphics/psdrv/font.c rename to dlls/wineps/font.c diff --git a/graphics/psdrv/graphics.c b/dlls/wineps/graphics.c similarity index 100% rename from graphics/psdrv/graphics.c rename to dlls/wineps/graphics.c diff --git a/graphics/psdrv/init.c b/dlls/wineps/init.c similarity index 95% rename from graphics/psdrv/init.c rename to dlls/wineps/init.c index fef71459b7b..6e9956a07e7 100644 --- a/graphics/psdrv/init.c +++ b/dlls/wineps/init.c @@ -221,15 +221,35 @@ static LOGFONTA DefaultLogFont = { * Initializes font metrics and registers driver. Called from GDI_Init() * */ -BOOL PSDRV_Init(void) +BOOL WINAPI PSDRV_Init( HINSTANCE hinst, DWORD reason, LPVOID reserved ) { - TRACE("\n"); - PSDRV_Heap = HeapCreate(0, 0x10000, 0); - PSDRV_GetFontMetrics(); - PSDRV_DefaultFont = CreateFontIndirectA(&DefaultLogFont); - return DRIVER_RegisterDriver( "WINEPS", &PSDRV_Funcs ); + static int process_count = 0; + + TRACE("(0x%4x, 0x%08lx, %p)\n", hinst, reason, reserved); + + switch(reason) { + case DLL_PROCESS_ATTACH: + if (!process_count++) { + /* FIXME: return FALSE if we fail any of these steps */ + PSDRV_Heap = HeapCreate(0, 0x10000, 0); + PSDRV_GetFontMetrics(); + PSDRV_DefaultFont = CreateFontIndirectA(&DefaultLogFont); + DRIVER_RegisterDriver( "WINEPS", &PSDRV_Funcs ); + } + break; + case DLL_PROCESS_DETACH: + if (!--process_count) { + DeleteObject( PSDRV_DefaultFont ); + HeapDestroy( PSDRV_Heap ); + DRIVER_UnregisterDriver( "WINEPS" ); + } + break; + } + + return TRUE; } + /********************************************************************** * PSDRV_CreateDC */ diff --git a/graphics/psdrv/objects.c b/dlls/wineps/objects.c similarity index 100% rename from graphics/psdrv/objects.c rename to dlls/wineps/objects.c diff --git a/graphics/psdrv/pen.c b/dlls/wineps/pen.c similarity index 100% rename from graphics/psdrv/pen.c rename to dlls/wineps/pen.c diff --git a/graphics/psdrv/ppd.c b/dlls/wineps/ppd.c similarity index 100% rename from graphics/psdrv/ppd.c rename to dlls/wineps/ppd.c diff --git a/graphics/psdrv/ps.c b/dlls/wineps/ps.c similarity index 100% rename from graphics/psdrv/ps.c rename to dlls/wineps/ps.c diff --git a/include/psdrv.h b/dlls/wineps/psdrv.h similarity index 99% rename from include/psdrv.h rename to dlls/wineps/psdrv.h index 2902043a978..bf6a8a2877d 100644 --- a/include/psdrv.h +++ b/dlls/wineps/psdrv.h @@ -251,7 +251,7 @@ extern AFM *PSDRV_FindAFMinList(FONTFAMILY *head, char *name); extern void PSDRV_AddAFMtoList(FONTFAMILY **head, AFM *afm); extern void PSDRV_FreeAFMList( FONTFAMILY *head ); -extern BOOL PSDRV_Init(void); +extern BOOL WINAPI PSDRV_Init(HINSTANCE hinst, DWORD reason, LPVOID reserved); extern HFONT16 PSDRV_FONT_SelectObject( DC *dc, HFONT16 hfont, FONTOBJ *font); extern HPEN PSDRV_PEN_SelectObject( DC * dc, HPEN hpen, PENOBJ * pen ); extern HBRUSH PSDRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush, diff --git a/graphics/psdrv/text.c b/dlls/wineps/text.c similarity index 100% rename from graphics/psdrv/text.c rename to dlls/wineps/text.c diff --git a/dlls/wineps/wineps.spec b/dlls/wineps/wineps.spec new file mode 100644 index 00000000000..41b475c6a4d --- /dev/null +++ b/dlls/wineps/wineps.spec @@ -0,0 +1,4 @@ +name wineps +type win32 +init PSDRV_Init + diff --git a/if1632/wineps.spec b/dlls/wineps/wineps16.spec similarity index 94% rename from if1632/wineps.spec rename to dlls/wineps/wineps16.spec index 4ede174077f..33c2089c0bd 100644 --- a/if1632/wineps.spec +++ b/dlls/wineps/wineps16.spec @@ -1,4 +1,4 @@ -name wineps +name wineps16 type win16 13 pascal16 DeviceMode(word word str str) PSDRV_DeviceMode16 diff --git a/graphics/psdrv/.cvsignore b/graphics/psdrv/.cvsignore deleted file mode 100644 index f3c7a7c5da6..00000000000 --- a/graphics/psdrv/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -Makefile diff --git a/if1632/.cvsignore b/if1632/.cvsignore index 422f4160346..9da227f1df1 100644 --- a/if1632/.cvsignore +++ b/if1632/.cvsignore @@ -1,10 +1,4 @@ +*.spec.c Makefile call16.s -comm.spec.c -dispdib.spec.c -kernel.spec.c -system.spec.c thunk.glue.c -toolhelp.spec.c -wineps.spec.c -wprocs.spec.c diff --git a/if1632/Makefile.in b/if1632/Makefile.in index f54f5dd01a1..b1d82f2880a 100644 --- a/if1632/Makefile.in +++ b/if1632/Makefile.in @@ -7,6 +7,7 @@ MODULE = if1632 SPEC_SRCS = \ comm.spec \ + dispdib.spec \ kernel.spec \ system.spec \ toolhelp.spec \ diff --git a/loader/main.c b/loader/main.c index 1652e5e58cc..cd598692c83 100644 --- a/loader/main.c +++ b/loader/main.c @@ -49,7 +49,6 @@ #include "thread.h" #include "task.h" #include "debugtools.h" -#include "psdrv.h" #include "win16drv.h" #include "callback.h" #include "server.h"