// @(#)root/win32:$Name: $:$Id: TGWin32Brush.h,v 1.1.1.1 2000/05/16 17:00:47 rdm Exp $ // Author: Valery Fine 26/01/96 /************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOT_TGWin32Brush #define ROOT_TGWin32Brush // #define ColorOffset 20 // #define ColorOffset 0 // #define ROOTColorIndex(ic) PALETTEINDEX(ic+ColorOffset) #define ROOTColorIndex(ic) fWin32Mother->ColorIndex(ic) #define WHITE_ROOT_COLOR ROOTColorIndex(0) #include "Windows4Root.h" // //*-*- data to create fill area interior style // static char p1_bits[] = { ~(0xaa),~(0xaa),~(0x55),~(0x55),~(0xaa),~(0xaa),~(0x55),~(0x55),~(0xaa),~(0xaa),~(0x55),~(0x55), ~(0xaa),~(0xaa),~(0x55),~(0x55),~(0xaa),~(0xaa),~(0x55),~(0x55),~(0xaa),~(0xaa),~(0x55),~(0x55), ~(0xaa),~(0xaa),~(0x55),~(0x55),~(0xaa),~(0xaa),~(0x55),~(0x55)}; static char p2_bits[] = { ~(0x44),~(0x44),~(0x11),~(0x11),~(0x44),~(0x44),~(0x11),~(0x11),~(0x44),~(0x44),~(0x11),~(0x11), ~(0x44),~(0x44),~(0x11),~(0x11),~(0x44),~(0x44),~(0x11),~(0x11),~(0x44),~(0x44),~(0x11),~(0x11), ~(0x44),~(0x44),~(0x11),~(0x11),~(0x44),~(0x44),~(0x11),~(0x11)}; static char p3_bits[] = { ~(0x00),~(0x00),~(0x44),~(0x44),~(0x00),~(0x00),~(0x11),~(0x11),~(0x00),~(0x00),~(0x44),~(0x44), ~(0x00),~(0x00),~(0x11),~(0x11),~(0x00),~(0x00),~(0x44),~(0x44),~(0x00),~(0x00),~(0x11),~(0x11), ~(0x00),~(0x00),~(0x44),~(0x44),~(0x00),~(0x00),~(0x11),~(0x11)}; static char p4_bits[] = { ~(0x80),~(0x80),~(0x40),~(0x40),~(0x20),~(0x20),~(0x10),~(0x10),~(0x08),~(0x08),~(0x04),~(0x04), ~(0x02),~(0x02),~(0x01),~(0x01),~(0x80),~(0x80),~(0x40),~(0x40),~(0x20),~(0x20),~(0x10),~(0x10), ~(0x08),~(0x08),~(0x04),~(0x04),~(0x02),~(0x02),~(0x01),~(0x01)}; static char p5_bits[] = { ~(0x20),~(0x20),~(0x40),~(0x40),~(0x80),~(0x80),~(0x01),~(0x01),~(0x02),~(0x02),~(0x04),~(0x04), ~(0x08),~(0x08),~(0x10),~(0x10),~(0x20),~(0x20),~(0x40),~(0x40),~(0x80),~(0x80),~(0x01),~(0x01), ~(0x02),~(0x02),~(0x04),~(0x04),~(0x08),~(0x08),~(0x10),~(0x10)}; static char p6_bits[] = { ~(0x44),~(0x44),~(0x44),~(0x44),~(0x44),~(0x44),~(0x44),~(0x44),~(0x44),~(0x44),~(0x44),~(0x44), ~(0x44),~(0x44),~(0x44),~(0x44),~(0x44),~(0x44),~(0x44),~(0x44),~(0x44),~(0x44),~(0x44),~(0x44), ~(0x44),~(0x44),~(0x44),~(0x44),~(0x44),~(0x44),~(0x44),~(0x44)}; static char p7_bits[] = { ~(0x00),~(0x00),~(0x00),~(0x00),~(0x00),~(0x00),~(0xff),~(0xff),~(0x00),~(0x00),~(0x00),~(0x00), ~(0x00),~(0x00),~(0xff),~(0xff),~(0x00),~(0x00),~(0x00),~(0x00),~(0x00),~(0x00),~(0xff),~(0xff), ~(0x00),~(0x00),~(0x00),~(0x00),~(0x00),~(0x00),~(0xff),~(0xff)}; static char p8_bits[] = { ~(0x11),~(0x11),~(0xb8),~(0xb8),~(0x7c),~(0x7c),~(0x3a),~(0x3a),~(0x11),~(0x11),~(0xa3),~(0xa3), ~(0xc7),~(0xc7),~(0x8b),~(0x8b),~(0x11),~(0x11),~(0xb8),~(0xb8),~(0x7c),~(0x7c),~(0x3a),~(0x3a), ~(0x11),~(0x11),~(0xa3),~(0xa3),~(0xc7),~(0xc7),~(0x8b),~(0x8b)}; static char p9_bits[] = { ~(0x10),~(0x10),~(0x10),~(0x10),~(0x28),~(0x28),~(0xc7),~(0xc7),~(0x01),~(0x01),~(0x01),~(0x01), ~(0x82),~(0x82),~(0x7c),~(0x7c),~(0x10),~(0x10),~(0x10),~(0x10),~(0x28),~(0x28),~(0xc7),~(0xc7), ~(0x01),~(0x01),~(0x01),~(0x01),~(0x82),~(0x82),~(0x7c),~(0x7c)}; static char p10_bits[] = { ~(0x10),~(0x10),~(0x10),~(0x10),~(0x10),~(0x10),~(0xff),~(0xff),~(0x01),~(0x01),~(0x01),~(0x01), ~(0x01),~(0x01),~(0xff),~(0xff),~(0x10),~(0x10),~(0x10),~(0x10),~(0x10),~(0x10),~(0xff),~(0xff), ~(0x01),~(0x01),~(0x01),~(0x01),~(0x01),~(0x01),~(0xff),~(0xff)}; static char p11_bits[] = { ~(0x08),~(0x08),~(0x49),~(0x49),~(0x2a),~(0x2a),~(0x1c),~(0x1c),~(0x2a),~(0x2a),~(0x49),~(0x49), ~(0x08),~(0x08),~(0x00),~(0x00),~(0x80),~(0x80),~(0x94),~(0x94),~(0xa2),~(0xa2),~(0xc1),~(0xc1), ~(0xa2),~(0xa2),~(0x94),~(0x94),~(0x80),~(0x80),~(0x00),~(0x00)}; static char p12_bits[] = { ~(0x1c),~(0x1c),~(0x22),~(0x22),~(0x41),~(0x41),~(0x41),~(0x41),~(0x41),~(0x41),~(0x22),~(0x22), ~(0x1c),~(0x1c),~(0x00),~(0x00),~(0xc1),~(0xc1),~(0x22),~(0x22),~(0x14),~(0x14),~(0x14),~(0x14), ~(0x14),~(0x14),~(0x22),~(0x22),~(0xc1),~(0xc1),~(0x00),~(0x00)}; static char p13_bits[] = { ~(0x01),~(0x01),~(0x82),~(0x82),~(0x44),~(0x44),~(0x28),~(0x28),~(0x10),~(0x10),~(0x28),~(0x28), ~(0x44),~(0x44),~(0x82),~(0x82),~(0x01),~(0x01),~(0x82),~(0x82),~(0x44),~(0x44),~(0x28),~(0x28), ~(0x10),~(0x10),~(0x28),~(0x28),~(0x44),~(0x44),~(0x82),~(0x82)}; static char p14_bits[] = { ~(0xff),~(0xff),~(0x11),~(0x10),~(0x11),~(0x10),~(0x11),~(0x10),~(0xf1),~(0x1f),~(0x11),~(0x11), ~(0x11),~(0x11),~(0x11),~(0x11),~(0xff),~(0x11),~(0x01),~(0x11),~(0x01),~(0x11),~(0x01),~(0x11), ~(0xff),~(0xff),~(0x01),~(0x10),~(0x01),~(0x10),~(0x01),~(0x10)}; static char p15_bits[] = { ~(0x22),~(0x22),~(0x55),~(0x55),~(0x22),~(0x22),~(0x00),~(0x00),~(0x88),~(0x88),~(0x55),~(0x55), ~(0x88),~(0x88),~(0x00),~(0x00),~(0x22),~(0x22),~(0x55),~(0x55),~(0x22),~(0x22),~(0x00),~(0x00), ~(0x88),~(0x88),~(0x55),~(0x55),~(0x88),~(0x88),~(0x00),~(0x00)}; static char p16_bits[] = { ~(0x0e),~(0x0e),~(0x11),~(0x11),~(0xe0),~(0xe0),~(0x00),~(0x00),~(0x0e),~(0x0e),~(0x11),~(0x11), ~(0xe0),~(0xe0),~(0x00),~(0x00),~(0x0e),~(0x0e),~(0x11),~(0x11),~(0xe0),~(0xe0),~(0x00),~(0x00), ~(0x0e),~(0x0e),~(0x11),~(0x11),~(0xe0),~(0xe0),~(0x00),~(0x00)}; static char p17_bits[] = { ~(0x44),~(0x44),~(0x22),~(0x22),~(0x11),~(0x11),~(0x00),~(0x00),~(0x44),~(0x44),~(0x22),~(0x22), ~(0x11),~(0x11),~(0x00),~(0x00),~(0x44),~(0x44),~(0x22),~(0x22),~(0x11),~(0x11),~(0x00),~(0x00), ~(0x44),~(0x44),~(0x22),~(0x22),~(0x11),~(0x11),~(0x00),~(0x00)}; static char p18_bits[] = { ~(0x11),~(0x11),~(0x22),~(0x22),~(0x44),~(0x44),~(0x00),~(0x00),~(0x11),~(0x11),~(0x22),~(0x22), ~(0x44),~(0x44),~(0x00),~(0x00),~(0x11),~(0x11),~(0x22),~(0x22),~(0x44),~(0x44),~(0x00),~(0x00), ~(0x11),~(0x11),~(0x22),~(0x22),~(0x44),~(0x44),~(0x00),~(0x00)}; static char p19_bits[] = { ~(0xe0),~(0x03),~(0x98),~(0x0c),~(0x84),~(0x10),~(0x42),~(0x21),~(0x42),~(0x21),~(0x21),~(0x42), ~(0x19),~(0x4c),~(0x07),~(0xf0),~(0x19),~(0x4c),~(0x21),~(0x42),~(0x42),~(0x21),~(0x42),~(0x21), ~(0x84),~(0x10),~(0x98),~(0x0c),~(0xe0),~(0x03),~(0x80),~(0x00)}; static char p20_bits[] = { ~(0x22),~(0x22),~(0x11),~(0x11),~(0x11),~(0x11),~(0x11),~(0x11),~(0x22),~(0x22),~(0x44),~(0x44), ~(0x44),~(0x44),~(0x44),~(0x44),~(0x22),~(0x22),~(0x11),~(0x11),~(0x11),~(0x11),~(0x11),~(0x11), ~(0x22),~(0x22),~(0x44),~(0x44),~(0x44),~(0x44),~(0x44),~(0x44)}; static char p21_bits[] = { ~(0xf1),~(0xf1),~(0x10),~(0x10),~(0x10),~(0x10),~(0x10),~(0x10),~(0x1f),~(0x1f),~(0x01),~(0x01), ~(0x01),~(0x01),~(0x01),~(0x01),~(0xf1),~(0xf1),~(0x10),~(0x10),~(0x10),~(0x10),~(0x10),~(0x10), ~(0x1f),~(0x1f),~(0x01),~(0x01),~(0x01),~(0x01),~(0x01),~(0x01)}; static char p22_bits[] = { ~(0x8f),~(0x8f),~(0x08),~(0x08),~(0x08),~(0x08),~(0x08),~(0x08),~(0xf8),~(0xf8),~(0x80),~(0x80), ~(0x80),~(0x80),~(0x80),~(0x80),~(0x8f),~(0x8f),~(0x08),~(0x08),~(0x08),~(0x08),~(0x08),~(0x08), ~(0xf8),~(0xf8),~(0x80),~(0x80),~(0x80),~(0x80),~(0x80),~(0x80)}; static char p23_bits[] = { ~(0xAA),~(0xAA),~(0x55),~(0x55),~(0x6a),~(0x6a),~(0x74),~(0x74),~(0x78),~(0x78),~(0x74),~(0x74), ~(0x6a),~(0x6a),~(0x55),~(0x55),~(0xAA),~(0xAA),~(0x55),~(0x55),~(0x6a),~(0x6a),~(0x74),~(0x74), ~(0x78),~(0x78),~(0x74),~(0x74),~(0x6a),~(0x6a),~(0x55),~(0x55)}; static char p24_bits[] = { ~(0x80),~(0x00),~(0xc0),~(0x00),~(0xea),~(0xa8),~(0xd5),~(0x54),~(0xea),~(0xa8),~(0xd5),~(0x54), ~(0xeb),~(0xe8),~(0xd5),~(0xd4),~(0xe8),~(0xe8),~(0xd4),~(0xd4),~(0xa8),~(0xe8),~(0x54),~(0xd5), ~(0xa8),~(0xea),~(0x54),~(0xd5),~(0xfc),~(0xff),~(0xfe),~(0xff)}; static char p25_bits[] = { ~(0x80),~(0x00),~(0xc0),~(0x00),~(0xe0),~(0x00),~(0xf0),~(0x00),~(0xff),~(0xf0),~(0xff),~(0xf0), ~(0xfb),~(0xf0),~(0xf9),~(0xf0),~(0xf8),~(0xf0),~(0xf8),~(0x70),~(0xf8),~(0x30),~(0xff),~(0xf0), ~(0xff),~(0xf8),~(0xff),~(0xfc),~(0xff),~(0xfe),~(0xff),~(0xff)}; static char *patter_bits[] = { p1_bits, p2_bits, p3_bits, p4_bits, p5_bits, p6_bits, p7_bits, p8_bits, p9_bits, p10_bits, p11_bits, p12_bits, p13_bits, p14_bits, p15_bits, p16_bits, p17_bits, p18_bits, p19_bits, p20_bits, p21_bits, p22_bits, p23_bits, p24_bits, p25_bits}; class TGWin32Brush { private: BITMAP fFillBitMap; // Bitmao to build a hatch brush LOGBRUSH fLOGFillBrush; // WIN32 LOGBRUSH datastruture to paint ROOT objects HBRUSH fBrush; // Handle of the current brush; public: TGWin32Brush(); ~TGWin32Brush(); void Delete(); void SetColor(COLORREF ci); void SetStyle(int style, int fasi); HBRUSH GetBrush(){return fBrush;} UINT GetStyle(){return fLOGFillBrush.lbStyle;} COLORREF GetColor(){return fLOGFillBrush.lbColor;} }; #endif