From 71df58baf5369d934e5a3e7ea312e9f354f1a378 Mon Sep 17 00:00:00 2001 From: Steven Edwards Date: Sat, 26 Apr 2003 21:39:36 +0000 Subject: [PATCH] Fixed wm_paint test to use ReactOS build system. svn path=/trunk/; revision=4593 --- reactos/apps/tests/wm_paint/makefile | 66 +++---------------- .../wm_paint/{Listing1_1.cpp => wm_paint.c} | 13 ++-- 2 files changed, 16 insertions(+), 63 deletions(-) rename reactos/apps/tests/wm_paint/{Listing1_1.cpp => wm_paint.c} (92%) diff --git a/reactos/apps/tests/wm_paint/makefile b/reactos/apps/tests/wm_paint/makefile index c606328b2a6..9fccf77a108 100644 --- a/reactos/apps/tests/wm_paint/makefile +++ b/reactos/apps/tests/wm_paint/makefile @@ -1,66 +1,20 @@ -# Makefile - Proj_Listing1_1.dsp -ifndef CFG -CFG=Proj_Listing1_1 - Win32 Debug -endif -CC=gcc -CFLAGS= -CXX=g++ -CXXFLAGS=$(CFLAGS) -RC=windres -O COFF -ifeq "$(CFG)" "Proj_Listing1_1 - Win32 Release" -CFLAGS+=-fexceptions -O2 -DWIN32 -DNDEBUG -D_WINDOWS -D_MBCS -W -LD=$(CXX) $(CXXFLAGS) -LDFLAGS= -LDFLAGS+=-Wl,--subsystem,windows -LIBS+=-lkernel32 -luser32 -lgdi32 -else -ifeq "$(CFG)" "Proj_Listing1_1 - Win32 Debug" -CFLAGS+=-fexceptions -g -O0 -DWIN32 -D_DEBUG -D_WINDOWS -D_MBCS -W -LD=$(CXX) $(CXXFLAGS) -LDFLAGS= -LDFLAGS+=-Wl,--subsystem,windows -LIBS+=-lkernel32 -luser32 -lgdi32 -endif -endif +PATH_TO_TOP = ../../.. -ifndef TARGET -TARGET=WM_PAINT.exe -endif +TARGET_NORC = yes -.PHONY: all -all: $(TARGET) +TARGET_TYPE = program -%.o: %.c - $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $< +TARGET_APPTYPE = windows -%.o: %.cpp - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -o $@ -c $< +TARGET_NAME = wm_paint -%.res: %.rc - $(RC) $(CPPFLAGS) -o $@ -i $< +TARGET_SDKLIBS = kernel32.a gdi32.a -SOURCE_FILES= \ - Listing1_1.cpp +TARGET_OBJECTS = $(TARGET_NAME).o -HEADER_FILES= +include $(PATH_TO_TOP)/rules.mak -RESOURCE_FILES= - -SRCS=$(SOURCE_FILES) $(HEADER_FILES) $(RESOURCE_FILES) - -OBJS=$(patsubst %.rc,%.res,$(patsubst %.cpp,%.o,$(patsubst %.c,%.o,$(filter %.c %.cpp %.rc,$(SRCS))))) - -$(TARGET): $(OBJS) - $(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) - -.PHONY: clean -clean: - -del $(OBJS) $(TARGET) - -.PHONY: depends -depends: - -$(CXX) $(CXXFLAGS) $(CPPFLAGS) -MM $(filter %.c %.cpp,$(SRCS)) > Proj_Listing1_1.dep - --include Proj_Listing1_1.dep +include $(TOOLS_PATH)/helper.mk +# EOF diff --git a/reactos/apps/tests/wm_paint/Listing1_1.cpp b/reactos/apps/tests/wm_paint/wm_paint.c similarity index 92% rename from reactos/apps/tests/wm_paint/Listing1_1.cpp rename to reactos/apps/tests/wm_paint/wm_paint.c index 00bb7ad9f4c..d0d035da70e 100644 --- a/reactos/apps/tests/wm_paint/Listing1_1.cpp +++ b/reactos/apps/tests/wm_paint/wm_paint.c @@ -31,8 +31,7 @@ int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE HPrevInstance, wc.lpfnWndProc = MainWndProc; wc.hInstance = HInstance; wc.hCursor = LoadCursor(NULL, IDC_ARROW); - wc.hbrBackground = - reinterpret_cast(COLOR_BTNFACE + 1); + wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1); wc.lpszClassName = WndClassName; if (RegisterClass(&wc)) @@ -70,7 +69,7 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam, { // determine the invalidated area of the window RECT RUpdate; - GetUpdateRect(HWnd, &RUpdate, false); + GetUpdateRect(HWnd, &RUpdate, NULL); // grab a handle to our window's // common display device context @@ -87,11 +86,11 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam, RUpdate.right, RUpdate.bottom); // fill the client area with the background brush - HBRUSH HBrush = - reinterpret_cast( - GetClassLong(HWnd, GCL_HBRBACKGROUND) + //HBRUSH HBrush = + //reinterpret_cast + (HBRUSH)(GetClassLong(HWnd, GCL_HBRBACKGROUND) ); - FillRect(Hdc, &RClient, HBrush); + FillRect(Hdc, &RClient, NULL); // render the persistent text const char* text = "Persistent Text";