//-----------------------------------------------------------------// void widget_progress::initialize() { // 標準的設定 at_param().state_.set(widget::state::SERVICE); at_param().state_.set(widget::state::POSITION_LOCK); at_param().state_.set(widget::state::SIZE_LOCK); at_param().state_.set(widget::state::MOVE_STALL); vtx::spos size = get_rect().size; img::paint pa; { const widget::plate_param& pp = param_.plate_param_; if(pp.resizeble_) { vtx::spos bsz = size; if(bsz.x >= pp.grid_.x * 3) bsz.x = pp.grid_.x * 3; if(bsz.y >= pp.grid_.y * 3) bsz.y = pp.grid_.y * 3; create_round_frame(pa, param_.plate_param_, param_.color_param_, bsz); base_h_ = wd_.at_mobj().install(&pa, bsz, param_.plate_param_.grid_); } else { create_round_frame(pa, param_.plate_param_, param_.color_param_, size); base_h_ = wd_.at_mobj().install(&pa); } } #if 0 const slider_param& sp = param_.slider_param_; if(param_.hand_image_) { const vtx::spos& size = param_.hand_image_->get_size(); create_image_base(param_.hand_image_, size, pa); } else { short wf = param_.plate_param_.frame_width_; if(sp.direction_ == slider_param::direction::HOLIZONTAL) { size.x = (size.x - wf * 2) * param_.slider_param_.handle_ratio_; size.y -= wf * 2; } else if(sp.direction_ == slider_param::direction::VERTICAL) { size.x -= wf * 2; size.y = (size.y - wf * 2) * param_.slider_param_.handle_ratio_; } plate_param pp = param_.plate_param_; pp.round_radius_ -= param_.plate_param_.frame_width_; pp.frame_width_ = 0; color_param cp = param_.color_param_; cp.swap_color(); cp.back_color_ *= 0.75f; create_round_frame(pa, pp, cp, size); pa.set_fore_color(cp.fore_color_); pa.alpha_blend(); if(sp.direction_ == slider_param::direction::HOLIZONTAL) { pa.line(size.x / 2, 3, size.x / 2, size.y - 3 * 2); } else if(sp.direction_ == slider_param::direction::VERTICAL) { } } hand_h_ = wd_.at_mobj().install(&pa); #endif }
int main(int argc, char* argv[]) { if(argc != 2) { show_usage(); return EXIT_FAILURE; } const std::string root = argv[1]; if(root == "-h" || root == "--help") { show_usage(); return EXIT_SUCCESS; } if(!filesystem::is_directory(root)) { if(filesystem::file_exists(root)) { std::cerr << ""; return EXIT_FAILURE; } if(!filesystem::make_directory(root)) { std::cerr << ""; return EXIT_FAILURE; } } BOOST_FOREACH(const tcreator& creator, creators) { if(!filesystem::make_directory(root + creator.first)) { std::cerr << ""; return EXIT_FAILURE; } } try { const surface base_image = create_image_base(root + "/base.png"); BOOST_FOREACH(const tcreator& creator, creators) { creator.second(base_image, root + creator.first); } } catch(exploder_failure& err) { std::cerr << "Error: Failed with error »" << err.message << "«.\n"; return EXIT_FAILURE; } return EXIT_SUCCESS; }