2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
25 * $XConsortium: x_util.h /main/3 1995/11/06 17:57:58 rswiston $
27 * @(#)x_util.h 1.16 21 Apr 1994 cde_app_builder/src/ab
29 * RESTRICTED CONFIDENTIAL INFORMATION:
31 * The information in this document is subject to special
32 * restrictions in a confidential disclosure agreement between
33 * HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
34 * document outside HP, IBM, Sun, USL, SCO, or Univel without
35 * Sun's specific written approval. This document and all copies
36 * and derivative works thereof must be returned or destroyed at
39 * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
49 #include <X11/Intrinsic.h>
50 #include <X11/StringDefs.h>
53 #define min(a,b) ((a) < (b)? (a):(b))
57 #define max(a,b) ((a) > (b)? (a):(b))
60 extern int x_load_cursor_bitmaps(
63 extern void x_get_widget_rect(
67 extern void x_get_rect_bounding(
71 extern void x_graphics_op(
81 extern void x_get_widget_rect(
85 extern void x_adjust_rect_margin(
101 extern void x_dashed_box_r(
106 extern void x_fullscreen_box(
114 extern void x_fullscreen_preview_box(
122 extern void x_conn_fullscreen_init(
126 extern void x_conn_fullscreen_chord(
134 extern void x_fullscreen_chord(
142 extern void x_conn_fullscreen_cleanup(
149 extern Boolean x_widget_translate_xy(
157 extern Boolean x_rootxy_inside_widget(
162 extern Window x_xwin_at_rootxy(
169 extern Cursor x_create_cursor(
172 unsigned char bits[],
173 unsigned short width,
174 unsigned short height,
179 extern Cursor x_create_stencil_cursor(
182 unsigned short width,
183 unsigned short height,
188 extern int x_get_num_pending_expose_events(Display *display);
191 /*************************************************************************
195 **************************************************************************/
196 #define rect_right(r) (short)((r)->x + (short)(r)->width)
197 #define rect_bottom(r) (short)((r)->y + (short)(r)->height)
199 #define rect_includespoint(r,p_x,p_y) \
200 ((p_x) >= (r)->x && (p_y) >= (r)->y && \
201 (p_x)< (short)((r)->x+(short)(r)->width) && \
202 (p_y)< (short)((r)->y+(short)(r)->height))
204 #define rect_includesrect(r1, r2) \
205 ((r2)->x >= (r1)->x && (r2)->y >= (r1)->y && \
206 ((r2)->x + (short)(r2)->width) <= ((r1)->x + (short)(r1)->width) && \
207 ((r2)->y + (short)(r2)->height) <= ((r1)->y + (short)(r1)->height))
209 #define rect_equal(r1,r2) \
210 ((r1)->x==(r2)->x && (r1)->width==(r2)->width && \
211 (r1)->y==(r2)->y && (r1)->height==(r2)->height)
213 #define rect_zero_out(r) \
214 { (r)->x=0;(r)->y=0;(r)->width=0;(r)->height=0; }
216 #define rect_isnull(r) \
217 ((r)->width==0 && (r)->height==0)
219 /*************************************************************************
223 **************************************************************************/
224 extern Pixmap AB_cp_cursor_pixmap, AB_mv_cursor_pixmap;
225 extern unsigned short AB_cp_cursor_height, AB_cp_cursor_width;
226 extern unsigned short AB_mv_cursor_height, AB_mv_cursor_width;
228 #endif /* _X_UTIL_H_ */