msdos.h 3.73 KB
Newer Older
Richard M. Stallman's avatar
Richard M. Stallman committed
1
/* MS-DOS specific C utilities, interface.
Paul Eggert's avatar
Paul Eggert committed
2
   Copyright (C) 1993, 2001-2016 Free Software Foundation, Inc.
Richard M. Stallman's avatar
Richard M. Stallman committed
3 4 5

This file is part of GNU Emacs.

6
GNU Emacs is free software: you can redistribute it and/or modify
Richard M. Stallman's avatar
Richard M. Stallman committed
7
it under the terms of the GNU General Public License as published by
8 9
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Richard M. Stallman's avatar
Richard M. Stallman committed
10 11 12 13 14 15 16

GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
17
along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
Richard M. Stallman's avatar
Richard M. Stallman committed
18

19 20
#ifndef EMACS_MSDOS_H
#define EMACS_MSDOS_H
Morten Welinder's avatar
Morten Welinder committed
21

Richard M. Stallman's avatar
Richard M. Stallman committed
22 23
#include <dpmi.h>

24
int dos_ttraw (struct tty_display_info *);
25
int dos_ttcooked (void);
Kim F. Storm's avatar
Kim F. Storm committed
26 27
int dos_get_saved_screen (char **, int *, int *);
int dos_set_keyboard (int, int);
28
void dos_set_window_size (int *, int *);
Kim F. Storm's avatar
Kim F. Storm committed
29

Richard M. Stallman's avatar
Richard M. Stallman committed
30 31
int getdefdir (int, char*);
void unixtodos_filename (char *);
32
void dostounix_filename (char *);
33
char *rootrelativepath (char *);
34 35
void init_environment (int, char **, int);
void internal_terminal_init (void);
36
void initialize_msdos_display (struct terminal *);
Richard M. Stallman's avatar
Richard M. Stallman committed
37 38

extern int have_mouse;
39 40 41
void mouse_init (void);
void mouse_on (void);
void mouse_off (void);
Richard M. Stallman's avatar
Richard M. Stallman committed
42
void mouse_moveto (int, int);
43

Eli Zaretskii's avatar
Eli Zaretskii committed
44 45 46
#include <sys/types.h>
#include <sys/stat.h>

47 48 49
#if __DJGPP__ == 2 && __DJGPP_MINOR__ < 4
int readlink (const char *, char *, size_t);
#endif
Eli Zaretskii's avatar
Eli Zaretskii committed
50 51 52 53 54 55 56 57 58 59 60 61 62
ssize_t readlinkat (int, const char *, char *, size_t);
int fstatat (int, char const *, struct stat *, int);
int unsetenv (const char *);

/* Constants.  */
#define EINPROGRESS 112
/* Gnulib sets O_CLOEXEC to O_NOINHERIT, which gets in the way when we
   need to redirect standard handles for subprocesses using temporary
   files created by mkostemp, see callproc.c.  */
#ifdef O_CLOEXEC
# undef O_CLOEXEC
#endif
#define O_CLOEXEC 0
63

Morten Welinder's avatar
Morten Welinder committed
64 65 66 67 68 69 70 71

#ifndef HAVE_X_WINDOWS
/* Dummy types.  */
typedef int XFontStruct;
typedef int GC;
typedef int Pixmap;
typedef int Display;
typedef int Window;
72
typedef int XRectangle;
73
#define PIX_TYPE unsigned long
Morten Welinder's avatar
Morten Welinder committed
74 75
#define XDISPLAY

76 77
typedef struct tty_display_info Display_Info;

78
extern struct tty_display_info the_only_display_info;
79

Morten Welinder's avatar
Morten Welinder committed
80
#define FRAME_X_DISPLAY(f) ((Display *) 0)
81
#define FRAME_FONT(f) ((f)->output_data.tty->font)
82
#define FRAME_DISPLAY_INFO(f) (&the_only_display_info)
83

84 85 86 87 88
/* Prototypes.  */

/* Forward declarations for prototypes.  */
struct frame;
struct window;
89 90

/* Defined in xfns.c; emulated on msdos.c */
91

Jan D's avatar
Jan D committed
92
extern void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
93

Morten Welinder's avatar
Morten Welinder committed
94 95 96
#define XFreeGC (void)
#define x_destroy_bitmap(p1,p2)
#define XGetGeometry(p1,p2,p3,p4,p5,p6,p7,p8,p9)
97 98
#define DisplayWidth(p1,p2) (SELECTED_FRAME()->text_cols)
#define DisplayHeight(p1,p2) (SELECTED_FRAME()->text_lines)
Morten Welinder's avatar
Morten Welinder committed
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
#define XMenuSetAEQ (void)
#define XMenuSetFreeze (void)
#define XMenuRecompute (void)
#define XM_FAILURE -1
#define XM_SUCCESS 1
#define XM_NO_SELECT 2
#define XM_IA_SELECT 3
#define ButtonReleaseMask 0

typedef struct x_menu_struct
{
  int count;
  char **text;
  struct x_menu_struct **submenu;
  int *panenumber; /* Also used as enable.  */
  int allocated;
  int panecount;
  int width;
117
  const char **help_text;
Morten Welinder's avatar
Morten Welinder committed
118 119
} XMenu;

120
XMenu *XMenuCreate (Display *, Window, char *);
121 122
int XMenuAddPane (Display *, XMenu *, char const *, int);
int XMenuAddSelection (Display *, XMenu *, int, int, char *, int, char const *);
123 124
void XMenuLocate (Display *, XMenu *, int, int, int, int,
		  int *, int *, int *, int *);
125
int XMenuActivate (Display *, XMenu *, int *, int *, int, int, unsigned,
126
		   char **, void (*callback)(char const *, int, int));
127 128
void XMenuDestroy (Display *, XMenu *);

Morten Welinder's avatar
Morten Welinder committed
129 130
#endif /* not HAVE_X_WINDOWS */

131
#endif /* not EMACS_MSDOS_H */
Miles Bader's avatar
Miles Bader committed
132