information. */
public static final boolean DEBUG_IC = false;
+ /* Flag that says whether or not to perform extra checks on threads
+ performing drawing calls. */
+ private static final boolean DEBUG_THREADS = false;
+
/* Return the directory leading to the directory in which native
library files are stored on behalf of CONTEXT. */
syncRunnable (runnable);
}
+\f
+
+ public static void
+ checkEmacsThread ()
+ {
+ if (DEBUG_THREADS)
+ {
+ if (Thread.currentThread () instanceof EmacsThread)
+ return;
+
+ throw new RuntimeException ("Emacs thread function"
+ + " called from other thread!");
+ }
+ }
+
+ /* These drawing functions must only be called from the Emacs
+ thread. */
+
public void
fillRectangle (EmacsDrawable drawable, EmacsGC gc,
int x, int y, int width, int height)
{
+ checkEmacsThread ();
EmacsFillRectangle.perform (drawable, gc, x, y,
width, height);
}
fillPolygon (EmacsDrawable drawable, EmacsGC gc,
Point points[])
{
+ checkEmacsThread ();
EmacsFillPolygon.perform (drawable, gc, points);
}
drawRectangle (EmacsDrawable drawable, EmacsGC gc,
int x, int y, int width, int height)
{
+ checkEmacsThread ();
EmacsDrawRectangle.perform (drawable, gc, x, y,
width, height);
}
drawLine (EmacsDrawable drawable, EmacsGC gc,
int x, int y, int x2, int y2)
{
+ checkEmacsThread ();
EmacsDrawLine.perform (drawable, gc, x, y,
x2, y2);
}
drawPoint (EmacsDrawable drawable, EmacsGC gc,
int x, int y)
{
+ checkEmacsThread ();
EmacsDrawPoint.perform (drawable, gc, x, y);
}
int srcX, int srcY, int width, int height, int destX,
int destY)
{
+ checkEmacsThread ();
EmacsCopyArea.perform (srcDrawable, gc, dstDrawable,
srcX, srcY, width, height, destX,
destY);
public void
clearWindow (EmacsWindow window)
{
+ checkEmacsThread ();
window.clearWindow ();
}
clearArea (EmacsWindow window, int x, int y, int width,
int height)
{
+ checkEmacsThread ();
window.clearArea (x, y, width, height);
}