434 GtkTreePath *dest_path, |
434 GtkTreePath *dest_path, |
435 GtkSelectionData *selection_data) |
435 GtkSelectionData *selection_data) |
436 { |
436 { |
437 //printf("drag received\n"); |
437 //printf("drag received\n"); |
438 UiListModel *model = UI_LIST_MODEL(drag_dest); |
438 UiListModel *model = UI_LIST_MODEL(drag_dest); |
|
439 /* |
439 if(model->model->drop) { |
440 if(model->model->drop) { |
440 gint *indices = gtk_tree_path_get_indices(dest_path); |
441 gint *indices = gtk_tree_path_get_indices(dest_path); |
441 gint row = indices[0]; |
442 gint row = indices[0]; |
442 UiEvent e; |
443 UiEvent e; |
443 e.obj = model->obj; |
444 e.obj = model->obj; |
447 e.intval = 0; |
448 e.intval = 0; |
448 UiSelection s; |
449 UiSelection s; |
449 s.data = selection_data; |
450 s.data = selection_data; |
450 model->model->drop(&e, &s, model->var->value, row); |
451 model->model->drop(&e, &s, model->var->value, row); |
451 } |
452 } |
|
453 */ |
452 return TRUE; |
454 return TRUE; |
453 } |
455 } |
454 |
456 |
455 gboolean ui_list_model_row_drop_possible( |
457 gboolean ui_list_model_row_drop_possible( |
456 GtkTreeDragDest *drag_dest, |
458 GtkTreeDragDest *drag_dest, |
457 GtkTreePath *dest_path, |
459 GtkTreePath *dest_path, |
458 GtkSelectionData *selection_data) |
460 GtkSelectionData *selection_data) |
459 { |
461 { |
460 //printf("row_drop_possible\n"); |
462 //printf("row_drop_possible\n"); |
461 UiListModel *model = UI_LIST_MODEL(drag_dest); |
463 UiListModel *model = UI_LIST_MODEL(drag_dest); |
|
464 /* |
462 if(model->model->candrop) { |
465 if(model->model->candrop) { |
463 gint *indices = gtk_tree_path_get_indices(dest_path); |
466 gint *indices = gtk_tree_path_get_indices(dest_path); |
464 gint row = indices[0]; |
467 gint row = indices[0]; |
465 UiEvent e; |
468 UiEvent e; |
466 e.obj = model->obj; |
469 e.obj = model->obj; |
470 e.intval = 0; |
473 e.intval = 0; |
471 UiSelection s; |
474 UiSelection s; |
472 s.data = selection_data; |
475 s.data = selection_data; |
473 return model->model->candrop(&e, &s, model->var->value, row); |
476 return model->model->candrop(&e, &s, model->var->value, row); |
474 } |
477 } |
|
478 */ |
475 return TRUE; |
479 return TRUE; |
476 } |
480 } |
477 |
481 |
478 gboolean ui_list_model_row_draggable( |
482 gboolean ui_list_model_row_draggable( |
479 GtkTreeDragSource *drag_source, |
483 GtkTreeDragSource *drag_source, |
480 GtkTreePath *path) |
484 GtkTreePath *path) |
481 { |
485 { |
482 //printf("row_draggable\n"); |
486 //printf("row_draggable\n"); |
483 UiListModel *model = UI_LIST_MODEL(drag_source); |
487 UiListModel *model = UI_LIST_MODEL(drag_source); |
|
488 /* |
484 if(model->model->candrag) { |
489 if(model->model->candrag) { |
485 gint *indices = gtk_tree_path_get_indices(path); |
490 gint *indices = gtk_tree_path_get_indices(path); |
486 gint row = indices[0]; |
491 gint row = indices[0]; |
487 UiEvent e; |
492 UiEvent e; |
488 e.obj = model->obj; |
493 e.obj = model->obj; |
490 e.document = e.obj->ctx->document; |
495 e.document = e.obj->ctx->document; |
491 e.eventdata = NULL; |
496 e.eventdata = NULL; |
492 e.intval = 0; |
497 e.intval = 0; |
493 return model->model->candrag(&e, model->var->value, row); |
498 return model->model->candrag(&e, model->var->value, row); |
494 } |
499 } |
|
500 */ |
495 return TRUE; |
501 return TRUE; |
496 } |
502 } |
497 |
503 |
498 gboolean ui_list_model_drag_data_get( |
504 gboolean ui_list_model_drag_data_get( |
499 GtkTreeDragSource *drag_source, |
505 GtkTreeDragSource *drag_source, |
500 GtkTreePath *path, |
506 GtkTreePath *path, |
501 GtkSelectionData *selection_data) |
507 GtkSelectionData *selection_data) |
502 { |
508 { |
503 //printf("drag_data_get\n"); |
509 //printf("drag_data_get\n"); |
504 UiListModel *model = UI_LIST_MODEL(drag_source); |
510 UiListModel *model = UI_LIST_MODEL(drag_source); |
|
511 /* |
505 if(model->model->data_get) { |
512 if(model->model->data_get) { |
506 gint *indices = gtk_tree_path_get_indices(path); |
513 gint *indices = gtk_tree_path_get_indices(path); |
507 gint row = indices[0]; |
514 gint row = indices[0]; |
508 UiEvent e; |
515 UiEvent e; |
509 e.obj = model->obj; |
516 e.obj = model->obj; |
513 e.intval = 0; |
520 e.intval = 0; |
514 UiSelection s; |
521 UiSelection s; |
515 s.data = selection_data; |
522 s.data = selection_data; |
516 model->model->data_get(&e, &s, model->var->value, row); |
523 model->model->data_get(&e, &s, model->var->value, row); |
517 } |
524 } |
|
525 */ |
518 return TRUE; |
526 return TRUE; |
519 } |
527 } |
520 |
528 |
521 gboolean ui_list_model_drag_data_delete( |
529 gboolean ui_list_model_drag_data_delete( |
522 GtkTreeDragSource *drag_source, |
530 GtkTreeDragSource *drag_source, |
523 GtkTreePath *path) |
531 GtkTreePath *path) |
524 { |
532 { |
525 //printf("drag_data_delete\n"); |
533 //printf("drag_data_delete\n"); |
526 UiListModel *model = UI_LIST_MODEL(drag_source); |
534 UiListModel *model = UI_LIST_MODEL(drag_source); |
|
535 /* |
527 if(model->model->data_get) { |
536 if(model->model->data_get) { |
528 gint *indices = gtk_tree_path_get_indices(path); |
537 gint *indices = gtk_tree_path_get_indices(path); |
529 gint row = indices[0]; |
538 gint row = indices[0]; |
530 UiEvent e; |
539 UiEvent e; |
531 e.obj = model->obj; |
540 e.obj = model->obj; |