mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-12 22:40:46 -08:00
Although static_assert is C11-specific, and Emacs remains on C99, it has been backported to older compilers by Gnulib. Gnulib has already changed to prefer static_assert, and we can do the same. * lib-src/asset-directory-tool.c (main_2): * src/alloc.c (BLOCK_ALIGN, aligned_alloc, lisp_align_malloc) (vectorlike_nbytes, allocate_pseudovector): * src/android.c (android_globalize_reference, android_set_dashes): * src/android.h: * src/androidfont.c (androidfont_draw, androidfont_text_extents): * src/androidvfs.c: * src/bidi.c (BIDI_CACHE_MAX_ELTS_PER_SLOT, bidi_find_bracket_pairs): * src/buffer.c (init_buffer_once): * src/casefiddle.c (do_casify_multibyte_string): * src/dispnew.c (scrolling_window, scrolling): * src/editfns.c (styled_format): * src/emacs-module.c (module_extract_big_integer): * src/fileio.c (Fdo_auto_save): * src/fns.c (next_almost_prime, hash_string): * src/fringe.c (init_fringe): * src/keyboard.h (kbd_buffer_store_event_hold): * src/keymap.c: * src/lisp.h (memclear, reduce_emacs_uint_to_hash_hash, modiff_incr): * src/lread.c (skip_lazy_string): * src/pdumper.c (dump_bignum, Fdump_emacs_portable) (dump_do_dump_relocation, pdumper_load): * src/process.c (make_process, Fmake_process, connect_network_socket): * src/regex-emacs.c: * src/sort.c (tim_sort): * src/sysdep.c (init_random, SSIZE_MAX): * src/thread.c: * src/timefns.c (trillion_factor): * src/unexelf.c: * src/xterm.c (x_send_scroll_bar_event): Prefer static_assert to Gnulib verify. Remove import of verify.h, except when used for other reasons.
137 lines
3.7 KiB
Objective-C
137 lines
3.7 KiB
Objective-C
/* Definitions and headers for communication on the NeXT/Open/GNUstep API.
|
|
Copyright (C) 1995, 2005, 2008-2024 Free Software Foundation, Inc.
|
|
|
|
This file is part of GNU Emacs.
|
|
|
|
GNU Emacs is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or (at
|
|
your option) any later version.
|
|
|
|
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
|
|
along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
|
|
|
|
#ifndef __NSGUI_H__
|
|
#define __NSGUI_H__
|
|
|
|
/* This gets included from a couple of the plain (non-NS) .c files. */
|
|
#ifdef __OBJC__
|
|
|
|
#ifdef NS_IMPL_COCOA
|
|
#ifdef Z
|
|
#warning "Z is defined. If you get a later parse error in a header, check that buffer.h or other files #define-ing Z are not included."
|
|
#endif /* Z */
|
|
#define Cursor FooFoo
|
|
#endif /* NS_IMPL_COCOA */
|
|
|
|
#import <AppKit/AppKit.h>
|
|
|
|
#ifdef NS_IMPL_COCOA
|
|
#undef Cursor
|
|
#endif /* NS_IMPL_COCOA */
|
|
#import <Foundation/NSDistantObject.h>
|
|
|
|
#ifdef NS_IMPL_COCOA
|
|
#include <AvailabilityMacros.h>
|
|
#endif /* NS_IMPL_COCOA */
|
|
|
|
#endif /* __OBJC__ */
|
|
|
|
/* Emulate XCharStruct. */
|
|
typedef struct _XCharStruct
|
|
{
|
|
int rbearing;
|
|
int lbearing;
|
|
int width;
|
|
int ascent;
|
|
int descent;
|
|
} XCharStruct;
|
|
|
|
#ifdef __OBJC__
|
|
typedef id Emacs_Pixmap;
|
|
#else
|
|
typedef void *Emacs_Pixmap;
|
|
#endif
|
|
|
|
#ifdef __OBJC__
|
|
typedef NSCursor *Emacs_Cursor;
|
|
#else
|
|
typedef void *Emacs_Cursor;
|
|
#endif
|
|
|
|
typedef int Window;
|
|
|
|
#ifndef __OBJC__
|
|
#if defined (__LP64__) && __LP64__
|
|
typedef double CGFloat;
|
|
#else
|
|
typedef float CGFloat;
|
|
#endif
|
|
typedef struct _NSPoint { CGFloat x, y; } NSPoint;
|
|
typedef struct _NSSize { CGFloat width, height; } NSSize;
|
|
typedef struct _NSRect { NSPoint origin; NSSize size; } NSRect;
|
|
#endif /* NOT OBJC */
|
|
|
|
#define NativeRectangle NSRect
|
|
|
|
#define CONVERT_TO_EMACS_RECT(xr, nr) \
|
|
((xr).x = (nr).origin.x, \
|
|
(xr).y = (nr).origin.y, \
|
|
(xr).width = (nr).size.width, \
|
|
(xr).height = (nr).size.height)
|
|
|
|
#define CONVERT_FROM_EMACS_RECT(xr, nr) \
|
|
((nr).origin.x = (xr).x, \
|
|
(nr).origin.y = (xr).y, \
|
|
(nr).size.width = (xr).width, \
|
|
(nr).size.height = (xr).height)
|
|
|
|
#define STORE_NATIVE_RECT(nr, px, py, pwidth, pheight) \
|
|
((nr).origin.x = (px), \
|
|
(nr).origin.y = (py), \
|
|
(nr).size.width = (pwidth), \
|
|
(nr).size.height = (pheight))
|
|
|
|
|
|
|
|
|
|
/* This stuff needed by frame.c. */
|
|
#define ForgetGravity 0
|
|
#define NorthWestGravity 1
|
|
#define NorthGravity 2
|
|
#define NorthEastGravity 3
|
|
#define WestGravity 4
|
|
#define CenterGravity 5
|
|
#define EastGravity 6
|
|
#define SouthWestGravity 7
|
|
#define SouthGravity 8
|
|
#define SouthEastGravity 9
|
|
#define StaticGravity 10
|
|
|
|
#define NoValue 0x0000
|
|
#define XValue 0x0001
|
|
#define YValue 0x0002
|
|
#define WidthValue 0x0004
|
|
#define HeightValue 0x0008
|
|
#define AllValues 0x000F
|
|
#define XNegative 0x0010
|
|
#define YNegative 0x0020
|
|
|
|
#define USPosition (1L << 0) /* user specified x, y */
|
|
#define USSize (1L << 1) /* user specified width, height */
|
|
|
|
#define PPosition (1L << 2) /* program specified position */
|
|
#define PSize (1L << 3) /* program specified size */
|
|
#define PMinSize (1L << 4) /* program specified minimum size */
|
|
#define PMaxSize (1L << 5) /* program specified maximum size */
|
|
#define PResizeInc (1L << 6) /* program specified resize increments */
|
|
#define PAspect (1L << 7) /* program specified min, max aspect ratios */
|
|
#define PBaseSize (1L << 8) /* program specified base for incrementing */
|
|
#define PWinGravity (1L << 9) /* program specified window gravity */
|
|
|
|
#endif /* __NSGUI_H__ */
|