comparison src/frame-x.c @ 440:8de8e3f6228a r21-2-28

Import from CVS: tag r21-2-28
author cvs
date Mon, 13 Aug 2007 11:33:38 +0200
parents 3ecd8885ac67
children abe6d1db359e
comparison
equal deleted inserted replaced
439:357dd071b03c 440:8de8e3f6228a
111 if (!w) 111 if (!w)
112 return 0; 112 return 0;
113 113
114 /* We used to map over all frames here and then map over all widgets 114 /* We used to map over all frames here and then map over all widgets
115 belonging to that frame. However it turns out that this was very fragile 115 belonging to that frame. However it turns out that this was very fragile
116 as it requires our display stuctures to be in sync _and_ that the 116 as it requires our display stuctures to be in sync _and_ that the
117 loop is told about every new widget somebody adds. Therefore we 117 loop is told about every new widget somebody adds. Therefore we
118 now let Xt find it for us (which does a bottom-up search which 118 now let Xt find it for us (which does a bottom-up search which
119 could even be faster) */ 119 could even be faster) */
120 return x_any_widget_or_parent_to_frame (d, w); 120 return x_any_widget_or_parent_to_frame (d, w);
121 } 121 }
659 for (ptr = value; *ptr; ptr++) 659 for (ptr = value; *ptr; ptr++)
660 if (!BYTE_ASCII_P (*ptr)) 660 if (!BYTE_ASCII_P (*ptr))
661 { 661 {
662 CONST char * tmp; 662 CONST char * tmp;
663 encoding = DEVICE_XATOM_COMPOUND_TEXT (XDEVICE (FRAME_DEVICE (f))); 663 encoding = DEVICE_XATOM_COMPOUND_TEXT (XDEVICE (FRAME_DEVICE (f)));
664 GET_C_CHARPTR_EXT_CTEXT_DATA_ALLOCA ((CONST char *) value, tmp); 664 TO_EXTERNAL_FORMAT (C_STRING, value,
665 C_STRING_ALLOCA, tmp,
666 Qctext);
665 new_XtValue = (String) tmp; 667 new_XtValue = (String) tmp;
666 break; 668 break;
667 } 669 }
668 #endif /* MULE */ 670 #endif /* MULE */
669 671
670 /* ### Caching is device-independent - belongs in update_frame_title. */ 672 /* #### Caching is device-independent - belongs in update_frame_title. */
671 Xt_GET_VALUE (FRAME_X_SHELL_WIDGET (f), Xt_resource_name, &old_XtValue); 673 Xt_GET_VALUE (FRAME_X_SHELL_WIDGET (f), Xt_resource_name, &old_XtValue);
672 if (!old_XtValue || strcmp (new_XtValue, old_XtValue)) 674 if (!old_XtValue || strcmp (new_XtValue, old_XtValue))
673 { 675 {
674 Arg al[2]; 676 Arg al[2];
675 XtSetArg (al[0], Xt_resource_name, new_XtValue); 677 XtSetArg (al[0], Xt_resource_name, new_XtValue);
761 CONST char *extprop; 763 CONST char *extprop;
762 764
763 if (XSTRING_LENGTH (prop) == 0) 765 if (XSTRING_LENGTH (prop) == 0)
764 continue; 766 continue;
765 767
766 GET_C_STRING_CTEXT_DATA_ALLOCA (prop, extprop); 768 TO_EXTERNAL_FORMAT (LISP_STRING, prop,
769 C_STRING_ALLOCA, extprop,
770 Qctext);
767 if (STRINGP (val)) 771 if (STRINGP (val))
768 { 772 {
769 CONST Extbyte *extval; 773 CONST Extbyte *extval;
770 Extcount extvallen; 774 Extcount extvallen;
771 775
772 GET_STRING_CTEXT_DATA_ALLOCA (val, extval, extvallen); 776 TO_EXTERNAL_FORMAT (LISP_STRING, val,
777 ALLOCA, (extval, extvallen),
778 Qctext);
773 XtVaSetValues (w, XtVaTypedArg, extprop, 779 XtVaSetValues (w, XtVaTypedArg, extprop,
774 XtRString, extval, extvallen + 1, 780 XtRString, extval, extvallen + 1,
775 (XtArgVal) NULL); 781 (XtArgVal) NULL);
776 } 782 }
777 else 783 else
1101 struct x_device *xd = DEVICE_X_DATA (d); 1107 struct x_device *xd = DEVICE_X_DATA (d);
1102 XWindowAttributes win_attrib; 1108 XWindowAttributes win_attrib;
1103 unsigned int modifier = 0, state = 0; 1109 unsigned int modifier = 0, state = 0;
1104 char *Ctext; 1110 char *Ctext;
1105 int numItems = 0, textlen = 0, pos = 0; 1111 int numItems = 0, textlen = 0, pos = 0;
1106 struct Lisp_Event *lisp_event = XEVENT(event); 1112 Lisp_Event *lisp_event = XEVENT (event);
1107 Lisp_Object item = Qnil; 1113 Lisp_Object item = Qnil;
1108 struct gcpro gcpro1; 1114 struct gcpro gcpro1;
1109 1115
1110 /* only drag if this is really a press */ 1116 /* only drag if this is really a press */
1111 if (EVENT_TYPE(lisp_event) != button_press_event 1117 if (EVENT_TYPE(lisp_event) != button_press_event
1253 1259
1254 for (ii = 0; ii < transferInfo->dropData->numItems; ii++) 1260 for (ii = 0; ii < transferInfo->dropData->numItems; ii++)
1255 { 1261 {
1256 filePath = transferInfo->dropData->data.files[ii]; 1262 filePath = transferInfo->dropData->data.files[ii];
1257 hurl = dnd_url_hexify_string ((char *)filePath, "file:"); 1263 hurl = dnd_url_hexify_string ((char *)filePath, "file:");
1258 /* ### Mule-izing required */ 1264 /* #### Mule-izing required */
1259 l_data = Fcons (make_string ((Bufbyte* )hurl, 1265 l_data = Fcons (make_string ((Bufbyte* )hurl,
1260 strlen (hurl)), 1266 strlen (hurl)),
1261 l_data); 1267 l_data);
1262 xfree (hurl); 1268 xfree (hurl);
1263 } 1269 }
1328 XWindowAttributes win_attrib; 1334 XWindowAttributes win_attrib;
1329 unsigned int modifier = 0, state = 0; 1335 unsigned int modifier = 0, state = 0;
1330 char *dnd_data = NULL; 1336 char *dnd_data = NULL;
1331 unsigned long dnd_len = 0; 1337 unsigned long dnd_len = 0;
1332 int dnd_typ = DndText, dnd_dealloc = 0; 1338 int dnd_typ = DndText, dnd_dealloc = 0;
1333 struct Lisp_Event *lisp_event = XEVENT(event); 1339 Lisp_Event *lisp_event = XEVENT (event);
1334 1340
1335 /* only drag if this is really a press */ 1341 /* only drag if this is really a press */
1336 if (EVENT_TYPE(lisp_event) != button_press_event) 1342 if (EVENT_TYPE(lisp_event) != button_press_event)
1337 return Qnil; 1343 return Qnil;
1338 1344
1864 int menubar_visible; 1870 int menubar_visible;
1865 Widget menubar; 1871 Widget menubar;
1866 #endif 1872 #endif
1867 1873
1868 if (STRINGP (f->name)) 1874 if (STRINGP (f->name))
1869 GET_C_STRING_CTEXT_DATA_ALLOCA (f->name, name); 1875 TO_EXTERNAL_FORMAT (LISP_STRING, f->name,
1876 C_STRING_ALLOCA, name,
1877 Qctext);
1870 else 1878 else
1871 name = "emacs"; 1879 name = "emacs";
1872 1880
1873 /* The widget hierarchy is 1881 /* The widget hierarchy is
1874 1882
2662 XtDestroyWidget (FRAME_X_SHELL_WIDGET (f)); 2670 XtDestroyWidget (FRAME_X_SHELL_WIDGET (f));
2663 x_error_occurred_p (XtDisplay (FRAME_X_SHELL_WIDGET (f))); 2671 x_error_occurred_p (XtDisplay (FRAME_X_SHELL_WIDGET (f)));
2664 #else 2672 #else
2665 XtDestroyWidget (FRAME_X_SHELL_WIDGET (f)); 2673 XtDestroyWidget (FRAME_X_SHELL_WIDGET (f));
2666 /* make sure the windows are really gone! */ 2674 /* make sure the windows are really gone! */
2667 /* ### Is this REALLY necessary? */ 2675 /* #### Is this REALLY necessary? */
2668 XFlush (dpy); 2676 XFlush (dpy);
2669 #endif /* EXTERNAL_WIDGET */ 2677 #endif /* EXTERNAL_WIDGET */
2670 2678
2671 FRAME_X_SHELL_WIDGET (f) = 0; 2679 FRAME_X_SHELL_WIDGET (f) = 0;
2672 2680