int need_delete = 1;
int need_focus = 1;
- if (!XtIsWMShell (widget))
- abort ();
+ assert (XtIsWMShell (widget));
{
Atom type, *atoms = 0;
XSetClassHint (dpy, XtWindow (shell), &classhint);
}
-#ifndef HAVE_SESSION
+#ifndef HAVE_WMCOMMAND
static void
x_wm_maybe_store_wm_command (struct frame *f)
{
}
}
-#endif /* !HAVE_SESSION */
+#endif /* !HAVE_WMCOMMAND */
static int
x_frame_iconified_p (struct frame *f)
{
for (i = 0; i < dragData->numItems; i++)
{
- XtFree(dragData->data.buffers[i].bp);
+ XtFree((char *) dragData->data.buffers[i].bp);
if (dragData->data.buffers[i].name)
XtFree(dragData->data.buffers[i].name);
}
numItems++;
item = XCDR (item);
}
-
+
if (numItems)
{
/*
*/
Ctext = (char *)xmalloc (textlen+1);
Ctext[0] = 0;
-
+
item = dragdata;
while (!NILP (item))
{
item = XCDR (item);
}
Ctext[pos] = 0;
-
+
dnd_convert_cb_rec[0].callback = x_cde_convert_callback;
dnd_convert_cb_rec[0].closure = (XtPointer) Ctext;
dnd_convert_cb_rec[1].callback = NULL;
dnd_convert_cb_rec[1].closure = NULL;
-
+
dnd_destroy_cb_rec[0].callback = x_cde_destroy_callback;
dnd_destroy_cb_rec[0].closure = (XtPointer) Ctext;
dnd_destroy_cb_rec[1].callback = NULL;
}
UNGCPRO;
-
+
return numItems?Qt:Qnil;
}
/* what, if the data is no text, and how can I tell it? */
l_data = Fcons ( list3 ( list1 ( make_string ((Bufbyte *)"text/plain", 10) ),
make_string ((Bufbyte *)"8bit", 4),
- make_string ((Bufbyte *)transferInfo->dropData->data.buffers[ii].bp,
+ make_string ((Bufbyte *)transferInfo->dropData->data.buffers[ii].bp,
transferInfo->dropData->data.buffers[ii].size) ),
l_data );
}
enqueue=0;
/* The Problem: no button and mods from CDE... */
- if (enqueue)
+ if (enqueue)
enqueue_misc_user_event_pos ( frame, Qdragdrop_drop_dispatch,
Fcons (l_type, l_data),
0 /* this is the button */,
if (!STRINGP (data))
return Qnil;
- /* and whats with MULE data ??? */
+ /* and what's with MULE data ??? */
dnd_data = (char *)XSTRING_DATA (data);
dnd_len = XSTRING_LENGTH (data) + 1; /* the zero */
}
- /*
- * not so cross hack that converts a emacs event back to a XEvent
- */
+ /* not so gross hack that converts an emacs event back to a XEvent */
x_event.xbutton.type = ButtonPress;
x_event.xbutton.send_event = False;
XtSetArg (al[ac], XtNinput, True); ac++;
XtSetArg (al[ac], XtNminWidthCells, 10); ac++;
XtSetArg (al[ac], XtNminHeightCells, 1); ac++;
- XtSetArg (al[ac], XtNvisual, visual); ac++;
- XtSetArg (al[ac], XtNdepth, depth); ac++;
- XtSetArg (al[ac], XtNcolormap, cmap); ac++;
+ XtSetArg (al[ac], XtNvisual, visual); ac++;
+ XtSetArg (al[ac], XtNdepth, depth); ac++;
+ XtSetArg (al[ac], XtNcolormap, cmap); ac++;
}
if (!NILP (parent))
though, the failure to call the popup callbacks resulted in XEmacs
not accepting any input. Bizarre but true. Stupid but true.
- So, in case there are any other gotches floating out there along
+ So, in case there are any other gotchas floating out there along
the same lines I've duplicated the majority of XtPopup here. It
assumes no grabs and that the widget is not already popped up, both
valid assumptions for the one place this is called from. */
Xt_SET_VALUE (widget, XtNmappedWhenManaged, True);
}
-#ifdef HAVE_CDE
-/* Does this have to be non-automatic? */
-/* hack frame to respond to dnd messages */
-static XtCallbackRec dnd_transfer_cb_rec[2];
-#endif /* HAVE_CDE */
-
/* create the windows for the specified frame and display them.
Note that the widgets have already been created, and any
necessary geometry calculations have already been done. */
/* tell the window manager about us. */
x_wm_store_class_hints (shell_widget, XtName (frame_widget));
-#ifndef HAVE_SESSION
+#ifndef HAVE_WMCOMMAND
x_wm_maybe_store_wm_command (f);
-#endif /* HAVE_SESSION */
+#endif /* HAVE_WMCOMMAND */
x_wm_hack_wm_protocols (shell_widget);
}
#ifdef HACK_EDITRES
/* Allow XEmacs to respond to EditRes requests. See the O'Reilly Xt */
- /* Instrinsics Programming Manual, Motif Edition, Aug 1993, Sect 14.14, */
+ /* Intrinsics Programming Manual, Motif Edition, Aug 1993, Sect 14.14, */
/* pp. 483-493. */
XtAddEventHandler (shell_widget, /* the shell widget in question */
(EventMask) NoEventMask,/* OR with existing mask */
#ifdef HAVE_CDE
{
+ XtCallbackRec dnd_transfer_cb_rec[2];
+
dnd_transfer_cb_rec[0].callback = x_cde_transfer_callback;
dnd_transfer_cb_rec[0].closure = (XtPointer) f;
dnd_transfer_cb_rec[1].callback = NULL;
DtDND_FILENAME_TRANSFER | DtDND_BUFFER_TRANSFER,
XmDROP_COPY, dnd_transfer_cb_rec,
DtNtextIsBuffer, True,
- DtNregisterChildren, True,
+ DtNregisterChildren, True,
DtNpreserveRegistration, False,
NULL);
}
* will update the frame title anyway, so nothing is lost.
* JV:
* It turns out it gives problems with FVWMs name based mapping.
- * We'll just need to be carefull in the modeline specs.
+ * We'll just need to be careful in the modeline specs.
*/
- update_frame_title (f);
+ update_frame_title (f);
}
static void
static void
x_mark_frame (struct frame *f, void (*markobj) (Lisp_Object))
{
- ((markobj) (FRAME_X_ICON_PIXMAP (f)));
- ((markobj) (FRAME_X_ICON_PIXMAP_MASK (f)));
+ markobj (FRAME_X_ICON_PIXMAP (f));
+ markobj (FRAME_X_ICON_PIXMAP_MASK (f));
}
static void
static void
x_delete_frame (struct frame *f)
{
- Widget w = FRAME_X_SHELL_WIDGET (f);
- Display *dpy = XtDisplay (w);
+ Display *dpy;
-#ifndef HAVE_SESSION
+#ifndef HAVE_WMCOMMAND
if (FRAME_X_TOP_LEVEL_FRAME_P (f))
x_wm_maybe_move_wm_command (f);
-#endif /* HAVE_SESSION */
+#endif /* HAVE_WMCOMMAND */
+
+#ifdef HAVE_CDE
+ DtDndDropUnregister (FRAME_X_TEXT_WIDGET (f));
+#endif /* HAVE_CDE */
+
+ assert (FRAME_X_SHELL_WIDGET (f) != 0);
+ dpy = XtDisplay (FRAME_X_SHELL_WIDGET (f));
#ifdef EXTERNAL_WIDGET
- expect_x_error (dpy);
+ expect_x_error (XtDisplay (FRAME_X_SHELL_WIDGET (f)));
/* for obscure reasons having (I think) to do with the internal
window-to-widget hierarchy maintained by Xt, we have to call
XtUnrealizeWidget() here. Xt can really suck. */
if (f->being_deleted)
- XtUnrealizeWidget (w);
- XtDestroyWidget (w);
- x_error_occurred_p (dpy);
+ XtUnrealizeWidget (FRAME_X_SHELL_WIDGET (f));
+ XtDestroyWidget (FRAME_X_SHELL_WIDGET (f));
+ x_error_occurred_p (XtDisplay (FRAME_X_SHELL_WIDGET (f)));
#else
- XtDestroyWidget (w);
- XFlush (dpy); /* make sure the windows are really gone! */
+ XtDestroyWidget (FRAME_X_SHELL_WIDGET (f));
+ /* make sure the windows are really gone! */
+ /* ### Is this REALLY necessary? */
+ XFlush (dpy);
#endif /* EXTERNAL_WIDGET */
+ FRAME_X_SHELL_WIDGET (f) = 0;
+
if (FRAME_X_GEOM_FREE_ME_PLEASE (f))
- xfree (FRAME_X_GEOM_FREE_ME_PLEASE (f));
- xfree (f->frame_data);
- f->frame_data = 0;
+ {
+ xfree (FRAME_X_GEOM_FREE_ME_PLEASE (f));
+ FRAME_X_GEOM_FREE_ME_PLEASE (f) = 0;
+ }
+
+ if (f->frame_data)
+ {
+ xfree (f->frame_data);
+ f->frame_data = 0;
+ }
}
static void
x_update_frame_external_traits (struct frame* frm, Lisp_Object name)
{
- Arg av[10];
+ Arg al[10];
int ac = 0;
- Lisp_Object frame = Qnil;
+ Lisp_Object frame;
XSETFRAME(frame, frm);
if (!EQ (color, Vthe_null_color_instance))
{
fgc = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (color));
- XtSetArg (av[ac], XtNforeground, (void *) fgc.pixel); ac++;
+ XtSetArg (al[ac], XtNforeground, (void *) fgc.pixel); ac++;
}
}
else if (EQ (name, Qbackground))
if (!EQ (color, Vthe_null_color_instance))
{
bgc = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (color));
- XtSetArg (av[ac], XtNbackground, (void *) bgc.pixel); ac++;
+ XtSetArg (al[ac], XtNbackground, (void *) bgc.pixel); ac++;
}
/* Really crappy way to force the modeline shadows to be
Lisp_Object font = FACE_FONT (Vdefault_face, frame, Vcharset_ascii);
if (!EQ (font, Vthe_null_font_instance))
- XtSetArg (av[ac], XtNfont,
+ XtSetArg (al[ac], XtNfont,
(void *) FONT_INSTANCE_X_FONT (XFONT_INSTANCE (font)));
ac++;
}
else
abort ();
- XtSetValues (FRAME_X_TEXT_WIDGET (frm), av, ac);
+ XtSetValues (FRAME_X_TEXT_WIDGET (frm), al, ac);
#ifdef HAVE_TOOLBARS
/* Setting the background clears the entire frame area