/* Functions for the NeXT/Open/GNUstep and MacOSX window system.
-Copyright (C) 1989, 1992-1994, 2005-2006, 2008-2015 Free Software
+Copyright (C) 1989, 1992-1994, 2005-2006, 2008-2016 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.
+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
NSString *str;
NSView *view = FRAME_NS_VIEW (f);
+
encoded_name = ENCODE_UTF_8 (name);
str = [NSString stringWithUTF8String: SSDATA (encoded_name)];
+
/* Don't change the name if it's already NAME. */
if (! [[[view window] title] isEqualToString: str])
[[view window] setTitle: str];
{
NSTRACE ("x_implicitly_set_name");
+ Lisp_Object frame_title = buffer_local_value
+ (Qframe_title_format, XWINDOW (f->selected_window)->contents);
+ Lisp_Object icon_title = buffer_local_value
+ (Qicon_title_format, XWINDOW (f->selected_window)->contents);
+
/* Deal with NS specific format t. */
- if (FRAME_NS_P (f) && ((FRAME_ICONIFIED_P (f) && EQ (Vicon_title_format, Qt))
- || EQ (Vframe_title_format, Qt)))
+ if (FRAME_NS_P (f) && ((FRAME_ICONIFIED_P (f) && EQ (icon_title, Qt))
+ || EQ (frame_title, Qt)))
ns_set_name_as_filename (f);
else
ns_set_name (f, arg, 0);
void
x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
{
+ /* Currently, when the tool bar change state, the frame is resized.
+
+ TODO: It would be better if this didn't occur when 1) the frame
+ is full height or maximized or 2) when specified by
+ `frame-inhibit-implied-resize'. */
int nlines;
+ NSTRACE ("x_set_tool_bar_lines");
+
if (FRAME_MINIBUF_ONLY_P (f))
return;
{
free_frame_tool_bar (f);
FRAME_EXTERNAL_TOOL_BAR (f) = 0;
- }
+
+ {
+ EmacsView *view = FRAME_NS_VIEW (f);
+ int fs_state = [view fullscreenState];
+
+ if (fs_state == FULLSCREEN_MAXIMIZED)
+ {
+ [view setFSValue:FULLSCREEN_WIDTH];
+ }
+ else if (fs_state == FULLSCREEN_HEIGHT)
+ {
+ [view setFSValue:FULLSCREEN_NONE];
+ }
+ }
+ }
}
{
|| (CONSP (frame_inhibit_implied_resize)
&& !NILP (Fmemq (Qtool_bar_lines,
frame_inhibit_implied_resize))))
- /* This will probably fail to DTRT in the
- fullheight/-width cases. */
&& NILP (get_frame_param (f, Qfullscreen)))
? 0
: 2);
+ NSTRACE_MSG ("inhibit:%d", inhibit);
+
frame_size_history_add (f, Qupdate_frame_tool_bar, 0, 0, Qnil);
adjust_frame_size (f, -1, -1, inhibit, 0, Qtool_bar_lines);
}
DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0,
doc: /* Return the "vendor ID" string of Nextstep display server TERMINAL.
-(Labeling every distributor as a "vendor" embodies the false assumption
+\(Labeling every distributor as a "vendor" embodies the false assumption
that operating systems cannot be developed and distributed noncommercially.)
The optional argument TERMINAL specifies which display to ask about.
TERMINAL should be a terminal object, a frame or a display name (a string).
Note: "screen" here is not in Nextstep terminology but in X11's. For
the number of physical monitors, use `(length
-(display-monitor-attributes-list TERMINAL))' instead. */)
+\(display-monitor-attributes-list TERMINAL))' instead. */)
(Lisp_Object terminal)
{
check_ns_display_info (terminal);
Optional second arg XRM-STRING is a string of resources in xrdb format.
If the optional third arg MUST-SUCCEED is non-nil,
terminate Emacs if we can't open the connection.
-(In the Nextstep version, the last two arguments are currently ignored.) */)
+\(In the Nextstep version, the last two arguments are currently ignored.) */)
(Lisp_Object display, Lisp_Object resource_string, Lisp_Object must_succeed)
{
struct ns_display_info *dpyinfo;
}
-DEFUN ("ns-convert-utf8-nfd-to-nfc", Fns_convert_utf8_nfd_to_nfc,
- Sns_convert_utf8_nfd_to_nfc, 1, 1, 0,
- doc: /* Return an NFC string that matches the UTF-8 NFD string STR. */)
- (Lisp_Object str)
-{
-/* TODO: If GNUstep ever implements precomposedStringWithCanonicalMapping,
- remove this. */
- NSString *utfStr;
- Lisp_Object ret = Qnil;
- NSAutoreleasePool *pool;
-
- CHECK_STRING (str);
- pool = [[NSAutoreleasePool alloc] init];
- utfStr = [NSString stringWithUTF8String: SSDATA (str)];
-#ifdef NS_IMPL_COCOA
- if (utfStr)
- utfStr = [utfStr precomposedStringWithCanonicalMapping];
-#endif
- if (utfStr)
- {
- const char *cstr = [utfStr UTF8String];
- if (cstr)
- ret = build_string (cstr);
- }
-
- [pool release];
- if (NILP (ret))
- error ("Invalid UTF-8");
-
- return ret;
-}
-
-
#ifdef NS_IMPL_COCOA
/* Compile and execute the AppleScript SCRIPT and return the error
DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0,
doc: /* Internal function called by `color-defined-p', which see.
-(Note that the Nextstep version of this function ignores FRAME.) */)
+\(Note that the Nextstep version of this function ignores FRAME.) */)
(Lisp_Object color, Lisp_Object frame)
{
NSColor * col;
syms_of_nsfns (void)
{
DEFSYM (Qfontsize, "fontsize");
+ DEFSYM (Qframe_title_format, "frame-title-format");
+ DEFSYM (Qicon_title_format, "icon-title-format");
DEFVAR_LISP ("ns-icon-type-alist", Vns_icon_type_alist,
doc: /* Alist of elements (REGEXP . IMAGE) for images of icons associated to frames.
defsubr (&Sns_emacs_info_panel);
defsubr (&Sns_list_services);
defsubr (&Sns_perform_service);
- defsubr (&Sns_convert_utf8_nfd_to_nfc);
defsubr (&Sns_popup_font_panel);
defsubr (&Sns_popup_color_panel);