All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gnu.x11.test.Info Maven / Gradle / Ivy

Go to download

Escher is a collection of libraries for X Window System written purely in Java.

The newest version!
package gnu.x11.test;

import gnu.util.Misc;
import gnu.x11.Atom;
import gnu.x11.Font;
import gnu.x11.Window;
import gnu.x11.extension.NotFoundException;
import gnu.x11.extension.render.Render;
import gnu.x11.extension.glx.GLX;
import gnu.x11.extension.glx.GL;


/** 
 * List info about X server. 
 *
 * @see 
 * text output on linux + xfree86 4.0
 *
 * @see 
 * text output on solaris + x11
 *
 * @see 
 * text output on window 98 + winpro
 * 
 * @see 
 * help output
 */
public class Info extends gnu.x11.Application {
  public Info (String [] args) { 
    super (args);

    boolean print_keysyms = option.booleann ("print-keysyms",
      "print all keysyms for debug", false);

    about ("0.1", "list info about X server",
      "Stephen Tse ",
      "http://escher.sourceforge.net/");

    if (help_option) return;

    System.out.println ("\n\n---- display\n" + display);

    System.out.println ("\n\n---- extension");
    String[] exts = display.extensions ();
    for (int i = 0; i < exts.length; i++)
      System.out.println(exts[i]);

    extension_details ();

    System.out.println ("\n\n---- keyboard control\n"
      + display.input.keyboard_control ());
    
    System.out.println ("\n\n---- pointer control\n"
      + display.input.pointer_control ());
    
    System.out.println ("\n\n---- screen saver\n"
      + display.screen_saver ());
    
    System.out.println ("\n\n---- font path");
    String[] fontpath = display.font_path ();
    for (int i = 0; i < fontpath.length; i++)
      System.out.println(fontpath[i]);

    System.out.println ("\n\n---- first 20 fonts");
    Font[] fonts = display.fonts ("*", 20);
    for (int i = 0; i < fonts.length; i++)
      System.out.println(fonts[i]);

    System.out.println ("\n\n---- children of root");
    Window[] children = display.default_root.tree ().children ();
    for (int i = 0; i < children.length; i++)
      System.out.println(children[i]);

    System.out.println ("\n\n---- properties of root");
    Atom[] props = display.default_root.properties ();
    for (int i = 0; i < props.length; i++)
      System.out.println(props[i]);

    System.out.println ("\n\n---- screens"
      + Misc.to_string (display.screens));

    System.out.println ("\n\n---- pixmap formats"
      + Misc.to_string (display.pixmap_formats));


    System.out.println ("\n\n---- keyboard symbols");
    System.out.println ("  min-keycode: " + display.input.min_keycode);
    System.out.println ("  max-keycode: " + display.input.max_keycode);
    System.out.println ("  keycode-count: "
      + (display.input.max_keycode - display.input.min_keycode + 1));
    System.out.println ("  keysyms-per-keycode: : " 
      + display.input.keysyms_per_keycode);

    // compare to "xmodmap -pk"
    if (print_keysyms) {
      System.out.println ("  ** keysyms **");
      for (int i=0; i




© 2015 - 2025 Weber Informatics LLC | Privacy Policy