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