Corrections to SVN properties.
[AROS.git] / workbench / classes / zune / nlist / nlisttree_mcc / images / OpenNodeWin98 / OpenNodeWin98.c
blob40227633fbb840c91d421f0eb6148403c10491fc
1 /******************************************************************************\
2 ********************************************************************************
3 ***
4 *** $Source$
5 *** $Revision$
6 *** $Date$
7 ***
8 *** $Id$
9 ***
10 *** $Author$
11 ***
12 ***
13 ***
14 *** UNLESS OTHERWISE NOTED, ALL FILES ARE
15 *** COPYRIGHT (C) 2000 BY "APOCALYPSE HARD- UND SOFTWARE CARSTEN SCHOLLING".
16 *** ALL RIGHTS RESERVED.
17 ***
18 *** NO PART OF THIS SOFTWARE MAY BE COPIED, REPRODUCED, TRANSMITTED, REDIST-
19 *** RIBUTED, DISCLOSED OR DUPLICATED IN ANY FORM OR BY ANY MEANS, WITHOUT
20 *** THE PRIOR WRITTEN PERMISSION OF "APOCALYPSE HARD- UND SOFTWARE".
21 ***
22 ***
23 *** DISCLAIMER
24 ***
25 *** THIS SOFTWARE AND INFORMATION IS PROVIDED "AS IS". NO REPRESENTATIONS OR
26 *** WARRANTIES ARE MADE WITH RESPECT TO THE ACCURACY, RELIABILITY, PERFOR-
27 *** MANCE, CURRENTNESS OR OPERATION OF THIS SOFTWARE AND INFORMATION, AND
28 *** ALL USE IS AT YOUR OWN RISK. NEITHER "APOCALYPSE HARD- UND SOFTWARE" NOR
29 *** THE AUTHORS ITSELF ASSUME ANY RESPONSIBILITY OR LIABILITY WHATSOEVER
30 *** WITH RESPECT TO YOUR USE OF THIS SOFTWARE AND INFORMATION.
31 ***
32 ***
33 ***
34 ***
35 *** $Log$
36 *** Revision 1.1 2004/07/10 20:31:44 damato
37 *** - inital checkin
38 ***
39 ***
40 ***
41 ********************************************************************************
42 \******************************************************************************/
44 #include <intuition/gadgetclass.h>
45 #include <intuition/imageclass.h>
46 #include <intuition/intuition.h>
47 #include <clib/alib_protos.h>
48 #include <libraries/mui.h>
50 #include <compiler.h>
51 #include <debug.h>
54 #include "OpenNodeWin98_rev.h"
56 #define IMAGE "OpenNodeWin98"
59 #define libfunc(x) image_Lib ## x
60 #define reqfunc muilink_use_image
61 #define addname(x) image_ ## x
65 ** $setver$
67 STATIC const char UserLibID[] = VERSTAG;
70 struct Data {
72 struct MUI_RenderInfo *mri;
76 #include <MUI/imageheader.c>
79 STATIC ULONG ASM _BoopsiQuery( REG(a0) struct IClass *cl, REG(a2) Object *obj, REG(a1) struct MUI_BoopsiQuery *mbq )
81 struct Data *data = INST_DATA( cl, obj );
83 //D(bug( "\n" ) );
85 if ( mbq->mbq_Flags & MBQF_HORIZ )
87 mbq->mbq_MinWidth = 9;
88 mbq->mbq_MaxWidth = MBQ_MUI_MAXMAX;
89 mbq->mbq_DefWidth = 9;
91 mbq->mbq_MinHeight = 9;
92 mbq->mbq_MaxHeight = MBQ_MUI_MAXMAX;
93 mbq->mbq_DefHeight = 9;
95 else
97 mbq->mbq_MinWidth = 9;
98 mbq->mbq_MaxWidth = MBQ_MUI_MAXMAX;
99 mbq->mbq_DefWidth = 9;
101 mbq->mbq_MinHeight = 9;
102 mbq->mbq_MaxHeight = MBQ_MUI_MAXMAX;
103 mbq->mbq_DefHeight = 9;
106 data->mri = mbq->mbq_RenderInfo;
108 return( MUIM_BoopsiQuery );
113 STATIC ULONG ASM _Draw( REG(a0) struct IClass *cl, REG(a2) Object *obj, REG(a1) struct impDraw *msg )
115 #define img ( (struct Image *)obj )
116 struct Data *data = INST_DATA( cl, obj );
117 struct RastPort *rp = msg->imp_RPort;
119 if ( rp != NULL )
121 ULONG l = img->LeftEdge + msg->imp_Offset.X;
122 ULONG t = img->TopEdge + msg->imp_Offset.Y;
123 ULONG w = img->Width;
124 ULONG h = img->Height;
125 ULONG r = l + w - 1;
126 ULONG b = t + h - 1;
127 BOOL sel = ( msg->imp_State == IDS_SELECTED ) ? TRUE : FALSE;
128 UBYTE backgroundpen = data->mri ? data->mri->mri_Pens[MPEN_BACKGROUND] : msg->imp_DrInfo->dri_Pens[BACKGROUNDPEN];
129 UBYTE halfshinepen = data->mri ? data->mri->mri_Pens[MPEN_HALFSHINE] : msg->imp_DrInfo->dri_Pens[SHINEPEN];
130 UBYTE halfshadowpen = data->mri ? data->mri->mri_Pens[MPEN_HALFSHADOW] : msg->imp_DrInfo->dri_Pens[SHADOWPEN];
131 UBYTE shadowpen = data->mri ? data->mri->mri_Pens[MPEN_SHADOW] : msg->imp_DrInfo->dri_Pens[SHADOWPEN];
132 UBYTE shinepen = data->mri ? data->mri->mri_Pens[MPEN_SHINE] : msg->imp_DrInfo->dri_Pens[SHINEPEN];
134 //D(bug( "\n" ) );
136 SetDrMd( rp, JAM1 );
139 if ( ( w > 2 ) && ( h > 2 ) )
141 SetAPen( rp, backgroundpen );
142 RectFill( rp, l, t, r, b );
146 SetAPen( rp, halfshadowpen );
149 ** #########
150 ** #+++++++#
151 ** #+++++++#
152 ** #+++++++#
153 ** #+++++++#
154 ** #+++++++#
155 ** #+++++++#
156 ** #+++++++#
157 ** #########
159 Move( rp, l, t );
160 Draw( rp, r, t );
161 Draw( rp, r, b );
162 Draw( rp, l, b );
163 Draw( rp, l, t );
165 SetAPen( rp, shadowpen );
168 ** *********
169 ** *+++++++*
170 ** *+++++++*
171 ** *+++++++*
172 ** *+#####+*
173 ** *+++++++*
174 ** *+++++++*
175 ** *+++++++*
176 ** *********
178 Move( rp, l + 2, t + 4 );
179 Draw( rp, r - 2, t + 4 );
182 return( 0 );
186 ULONG ASM SAVEDS _Dispatcher( REG(a0) struct IClass *cl, REG(a2) Object *obj, REG(a1) Msg msg )
188 switch ( msg->MethodID )
190 case IM_DRAW: return( _Draw( cl, obj, (APTR)msg ) );
191 case MUIM_BoopsiQuery: return( _BoopsiQuery( cl, obj, (APTR)msg ) );
194 return( DoSuperMethodA( cl, obj, msg ) );