Example #1
0
        //throws gnu.x11.extension.NotFoundException {
        public PrintHello(String [] args)
            : base(args)
        {
            String printer_name = option.option ("printer");

            about ("0.1", "print hello world",
              "Stephen Tse <*****@*****.**>",
              "http://escher.sourceforge.net/");

            if (help_option) return;

            Print print = new Print (display);
            Print.Context context = print.create_context (printer_name);

            Console.WriteLine (print);
            Console.WriteLine (context);

            context.set_attributes (Print.Context.JOB_ATTRIBUTE_POOL,
              Print.Context.ATTRIBUTE_MERGE,
              "*job-name: Hello world for Xprint");
            context.set ();
            print.start_job (Print.SPOOL);

            Window root = context.screen ();
            GC gc = root.screen ().default_gc ();
            gc.set_font (new gnu.x11.Font (display, FONT));
            Window window = new Window (root, 100, 100, 100, 100);
            window.create ();

            print.start_page (window);
            window.map ();
            window.text (gc, 20, 30, "Hello World!");
            print.end_page ();

            print.end_job ();
            context.destroy ();
            display.close ();
        }
Example #2
0
 /** Intern. */
 public Context(Print owner, int id) :
     base(owner.display, id)
 {
     this.owner = owner;
 }
Example #3
0
 public PrintersEnum(Print owner, Data reply, int len, int c) : base(reply, len, c)
 {
     this.owner = owner;
 }
Example #4
0
 public Printer(Print owner, Data data, int offset) : base(data, offset)
 {
     this.owner = owner;
 }
Example #5
0
 public PrintersEnum(Print owner, Data reply, int len, int c)
     : base(reply,len,c)
 {
     this.owner=owner;
 }
Example #6
0
 public Printer(Print owner, Data data, int offset)
     : base(data, offset)
 {
     this.owner=owner;
 }
Example #7
0
            // print 2 - create context
            /**
             * @see <a href="XpCreateContext.html">XpCreateContext</a>
             */
            public Context(Print owner, String name)
                : base(owner.display)
            {
                this.owner=owner;

                  int len = 4 + Data.unit (name) + Data.unit (owner.locale);
                  Request request = new Request (this.display, owner.major_opcode, 2, len);
                  request.write4 (id);
                  request.write4 (name.Length);
                  request.write4 (owner.locale.Length);
                  request.write1 (name);
                  request.write1 (owner.locale);
                  this.display.send_request (request);
            }
Example #8
0
 /** Intern. */
 public Context(Print owner, int id)
     : base(owner.display, id)
 {
     this.owner=owner;
 }