Пример #1
0
 /**
  * @param a possible:
  * {@link Atom#NONE} (default)
  */
 public void set_dither(Atom a)
 {
     set (11, a.id);
 }
Пример #2
0
        // opcode 23 - get selection owner
        /**
           * @see <a href="XGetSelectionOwner.html">XGetSelectionOwner</a>
           */
        public Window selection_owner(Atom selection)
        {
            Request request = new Request (this, 23, 2);
            request.write4 (selection.id);

            Data reply = read_reply (request);
            return (Window) Window.intern (this, reply.read4 (8));
        }
Пример #3
0
     // opcode 20 - get property
     /**
        * @see <a href="XGetWindowProperty.html">XGetWindowProperty</a>
        */
     public PropertyReply property(bool delete, Atom property, Atom type, 
 int offset, int length)
     {
         Request request = new Request (display, 20, delete, 6);
         request.write4 (id);
         request.write4 (property.id);
         request.write4 (type.id);
         request.write4 (offset);
         request.write4 (length);
         return new PropertyReply (display.read_reply (request));
     }
Пример #4
0
        // opcode 114 - rotate properties
        /**
           * @see <a href="XRotateWindowProperties.html">
           * XRotateWindowProperties</a>
           */
        public void rotate_properties(Atom [] properties, int delta)
        {
            Request request = new Request (display, 114, 3+properties.Length);
            request.write4 (id);
            request.write2 (properties.Length);
            request.write2 (delta);

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

            display.send_request (request);
        }
Пример #5
0
     // opcode 24 - convert selection
     /**
        * @param time possible: {@link Display#CURRENT_TIME}
        * @see <a href="XConvertSelection.html">XConvertSelection</a>
        */
     public void convert_selection(Atom selection, Atom target, 
 Atom property, int time)
     {
         Request request = new Request (display, 24, 6);
         request.write4 (id);
         request.write4 (selection.id);
         request.write4 (target.id);
         request.write4 (property.id);
         request.write4 (time);
         display.send_request (request);
     }
Пример #6
0
 // opcode 19 - delete property
 /**
    * @see <a href="XDeleteProperty.html">XDeleteProperty</a>
    */
 public void delete_property(Atom property)
 {
     Request request = new Request (display, 19, 3);
     request.write4 (id);
     request.write4 (property.id);
     display.send_request (request);
 }
Пример #7
0
 /**
    * @see #change_property(int, int, Atom, Atom, int, Object, int, int)
    */
 public void change_property(Atom property, Atom type, int data)
 {
     change_property (REPLACE, 1, property, type, 32,
       new int [] {data}, 0, 32);
 }
Пример #8
0
        // opcode 18 - change property
        /**
           * Extra parameters (offset and data_format) are used to support Data
           * class as parameter for writing. See set_wm_normal_hints ().
           *
           * @param mode valid:
           * {@link #REPLACE},
           * {@link #PREPEND},
           * {@link #APPEND}
           *
           * @param format: valid:
           * <code>8</code>,
           * <code>16</code>,
           * <code>32</code>
           *
           * @param data_format: valid:
           * <code>8</code>,
           * <code>16</code>,
           * <code>32</code>
           *
           * @see <a href="XChangeProperty.html">XChangeProperty</a>
           */
        public void change_property(int mode, int n, Atom property, Atom type,
    int format, Object data, int offset, int data_format)
        {
            Request request = new Request (display, 18, mode, 6+Data.unit (n*format/8));
            request.write4 (id);
            request.write4 (property.id);
            request.write4 (type.id);
            request.write1 (format);
            request.write3_unused ();
            request.write4 (n);		// data length in format unit

            // data
            switch (data_format) {
            case 8: request.write1 ((byte []) data, offset); break;
            case 16: request.write2 ((int []) data, offset); break;
            case 32: request.write4 ((int []) data, offset); break;
            }
            display.send_request (request);
        }
Пример #9
0
 // opcode 22 - set selection owner
 /**
    * @param time possible: {@link Display#CURRENT_TIME}
    * @see <a href="XSetSelectionOwner.html">XSetSelectionOwner</a>
    */
 public void set_selection_owner(Atom selection, int time)
 {
     Request request = new Request (display, 22, 4);
     request.write4 (id);
     request.write4 (selection.id);
     request.write4 (time);
     display.send_request (request);
 }
Пример #10
0
 public void set_type(Atom atom)
 {
     write4 (8, atom.id);
 }
Пример #11
0
        //throws NotFoundException
        public Puppet(String [] args)
            : base(args)
        {
            Preference.staticInit();

            print_event = option.booleann ("print-event",
              "dump all events for debug", false);

            space = option.rectangle ("space",
              "workspace for normal windows", pref.space ());

            about ("0.1", "puppet window manager",
              "Stephen Tse <*****@*****.**>",
              "http://escher.sourceforge.net/",
              "\nFor bindings, check http://escher.sourceforge.net/"
              + "current/doc/gnu/app/puppet/Puppet.html.");

            if (help_option) return;

            /**
             * addShutdownHook in IBM JDK 1.3 does not seem to work for processing
             * Control-C. It simply ignores TERM signal instead of calling shutdown
             * hooks and then exiting.
             */
            //     Runtime.getRuntime ().addShutdownHook (new Thread () {
            //       public void run () { System.err.println ("shutting down..."); }});

            root = display.default_root;
            Window.NONE.display = display; // for move pointer
            xtest = new XTest (display); // for press button
            registers = new Client [display.input.max_keycode
              - display.input.min_keycode];

            _mit_priority_colors = (Atom) Atom.intern (display, "_MIT_PRIORITY_COLORS");
            wm_change_state = (Atom) Atom.intern (display, "WM_CHANGE_STATE");
            wm_state = (Atom) Atom.intern (display, "WM_STATE");
            wm_colormap_windows = (Atom) Atom.intern (display, "WM_COLORMAP_WINDOWS");
            wm_protocols = (Atom) Atom.intern (display, "WM_PROTOCOLS");
            wm_take_focus = (Atom) Atom.intern (display, "WM_TAKE_FOCUS");
            wm_save_yourself = (Atom) Atom.intern (display, "WM_SAVE_YOURSELF");
            wm_delete_window = (Atom) Atom.intern (display, "WM_DELETE_WINDOW");
            sm_client_id = (Atom) Atom.intern (display, "SM_CLIENT_ID");
            wm_client_leader = (Atom) Atom.intern (display, "WM_CLIENT_LEADER");
            wm_window_role = (Atom) Atom.intern (display, "WM_WINDOW_ROLE");

            control_root_window ();
            scan_children ();

            focus = (Client) Client.intern (root.pointer ().child ());
            focus.set_input_focus ();

            grab_keybut ();
            Console.WriteLine ("Initialization completed.");

            while (!exit_now) read_and_dispatch_event ();
        }