{
Free_Pixmap (FRAME_X_DISPLAY (f), img->pixmap);
img->pixmap = NO_PIXMAP;
-#ifdef HAVE_NS
- if (img->background_valid)
- ns_free_indexed_color(img->background, f);
-#endif
+ /* NOTE (HAVE_NS): background color is NOT an indexed color! */
img->background_valid = 0;
}
GNUstep port and post-20 update by Adrian Robert (arobert@cogsci.ucsd.edu)
*/
+/* This should be the first include, as it may set up #defines affecting
+ interpretation of even the system includes. */
+#include "config.h"
+
#include <signal.h>
#include <math.h>
-#include "config.h"
+
#include "lisp.h"
#include "blockinput.h"
#include "nsterm.h"
#include "keyboard.h"
#include "termhooks.h"
#include "fontset.h"
-
#include "character.h"
#include "font.h"
Author: Adrian Robert (arobert@cogsci.ucsd.edu)
*/
+/* This should be the first include, as it may set up #defines affecting
+ interpretation of even the system includes. */
#include "config.h"
#include "lisp.h"
GNUstep port and post-20 update by Adrian Robert (arobert@cogsci.ucsd.edu)
*/
+/* This should be the first include, as it may set up #defines affecting
+ interpretation of even the system includes. */
#include "config.h"
+
#include "lisp.h"
#include "dispextern.h"
#include "nsterm.h"
Christian Limpach, Scott Bender, Christophe de Dinechin) and code in the
Carbon version by Yamamoto Mitsuharu. */
+/* This should be the first include, as it may set up #defines affecting
+ interpretation of even the system includes. */
#include "config.h"
+
#include "lisp.h"
#include "window.h"
#include "buffer.h"
GNUstep port and post-20 update by Adrian Robert (arobert@cogsci.ucsd.edu)
*/
+/* This should be the first include, as it may set up #defines affecting
+ interpretation of even the system includes. */
#include "config.h"
+
#include "lisp.h"
#include "nsterm.h"
#include "termhooks.h"
GNUstep port and post-20 update by Adrian Robert (arobert@cogsci.ucsd.edu)
*/
+/* This should be the first include, as it may set up #defines affecting
+ interpretation of even the system includes. */
+#include "config.h"
+
#include <math.h>
#include <sys/types.h>
#include <time.h>
#include <unistd.h>
-#include "config.h"
#include "lisp.h"
#include "blockinput.h"
#include "sysselect.h"
color_table->size * sizeof (NSColor *));
}
idx = color_table->avail++;
- index = [NSNumber numberWithUnsignedInt: idx];
}
color_table->colors[idx] = color;
void
ns_free_indexed_color (unsigned long idx, struct frame *f)
{
- struct ns_color_table *color_table = FRAME_NS_DISPLAY_INFO (f)->color_table;
+ struct ns_color_table *color_table;
NSColor *color;
- if (!idx)
+ NSNumber *index;
+
+ if (!f)
+ return;
+
+ color_table = FRAME_NS_DISPLAY_INFO (f)->color_table;
+
+ if (idx <= 0 || idx >= color_table->size) {
+ message1("ns_free_indexed_color: Color index out of range.\n");
return;
+ }
+
+ index = [NSNumber numberWithUnsignedInt: idx];
+ if ([color_table->empty_indices containsObject: index]) {
+ message1("ns_free_indexed_color: attempt to free already freed color.\n");
+ return;
+ }
+
color = color_table->colors[idx];
[color release];
color_table->colors[idx] = nil;