+ struct ns_display_info *dpyinfo = check_ns_display_info (terminal);
+
+ return make_number (x_display_pixel_height (dpyinfo));
+}
+
+#ifdef NS_IMPL_COCOA
+/* Returns the name for the screen that DICT came from, or NULL.
+ Caller must free return value.
+*/
+
+static char *
+ns_screen_name (CGDirectDisplayID did)
+{
+ char *name = NULL;
+ NSDictionary *info = (NSDictionary *)
+ IODisplayCreateInfoDictionary (CGDisplayIOServicePort (did),
+ kIODisplayOnlyPreferredName);
+ NSDictionary *names
+ = [info objectForKey:
+ [NSString stringWithUTF8String:kDisplayProductName]];
+
+ if ([names count] > 0) {
+ NSString *n = [names objectForKey: [[names allKeys] objectAtIndex:0]];
+ if (n != nil)
+ name = xstrdup ([n UTF8String]);
+ }
+
+ [info release];
+ return name;
+}
+#endif
+
+static Lisp_Object
+ns_make_monitor_attribute_list (struct MonitorInfo *monitors,
+ int n_monitors,
+ int primary_monitor,
+ const char *source)
+{
+ Lisp_Object monitor_frames = Fmake_vector (make_number (n_monitors), Qnil);
+ Lisp_Object frame, rest;
+ NSArray *screens = [NSScreen screens];
+ int i;
+
+ FOR_EACH_FRAME (rest, frame)
+ {
+ struct frame *f = XFRAME (frame);
+
+ if (FRAME_NS_P (f))
+ {
+ NSView *view = FRAME_NS_VIEW (f);
+ NSScreen *screen = [[view window] screen];
+ NSUInteger k;
+
+ i = -1;
+ for (k = 0; i == -1 && k < [screens count]; ++k)
+ {
+ if ([screens objectAtIndex: k] == screen)
+ i = (int)k;
+ }
+
+ if (i > -1)
+ ASET (monitor_frames, i, Fcons (frame, AREF (monitor_frames, i)));
+ }
+ }
+
+ return make_monitor_attribute_list (monitors, n_monitors, primary_monitor,
+ monitor_frames, source);