annotate src/glyphs-shared.c @ 569:9cdcb214753f

[xemacs-hg @ 2001-05-24 12:20:33 by yoshiki] Fix broken build. * gui.c (gui_error_2): New function. * lisp.h (gui_error_2): Declare it.
author yoshiki
date Thu, 24 May 2001 12:20:35 +0000
parents 183866b06e0b
children 4d7fdf497470
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
1 /* mswindows-specific glyph objects.
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
2 Copyright (C) 1993, 1994 Free Software Foundation, Inc.
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
3 Copyright (C) 1995 Board of Trustees, University of Illinois.
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
4 Copyright (C) 1995 Tinker Systems
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
5 Copyright (C) 1995, 1996 Ben Wing
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
6 Copyright (C) 1995 Sun Microsystems
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
7 Copyright (C) 1998, 1999, 2000 Andy Piper.
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
8
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
9 This file is part of XEmacs.
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
10
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
11 XEmacs is free software; you can redistribute it and/or modify it
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
12 under the terms of the GNU General Public License as published by the
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
13 Free Software Foundation; either version 2, or (at your option) any
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
14 later version.
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
15
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
16 XEmacs is distributed in the hope that it will be useful, but WITHOUT
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
19 for more details.
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
20
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
21 You should have received a copy of the GNU General Public License
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
22 along with XEmacs; see the file COPYING. If not, write to
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
23 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
24 Boston, MA 02111-1307, USA. */
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
25
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
26 /* Synched up with: Not in FSF. */
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
27
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
28 /* taken from glyphs-*.c
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
29 HINT HINT HINT Bill Perry: Please put code here and avoid massive
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
30 duplication in *-gtk.c!!! */
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
31
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
32 #include <config.h>
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
33 #include "lisp.h"
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
34 #include "lstream.h"
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
35
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
36 #include "window.h"
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
37 #include "elhash.h"
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
38 #include "buffer.h"
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
39 #include "frame.h"
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
40 #include "insdel.h"
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
41 #include "opaque.h"
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
42 #include "sysdep.h"
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
43 #include "sysfile.h"
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
44 #include "faces.h"
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
45 #include "imgproc.h"
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
46
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
47 Lisp_Object Q_resource_type, Q_resource_id;
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
48
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
49 void
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
50 shared_resource_validate (Lisp_Object instantiator)
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
51 {
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
52 if ((NILP (find_keyword_in_vector (instantiator, Q_file))
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
53 &&
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
54 NILP (find_keyword_in_vector (instantiator, Q_resource_id)))
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
55 ||
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
56 NILP (find_keyword_in_vector (instantiator, Q_resource_type)))
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
57 sferror ("Must supply :file, :resource-id and :resource-type",
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
58 instantiator);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
59 }
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
60
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
61
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
62 Lisp_Object
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
63 shared_resource_normalize (Lisp_Object inst, Lisp_Object console_type,
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
64 Lisp_Object dest_mask, Lisp_Object tag)
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
65 {
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
66 /* This function can call lisp */
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
67 Lisp_Object file = Qnil;
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
68 struct gcpro gcpro1, gcpro2;
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
69 Lisp_Object alist = Qnil;
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
70
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
71 GCPRO2 (file, alist);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
72
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
73 file = potential_pixmap_file_instantiator (inst, Q_file, Q_data,
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
74 console_type);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
75
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
76 if (CONSP (file)) /* failure locating filename */
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
77 signal_double_image_error ("Opening pixmap file",
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
78 "no such file or directory",
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
79 Fcar (file));
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
80
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
81 if (NILP (file)) /* no conversion necessary */
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
82 RETURN_UNGCPRO (inst);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
83
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
84 alist = tagged_vector_to_alist (inst);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
85
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
86 {
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
87 alist = remassq_no_quit (Q_file, alist);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
88 alist = Fcons (Fcons (Q_file, file), alist);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
89 }
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
90
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
91 {
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
92 Lisp_Object result = alist_to_tagged_vector (tag, alist);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
93 free_alist (alist);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
94 RETURN_UNGCPRO (result);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
95 }
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
96 }
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
97
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
98 void
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
99 syms_of_glyphs_shared (void)
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
100 {
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
101 DEFKEYWORD (Q_resource_id);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
102 DEFKEYWORD (Q_resource_type);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents:
diff changeset
103 }