]> asedeno.scripts.mit.edu Git - pssh.git/blob - forms/resize.h
My 2007-03-18 release:
[pssh.git] / forms / resize.h
1 /* $Id: resize.h,v 1.1 2005/05/15 09:06:04 admin Exp $ */
2 /*******************************************************************************
3     Copyright (c) 2004, Alexander R. Pruss
4     All rights reserved.
5
6     Redistribution and use in source and binary forms, with or without modification,
7     are permitted provided that the following conditions are met:
8
9         Redistributions of source code must retain the above copyright notice, this
10         list of conditions and the following disclaimer.
11
12         Redistributions in binary form must reproduce the above copyright notice, this
13         list of conditions and the following disclaimer in the documentation and/or
14         other materials provided with the distribution.
15
16         Neither the name of the PalmResize Project nor the names of its
17         contributors may be used to endorse or promote products derived from this
18         software without specific prior written permission.
19
20     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
21     ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
24     ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25     (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
27     ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29     SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 *******************************************************************************/
31
32 #ifndef PLUCKER_RESIZE_H
33 #define PLUCKER_RESIZE_H
34
35 //#include "viewer.h"
36 #include <PalmOS.h>
37
38 // GrP
39 #include "includes.h"
40 #define SUPPORT_DIA
41 #define SUPPORT_DIA_SONY
42 #define SafeMemPtrNew(s) arena_malloc(s)
43 #define SafeMemPtrFree(p) arena_free(p)
44
45 #if ! defined( SUPPORT_DIA ) && defined( HAVE_SILKSCREEN )
46 # define SUPPORT_DIA
47 #endif
48
49 #if ! defined( SUPPORT_DIA_SONY ) && defined( HAVE_SONY_SDK )
50 # define SUPPORT_DIA_SONY
51 #endif
52
53 #if ! defined( SUPPORT_DIA_HANDERA ) && defined( HAVE_HANDERA_SDK )
54 # define SUPPORT_DIA_HANDERA
55 #endif
56
57 #ifndef winDisplayChangedEvent
58 # define winDisplayChangedEvent 0x4101
59 #else
60 # define HAVE_PALM_DIA_SDK
61 #endif
62
63 #include "resizeconsts.h"
64
65 #define WORD_LIST_TYPE 'wrdl'
66
67 typedef void (*DIAResizeCallback)(FormPtr frmP, Int16 dw, Int16 dh);
68
69 typedef struct {
70     UInt16 objectID;
71     UInt16 flags;
72     UInt16 reserved;
73 } DIAConfigEntryType;
74
75 typedef UInt8 DIAStateType;
76
77 typedef struct {
78     UInt16             sizeInWords;
79     UInt16             flags;
80     UInt16             bin;
81     UInt16             preferredState;
82     DIAConfigEntryType objectList[0];
83 } DIAConfigType;
84
85 typedef struct {
86     UInt16 from;
87     UInt16 to;
88 } DIAIndexEntryType;
89
90 typedef struct {
91     UInt16 count;
92     DIAIndexEntryType mapList[ 0 ];
93 } DIAIndexType;
94
95 typedef struct {
96     UInt16         formID;
97     UInt16         numObjects;
98     Boolean        open;
99     MemHandle      configHandle;
100     Coord          lastExtentX;
101     Coord          lastExtentY;
102     RectangleType  lastBounds;
103     Boolean        forceRedraw;
104     DIAConfigType* config;
105     RectangleType* originalBounds;
106     DIAResizeCallback callback;
107 } DIAFormEntryType;
108
109 #ifdef SUPPORT_DIA
110 extern void InitializeResizeSupport( UInt16 formMapId ) RESIZE_SECTION;
111 extern void TerminateResizeSupport( void ) RESIZE_SECTION;
112 extern void SetResizePolicy( UInt16 formID ) RESIZE_SECTION;
113 extern void SetResizeCallback( UInt16 formID, DIAResizeCallback fn ) RESIZE_SECTION;
114 extern Boolean ResizeHandleFrmOpenEvent( void ) RESIZE_SECTION;
115 extern Boolean ResizeHandleFrmCloseEvent( void ) RESIZE_SECTION;
116 extern Boolean ResizeHandleWinDisplayChangedEvent( void ) RESIZE_SECTION;
117 extern Boolean ResizeHandleWinExitEvent( void ) RESIZE_SECTION;
118 extern Boolean ResizeHandleWinEnterEvent( void ) RESIZE_SECTION;
119 extern Boolean ResizeHandleFrmRedrawUpdateCode( void ) RESIZE_SECTION;
120 extern void LoadResizePrefs( UInt32 appID, UInt16 prefID ) RESIZE_SECTION;
121 extern void SaveResizePrefs( UInt32 appID, UInt16 prefID, Int16 version )
122     RESIZE_SECTION;
123 extern void ResizeRefreshCurrentForm( void ) RESIZE_SECTION;
124 extern void SetHaveWinDisplayChangedEvent( Boolean value ) RESIZE_SECTION;
125 extern Boolean ResizeHandleEvent( EventType* event ) RESIZE_SECTION;
126 #else
127
128 #define HandleResizeNotification( x )
129 #define InitializeResizeSupport( x )
130 #define TerminateResizeSupport()
131 #define SetResizePolicy( x )
132 #define SetResizeCallback( x )
133 #define ResizeHandleFrmOpenEvent()  true
134 #define ResizeHandleFrmCloseEvent() true
135 #define ResizeHandleWinDisplayChangedEvent() true
136 #define ResizeHandleWinExitEvent()  true
137 #define ResizeHandleWinEnterEvent() true
138 #define LoadResizePrefs( a, b )
139 #define SaveResizePrefs( a, b, c )
140 #define ResizeRefreshCurrentForm()
141 #define SetHaveWinDisplayChangedEvent( x )
142 #define ResizeHandleFrmRedrawUpdateCode() true
143 #define ResizeHandleEvent( e ) false
144
145 #endif
146
147 #endif /* _ARP_RESIZE_H */