Update the GNUStep port so it works OK. Redraw and sizing bugs remain.
[bpt/emacs.git] / src / nsterm.h
index a43a904..fd8c9ba 100644 (file)
@@ -51,6 +51,16 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #ifdef __OBJC__
 
+/* CGFloat on GNUStep may be 4 or 8 byte, but functions expect float* for some
+   versions.
+   On Cocoa, functions expect CGFloat*. Make compatible type.  */
+#if defined (NS_IMPL_COCOA) || GNUSTEP_GUI_MAJOR_VERSION > 0 || \
+    GNUSTEP_GUI_MINOR_VERSION >= 22
+typedef CGFloat EmacsCGFloat;
+#else
+typedef float EmacsCGFloat;
+#endif
+
 /* ==========================================================================
 
    The Emacs application
@@ -60,6 +70,10 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 /* We override sendEvent: as a means to stop/start the event loop */
 @interface EmacsApp : NSApplication
 {
+#ifdef NS_IMPL_GNUSTEP
+@public
+  int nextappdefined;
+#endif
 }
 - (void)logNotification: (NSNotification *)notification;
 - (void)sendEvent: (NSEvent *)theEvent;
@@ -68,8 +82,18 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 - (void)fd_handler: (id)unused;
 - (void)timeout_handler: (NSTimer *)timedEntry;
 - (BOOL)fulfillService: (NSString *)name withArg: (NSString *)arg;
+#ifdef NS_IMPL_GNUSTEP
+- (void)sendFromMainThread:(id)unused;
+#endif
 @end
 
+#ifdef NS_IMPL_GNUSTEP
+/* Dummy class to get rid of startup warnings.  */
+@interface EmacsDocument : NSDocument
+{
+}
+@end
+#endif
 
 /* ==========================================================================
 
@@ -128,8 +152,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #endif
 
 #ifdef NS_IMPL_GNUSTEP
-/* Not declared, but useful. */
-- (void) unlockFocusNeedsFlush: (BOOL)needs;
+- (void)windowDidMove: (id)sender;
 #endif
 @end
 
@@ -199,10 +222,14 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
    }
 - initForView: (EmacsView *)view withIdentifier: (NSString *)identifier;
 - (void) clearActive;
+- (void) clearAll;
 - (BOOL) changed;
-- (void) addDisplayItemWithImage: (EmacsImage *)img idx: (int)idx
+- (void) addDisplayItemWithImage: (EmacsImage *)img
+                             idx: (int)idx
+                             tag: (int)tag
                         helpText: (const char *)help
                          enabled: (BOOL)enabled;
+
 /* delegate methods */
 - (NSToolbarItem *)toolbar: (NSToolbar *)toolbar
      itemForItemIdentifier: (NSString *)itemIdentifier
@@ -267,14 +294,10 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 @interface EmacsSavePanel : NSSavePanel
 {
 }
-- (NSString *) getFilename;
-- (NSString *) getDirectory;
 @end
 @interface EmacsOpenPanel : NSOpenPanel
 {
 }
-- (NSString *) getFilename;
-- (NSString *) getDirectory;
 @end
 
 @interface EmacsFileDelegate : NSObject
@@ -335,7 +358,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
    NSResponder *prevResponder;
 
    /* offset to the bottom of knob of last mouse down */
-   float last_mouse_offset;
+   CGFloat last_mouse_offset;
    float min_portion;
    int pixel_height;
    int last_hit_part;
@@ -577,8 +600,6 @@ extern Lisp_Object ns_display_name_list;
 extern struct ns_display_info *ns_display_info_for_name (Lisp_Object name);
 
 struct ns_display_info *check_x_display_info (Lisp_Object frame);
-FRAME_PTR check_x_frame (Lisp_Object frame);
-
 
 struct ns_output
 {
@@ -764,7 +785,6 @@ extern void ns_clear_frame (struct frame *f);
 
 extern const char *ns_xlfd_to_fontname (const char *xlfd);
 
-extern void check_ns (void);
 extern Lisp_Object ns_map_event_to_object (void);
 #ifdef __OBJC__
 extern Lisp_Object ns_string_from_pasteboard (id pb);
@@ -792,9 +812,9 @@ extern int ns_lisp_to_color (Lisp_Object color, NSColor **col);
 extern NSColor *ns_lookup_indexed_color (unsigned long idx, struct frame *f);
 extern unsigned long ns_index_color (NSColor *color, struct frame *f);
 extern void ns_free_indexed_color (unsigned long idx, struct frame *f);
-extern const char *ns_get_pending_menu_title ();
+extern const char *ns_get_pending_menu_title (void);
 extern void ns_check_menu_open (NSMenu *menu);
-extern void ns_check_pending_open_menu ();
+extern void ns_check_pending_open_menu (void);
 #endif
 
 /* C access to ObjC functionality */
@@ -843,6 +863,7 @@ 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 void x_destroy_window (struct frame *f);
 extern int ns_select (int nfds, fd_set *readfds, fd_set *writefds,
                       fd_set *exceptfds, EMACS_TIME *timeout,
                      sigset_t *sigmask);