void DumpProperties(BaseEngine *engine, bool fullDump) { Out("\t<Properties\n"); ScopedMem<char> str; str.Set(Escape((WCHAR *)engine->FileName(), true)); Out("\t\tFilePath=\"%s\"\n", str.Get()); str.Set(Escape(engine->GetProperty(Prop_Title))); if (str) Out("\t\tTitle=\"%s\"\n", str.Get()); str.Set(Escape(engine->GetProperty(Prop_Subject))); if (str) Out("\t\tSubject=\"%s\"\n", str.Get()); str.Set(Escape(engine->GetProperty(Prop_Author))); if (str) Out("\t\tAuthor=\"%s\"\n", str.Get()); str.Set(Escape(engine->GetProperty(Prop_Copyright))); if (str) Out("\t\tCopyright=\"%s\"\n", str.Get()); str.Set(Escape(engine->GetProperty(Prop_CreationDate))); if (str) Out("\t\tCreationDate=\"%s\"\n", str.Get()); str.Set(Escape(engine->GetProperty(Prop_ModificationDate))); if (str) Out("\t\tModDate=\"%s\"\n", str.Get()); str.Set(Escape(engine->GetProperty(Prop_CreatorApp))); if (str) Out("\t\tCreator=\"%s\"\n", str.Get()); str.Set(Escape(engine->GetProperty(Prop_PdfProducer))); if (str) Out("\t\tPdfProducer=\"%s\"\n", str.Get()); str.Set(Escape(engine->GetProperty(Prop_PdfVersion))); if (str) Out("\t\tPdfVersion=\"%s\"\n", str.Get()); str.Set(Escape(engine->GetProperty(Prop_PdfFileStructure))); if (str) Out("\t\tPdfFileStructure=\"%s\"\n", str.Get()); if (!engine->AllowsPrinting()) Out("\t\tPrintingAllowed=\"no\"\n"); if (!engine->AllowsCopyingText()) Out("\t\tCopyingTextAllowed=\"no\"\n"); if (engine->IsImageCollection()) Out("\t\tImageCollection=\"yes\"\n"); if (engine->PreferredLayout()) Out("\t\tPreferredLayout=\"%d\"\n", engine->PreferredLayout()); Out("\t/>\n"); if (fullDump) { ScopedMem<WCHAR> fontlist(engine->GetProperty(Prop_FontList)); if (fontlist) { WStrVec fonts; fonts.Split(fontlist, L"\n"); str.Set(Escape(fonts.Join(L"\n\t\t"))); Out("\t<FontList>\n\t\t%s\n\t</FontList>\n", str.Get()); } } }
void iDraw() { int m,n; iClear(); iSetcolor(1,1,1); iFilledRectangle(1,1,width-19,height-18); //draw text box iSetcolor(0,0,0); iRectangle(1,1,width-19,height-19); //draw text boundary if (selflag) { for (int l=selSI; l<=selEI; l++) { int sx = (l==selSI)?( (selSJ==0)?3:selSJ*charSpace) : 3; int sy = height - 17 - (l+1-s)*lineSpace - 5; int w; if (l==selSI) w = (selSI == selEI) ? selEJ-selSJ : strlen(str+l*charMax*sizeof(char))-selSJ; else if (l==selEI) w = selEJ; else w = (strlen(str+l*charMax*sizeof(char))==0)?1:strlen(str+l*charMax*sizeof(char)); iSetcolor(.8,.8,.9); iFilledRectangle(sx,sy,w*charSpace,lineSpace); } } iSetcolor(0,0,0); for (m=height-17-lineSpace, n=s; n<=imax; m-=lineSpace, n++) { iText(3, m, str+n*charMax*sizeof(char),font); //print text } if (fOpen) { fileopen(); iSetcolor(0,0,0); iText((width-15)/2-135,(height-19)/2+62,subTemp+r); //print file open text } else if (fsave) { filesave(); iSetcolor(0,0,0); iText((width-15)/2-135,(height-19)/2+62,subTemp+r); //print file save as text } else if (aboutR) { aboutRword(); } cursor(); //draw cursor iSetcolor(.9,.9,.9); iFilledRectangle(3,height-17,width-19,17); iSetcolor(0,0,0); iLine(2,height-18,width-19,height-18); iSetcolor(0,0,0); iText(5,height-12,"File",GLUT_BITMAP_HELVETICA_12); iSetcolor(0,0,0); iText(45,height-12,"Edit",GLUT_BITMAP_HELVETICA_12); iSetcolor(0,0,0); iText(85,height-12,"Format",GLUT_BITMAP_HELVETICA_12); iSetcolor(0,0,0); iText(141,height-12,"Help",GLUT_BITMAP_HELVETICA_12); //draw menus if (menuflag == 1) { fileMenu(); //draw file drop down menu } else if (menuflag == 2) { editMenu(); //draw edit drop down menu } else if (menuflag == 3) { formatMenu(); //draw format drop down menu } else if (menuflag == 4) { helpMenu(); //draw help drop down menu } if (fontflag) { fontlist(); //draw font list } else if (saveM) { saveMessage(); //message box while exitting } scrollbar(); // draw scrollbar if (load) loading(); //load window }