#include #include #include "documentd_menu.h" static std::string menu_clear(DOC_BUTTON_SPECS &specs) { return string_f( "" "" "" ,specs.width,specs.width ,specs.radius-1,specs.radius-1,2,2,specs.width-4,specs.width-4); } static void documentd_svgs (DOC_BUTTON_SPECS &specs, std::string &svg_image, std::string &svg_imbed) { int w4 = specs.width/4; int w7 = specs.width/7; int h6 = specs.width/6; int h4_6 = 4*h6; int h3 = specs.width/3; int h2 = 2*h3; svg_image= string_f( "" "" "" ,specs.width,specs.width ,0,specs.width, w4,-h3, w4,h3, w4,-h2, w4,h2); svg_imbed= string_f( "" "" "" "" ,specs.width,specs.width ,w7,h6, 6*w7,h4_6 ,4*w7,2*h6, w4,2*h6); } WHITEBOARD_MENU::WHITEBOARD_MENU(DOC_BUTTON_SPECS &specs) { svg_clear= menu_clear(specs); svg_text = string_f( "" "" "T" "" ,specs.width,specs.width ,specs.width/5,specs.width/2 ,specs.width/5*2,3*specs.width/5); svg_ellipse= string_f( "" "" "" ,specs.width,specs.width ,specs.width/2,specs.width/2,specs.width/2-4); svg_rect= string_f( "" "" "" ,specs.width,specs.width ,specs.radius-1,specs.radius-1,4,4,specs.width-8,specs.width-8); svg_line= string_f( "" "" "" ,specs.width,specs.width ,4,4,specs.width-4,specs.width-4); svg_handline= string_f( "" "" "" ,specs.width,specs.width ,4,4, 4,5, 5,4, 4,5, 5,4); svg_select = string_f( "" "" "" "" "" ,specs.width,specs.width ,specs.width-4-5); svg_star= string_f( "" "" "" "" "" ,specs.width,specs.width ,specs.width/4,2*specs.width/3 ,2*specs.width/4,specs.width/3 ,3*specs.width/4,2*specs.width/3); svg_parent= string_f( "" "" "" "" "" "" ,specs.width,specs.width ,specs.radius-1,specs.radius-1,2,2,specs.width-4,specs.width-4 ,specs.width/4,specs.width/2 ,2*specs.width/4,specs.width/2 ,3*specs.width/4,specs.width/2); svg_dashrect= string_f( "" "" "" ,specs.width,specs.width ,specs.radius-1,specs.radius-1,4,4,specs.width-8,specs.width-8); svg_linetype= string_f( "" "" "" "" "" ,specs.width,specs.width ,4,specs.width/4,specs.width-4,specs.width/4 ,4,specs.width/2,specs.width-4,specs.width/2 ,4,3*specs.width/4,specs.width-4,3*specs.width/4); svg_textpos= string_f( "" "T" "T" "T" "T" "" ,specs.width,specs.width ,specs.width/6,specs.width/2+2 ,specs.width/2-2,specs.width/3+2 ,specs.width/2-2,5*specs.width/6 ,4*specs.width/6,specs.width/2+2); svg_inctextsize= string_f( "" "A" "A" "" ,specs.width,specs.width ,specs.width/6,specs.width/2+2 ,specs.width/2,2*specs.width/3+2); svg_dectextsize= string_f( "" "A" "A" "" ,specs.width,specs.width ,specs.width/6,2*specs.width/3+2 ,specs.width/2+2,specs.width/2+2); // trash can int liney1=2*specs.width/6+2; int liney2=4*specs.width/6+4; int linex1_1 = 2*specs.width/6; int linex1_2 = 3*specs.width/6; int linex1_3 = 4*specs.width/6; svg_delitems = string_f("" "" "" "" "" "" "" "" ,specs.width,specs.width ,linex1_1,liney1,linex1_1,liney2 ,linex1_2,liney1,linex1_2,liney2 ,linex1_3,liney1,linex1_3,liney2 ,specs.width/2-2,specs.width/6-2,4,4 ,specs.width/6-2,specs.width/6+2,5*specs.width/6,specs.width/6 ,2*specs.width/6-2,2*specs.width/6+2,3*specs.width/6,3*specs.width/6); svg_undo = string_f("" "U" "" ,specs.width,specs.width ,specs.width/6,2*specs.width/3+2); int pos1 = specs.width/3; int pos2 = 2*specs.width/3; svg_grid= string_f( "" "" "" "" "" "" ,specs.width,specs.width ,0,pos1,specs.width,pos1 ,0,pos2,specs.width,pos2 ,pos1,0,pos1,specs.width ,pos2,0,pos2,specs.width); documentd_svgs (specs,svg_image,svg_imbed); } WORDPROC_MENU::WORDPROC_MENU(DOC_BUTTON_SPECS &specs) { documentd_svgs (specs,svg_image,svg_imbed); } CALC_MENU::CALC_MENU(DOC_BUTTON_SPECS &specs) { svg_clear = menu_clear(specs); } PHOTOS_MENU::PHOTOS_MENU(DOC_BUTTON_SPECS &specs) { svg_config = string_f( "" "" "" "" "" "" ,specs.width,specs.width ,specs.radius-1,specs.radius-1,2,2,specs.width-4,specs.width-4 ,2*specs.width/6,specs.width-6,2*specs.width/6 ,3*specs.width/6,specs.width-6,3*specs.width/6 ,4*specs.width/6,specs.width-6,4*specs.width/6); svg_txtedit = string_f( "" "T" "" ,specs.width,specs.width ,specs.width/6*2,4*specs.width/6); } // Return the SVG for the icon reload std::string documentd_menu_get_reload (DOC_BUTTON_SPECS &specs) { unsigned w_4 = specs.width/4; unsigned w_2 = specs.width/2; unsigned off = 2; // Offset to center the circle // Circle ray is w_4 unsigned pos = sin(45)*w_4; std::string ret = string_f( "" "" "" "\n" ,specs.width,specs.width ,w_2+off,w_4,w_4,w_4,w_2-pos+off,w_2-pos ,w_2-pos+off,w_2-pos); return ret; } VIDEO_MENU::VIDEO_MENU(DOC_BUTTON_SPECS &specs) { svg_config = string_f( "" "" "" "" "" "" ,specs.width,specs.width ,specs.radius-1,specs.radius-1,2,2,specs.width-4,specs.width-4 ,2*specs.width/6,specs.width-6,2*specs.width/6 ,3*specs.width/6,specs.width-6,3*specs.width/6 ,4*specs.width/6,specs.width-6,4*specs.width/6); int w7 = specs.width/7; int h6 = specs.width/6; int h4_6 = 4*h6; svg_showmain = string_f( "" "" "" ,specs.width,specs.width ,w7,h6, 6*w7,h4_6); int pos1 = specs.width/3; int pos2 = 2*specs.width/3; svg_showgrid= string_f( "" "" "" "" "" "" ,specs.width,specs.width ,0,pos1,specs.width,pos1 ,0,pos2,specs.width,pos2 ,pos1,0,pos1,specs.width ,pos2,0,pos2,specs.width); int w2 = specs.width/2; int w3 = specs.width/3; int w6 = specs.width/6; int w10 = specs.width/10; int bottom = specs.width-w10; svg_showme= string_f( "" "" "" "" ,specs.width,specs.width ,w2,w3,3*specs.width/4,4*specs.width/5,specs.width/4,4*specs.width/5 ,w2,w3,w6); svg_muteme= string_f( "" "" "" "" "" "" "" "" ,specs.width,specs.width ,w2,w3,w6 //,w2,2*specs.width/3,w6 ,w2,w2,w6 ,w2-w6,w3,2*w6,w2-w3 ,w2,w2,w2,bottom ,w3,bottom,2*specs.width/3,bottom ,w10,w10,bottom,bottom); int w4 = specs.width/4; svg_hideme= string_f( "" "" "" "" "" ,specs.width,specs.width ,w2,w2,bottom,w3,bottom,2*specs.width/3 ,w4/2,w4,w2+w10,w2,w10,w10 ,w10,w10,bottom,bottom); }