comparison src/frame-x.c @ 179:9ad43877534d r20-3b16

Import from CVS: tag r20-3b16
author cvs
date Mon, 13 Aug 2007 09:52:19 +0200
parents 6075d714658b
children e121b013d1f0
comparison
equal deleted inserted replaced
178:e703507b8a00 179:9ad43877534d
364 rest = XCDR (rest); 364 rest = XCDR (rest);
365 if (NILP (rest)) 365 if (NILP (rest))
366 return; 366 return;
367 f = XFRAME (XCAR (rest)); 367 f = XFRAME (XCAR (rest));
368 368
369 #ifndef HAVE_WINDOWMAKER 369 #ifndef HAVE_SESSION
370 x_wm_maybe_store_wm_command (f); 370 x_wm_maybe_store_wm_command (f);
371 #endif /* HAVE_WINDOWMAKER */ 371 #endif /* HAVE_SESSION */
372 372
373 } 373 }
374 } 374 }
375 375
376 static int 376 static int
1176 unsigned char *Data; 1176 unsigned char *Data;
1177 unsigned long Size; 1177 unsigned long Size;
1178 1178
1179 Lisp_Object path = Qnil; 1179 Lisp_Object path = Qnil;
1180 Lisp_Object frame = Qnil; 1180 Lisp_Object frame = Qnil;
1181 1181 Lisp_Object dnd_data = Qnil;
1182 struct gcpro gcpro1, gcpro2; 1182 Lisp_Object dnd_type = Qnil;
1183
1184 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
1183 1185
1184 Type = DndDataType (event); 1186 Type = DndDataType (event);
1185 if ((Type != DndFile) && (Type != DndFiles) && (Type != DndExe)) 1187 if (Type < 0) /* pseudo event produces -1 as type */
1186 return; 1188 {
1189 stderr_out("DndDropHandler: pseudo drop received\n");
1190 return;
1191 }
1192
1187 DndGetData (&Data, &Size); 1193 DndGetData (&Data, &Size);
1188 1194
1189 GCPRO2 (path, frame); 1195 GCPRO4 (path, frame, dnd_data, dnd_type);
1190 1196
1191 frame = make_frame ((struct frame *) data); 1197 frame = make_frame ((struct frame *) data);
1192 1198
1193 if (Type == DndFiles) 1199 stderr_out("DndDropHandler: real drop received (T%d Sl%d)\n",Type,Size);
1194 { 1200
1201 switch (Type)
1202 {
1203 case DndFiles:
1195 while (*Data) 1204 while (*Data)
1196 { 1205 {
1197 len = strlen ((char*) Data); 1206 len = strlen ((char*) Data);
1198 path = make_string ((char*) Data, len); 1207 path = make_ext_string ((char*) Data, len, FORMAT_FILENAME);
1199 va_run_hook_with_args (Qdrag_and_drop_functions, 2, frame, path); 1208 va_run_hook_with_args (Qdrag_and_drop_functions, 2, frame, path);
1200 Data += len+1; 1209 Data += len+1;
1201 } 1210 }
1202 } 1211 break;
1203 else 1212 case DndFile:
1204 { 1213 path = make_ext_string ((char*) Data, strlen(Data), FORMAT_FILENAME);
1205 path = make_string ((char*) Data, strlen (Data));
1206 va_run_hook_with_args (Qdrag_and_drop_functions, 2, frame, path); 1214 va_run_hook_with_args (Qdrag_and_drop_functions, 2, frame, path);
1215 break;
1216 case DndText:
1217 dnd_data = make_ext_string ((char *) Data, strlen(Data), FORMAT_FILENAME);
1218 va_run_hook_with_args (Qdrag_and_drop_functions, 3, frame, path, dnd_data);
1219 break;
1220 case DndDir:
1221 case DndLink:
1222 case DndExe:
1223 case DndURL:
1224 case DndMIME:
1225 dnd_type = make_int (Type);
1226 dnd_data = make_ext_string ((char*) Data, strlen(Data), FORMAT_FILENAME);
1227 va_run_hook_with_args (Qdrag_and_drop_functions, 4,
1228 frame, path, dnd_data, dnd_type);
1229 break;
1230 default: /* Unknown, RawData and any other type */
1231 dnd_type = make_int (Type);
1232 dnd_data = make_ext_string ((char*) Data, Size, FORMAT_BINARY);
1233 va_run_hook_with_args (Qdrag_and_drop_functions, 4,
1234 frame, path, dnd_data, dnd_type);
1235 break;
1207 } 1236 }
1208 1237
1209 UNGCPRO; 1238 UNGCPRO;
1210 return; 1239 return;
1211 } 1240 }
1868 if (FRAME_X_TOP_LEVEL_FRAME_P (f)) 1897 if (FRAME_X_TOP_LEVEL_FRAME_P (f))
1869 { 1898 {
1870 /* tell the window manager about us. */ 1899 /* tell the window manager about us. */
1871 x_wm_store_class_hints (shell_widget, XtName (frame_widget)); 1900 x_wm_store_class_hints (shell_widget, XtName (frame_widget));
1872 1901
1873 #ifndef HAVE_WINDOWMAKER 1902 #ifndef HAVE_SESSION
1874 x_wm_maybe_store_wm_command (f); 1903 x_wm_maybe_store_wm_command (f);
1875 #endif /* HAVE_WINDOWMAKER */ 1904 #endif /* HAVE_SESSION */
1876 1905
1877 x_wm_hack_wm_protocols (shell_widget); 1906 x_wm_hack_wm_protocols (shell_widget);
1878 } 1907 }
1879 1908
1880 #ifdef HAVE_XIM 1909 #ifdef HAVE_XIM
2445 x_delete_frame (struct frame *f) 2474 x_delete_frame (struct frame *f)
2446 { 2475 {
2447 Widget w = FRAME_X_SHELL_WIDGET (f); 2476 Widget w = FRAME_X_SHELL_WIDGET (f);
2448 Lisp_Object popup, frame; 2477 Lisp_Object popup, frame;
2449 2478
2450 #ifndef HAVE_WINDOWMAKER 2479 #ifndef HAVE_SESSION
2451 if (FRAME_X_TOP_LEVEL_FRAME_P (f)) 2480 if (FRAME_X_TOP_LEVEL_FRAME_P (f))
2452 x_wm_maybe_move_wm_command (f); 2481 x_wm_maybe_move_wm_command (f);
2453 #endif /* HAVE_WINDOWMAKER */ 2482 #endif /* HAVE_SESSION */
2454 2483
2455 /* Frames with the popup property are using other frames as their 2484 /* Frames with the popup property are using other frames as their
2456 widget parent. Deleting them are their parent has already been 2485 widget parent. Deleting them are their parent has already been
2457 deleted can lead to crashes. */ 2486 deleted can lead to crashes. */
2458 XSETFRAME (frame, f); 2487 XSETFRAME (frame, f);