annotate oldXMenu/XCrAssoc.c @ 69049:28b3892bfcda

(enum fringe_bitmap_type): Remove. Change all uses to use `int'. (NO_FRINGE_BITMAP, UNDEF_FRINGE_BITMAP, MAX_STANDARD_FRINGE_BITMAPS): Define explicitly. (Qtruncation, Qcontinuation, Qempty_line, Qtop_bottom) (Qhollow_small): New variables. (syms_of_fringe): Intern and staticpro them. (question_mark_bits): Rename from unknown_bits. (left_curly_arrow_bits): Rename from continuation_bits. (right_curly_arrow_bits): Rename from continued_bits. (left_triangle_bits): Rename from ov_bits. (right_triangle_bits): Added. (filled_rectangle_bits): Rename from filled_box_cursor_bits. (hollow_rectangle_bits): Rename from hollow_box_cursor_bits. (filled_square_bits): Added. (vertical_bar_bits): Rename from bar_cursor_bits. (horisontal_bar_bits): Rename from hbar_cursor_bits. (empty_line_bits): Rename from zv_bits. (standard_bitmaps): Update to use new names. (draw_fringe_bitmap_1): Make static. (get_logical_cursor_bitmap, get_logical_fringe_bitmap): New functions to map from logical cursors and indicators to physical bitmaps. (draw_fringe_bitmap): Resolve fringe cursor and overlay-arrow bitmaps using symbol names instead of bitmap numbers. (update_window_fringes): Use logical indicator symbol names instead of bitmap numbers for logical. Add bitmap cache. (LEFT_FRINGE, RIGHT_FRINGE): New helper macros.
author Kim F. Storm <storm@cua.dk>
date Mon, 20 Feb 2006 22:14:22 +0000
parents e8a3fb527b77
children ce127a46b1ca c5406394f567
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
25858
Dave Love <fx@gnu.org>
parents:
diff changeset
1 /* Copyright Massachusetts Institute of Technology 1985 */
68640
e8a3fb527b77 Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 65000
diff changeset
2 /* Copyright (C) 2002, 2003, 2004, 2005,
e8a3fb527b77 Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 65000
diff changeset
3 2006 Free Software Foundation, Inc. */
25858
Dave Love <fx@gnu.org>
parents:
diff changeset
4
Dave Love <fx@gnu.org>
parents:
diff changeset
5 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
6 Permission to use, copy, modify, distribute, and sell this software and its
Dave Love <fx@gnu.org>
parents:
diff changeset
7 documentation for any purpose is hereby granted without fee, provided that
Dave Love <fx@gnu.org>
parents:
diff changeset
8 the above copyright notice appear in all copies and that both that
Dave Love <fx@gnu.org>
parents:
diff changeset
9 copyright notice and this permission notice appear in supporting
Dave Love <fx@gnu.org>
parents:
diff changeset
10 documentation, and that the name of M.I.T. not be used in advertising or
Dave Love <fx@gnu.org>
parents:
diff changeset
11 publicity pertaining to distribution of the software without specific,
Dave Love <fx@gnu.org>
parents:
diff changeset
12 written prior permission. M.I.T. makes no representations about the
Dave Love <fx@gnu.org>
parents:
diff changeset
13 suitability of this software for any purpose. It is provided "as is"
Dave Love <fx@gnu.org>
parents:
diff changeset
14 without express or implied warranty.
Dave Love <fx@gnu.org>
parents:
diff changeset
15 */
Dave Love <fx@gnu.org>
parents:
diff changeset
16
Dave Love <fx@gnu.org>
parents:
diff changeset
17 #include <config.h>
Dave Love <fx@gnu.org>
parents:
diff changeset
18 #include <X11/Xlib.h>
Dave Love <fx@gnu.org>
parents:
diff changeset
19 #include <errno.h>
Dave Love <fx@gnu.org>
parents:
diff changeset
20 #include "X10.h"
Dave Love <fx@gnu.org>
parents:
diff changeset
21
Dave Love <fx@gnu.org>
parents:
diff changeset
22 #ifndef NULL
Dave Love <fx@gnu.org>
parents:
diff changeset
23 #define NULL 0
Dave Love <fx@gnu.org>
parents:
diff changeset
24 #endif
Dave Love <fx@gnu.org>
parents:
diff changeset
25
Dave Love <fx@gnu.org>
parents:
diff changeset
26 extern int errno;
Dave Love <fx@gnu.org>
parents:
diff changeset
27
Dave Love <fx@gnu.org>
parents:
diff changeset
28 /*
Dave Love <fx@gnu.org>
parents:
diff changeset
29 * XCreateAssocTable - Create an XAssocTable. The size argument should be
Dave Love <fx@gnu.org>
parents:
diff changeset
30 * a power of two for efficiency reasons. Some size suggestions: use 32
Dave Love <fx@gnu.org>
parents:
diff changeset
31 * buckets per 100 objects; a reasonable maximum number of object per
Dave Love <fx@gnu.org>
parents:
diff changeset
32 * buckets is 8. If there is an error creating the XAssocTable, a NULL
Dave Love <fx@gnu.org>
parents:
diff changeset
33 * pointer is returned.
Dave Love <fx@gnu.org>
parents:
diff changeset
34 */
Dave Love <fx@gnu.org>
parents:
diff changeset
35 XAssocTable *XCreateAssocTable(size)
Dave Love <fx@gnu.org>
parents:
diff changeset
36 register int size; /* Desired size of the table. */
Dave Love <fx@gnu.org>
parents:
diff changeset
37 {
Dave Love <fx@gnu.org>
parents:
diff changeset
38 register XAssocTable *table; /* XAssocTable to be initialized. */
Dave Love <fx@gnu.org>
parents:
diff changeset
39 register XAssoc *buckets; /* Pointer to the first bucket in */
Dave Love <fx@gnu.org>
parents:
diff changeset
40 /* the bucket array. */
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 25858
diff changeset
41
25858
Dave Love <fx@gnu.org>
parents:
diff changeset
42 /* Malloc the XAssocTable. */
Dave Love <fx@gnu.org>
parents:
diff changeset
43 if ((table = (XAssocTable *)malloc(sizeof(XAssocTable))) == NULL) {
Dave Love <fx@gnu.org>
parents:
diff changeset
44 /* malloc call failed! */
Dave Love <fx@gnu.org>
parents:
diff changeset
45 errno = ENOMEM;
Dave Love <fx@gnu.org>
parents:
diff changeset
46 return(NULL);
Dave Love <fx@gnu.org>
parents:
diff changeset
47 }
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 25858
diff changeset
48
25858
Dave Love <fx@gnu.org>
parents:
diff changeset
49 /* calloc the buckets (actually just their headers). */
Dave Love <fx@gnu.org>
parents:
diff changeset
50 buckets = (XAssoc *)calloc((unsigned)size, (unsigned)sizeof(XAssoc));
Dave Love <fx@gnu.org>
parents:
diff changeset
51 if (buckets == NULL) {
Dave Love <fx@gnu.org>
parents:
diff changeset
52 /* calloc call failed! */
Dave Love <fx@gnu.org>
parents:
diff changeset
53 errno = ENOMEM;
Dave Love <fx@gnu.org>
parents:
diff changeset
54 return(NULL);
Dave Love <fx@gnu.org>
parents:
diff changeset
55 }
Dave Love <fx@gnu.org>
parents:
diff changeset
56
Dave Love <fx@gnu.org>
parents:
diff changeset
57 /* Insert table data into the XAssocTable structure. */
Dave Love <fx@gnu.org>
parents:
diff changeset
58 table->buckets = buckets;
Dave Love <fx@gnu.org>
parents:
diff changeset
59 table->size = size;
Dave Love <fx@gnu.org>
parents:
diff changeset
60
Dave Love <fx@gnu.org>
parents:
diff changeset
61 while (--size >= 0) {
Dave Love <fx@gnu.org>
parents:
diff changeset
62 /* Initialize each bucket. */
Dave Love <fx@gnu.org>
parents:
diff changeset
63 buckets->prev = buckets;
Dave Love <fx@gnu.org>
parents:
diff changeset
64 buckets->next = buckets;
Dave Love <fx@gnu.org>
parents:
diff changeset
65 buckets++;
Dave Love <fx@gnu.org>
parents:
diff changeset
66 }
Dave Love <fx@gnu.org>
parents:
diff changeset
67
Dave Love <fx@gnu.org>
parents:
diff changeset
68 return(table);
Dave Love <fx@gnu.org>
parents:
diff changeset
69 }
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 49600
diff changeset
70
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 49600
diff changeset
71 /* arch-tag: 5df3237d-ada0-4345-a3ab-282cafb397aa
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 49600
diff changeset
72 (do not change this comment) */