annotate src/console-gtk.c @ 2210:9361a78f86a0

[xemacs-hg @ 2004-08-11 02:04:03 by james] Mark really_abort() as a function that does not return.
author james
date Wed, 11 Aug 2004 02:04:12 +0000
parents 79c6ff3eef26
children 04bc9d2f42c7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
1 /* Console functions for X windows.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
2 Copyright (C) 1996 Ben Wing.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
3
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
4 This file is part of XEmacs.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
5
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
6 XEmacs is free software; you can redistribute it and/or modify it
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
9 later version.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
10
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
14 for more details.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
15
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
20
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
21 /* Synched up with: Not in FSF. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
22
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
23 /* Authorship:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
24
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
25 Ben Wing: January 1996, for 19.14.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
26 William Perry: April 2000, for 21.1 (Gtk version)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
27 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
28
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
29 #include <config.h>
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
30 #include "lisp.h"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
31
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
32 #include "process.h" /* canonicalize_host_name */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
33 #include "redisplay.h" /* for display_arg */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
34
872
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents: 578
diff changeset
35 #include "console-gtk-impl.h"
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents: 578
diff changeset
36
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
37 DEFINE_CONSOLE_TYPE (gtk);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
38
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
39 static int
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
40 gtk_initially_selected_for_input (struct console *con)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
41 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
42 return 1;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
43 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
44
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
45 /* Remember, in all of the following functions, we have to verify
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
46 the integrity of our input, because the generic functions don't. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
47
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
48 static Lisp_Object
578
190b164ddcac [xemacs-hg @ 2001-05-25 11:26:50 by ben]
ben
parents: 462
diff changeset
49 gtk_device_to_console_connection (Lisp_Object connection, Error_Behavior errb)
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
50 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
51 /* Strip the trailing .# off of the connection, if it's there. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
52
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
53 if (NILP (connection))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
54 return Qnil;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
55 else
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
56 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
57 connection = build_string ("gtk");
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
58 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
59 return connection;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
60 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
61
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
62 static Lisp_Object
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
63 gtk_semi_canonicalize_console_connection (Lisp_Object connection,
578
190b164ddcac [xemacs-hg @ 2001-05-25 11:26:50 by ben]
ben
parents: 462
diff changeset
64 Error_Behavior errb)
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
65 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
66 struct gcpro gcpro1;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
67
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
68 GCPRO1 (connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
69
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
70 connection = build_string ("gtk");
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
71
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
72 RETURN_UNGCPRO (connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
73 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
74
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
75 static Lisp_Object
578
190b164ddcac [xemacs-hg @ 2001-05-25 11:26:50 by ben]
ben
parents: 462
diff changeset
76 gtk_canonicalize_console_connection (Lisp_Object connection, Error_Behavior errb)
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
77 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
78 Lisp_Object hostname = Qnil;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
79 struct gcpro gcpro1, gcpro2;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
80
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
81 GCPRO2 (connection, hostname);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
82
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
83 connection = build_string ("gtk");
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
84
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
85 RETURN_UNGCPRO (connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
86 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
87
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
88 static Lisp_Object
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
89 gtk_semi_canonicalize_device_connection (Lisp_Object connection,
578
190b164ddcac [xemacs-hg @ 2001-05-25 11:26:50 by ben]
ben
parents: 462
diff changeset
90 Error_Behavior errb)
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
91 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
92 struct gcpro gcpro1;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
93
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
94 GCPRO1 (connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
95
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
96 connection = build_string("gtk");
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
97
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
98 RETURN_UNGCPRO (connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
99 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
100
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
101 static Lisp_Object
578
190b164ddcac [xemacs-hg @ 2001-05-25 11:26:50 by ben]
ben
parents: 462
diff changeset
102 gtk_canonicalize_device_connection (Lisp_Object connection, Error_Behavior errb)
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
103 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
104 struct gcpro gcpro1;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
105
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
106 GCPRO1 (connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
107 connection = build_string("gtk");
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
108
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
109 RETURN_UNGCPRO (connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
110 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
111
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
112 void
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
113 console_type_create_gtk (void)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
114 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
115 INITIALIZE_CONSOLE_TYPE (gtk, "gtk", "console-gtk-p");
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
116
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
117 CONSOLE_HAS_METHOD (gtk, semi_canonicalize_console_connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
118 CONSOLE_HAS_METHOD (gtk, canonicalize_console_connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
119 CONSOLE_HAS_METHOD (gtk, semi_canonicalize_device_connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
120 CONSOLE_HAS_METHOD (gtk, canonicalize_device_connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
121 CONSOLE_HAS_METHOD (gtk, device_to_console_connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
122 CONSOLE_HAS_METHOD (gtk, initially_selected_for_input);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
123 /* CONSOLE_HAS_METHOD (gtk, delete_console); */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
124 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
125
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
126 void
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
127 reinit_console_type_create_gtk (void)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
128 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
129 REINITIALIZE_CONSOLE_TYPE (gtk);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
130 }