コード例 #1
0
ファイル: Display.cs プロジェクト: jbnivoit/projects
        // opcode 98 - query extension

        /**
         * @see <a href="XQueryExtension.html">XQueryExtension</a>
         */
        public ExtensionReply extension(String name)
        {
            Request request = new Request(this, 98, 2 + Data.unit(name));

            request.write2(name.Length);
            request.write2_unused();
            request.write1(name);
            return(new ExtensionReply(read_reply(request)));
        }
コード例 #2
0
ファイル: Display.cs プロジェクト: jbnivoit/projects
        // opcode 51 - set font path

        /**
         * @see <a href="XSetFontPath.html">XSetFontPath</a>
         */
        public void set_font_path(int count, String path)
        {
            Request request = new Request(this, 51, 2 + Data.unit(path));

            request.write2(count);
            request.write2_unused();
            request.write1(path);
            send_request(request);
        }
コード例 #3
0
ファイル: Font.cs プロジェクト: jbnivoit/projects
        // opcode 45 - open font
        /**
           * @see <a href="XLoadFont.html">XLoadFont</a>
           */
        public Font(Display display, String name)
            : base(display)
        {
            this.name = name;

            Request request = new Request (display, 45, 3+Data.unit (name));
            request.write4 (id);
            request.write2 (name.Length);
            request.write2_unused ();
            request.write1 (name);
            display.send_request (request);
        }
コード例 #4
0
ファイル: Font.cs プロジェクト: jbnivoit/projects
        // opcode 45 - open font

        /**
         * @see <a href="XLoadFont.html">XLoadFont</a>
         */
        public Font(Display display, String name)

            : base(display)
        {
            this.name = name;

            Request request = new Request(display, 45, 3 + Data.unit(name));

            request.write4(id);
            request.write2(name.Length);
            request.write2_unused();
            request.write1(name);
            display.send_request(request);
        }
コード例 #5
0
        // opcode 100 - change keyboard mapping

        /**
         * @see <a href="XChangeKeyboardMapping.html">XChangeKeyboardMapping</a>
         */
        public void change_keyboard_mapping(int first_keycode,
                                            int keysyms_per_keycode, int [] keysyms)
        {
            int keycode_count = keysyms.Length / keysyms_per_keycode;

            Request request = new Request(display, 100, keycode_count, 2 + keysyms.Length);

            request.write1(first_keycode);
            request.write1(keysyms_per_keycode);
            request.write2_unused();

            for (int i = 0; i < keysyms.Length; i++)
            {
                request.write4(keysyms [i]);
            }

            display.send_request(request);
        }
コード例 #6
0
ファイル: Colormap.cs プロジェクト: jbnivoit/projects
        // opcode 92 - lookup color

        /**
         * @see <a href="XLookupColor.html">XLookupColor</a>
         */
        public Color lookup_color(String name)
        {
            Request request = new Request(display, 92, 3 + Data.unit(name));

            request.write4(id);
            request.write2(name.Length);
            request.write2_unused();
            request.write1(name);

            Data  reply = display.read_reply(request);
            Color color = new Color(0);

            color.name   = name;
            color.exact  = new RGB(reply.read2(8), reply.read2(10), reply.read2(12));
            color.visual = new RGB(reply.read2(14), reply.read2(16),
                                   reply.read2(18));
            return(color);
        }
コード例 #7
0
ファイル: Atom.cs プロジェクト: jbnivoit/projects
        // opcode 16 - intern atom

        /**
         * @see <a href="XInternAtom.html">XInternAtom</a>
         */
        public Atom(Display display, String name, bool only_if_exists)
        {
            this.display = display;
            this.name    = name;

            Request request = new Request(display, 16, only_if_exists, 2 + Data.unit(name));

            request.write2(name.Length);
            request.write2_unused();
            request.write1(name);

            Data reply = display.read_reply(request);

            id = reply.read4(8);

            display.atom_ids.Add(id, this);
            display.atom_names.Add(name, this);
        }
コード例 #8
0
        // opcode 72 - put image
        public void put_small_image(GC gc, Image image, int y1, int y2,
                                    int x, int y)
        {
            int offset = image.line_byte_count * y1;
            int length = image.line_byte_count * (y2 - y1);

            Request request = new Request(display, 72, image.format,
                                          6 + Data.unit(length));

            request.write4(id);
            request.write4(gc.id);
            request.write2(image.width);
            request.write2(y2 - y1);
            request.write2(x);
            request.write2(y);
            request.write1(image.left_pad);
            request.write1(image.pixmap_format.depth());
            request.write2_unused();
            request.write1(image.data, offset, length);
            display.send_request(request);
        }
コード例 #9
0
ファイル: Input.cs プロジェクト: jbnivoit/projects
        // opcode 100 - change keyboard mapping
        /**
           * @see <a href="XChangeKeyboardMapping.html">XChangeKeyboardMapping</a>
           */
        public void change_keyboard_mapping(int first_keycode, 
    int keysyms_per_keycode, int [] keysyms)
        {
            int keycode_count = keysyms.Length / keysyms_per_keycode;

            Request request = new Request (display, 100, keycode_count, 2+keysyms.Length);
            request.write1 (first_keycode);
            request.write1 (keysyms_per_keycode);
            request.write2_unused ();

            for (int i=0; i<keysyms.Length; i++)
              request.write4 (keysyms [i]);

            display.send_request (request);
        }
コード例 #10
0
ファイル: Display.cs プロジェクト: jbnivoit/projects
 // opcode 51 - set font path
 /**
    * @see <a href="XSetFontPath.html">XSetFontPath</a>
    */
 public void set_font_path(int count, String path)
 {
     Request request = new Request (this, 51, 2+Data.unit (path));
     request.write2 (count);
     request.write2_unused ();
     request.write1 (path);
     send_request (request);
 }
コード例 #11
0
ファイル: Display.cs プロジェクト: jbnivoit/projects
 // opcode 98 - query extension
 /**
    * @see <a href="XQueryExtension.html">XQueryExtension</a>
    */
 public ExtensionReply extension(String name)
 {
     Request request = new Request (this, 98, 2+Data.unit (name));
     request.write2 (name.Length);
     request.write2_unused ();
     request.write1 (name);
     return new ExtensionReply (read_reply (request));
 }
コード例 #12
0
ファイル: Colormap.cs プロジェクト: jbnivoit/projects
        // opcode 92 - lookup color
        /**
           * @see <a href="XLookupColor.html">XLookupColor</a>
           */
        public Color lookup_color(String name)
        {
            Request request = new Request (display, 92, 3+Data.unit (name));
            request.write4 (id);
            request.write2 (name.Length);
            request.write2_unused ();
            request.write1 (name);

            Data reply = display.read_reply (request);
            Color color = new Color (0);
            color.name = name;
            color.exact = new RGB (reply.read2 (8), reply.read2 (10), reply.read2 (12));
            color.visual = new RGB (reply.read2 (14), reply.read2 (16),
              reply.read2 (18));
            return color;
        }
コード例 #13
0
ファイル: XTest.cs プロジェクト: jbnivoit/projects
     // xtest opcode 2 - fake input
     /**
        * @param type valid:
        * {@link #KEY_PRESS},
        * {@link #KEY_RELEASE},
        * {@link #BUTTON_PRESS},
        * {@link #BUTTON_RELEASE},
        * {@link #MOTION_NOTIFY}
        *
        * @param time possible: {@link gnu.x11.Display#CURRENT_TIME}
        */
     public void fake_input(int type, int detail, int delay, Window root, 
 int x, int y)
     {
         Request request = new Request (display, major_opcode, 2, 9);
         request.write1 (type);
         request.write1 (detail);
         request.write2_unused ();
         request.write4 (delay);
         request.write4 (root.id);
         request.write_unused (8);
         request.write2 (x);
         request.write2 (y);
         display.send_request (request);
     }
コード例 #14
0
ファイル: Drawable.cs プロジェクト: jbnivoit/projects
        // opcode 72 - put image
        public void put_small_image(GC gc, Image image, int y1, int y2, 
    int x, int y)
        {
            int offset = image.line_byte_count * y1;
            int length = image.line_byte_count * (y2 - y1);

            Request request = new Request (display, 72, image.format,
              6+Data.unit (length));

            request.write4 (id);
            request.write4 (gc.id);
            request.write2 (image.width);
            request.write2 (y2 - y1);
            request.write2 (x);
            request.write2 (y);
            request.write1 (image.left_pad);
            request.write1 (image.pixmap_format.depth ());
            request.write2_unused ();
            request.write1 (image.data, offset, length);
            display.send_request (request);
        }
コード例 #15
0
ファイル: Print.cs プロジェクト: jbnivoit/projects
 // print 18 - set attributes
 /**
  * @param pool valid:
  * {@link #JOB_ATTRIBUTE_POOL},
  * {@link #DOC_ATTRIBUTE_POOL},
  * {@link #PAGE_ATTRIBUTE_POOL},
  * {@link #PRINTER_ATTRIBUTE_POOL},
  * {@link #SERVER_ATTRIBUTE_POOL}
  *
  * @see <a href="XpSetAttributes.html">XpSetAttributes</a>
  */
 public void set_attributes(int pool, int rule, String attributes)
 {
     int len = 4 + Data.unit (attributes);
       Request request = new Request (this.display, this.owner.major_opcode, 18, len);
       request.write4 (id);
       request.write4 (attributes.Length);
       request.write1 (pool);
       request.write1 (rule);
       request.write2_unused ();
       request.write1 (attributes);
       this.display.send_request (request);
 }
コード例 #16
0
ファイル: Atom.cs プロジェクト: jbnivoit/projects
        // opcode 16 - intern atom
        /**
           * @see <a href="XInternAtom.html">XInternAtom</a>
           */
        public Atom(Display display, String name, bool only_if_exists)
        {
            this.display = display;
            this.name = name;

            Request request = new Request (display, 16, only_if_exists, 2+Data.unit (name));
            request.write2 (name.Length);
            request.write2_unused ();
            request.write1 (name);

            Data reply = display.read_reply (request);
            id = reply.read4 (8);

            display.atom_ids.Add (id, this);
            display.atom_names.Add (name, this);
        }
コード例 #17
0
ファイル: Shape.cs プロジェクト: jbnivoit/projects
     // shape opcode 2 - mask
     /**
        * @param dest_kind valid:
        * {@link #BOUNDING},
        * {@link #CLIP}
        *
        * @param operation valid:
        * {@link #SET},
        * {@link #UNION},
        * {@link #INTERSECT},
        * {@link #SUBTRACT},
        * {@link #INVERT}
        *
        * @param src possible: {@link gnu.x11.Pixmap#NONE}
        * @see <a href="XShapeCombineMask.html">XShapeCombineMask</a>
        */
     public void combine_mask(Window dest, int dest_kind, int x_offset, 
 int y_offset, Pixmap src, int operation)
     {
         Request request = new Request (display, major_opcode, 2, 5);
         request.write1 (operation);
         request.write1 (dest_kind);
         request.write2_unused ();
         request.write4 (dest.id);
         request.write2 (x_offset);
         request.write2 (y_offset);
         request.write4 (src.id);
         display.send_request (request);
     }