bool var___::del__(){ if(!qianche_rem_.empty()){ del__(huashen__(qianche_rem_,'x')); qianche_rem_.clear(); } return huashen_.size()<=0; }
bool var___::del__(list<string>* rems){ if(rems&&rems->size()>0){ for(list<string>::iterator li=rems->begin();li!=rems->end();++li) del__(huashen__(*li,'x')); }else huashen_.clear(); return huashen_.size()<=0; }
int dnd___::proc__(std::deque<Glib::ustring>* p,char*buf,long siz,char**addr_ret,void*shangji,void*ce) { if((*p)[0]==name__()){ if(siz==-1)return 1; if(p->size()<3){ d_(sh_,err_show_buzu_,p); return 1; } Gtk::Widget* w; sh_->builder_->get_widget((*p)[2], w); if(!w){ d_(sh_,err_show_wufa_,2,p,2); return 1; } GtkWidget* w1=w->gobj(); if((*p)[1]=="移除"){ del__(w1); return 1; } if((*p)[1]=="目标"){ if(p->size()<6){ d_(sh_,err_show_buzu_,p); return 1; } int gdd=0,gda=0; dnd_cb___* cb=new dnd_cb___('d',w1,sh_,d_); for(size_t i=3;i<p->size();i++){ const Glib::ustring& p1=(*p)[i]; if(p1=="代码"){ if(++i>=p->size()){ d_(sh_,err_show_buzu_,p); delete cb; return 1; } cb->code_=(*p)[i]; continue; } if(p1=="复制"){ gda|=GDK_ACTION_COPY; continue; } if(p1=="移动"){ gda|=GDK_ACTION_MOVE; continue; } if(p1=="链接"){ gda|=GDK_ACTION_LINK; continue; } if(p1=="高亮"){ gdd|=GTK_DEST_DEFAULT_HIGHLIGHT|GTK_DEST_DEFAULT_MOTION; continue; } if(p1=="按钮"){ gdd|=GTK_DEST_DEFAULT_DROP|GTK_DEST_DEFAULT_MOTION; continue; } delete cb; d_(sh_,err_show_buzhichi_,2,p,i); return 1; } gtk_drag_dest_set (w1, (GtkDestDefaults)gdd, 0, 0, (GdkDragAction)gda); gtk_drag_dest_add_uri_targets(w1); cb->sid_=g_signal_connect (w1, "drag-data-received",G_CALLBACK(drag_data_received__), cb); cb_.push_back(cb); return 1; } d_(sh_,err_show_buzhichi_,2,p,1); return 1; } return 0; }
dnd___::~dnd___(){ del__(NULL); }