comparison src/console-gtk.c @ 462:0784d089fdc9 r21-2-46

Import from CVS: tag r21-2-46
author cvs
date Mon, 13 Aug 2007 11:44:37 +0200
parents
children 190b164ddcac
comparison
equal deleted inserted replaced
461:120ed4009e51 462:0784d089fdc9
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 "console-gtk.h"
33 #include "process.h" /* canonicalize_host_name */
34 #include "redisplay.h" /* for display_arg */
35
36 DEFINE_CONSOLE_TYPE (gtk);
37
38 static int
39 gtk_initially_selected_for_input (struct console *con)
40 {
41 return 1;
42 }
43
44 /* Remember, in all of the following functions, we have to verify
45 the integrity of our input, because the generic functions don't. */
46
47 static Lisp_Object
48 gtk_device_to_console_connection (Lisp_Object connection, Error_behavior errb)
49 {
50 /* Strip the trailing .# off of the connection, if it's there. */
51
52 if (NILP (connection))
53 return Qnil;
54 else
55 {
56 connection = build_string ("gtk");
57 }
58 return connection;
59 }
60
61 static Lisp_Object
62 gtk_semi_canonicalize_console_connection (Lisp_Object connection,
63 Error_behavior errb)
64 {
65 struct gcpro gcpro1;
66
67 GCPRO1 (connection);
68
69 connection = build_string ("gtk");
70
71 RETURN_UNGCPRO (connection);
72 }
73
74 static Lisp_Object
75 gtk_canonicalize_console_connection (Lisp_Object connection, Error_behavior errb)
76 {
77 Lisp_Object hostname = Qnil;
78 struct gcpro gcpro1, gcpro2;
79
80 GCPRO2 (connection, hostname);
81
82 connection = build_string ("gtk");
83
84 RETURN_UNGCPRO (connection);
85 }
86
87 static Lisp_Object
88 gtk_semi_canonicalize_device_connection (Lisp_Object connection,
89 Error_behavior errb)
90 {
91 struct gcpro gcpro1;
92
93 GCPRO1 (connection);
94
95 connection = build_string("gtk");
96
97 RETURN_UNGCPRO (connection);
98 }
99
100 static Lisp_Object
101 gtk_canonicalize_device_connection (Lisp_Object connection, Error_behavior errb)
102 {
103 struct gcpro gcpro1;
104
105 GCPRO1 (connection);
106 connection = build_string("gtk");
107
108 RETURN_UNGCPRO (connection);
109 }
110
111 void
112 console_type_create_gtk (void)
113 {
114 INITIALIZE_CONSOLE_TYPE (gtk, "gtk", "console-gtk-p");
115
116 CONSOLE_HAS_METHOD (gtk, semi_canonicalize_console_connection);
117 CONSOLE_HAS_METHOD (gtk, canonicalize_console_connection);
118 CONSOLE_HAS_METHOD (gtk, semi_canonicalize_device_connection);
119 CONSOLE_HAS_METHOD (gtk, canonicalize_device_connection);
120 CONSOLE_HAS_METHOD (gtk, device_to_console_connection);
121 CONSOLE_HAS_METHOD (gtk, initially_selected_for_input);
122 /* CONSOLE_HAS_METHOD (gtk, delete_console); */
123 }
124
125 void
126 reinit_console_type_create_gtk (void)
127 {
128 REINITIALIZE_CONSOLE_TYPE (gtk);
129 }