Package com.aelitis.azureus.core.util

Examples of com.aelitis.azureus.core.util.QTFastStartRAF$Atom


      }
     
      public void
      run()
      {
        QTFastStartRAF  raf = null;
       
        String name = file.getName();
       
        int  dot_pos = name.lastIndexOf('.');
       
        String ext = dot_pos<0?"":name.substring(dot_pos+1);
       
        try{
          raf = new QTFastStartRAF( file, user_agent != null && QTFastStartRAF.isSupportedExtension( ext ));
         
          raf.seek( offset );
     
          byte[] buffer = new byte[max_read_chunk];
         
          long  rem    = length;
          long  pos   = offset;
         
          while( rem > 0 ){
           
            if ( cancelled ){
             
              throw( new Exception( "Cancelled" ));
             
            }else if ( channel_destroyed ){
             
              throw( new Exception( "Destroyed" ));
            }
           
            int  chunk = (int)Math.min( rem, max_read_chunk );
           
            int  len = raf.read( buffer, 0, chunk );
                       
            sendEvent( new event( new PooledByteBufferImpl( buffer, 0, len ), pos, len ));
           
            rem -= len;
            pos  += len;
          }
        }catch( Throwable e ){
         
          sendEvent( new event( e ));
         
        }finally{
         
          if ( raf != null ){
           
            try{
              raf.close();
             
            }catch( Throwable e ){
             
              Debug.out( e );
            }
View Full Code Here


          for_stream = QTFastStartRAF.isSupportedExtension( ext );
        }
       
        if ( for_stream ){
         
          QTFastStartRAF  raf = null;
         
          try{
            raf = new QTFastStartRAF( getAccessor( max_read_chunk, user_agent ), true );
           
            raf.seek( offset );
       
            byte[] buffer = new byte[max_read_chunk];
           
            long  rem    = length;
            long  pos   = offset;
           
            while( rem > 0 ){
             
              if ( cancelled ){
               
                throw( new Exception( "Cancelled" ));
               
              }else if ( channel_destroyed ){
               
                throw( new Exception( "Destroyed" ));
              }
             
              int  chunk = (int)Math.min( rem, max_read_chunk );
             
              int  len = raf.read( buffer, 0, chunk );
                         
              sendEvent( new event( new PooledByteBufferImpl( buffer, 0, len ), pos, len ));
             
              rem -= len;
              pos  += len;
             
              position += len;
            }
          }catch( Throwable e ){
           
            sendEvent( new event( e ));
           
          }finally{
           
            if ( raf != null ){
             
              try{
                raf.close();
               
              }catch( Throwable e ){
               
                Debug.out( e );
              }
View Full Code Here

  display.check_error();
    }

    private void clientMessage(ClientMessage event) {
  if (event.window_id() == 0) {
      Atom type = event.type();
      if (type.name.equals("SERVER_SHUTDOWN")) {
    System.err.println("Xremwin server shutdown detected");
    exit_now = true;
    return;
      }
  }
     
  X11Client client
      = (X11Client)X11Client.intern(this, event.window_id());
  Atom type = event.type();
  // client asks to change window state from normal to iconic
  if (event.format() == 32 /*atom*/) {
      if (type.name.equals("WM_CHANGE_STATE")
    && event.wm_data () == Window.WMHints.ICONIC)
      {
View Full Code Here

      }
  }
    }

    private void propertyNotify(PropertyNotify event) {
  Atom atom = event.atom(display);
  X11Client client
      = (X11Client)X11Client.intern(this, event.window_id());
  //if (atom == atomWmColormapWindows || atom == atomWmProtocols) {
  //    logger.warning("Unhandled property notify: " + atom);
  //}
View Full Code Here

  // Note: this condition will return false if we unmap this window.
  if(client.isMappedBefore()) {
      return;
  }
 
  Atom type = X11WindowManagerHints.getNetWindowType(display, client);
  if (type != null) {
      X11WindowManagerHints.setNetWindowType(display, client, type);
      // check if window is supported. we don't map it if not supported.
      if (!X11WindowManagerHints.isSupportedWinType(display, client)) {
        return;
View Full Code Here

  ArrayList<Atom> res = new ArrayList<Atom>();
  Window.PropertyReply rep = win.property(false, netWmState, Atom.ATOM,
    0, 5);
  Enum enm = rep.items();
  while (enm.more()) {
      Atom atom = (Atom) Atom.intern(display, enm.next_integer());
      res.add(atom);
      logger.fine("WM State: " + win + " " + atom);
  }
  if (res.size() > 0) {
      return res.toArray(new Atom[res.size()]);
View Full Code Here

     * get window type (_NET_WM_WINDOW_TYPE)
     * @param win
     * @return window type ATOM
     */
    static Atom getNetWindowType(Display display, Window win) {
  Atom res = null;
  Window.PropertyReply rep = win.property(false, windowTypes[0],
    Atom.ATOM, 0, 1);

  if (rep.length() == 1) {
      Enum enm = rep.items();
View Full Code Here

TOP

Related Classes of com.aelitis.azureus.core.util.QTFastStartRAF$Atom

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.