/* * Copyright (c) 1987, 1988, 1989 Stanford University * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of Stanford not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. Stanford makes no representations about * the suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * STANFORD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. * IN NO EVENT SHALL STANFORD BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ // runs idraw. #include "idraw.h" #include // Predefine default properties for the window size, paint menus, and // history. static PropertyData properties[] = { { "*font1", "*-courier-medium-r-*-100-* Courier 10" }, { "*font2", "*-courier-medium-r-*-120-* Courier 12" }, { "*font3", "*-courier-medium-r-*-140-* Courier 14" }, { "*font4", "*-courier-medium-r-*-180-* Courier 18" }, { "*font5", "*-courier-medium-r-*-240-* Courier 24" }, { "*font6", "*-courier-bold-r-*-100-* Courier-Bold 10" }, { "*font7", "*-courier-bold-r-*-120-* Courier-Bold 12" }, { "*font8", "*-courier-bold-r-*-140-* Courier-Bold 14" }, { "*font9", "*-courier-bold-r-*-180-* Courier-Bold 18" }, { "*font10", "*-courier-bold-r-*-240-* Courier-Bold 24" }, { "*font11", "*-courier-medium-o-*-100-* Courier-Italic 10" }, { "*font12", "*-courier-medium-o-*-120-* Courier-Italic 12" }, { "*font13", "*-courier-medium-o-*-140-* Courier-Italic 14" }, { "*font14", "*-courier-medium-o-*-180-* Courier-Italic 18" }, { "*font15", "*-courier-medium-o-*-240-* Courier-Italic 24" }, { "*font16", "*-times-medium-r-*-120-* Times-Roman 12" }, { "*font17", "*-times-medium-r-*-140-* Times-Roman 14" }, { "*font18", "*-times-medium-r-*-180-* Times-Roman 18" }, { "*font19", "*-times-medium-r-*-240-* Times-Roman 24" }, { "*font20", "*-times-bold-r-*-120-* Times-Bold 12" }, { "*font21", "*-times-bold-r-*-140-* Times-Bold 14" }, { "*font22", "*-times-bold-r-*-180-* Times-Bold 18" }, { "*font23", "*-times-bold-r-*-240-* Times-Bold 24" }, { "*font24", "*-times-medium-i-*-120-* Times-Italic 12" }, { "*font25", "*-times-medium-i-*-140-* Times-Italic 14" }, { "*font26", "*-times-medium-i-*-180-* Times-Italic 18" }, { "*font27", "*-times-medium-i-*-180-* Times-Italic 24" }, { "*font28", "*-helvetica-medium-r-*-120-* Helvetica 12" }, { "*font29", "*-helvetica-medium-r-*-140-* Helvetica 14" }, { "*font30", "*-helvetica-medium-r-*-180-* Helvetica 18" }, { "*font31", "*-helvetica-medium-r-*-240-* Helvetica 24" }, { "*font32", "*-helvetica-bold-r-*-120-* Helvetica-Bold 12" }, { "*font33", "*-helvetica-bold-r-*-140-* Helvetica-Bold 14" }, { "*font34", "*-helvetica-bold-r-*-180-* Helvetica-Bold 18" }, { "*font35", "*-helvetica-bold-r-*-240-* Helvetica-Bold 24" }, { "*font36", "*-helvetica-medium-o-*-120-* Helvetica-Oblique 12" }, { "*font37", "*-helvetica-medium-o-*-140-* Helvetica-Oblique 14" }, { "*font38", "*-helvetica-medium-o-*-180-* Helvetica-Oblique 18" }, { "*font39", "*-helvetica-medium-o-*-240-* Helvetica-Oblique 24" }, { "*brush1", "none" }, { "*brush2", "ffff 1 0 0" }, { "*brush3", "ffff 1 1 0" }, { "*brush4", "ffff 1 0 1" }, { "*brush5", "ffff 1 1 1" }, { "*brush6", "3333 1 0 0" }, { "*brush7", "3333 2 0 0" }, { "*brush8", "ffff 2 0 0" }, { "*pattern1", "none" }, { "*pattern2", "0.0" }, { "*pattern3", "1.0" }, { "*pattern4", "0.75" }, { "*pattern5", "0.5" }, { "*pattern6", "0.25" }, { "*pattern7", "1248" }, { "*pattern8", "8421" }, { "*pattern9", "f000" }, { "*pattern10", "8888" }, { "*pattern11", "f888" }, { "*pattern12", "8525" }, { "*pattern13", "cc33" }, { "*pattern14", "7bed" }, { "*fgcolor1", "Black" }, { "*fgcolor2", "Brown 42240 10752 10752" }, { "*fgcolor3", "Red" }, { "*fgcolor4", "Orange" }, { "*fgcolor5", "Yellow" }, { "*fgcolor6", "Green 0 50000 0" }, { "*fgcolor7", "Blue" }, { "*fgcolor8", "Indigo 48896 0 65280" }, { "*fgcolor9", "Violet 20224 12032 20224" }, { "*fgcolor10", "White" }, { "*fgcolor11", "LtLtGray 60000 60000 60000" }, { "*fgcolor12", "LtGray 50000 50000 50000" }, { "*fgcolor13", "MedGray 40000 40000 40000" }, { "*fgcolor14", "DkGray 33000 33000 33000" }, { "*fgcolor15", "DkDkGray 20000 20000 20000" }, { "*bgcolor1", "Black" }, { "*bgcolor2", "Brown 42240 10752 10752" }, { "*bgcolor3", "Red" }, { "*bgcolor4", "Orange" }, { "*bgcolor5", "Yellow" }, { "*bgcolor6", "Green 0 50000 0" }, { "*bgcolor7", "Blue" }, { "*bgcolor8", "Indigo 48896 0 65280" }, { "*bgcolor9", "Violet 20224 12032 20224" }, { "*bgcolor10", "White" }, { "*bgcolor11", "LtLtGray 60000 60000 60000" }, { "*bgcolor12", "LtGray 50000 50000 50000" }, { "*bgcolor13", "MedGray 40000 40000 40000" }, { "*bgcolor14", "DkGray 33000 33000 33000" }, { "*bgcolor15", "DkDkGray 20000 20000 20000" }, { "*initialfont", "2" }, { "*initialbrush", "2" }, { "*initialpattern","2" }, { "*initialfgcolor","1" }, { "*initialbgcolor","10" }, { "*history", "20" }, { "*reverseVideo", "off" }, { "*small", "true" }, { nil } }; // Define window size options. static OptionDesc options[] = { { "-l", "*small", OptionValueImplicit, "false" }, { "-s", "*small", OptionValueImplicit, "true" }, { nil } }; // main creates a connection to the display server, creates idraw, and // opens idraw's window. After idraw stops running, main closes // idraw's window, deletes everything it created, and returns success. int main (int argc, char** argv) { World* world = new World("Idraw", properties, options, argc, argv); Idraw* idraw = new Idraw(argc, argv); world->InsertApplication(idraw); idraw->Run(); world->Remove(idraw); delete idraw; delete world; const int SUCCESS = 0; return SUCCESS; }