Commit 3d608a86 authored by Jan D's avatar Jan D

Fix missing prototypes for HAVE_NS (caused crash) and vrious warnings.

* configure.in: Check for util.h.

* src/bidi.c (bidi_dump_cached_states): Fix fprintf warning.

* src/emacs.c: Include src/nsterm.h if HAVE_NS.

* src/image.c (xpm_scan, xpm_make_color_table_v)
(xpm_put_color_table_v, xpm_get_color_table_v)
(xpm_make_color_table_h, xpm_put_color_table_h)
(xpm_get_color_table_h, xpm_str_to_color_key, xpm_load_image)
(xpm_load): Convert to ANSI C prototypes.

* src/lisp.h (fmod_float): Declare.

* src/menu.h (x_set_menu_bar_line): Declare.
(free_menubar_widget_value_tree et.al): Add HAVE_NS for these functions.

* src/window.c: Include menu.h.

* src/nsfns.m (have_menus_p, ns_display_info_for_name)
(x_set_cursor_type, ns_appkit_version_str)
(ns_appkit_version_int, ns_do_applescript)
(x_set_scroll_bar_default_width, x_sync, compute_tip_xy)
(syms_of_nsfns): Convert to ANSI C prototypes.

* src/nsfont.m (ns_fallback_entity, syms_of_nsfont): Convert to ANSI C
prototypes.

* src/nsimage.m (ns_load_image): Move NSTRACE after declarations.

* src/nsmenu.m (popup_activated, name_is_separator)
(syms_of_nsmenu): Convert to ANSI C prototypes.
(runMenuAt): Prototypes and move declarations before code.

* src/nsterm.h : Include sysselect.h.
(x_sync, x_get_focus_frame, x_set_mouse_position)
(x_set_mouse_pixel_position, x_make_frame_visible)
(x_make_frame_invisible, x_iconify_frame, x_char_width, x_char_height)
(x_pixel_width, x_pixel_height, x_set_frame_alpha, x_set_tool_bar_lines)
(x_activate_menubar, free_frame_menubar, ns_init_paths, ns_select)
(syms_of_nsterm, syms_of_nsfns, syms_of_nsmenu, syms_of_nsselect):
Declare

* src/process.c: Check HAVE_UTIL_H. Include src/nsterm.h if HAVE_NS.

* src/nsterm.m (ns_init_paths, ns_alloc_autorelease_pool)
(ns_ring_bell, ns_defined_color, hide_hourglass)
(x_display_pixel_height, x_display_pixel_width, syms_of_nsterm):
Convert to ANSI C prototypes.
(x_set_window_size, ns_draw_fringe_bitmap, judge): Move declarations
before code.

* src/sysdep.c: Check HAVE_TERM_H

* src/term.c: Check HAVE_SYS_IOCTL_H.

* src/unexmacosx.c (print_region_list, print_regions)
(build_region_list, find_emacs_zone_regions)
(unexec_regions_merge, read_load_commands, dump_it)
(unexec_init_emacs_zone): Convert to ANSI C prototypes.

* src/xfaces.c (x_create_gc, x_free_gc): Convert to ANSI C prototypes.
parent 0613f5d5
2010-08-06 Jan Djärv <jan.h.d@swipnet.se>
* configure.in: Check for util.h.
2010-08-05 Eli Zaretskii <eliz@gnu.org>
* configure.in (UNEXEC_OBJ): Rename unexec.o => unexcoff.o.
......
This diff is collapsed.
......@@ -1210,7 +1210,7 @@ AC_CHECK_HEADERS(sys/select.h sys/timeb.h sys/time.h unistd.h utime.h \
linux/version.h sys/systeminfo.h termios.h limits.h string.h stdlib.h \
stdio_ext.h fcntl.h strings.h coff.h pty.h sys/mman.h \
sys/param.h sys/vlimit.h sys/resource.h locale.h sys/_mbstate_t.h \
sys/utsname.h pwd.h utmp.h dirent.h)
sys/utsname.h pwd.h utmp.h dirent.h util.h)
AC_MSG_CHECKING(if personality LINUX32 can be set)
AC_TRY_COMPILE([#include <sys/personality.h>], [personality (PER_LINUX32)],
......
2010-08-06 Jan Djärv <jan.h.d@swipnet.se>
* xfaces.c (x_create_gc, x_free_gc): Convert to ANSI C prototypes.
* window.c: Include menu.h.
* unexmacosx.c (print_region_list, print_regions)
(build_region_list, find_emacs_zone_regions)
(unexec_regions_merge, read_load_commands, dump_it)
(unexec_init_emacs_zone): Convert to ANSI C prototypes.
* term.c: Check HAVE_SYS_IOCTL_H.
* sysdep.c: Check HAVE_TERM_H
* process.c: Check HAVE_UTIL_H. Include nsterm.h if HAVE_NS.
* nsterm.m (ns_init_paths, ns_alloc_autorelease_pool)
(ns_ring_bell, ns_defined_color, hide_hourglass)
(x_display_pixel_height, x_display_pixel_width, syms_of_nsterm):
Convert to ANSI C prototypes.
(x_set_window_size, ns_draw_fringe_bitmap, judge): Move declarations
before code.
* nsterm.h : Include sysselect.h.
(x_sync, x_get_focus_frame, x_set_mouse_position)
(x_set_mouse_pixel_position, x_make_frame_visible)
(x_make_frame_invisible, x_iconify_frame, x_char_width, x_char_height)
(x_pixel_width, x_pixel_height, x_set_frame_alpha, x_set_tool_bar_lines)
(x_activate_menubar, free_frame_menubar, ns_init_paths, ns_select)
(syms_of_nsterm, syms_of_nsfns, syms_of_nsmenu, syms_of_nsselect):
Declare
* nsmenu.m (popup_activated, name_is_separator)
(syms_of_nsmenu): Convert to ANSI C prototypes.
(runMenuAt): Prototypes and move declarations before code.
* nsimage.m (ns_load_image): Move NSTRACE after declarations.
* nsfont.m (ns_fallback_entity, syms_of_nsfont): Convert to ANSI C
prototypes.
* nsfns.m (have_menus_p, ns_display_info_for_name)
(x_set_cursor_type, ns_appkit_version_str)
(ns_appkit_version_int, ns_do_applescript)
(x_set_scroll_bar_default_width, x_sync, compute_tip_xy)
(syms_of_nsfns): Convert to ANSI C prototypes.
* menu.h (x_set_menu_bar_line): Declare.
(free_menubar_widget_value_tree et.al): Add HAVE_NS for these functions.
* lisp.h (fmod_float): Declare.
* image.c (xpm_scan, xpm_make_color_table_v)
(xpm_put_color_table_v, xpm_get_color_table_v)
(xpm_make_color_table_h, xpm_put_color_table_h)
(xpm_get_color_table_h, xpm_str_to_color_key, xpm_load_image)
(xpm_load): Convert to ANSI C prototypes.
* emacs.c: Include nsterm.h if HAVE_NS.
* bidi.c (bidi_dump_cached_states): Fix fprintf warning.
2010-08-06 Dan Nicolaescu <dann@ics.uci.edu>
* process.c: Remove HAVE_SOCKETS #ifdefs inside #ifdef
......
......@@ -1774,6 +1774,6 @@ bidi_dump_cached_states (void)
fputs ("\n", stderr);
fputs ("pos ", stderr);
for (i = 0; i < bidi_cache_idx; i++)
fprintf (stderr, "%*d", ndigits, bidi_cache[i].charpos);
fprintf (stderr, "%*ld", ndigits, (long)bidi_cache[i].charpos);
fputs ("\n", stderr);
}
......@@ -731,6 +731,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the <util.h> header file. */
#undef HAVE_UTIL_H
/* Define to 1 if you have the `utimes' function. */
#undef HAVE_UTIMES
......
......@@ -63,6 +63,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "keyboard.h"
#include "keymap.h"
#ifdef HAVE_NS
#include "nsterm.h"
#endif
#ifdef HAVE_SETLOCALE
#include <locale.h>
#endif
......
......@@ -3658,9 +3658,10 @@ enum xpm_token
length of the corresponding token, respectively. */
static int
xpm_scan (s, end, beg, len)
const unsigned char **s, *end, **beg;
int *len;
xpm_scan (const unsigned char **s,
const unsigned char *end,
const unsigned char **beg,
int *len)
{
int c;
......@@ -3724,9 +3725,13 @@ xpm_scan (s, end, beg, len)
hash table is used. */
static Lisp_Object
xpm_make_color_table_v (put_func, get_func)
void (**put_func) (Lisp_Object, const unsigned char *, int, Lisp_Object);
Lisp_Object (**get_func) (Lisp_Object, const unsigned char *, int);
xpm_make_color_table_v (void (**put_func) (Lisp_Object,
const unsigned char *,
int,
Lisp_Object),
Lisp_Object (**get_func) (Lisp_Object,
const unsigned char *,
int))
{
*put_func = xpm_put_color_table_v;
*get_func = xpm_get_color_table_v;
......@@ -3734,28 +3739,30 @@ xpm_make_color_table_v (put_func, get_func)
}
static void
xpm_put_color_table_v (color_table, chars_start, chars_len, color)
Lisp_Object color_table;
const unsigned char *chars_start;
int chars_len;
Lisp_Object color;
xpm_put_color_table_v (Lisp_Object color_table,
const unsigned char *chars_start,
int chars_len,
Lisp_Object color)
{
XVECTOR (color_table)->contents[*chars_start] = color;
}
static Lisp_Object
xpm_get_color_table_v (color_table, chars_start, chars_len)
Lisp_Object color_table;
const unsigned char *chars_start;
int chars_len;
xpm_get_color_table_v (Lisp_Object color_table,
const unsigned char *chars_start,
int chars_len)
{
return XVECTOR (color_table)->contents[*chars_start];
}
static Lisp_Object
xpm_make_color_table_h (put_func, get_func)
void (**put_func) (Lisp_Object, const unsigned char *, int, Lisp_Object);
Lisp_Object (**get_func) (Lisp_Object, const unsigned char *, int);
xpm_make_color_table_h (void (**put_func) (Lisp_Object,
const unsigned char *,
int,
Lisp_Object),
Lisp_Object (**get_func) (Lisp_Object,
const unsigned char *,
int))
{
*put_func = xpm_put_color_table_h;
*get_func = xpm_get_color_table_h;
......@@ -3766,11 +3773,10 @@ xpm_make_color_table_h (put_func, get_func)
}
static void
xpm_put_color_table_h (color_table, chars_start, chars_len, color)
Lisp_Object color_table;
const unsigned char *chars_start;
int chars_len;
Lisp_Object color;
xpm_put_color_table_h (Lisp_Object color_table,
const unsigned char *chars_start,
int chars_len,
Lisp_Object color)
{
struct Lisp_Hash_Table *table = XHASH_TABLE (color_table);
unsigned hash_code;
......@@ -3781,10 +3787,9 @@ xpm_put_color_table_h (color_table, chars_start, chars_len, color)
}
static Lisp_Object
xpm_get_color_table_h (color_table, chars_start, chars_len)
Lisp_Object color_table;
const unsigned char *chars_start;
int chars_len;
xpm_get_color_table_h (Lisp_Object color_table,
const unsigned char *chars_start,
int chars_len)
{
struct Lisp_Hash_Table *table = XHASH_TABLE (color_table);
int i = hash_lookup (table, make_unibyte_string (chars_start, chars_len),
......@@ -3804,8 +3809,7 @@ enum xpm_color_key {
static const char xpm_color_key_strings[][4] = {"s", "m", "g4", "g", "c"};
static int
xpm_str_to_color_key (s)
const char *s;
xpm_str_to_color_key (const char *s)
{
int i;
......@@ -3818,10 +3822,10 @@ xpm_str_to_color_key (s)
}
static int
xpm_load_image (f, img, contents, end)
struct frame *f;
struct image *img;
const unsigned char *contents, *end;
xpm_load_image (struct frame *f,
struct image *img,
const unsigned char *contents,
const unsigned char *end)
{
const unsigned char *s = contents, *beg, *str;
unsigned char buffer[BUFSIZ];
......@@ -4053,9 +4057,8 @@ xpm_load_image (f, img, contents, end)
}
static int
xpm_load (f, img)
struct frame *f;
struct image *img;
xpm_load (struct frame *f,
struct image *img)
{
int success_p = 0;
Lisp_Object file_name;
......
......@@ -2548,6 +2548,7 @@ EXFUN (Ffloat, 1);
EXFUN (Ftruncate, 2);
extern void init_floatfns (void);
extern void syms_of_floatfns (void);
extern Lisp_Object fmod_float (Lisp_Object x, Lisp_Object y);
/* Defined in fringe.c */
extern void syms_of_fringe (void);
......
......@@ -21,13 +21,18 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
extern Lisp_Object Vmenu_updating_frame;
extern void x_set_menu_bar_lines (struct frame *f,
Lisp_Object value,
Lisp_Object oldval);
extern void init_menu_items (void);
extern void finish_menu_items (void);
extern void discard_menu_items (void);
extern void save_menu_items (void);
extern int parse_single_submenu (Lisp_Object, Lisp_Object, Lisp_Object);
extern void list_of_panes (Lisp_Object);
#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NTGUI)
#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NTGUI) \
|| defined (HAVE_NS)
extern void free_menubar_widget_value_tree (widget_value *);
extern void update_submenu_strings (widget_value *);
extern void find_and_call_menu_selection (FRAME_PTR, int,
......
......@@ -125,7 +125,7 @@ Updated by Christian Limpach (chris@nice.ch)
/* Nonzero if we can use mouse menus. */
int
have_menus_p ()
have_menus_p (void)
{
return NSApp != nil;
}
......@@ -240,8 +240,7 @@ Updated by Christian Limpach (chris@nice.ch)
/* Return the X display structure for the display named NAME.
Open a new connection if necessary. */
struct ns_display_info *
ns_display_info_for_name (name)
Lisp_Object name;
ns_display_info_for_name (Lisp_Object name)
{
Lisp_Object names;
struct ns_display_info *dpyinfo;
......@@ -925,9 +924,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
/* This is the same as the xfns.c definition. */
void
x_set_cursor_type (f, arg, oldval)
FRAME_PTR f;
Lisp_Object arg, oldval;
x_set_cursor_type (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval)
{
set_frame_cursor_types (f, arg);
......@@ -949,7 +946,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
#define Xstr(x) Str(x)
static Lisp_Object
ns_appkit_version_str ()
ns_appkit_version_str (void)
{
char tmp[80];
......@@ -968,7 +965,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
have into a single int. For a better picture of the implementation
running, use ns_appkit_version_str.*/
static int
ns_appkit_version_int ()
ns_appkit_version_int (void)
{
#ifdef NS_IMPL_GNUSTEP
return GNUSTEP_GUI_MAJOR_VERSION * 100 + GNUSTEP_GUI_MINOR_VERSION;
......@@ -2004,8 +2001,7 @@ and GNUstep implementations ("distributor-specific release
string or a number containing the resulting script value. Otherwise,
1 is returned. */
static int
ns_do_applescript (script, result)
Lisp_Object script, *result;
ns_do_applescript (Lisp_Object script, Lisp_Object *result)
{
NSAppleEventDescriptor *desc;
NSDictionary* errorDict;
......@@ -2108,8 +2104,7 @@ and GNUstep implementations ("distributor-specific release
void
x_set_scroll_bar_default_width (f)
struct frame *f;
x_set_scroll_bar_default_width (struct frame *f)
{
int wid = FRAME_COLUMN_WIDTH (f);
FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = NS_SCROLL_BAR_WIDTH_DEFAULT;
......@@ -2189,7 +2184,7 @@ and GNUstep implementations ("distributor-specific release
void
x_sync (Lisp_Object frame)
x_sync (struct frame *f)
{
/* XXX Not implemented XXX */
return;
......@@ -2367,11 +2362,14 @@ The return value is a list of integers (LEFT TOP WIDTH HEIGHT), which
/* TODO: move to xdisp or similar */
static void
compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y)
struct frame *f;
Lisp_Object parms, dx, dy;
int width, height;
int *root_x, *root_y;
compute_tip_xy (struct frame *f,
Lisp_Object parms,
Lisp_Object dx,
Lisp_Object dy,
int width,
int height,
int *root_x,
int *root_y)
{
Lisp_Object left, top;
EmacsView *view = FRAME_NS_VIEW (f);
......@@ -2595,7 +2593,7 @@ - (NSString *)panel: (id)sender userEnteredFilename: (NSString *)filename
void
syms_of_nsfns ()
syms_of_nsfns (void)
{
int i;
......
......@@ -223,7 +223,7 @@ static void ns_glyph_metrics (struct nsfont_info *font_info,
/* Default font entity. */
static Lisp_Object
ns_fallback_entity ()
ns_fallback_entity (void)
{
return ns_descriptor_to_entity ([[NSFont userFixedPitchFontOfSize: 0]
fontDescriptor], Qnil, NULL);
......@@ -1510,7 +1510,7 @@ - (void)setIntAttribute: (NSInteger)attributeTag value: (NSInteger)val
void
syms_of_nsfont ()
syms_of_nsfont (void)
{
nsfont_driver.type = Qns;
register_font_driver (&nsfont_driver, NULL);
......
......@@ -83,11 +83,11 @@ Updated by Christian Limpach (chris@nice.ch)
ns_load_image (struct frame *f, struct image *img,
Lisp_Object spec_file, Lisp_Object spec_data)
{
NSTRACE (ns_load_image);
EmacsImage *eImg;
NSSize size;
NSTRACE (ns_load_image);
if (NILP (spec_data))
{
eImg = [EmacsImage allocInitFromFile: spec_file];
......
......@@ -105,7 +105,7 @@
int
popup_activated ()
popup_activated (void)
{
return popup_activated_flag;
}
......@@ -509,8 +509,7 @@
/* Utility (from macmenu.c): is this item a separator? */
static int
name_is_separator (name)
const char *name;
name_is_separator ( const char *name)
{
const char *start = name;
......@@ -737,19 +736,21 @@ - (Lisp_Object)runMenuAt: (NSPoint)p forFrame: (struct frame *)f
keymaps: (int)keymaps
{
EmacsView *view = FRAME_NS_VIEW (f);
NSEvent *e, *event;
long retVal;
/* p = [view convertPoint:p fromView: nil]; */
p.y = NSHeight ([view frame]) - p.y;
NSEvent *e = [[view window] currentEvent];
NSEvent *event = [NSEvent mouseEventWithType: NSRightMouseDown
location: p
modifierFlags: 0
timestamp: [e timestamp]
windowNumber: [[view window] windowNumber]
context: [e context]
eventNumber: 0/*[e eventNumber] */
clickCount: 1
pressure: 0];
long retVal;
e = [[view window] currentEvent];
event = [NSEvent mouseEventWithType: NSRightMouseDown
location: p
modifierFlags: 0
timestamp: [e timestamp]
windowNumber: [[view window] windowNumber]
context: [e context]
eventNumber: 0/*[e eventNumber] */
clickCount: 1
pressure: 0];
context_menu_value = -1;
[NSMenu popUpContextMenu: self withEvent: event forView: view];
......@@ -1801,7 +1802,7 @@ Each ITEM is a cons cell (STRING . VALUE).
========================================================================== */
void
syms_of_nsmenu ()
syms_of_nsmenu (void)
{
defsubr (&Sx_popup_dialog);
defsubr (&Sns_reset_menu);
......
......@@ -21,6 +21,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "frame.h"
#include "character.h"
#include "font.h"
#include "sysselect.h"
#ifdef HAVE_NS
......@@ -712,7 +713,9 @@ extern void ns_set_name_as_filename (struct frame *f);
extern void ns_set_doc_edited (struct frame *f, Lisp_Object arg);
extern int
ns_defined_color (struct frame *f, char *name, XColor *color_def, int alloc,
ns_defined_color (struct frame *f,
const char *name,
XColor *color_def, int alloc,
char makeIndex);
extern void
ns_query_color (void *col, XColor *color_def, int setPixel);
......@@ -742,10 +745,33 @@ extern Lisp_Object find_and_return_menu_selection (FRAME_PTR f,
extern Lisp_Object ns_popup_dialog (Lisp_Object position, Lisp_Object contents,
Lisp_Object header);
/* two more prototypes that should be moved to a more general include file */
/* More prototypes that should be moved to a more general include file */
extern void set_frame_menubar (struct frame *f, int first_time, int deep_p);
extern void x_set_window_size (struct frame *f, int change_grav,
int cols, int rows);
extern void x_sync (struct frame *);
extern Lisp_Object x_get_focus_frame (struct frame *);
extern void x_set_mouse_position (struct frame *f, int h, int v);
extern void x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y);
extern void x_make_frame_visible (struct frame *f);
extern void x_make_frame_invisible (struct frame *f);
extern void x_iconify_frame (struct frame *f);
extern int x_char_width (struct frame *f);
extern int x_char_height (struct frame *f);
extern int x_pixel_width (struct frame *f);
extern int x_pixel_height (struct frame *f);
extern void x_set_frame_alpha (struct frame *f);
extern void x_set_tool_bar_lines (struct frame *f,
Lisp_Object value,
Lisp_Object oldval);
extern void x_activate_menubar (struct frame *);
extern void free_frame_menubar (struct frame *);
extern void ns_init_paths (void);
extern void syms_of_nsterm (void);
extern void syms_of_nsfns (void);
extern void syms_of_nsmenu (void);
extern void syms_of_nsselect (void);
/* From nsimage.m, needed in image.c */
struct image;
......@@ -764,6 +790,8 @@ extern int x_display_pixel_height (struct ns_display_info *);
extern int x_display_pixel_width (struct ns_display_info *);
/* This in nsterm.m */
extern int ns_select (int nfds, fd_set *readfds, fd_set *writefds,
fd_set *exceptfds, struct timeval *timeout);
extern unsigned long ns_get_rgb_color (struct frame *f,
float r, float g, float b, float a);
extern NSPoint last_mouse_motion_position;
......
......@@ -296,7 +296,7 @@ the Function modifer (laptops). May be any of the modifier lisp symbols. */
void
ns_init_paths ()
ns_init_paths (void)
/* --------------------------------------------------------------------------
Used to allow emacs to find its resources under Emacs.app
Called from emacs.c at startup.
......@@ -479,7 +479,7 @@ Retain an object (callable from C)
void *
ns_alloc_autorelease_pool ()
ns_alloc_autorelease_pool (void)
/* --------------------------------------------------------------------------
Allocate a pool for temporary objects (callable from C)
-------------------------------------------------------------------------- */
......@@ -790,7 +790,7 @@ Free a pool and temporary objects it refers to (callable from C)
static void
ns_ring_bell ()
ns_ring_bell (struct frame *f)
/* --------------------------------------------------------------------------
"Beep" routine
-------------------------------------------------------------------------- */
......@@ -1186,12 +1186,14 @@ Free a pool and temporary objects it refers to (callable from C)
difference between the real width and Emacs' imagined one. For
right-hand bars, don't worry about it since the extra is never used.
(Obviously doesn't work for vertically split windows tho..) */
NSPoint origin = FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f)
? NSMakePoint (FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f)
- NS_SCROLL_BAR_WIDTH (f), 0)
: NSMakePoint (0, 0);
[view setFrame: NSMakeRect (0, 0, pixelwidth, pixelheight)];
[view setBoundsOrigin: origin];
{
NSPoint origin = FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f)
? NSMakePoint (FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f)
- NS_SCROLL_BAR_WIDTH (f), 0)
: NSMakePoint (0, 0);
[view setFrame: NSMakeRect (0, 0, pixelwidth, pixelheight)];
[view setBoundsOrigin: origin];
}
change_frame_size (f, rows, cols, 0, 1, 0); /* pretend, delay, safe */
FRAME_PIXEL_WIDTH (f) = pixelwidth;
......@@ -1507,7 +1509,10 @@ Free a pool and temporary objects it refers to (callable from C)
int
ns_defined_color (struct frame *f, char *name, XColor *color_def, int alloc,
ns_defined_color (struct frame *f,
const char *name,
XColor *color_def,
int alloc,
char makeIndex)
/* --------------------------------------------------------------------------
Return 1 if named color found, and set color_def rgb accordingly.
......@@ -2184,9 +2189,8 @@ Free a pool and temporary objects it refers to (callable from C)
int yAdjust = rowY - FRAME_INTERNAL_BORDER_WIDTH (f) < 5 ?
-FRAME_INTERNAL_BORDER_WIDTH (f) : 0;
int yIncr = FRAME_PIXEL_HEIGHT (f) - (p->by+yAdjust + p->ny) < 5 ?
FRAME_INTERNAL_BORDER_WIDTH (f) : 0;
if (yAdjust)
yIncr += FRAME_INTERNAL_BORDER_WIDTH (f);
FRAME_INTERNAL_BORDER_WIDTH (f) : 0
+ (yAdjust ? FRAME_INTERNAL_BORDER_WIDTH (f) : 0);
NSRect r = NSMakeRect (p->bx+xAdjust, p->by+yAdjust, p->nx, p->ny+yIncr);
NSRectClip (r);
[ns_lookup_indexed_color(face->background, f) set];
......@@ -2375,7 +2379,7 @@ External call (RIF): draw cursor
void
hide_hourglass ()
hide_hourglass (void)
{
if (!hourglass_shown_p)
return;
......@@ -3406,16 +3410,14 @@ We tell read_avail_input() that input is "expected" because we do expect
========================================================================== */
int
x_display_pixel_height (dpyinfo)
struct ns_display_info *dpyinfo;
x_display_pixel_height (struct ns_display_info *dpyinfo)
{
NSScreen *screen = [NSScreen mainScreen];
return [screen frame].size.height;
}
int
x_display_pixel_width (dpyinfo)
struct ns_display_info *dpyinfo;
x_display_pixel_width (struct ns_display_info *dpyinfo)
{
NSScreen *screen = [NSScreen mainScreen];
return [screen frame].size.width;
......@@ -5743,9 +5745,10 @@ - (void)dealloc
NSTRACE (judge);
if (condemned)
{
EmacsView *view;
BLOCK_INPUT;
/* ensure other scrollbar updates after deletion */
EmacsView *view = (EmacsView *)FRAME_NS_VIEW (frame);
view = (EmacsView *)FRAME_NS_VIEW (frame);
if (view != nil)
view->scrollbarsNeedingUpdate++;
[self removeFromSuperview];
......@@ -6122,7 +6125,7 @@ Convert an X font name (XLFD) to an NS font name.
void
syms_of_nsterm ()
syms_of_nsterm (void)
{
NSTRACE (syms_of_nsterm);
......
......@@ -89,6 +89,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <resolv.h>
#endif
#ifdef HAVE_UTIL_H
#include <util.h>
#endif
#endif /* subprocesses */
#include "lisp.h"
......@@ -116,7 +120,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#if defined (USE_GTK) || defined (HAVE_GCONF)
#include "xgselect.h"
#endif /* defined (USE_GTK) || defined (HAVE_GCONF) */
#ifdef HAVE_NS
#include "nsterm.h"
#endif
extern int timers_run;