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
2286
+ − 40 gtk_initially_selected_for_input (struct console *UNUSED (con))
462
+ − 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
2286
+ − 49 gtk_device_to_console_connection (Lisp_Object connection,
+ − 50 Error_Behavior UNUSED (errb))
462
+ − 51 {
+ − 52 /* Strip the trailing .# off of the connection, if it's there. */
+ − 53
+ − 54 if (NILP (connection))
+ − 55 return Qnil;
+ − 56 else
+ − 57 {
+ − 58 connection = build_string ("gtk");
+ − 59 }
+ − 60 return connection;
+ − 61 }
+ − 62
+ − 63 static Lisp_Object
+ − 64 gtk_semi_canonicalize_console_connection (Lisp_Object connection,
2286
+ − 65 Error_Behavior UNUSED (errb))
462
+ − 66 {
+ − 67 struct gcpro gcpro1;
+ − 68
+ − 69 GCPRO1 (connection);
+ − 70
+ − 71 connection = build_string ("gtk");
+ − 72
+ − 73 RETURN_UNGCPRO (connection);
+ − 74 }
+ − 75
+ − 76 static Lisp_Object
2286
+ − 77 gtk_canonicalize_console_connection (Lisp_Object connection,
+ − 78 Error_Behavior UNUSED (errb))
462
+ − 79 {
+ − 80 Lisp_Object hostname = Qnil;
+ − 81 struct gcpro gcpro1, gcpro2;
+ − 82
+ − 83 GCPRO2 (connection, hostname);
+ − 84
+ − 85 connection = build_string ("gtk");
+ − 86
+ − 87 RETURN_UNGCPRO (connection);
+ − 88 }
+ − 89
+ − 90 static Lisp_Object
+ − 91 gtk_semi_canonicalize_device_connection (Lisp_Object connection,
2286
+ − 92 Error_Behavior UNUSED (errb))
462
+ − 93 {
+ − 94 struct gcpro gcpro1;
+ − 95
+ − 96 GCPRO1 (connection);
+ − 97
+ − 98 connection = build_string("gtk");
+ − 99
+ − 100 RETURN_UNGCPRO (connection);
+ − 101 }
+ − 102
+ − 103 static Lisp_Object
2286
+ − 104 gtk_canonicalize_device_connection (Lisp_Object connection,
+ − 105 Error_Behavior UNUSED (errb))
462
+ − 106 {
+ − 107 struct gcpro gcpro1;
+ − 108
+ − 109 GCPRO1 (connection);
+ − 110 connection = build_string("gtk");
+ − 111
+ − 112 RETURN_UNGCPRO (connection);
+ − 113 }
+ − 114
+ − 115 void
+ − 116 console_type_create_gtk (void)
+ − 117 {
+ − 118 INITIALIZE_CONSOLE_TYPE (gtk, "gtk", "console-gtk-p");
+ − 119
+ − 120 CONSOLE_HAS_METHOD (gtk, semi_canonicalize_console_connection);
+ − 121 CONSOLE_HAS_METHOD (gtk, canonicalize_console_connection);
+ − 122 CONSOLE_HAS_METHOD (gtk, semi_canonicalize_device_connection);
+ − 123 CONSOLE_HAS_METHOD (gtk, canonicalize_device_connection);
+ − 124 CONSOLE_HAS_METHOD (gtk, device_to_console_connection);
+ − 125 CONSOLE_HAS_METHOD (gtk, initially_selected_for_input);
+ − 126 /* CONSOLE_HAS_METHOD (gtk, delete_console); */
+ − 127 }
+ − 128
+ − 129 void
+ − 130 reinit_console_type_create_gtk (void)
+ − 131 {
+ − 132 REINITIALIZE_CONSOLE_TYPE (gtk);
+ − 133 }