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