From 35ed44db5ac5780d77e50c38c8ac0ec3b6e34dc3 Mon Sep 17 00:00:00 2001 From: Adrian Robert Date: Wed, 21 Jan 2009 18:56:41 +0000 Subject: [PATCH] * nsterm.m (EV_TRAILER): Always use emacsframe for frame_or_window. (ns_font_to_xlfd, ns_fontname_to_xlfd): Remove, unused. --- src/ChangeLog | 6 ++++ src/nsterm.m | 76 ++------------------------------------------------- 2 files changed, 9 insertions(+), 73 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index b4378a7cbc2..c250ead9cc4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-01-21 Wolfgang Lux (tiny change) + + * nsterm.m (EV_TRAILER): Always use emacsframe for frame_or_window. + + 2009-01-21 Adrian Robert * nsmenu.m (NSMENUPROFILE): Change #if style. @@ -12,6 +17,7 @@ (EmacsPrefsController-setDefaultFont:,-setColors:): Raise the frame. (EmacsPrefsController-setPanelFromDefaultValues) New function. (EmacsPrefsController-resetToDefaults:): Use it. (Bug#1801) + (ns_font_to_xlfd, ns_fontname_to_xlfd): Remove, unused. * nsimage.m (EmacsImage+allocInitFromFile:): Set to ignore DPI. (Bug#1316) diff --git a/src/nsterm.m b/src/nsterm.m index a8b185b538b..fba0e726e47 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -289,8 +289,7 @@ static BOOL inNsSelect = 0; methods. Maybe it should even be a function. */ #define EV_TRAILER(e) \ { \ - XSETFRAME (emacs_event->frame_or_window, [NSApp isActive] ? \ - emacsframe : SELECTED_FRAME ()); \ + XSETFRAME (emacs_event->frame_or_window, emacsframe); \ if (e) emacs_event->timestamp = EV_TIMESTAMP (e); \ n_emacs_events_pending++; \ kbd_buffer_store_event_hold (emacs_event, q_event_ptr); \ @@ -6247,7 +6246,6 @@ static void selectItemWithTag (NSPopUpButton *popup, int tag) /* ========================================================================== Font-related functions; these used to be in nsfaces.m - The XLFD functions (115 lines) are an abomination that should be removed. ========================================================================== */ @@ -6297,76 +6295,8 @@ x_new_font (struct frame *f, Lisp_Object font_object, int fontset) /* XLFD: -foundry-family-weight-slant-swidth-adstyle-pxlsz-ptSz-resx-resy-spc-avgWidth-rgstry-encoding */ - -static const char * -ns_font_to_xlfd (NSFont *nsfont) -/* -------------------------------------------------------------------------- - Convert an NS font name to an X font name (XLFD). - The string returned is temporarily allocated. - -------------------------------------------------------------------------- */ -{ - NSFontManager *mgr = [NSFontManager sharedFontManager]; - NSString *sname = [nsfont /*familyName*/fontName]; - char *famName = (char *)[sname UTF8String]; - char *weightStr = [mgr fontNamed: sname hasTraits: NSBoldFontMask] ? - "bold" : "medium"; - char *slantStr = [mgr fontNamed: sname hasTraits: NSItalicFontMask] ? - "i" : "r"; - int size = [nsfont pointSize]; - int aWidth = lrint (10.0 * [nsfont widthOfString: @"a"]); - const char *xlfd; - int i, len; - - /* change '-' to '$' to avoid messing w/XLFD separator */ - for (len = strlen (famName), i =0; i