2 * $XConsortium: WindowSystemMotif.hh /main/15 1996/11/27 12:29:47 rcs $
4 * Copyright (c) 1991 HaL Computer Systems, Inc. All rights reserved.
5 * UNPUBLISHED -- rights reserved under the Copyright Laws of the United
6 * States. Use of a copyright notice is precautionary only and does not
7 * imply publication or disclosure.
9 * This software contains confidential information and trade secrets of HaL
10 * Computer Systems, Inc. Use, disclosure, or reproduction is prohibited
11 * without the prior express written permission of HaL Computer Systems, Inc.
13 * RESTRICTED RIGHTS LEGEND
14 * Use, duplication, or disclosure by the Government is subject to
15 * restrictions as set forth in subparagraph (c)(l)(ii) of the Rights in
16 * Technical Data and Computer Software clause at DFARS 252.227-7013.
17 * HaL Computer Systems, Inc.
18 * 1315 Dell Avenue, Campbell, CA 95008
22 #include <WWL/WApplicationShell.h>
23 #include "Other/AppPrintData.hh"
30 // VideoShell structure definition
32 typedef struct _VideoShell
46 class WindowSystem : public WWL, public FolioObject
48 struct CursorStackElement
50 Cursor cursor; // Cursor set at this stack level.
51 Widget exception; // Any exception to this cursor.
56 WindowSystem (int &argc, char *argv[]);
65 XtAppContext app_context(){ return f_application_context ; }
66 XtAppContext applicationContext() { return app_context(); }
67 AppPrintData * GetAppPrintData() { return f_AppPrintData; };
69 WApplicationShell &toplevel();
70 WApplicationShell &printToplevel();
71 WApplicationShell &onlineToplevel();
76 Display *printDisplay();
77 Display *onlineDisplay();
78 void setPrintDisplay(Widget widget);
79 void setPrinting(Boolean state);
80 VideoShell *videoShell();
81 Atom WM_DELETE_WINDOW()
82 { return f_wm_delete_window; }
84 Pixmap locked_pixmap(Widget w);
85 Pixmap unlocked_pixmap(Widget w);
86 Pixmap semilocked_pixmap(Widget w);
88 Pixmap default_pixmap (Dimension *width, Dimension *height);
89 // NOTE: until we get a real detached pixmap, use default
90 Pixmap detached_pixmap(Dimension *width, Dimension *height);
92 static WindowSystem &window_system()
93 { return (*f_window_system); }
96 XmString make_space(int num_pixels, Widget w);
99 { XBell (f_display, 0); }
101 void show_all_windows();
103 // use this only after a fork!!
104 void close_display_connection();
106 // Color and Preferences
108 // get_color returns 0 for failure
109 unsigned long get_color(const char *colorval, unsigned long &pixel) const ;
114 Cursor create_cursor (const char *filename);
116 void register_shell (WShell *);
117 void register_full_modal_shell (WShell *);
118 void register_primary_modal_shell (WShell *);
119 void set_cursor (Cursor cursor, Widget exception = NULL);
120 void reset_cursor (WCallback *wcb = NULL);
121 void full_modal_cursor (WCallback *wcb = NULL);
122 void primary_modal_cursor (WCallback *wcb = NULL);
124 { set_cursor (f_wait_cursor); }
126 // NOTE: replace calls to set_wait_state with other calls
127 void set_wait_state (WaitState state)
128 { if (state == WS_ON) wait_cursor(); else reset_cursor(); }
130 // Get bool value from resource file
131 bool get_boolean_app_resource (const char *name)
132 { return (get_boolean_default (name)); }
134 bool get_boolean_default (const char *name);
135 int get_int_default (const char *name);
136 const char *get_string_default (const char *name);
137 const WindowGeometry &get_geometry_default (const char *name);
139 Pixel get_color_default(const char *name);
141 // Get message from resource file
142 char *get_message(const char *message_name);
144 void update_display();
147 { return f_nofonts; }
149 XmFontListEntry dtinfo_font();
150 XmFontListEntry dtinfo_space_font();
152 private: // functions
153 void unregister_shell (WCallback *);
154 static void core_dump_handler (int signal_number);
155 static void interrupt_handler (int signal_number);
157 Pixmap read_pixmap(const char *name,
161 protected: // variables
164 WApplicationShell f_toplevel;
166 Display *f_print_display;
169 Cursor f_wait_cursor;
170 Cursor f_modal_cursor;
171 Cursor f_bomb_cursor;
172 Atom f_wm_delete_window;
173 Pixmap f_locked_pixmap;
174 Pixmap f_unlocked_pixmap;
175 Pixmap f_semilocked_pixmap;
176 Pixmap f_default_pixmap;
177 Pixmap f_default_print_pixmap;
178 // Node Pixmaps - default and detached
179 Dimension f_defpix_width;
180 Dimension f_defpix_height;
181 Dimension f_print_defpix_width;
182 Dimension f_print_defpix_height;
183 Pixmap f_detached_pixmap ;
184 Dimension f_detached_width ;
185 Dimension f_detached_height ;
187 CursorStackElement f_cursor_stack[16];
188 short f_cursor_stack_pos;
190 static WindowSystem *f_window_system;
191 AppPrintData * f_AppPrintData;
192 VideoShell * f_video_shell;
193 WApplicationShell f_print_toplevel;
194 Screen *f_print_screen;
195 XmFontListEntry f_dtinfo_font;
196 XmFontListEntry f_dtinfo_space_font;
198 XtAppContext f_application_context;
203 inline WindowSystem &
206 return (WindowSystem::window_system());
210 class Wait_Cursor : public Destructable
214 { window_system().set_wait_state (WS_ON); }
216 { window_system().set_wait_state (WS_OFF); }
219 enum { DTINFO_FONT, DTINFO_SPACE_FONT };
221 extern XmFontListEntry dtinfo_font(int);