Example #1
0
        // opcode 75 - poly text16
        /**
           * @see <a href="XDrawText16.html">XDrawText16</a>
           */
        public void poly_text16(GC gc, int x, int y, Text [] texts)
        {
            Request request = new Request (display, 75,
              4+Data.unit (length (texts, 16)));

            request.write4 (id);
            request.write4 (gc.id);
            request.write2 (x);
            request.write2 (y);

            for (int i=0; i<texts.Length; i++) {
              if (texts [i].font != null) {
            request.write1 (255);	// font-shift indicator
            request.write4 (texts [i].font.id); // java = MSB
              }

              String s = texts [i].s;

              if (s[0] > 128) { // non-ascii
            request.write1 (s.Length/2);
            request.write1 (texts [i].delta);
            request.write1 (s);

              } else {		// ascii
            request.write1 (s.Length);
            request.write1 (texts [i].delta);
            request.write2 (s);
              }
            }

            display.send_request (request);
        }
Example #2
0
        private int length(Text [] texts, int bit)
        {
            int n = 0;
            for (int i=0; i<texts.Length; i++) n += texts [i].Length (bit);

            return n;
        }
Example #3
0
        // opcode 74 - poly text8
        /**
           * @see <a href="XDrawText.html">XDrawText</a>
           */
        public void poly_text(GC gc, int x, int y, Text [] texts)
        {
            Request request = new Request (display, 74,
              4+Data.unit (length (texts, 8)));

            request.write4 (id);
            request.write4 (gc.id);
            request.write2 (x);
            request.write2 (y);

            for (int i=0; i<texts.Length; i++) {
              if (texts [i].font != null) {
            request.write1 (255);	// font-shift indicator
            request.write4 (texts [i].font.id); // java = MSB
              }

              request.write1 (texts [i].s.Length);
              request.write1 (texts [i].delta);
              request.write1 (texts [i].s);
            }

            display.send_request (request);
        }