annotate src/console-gtk.c @ 2302:513db903b41a

[xemacs-hg @ 2004-09-22 21:54:47 by viteno] Update src depends
author viteno
date Wed, 22 Sep 2004 21:54:47 +0000
parents 04bc9d2f42c7
children a25c824ed558
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
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 872
diff changeset
40 gtk_initially_selected_for_input (struct console *UNUSED (con))
462
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
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 872
diff changeset
49 gtk_device_to_console_connection (Lisp_Object connection,
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 872
diff changeset
50 Error_Behavior UNUSED (errb))
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
51 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
52 /* Strip the trailing .# off of the connection, if it's there. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
53
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
54 if (NILP (connection))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
55 return Qnil;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
56 else
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
57 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
58 connection = build_string ("gtk");
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
59 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
60 return connection;
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
63 static Lisp_Object
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
64 gtk_semi_canonicalize_console_connection (Lisp_Object connection,
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 872
diff changeset
65 Error_Behavior UNUSED (errb))
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
66 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
67 struct gcpro gcpro1;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
68
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
69 GCPRO1 (connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
70
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
71 connection = build_string ("gtk");
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
72
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
73 RETURN_UNGCPRO (connection);
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
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
76 static Lisp_Object
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 872
diff changeset
77 gtk_canonicalize_console_connection (Lisp_Object connection,
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 872
diff changeset
78 Error_Behavior UNUSED (errb))
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
79 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
80 Lisp_Object hostname = Qnil;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
81 struct gcpro gcpro1, gcpro2;
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 GCPRO2 (connection, hostname);
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 connection = build_string ("gtk");
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 RETURN_UNGCPRO (connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
88 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
89
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
90 static Lisp_Object
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
91 gtk_semi_canonicalize_device_connection (Lisp_Object connection,
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 872
diff changeset
92 Error_Behavior UNUSED (errb))
462
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 struct gcpro gcpro1;
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 GCPRO1 (connection);
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 connection = build_string("gtk");
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 RETURN_UNGCPRO (connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
101 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
102
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
103 static Lisp_Object
2286
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 872
diff changeset
104 gtk_canonicalize_device_connection (Lisp_Object connection,
04bc9d2f42c7 [xemacs-hg @ 2004-09-20 19:18:55 by james]
james
parents: 872
diff changeset
105 Error_Behavior UNUSED (errb))
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
106 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
107 struct gcpro gcpro1;
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 GCPRO1 (connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
110 connection = build_string("gtk");
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 RETURN_UNGCPRO (connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
113 }
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 void
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
116 console_type_create_gtk (void)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
117 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
118 INITIALIZE_CONSOLE_TYPE (gtk, "gtk", "console-gtk-p");
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
119
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
120 CONSOLE_HAS_METHOD (gtk, semi_canonicalize_console_connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
121 CONSOLE_HAS_METHOD (gtk, canonicalize_console_connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
122 CONSOLE_HAS_METHOD (gtk, semi_canonicalize_device_connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
123 CONSOLE_HAS_METHOD (gtk, canonicalize_device_connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
124 CONSOLE_HAS_METHOD (gtk, device_to_console_connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
125 CONSOLE_HAS_METHOD (gtk, initially_selected_for_input);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
126 /* CONSOLE_HAS_METHOD (gtk, delete_console); */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
127 }
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 void
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
130 reinit_console_type_create_gtk (void)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
131 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
132 REINITIALIZE_CONSOLE_TYPE (gtk);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
133 }