Package org.perl6.nqp.runtime

Examples of org.perl6.nqp.runtime.ResumeStatus$Frame


            @Override
            public void completed(Void v, AsyncTaskInstance task) {
                ThreadContext curTC = tc.gc.getCurrentThreadContext();

                IOHandleInstance ioHandle = (IOHandleInstance) IOType.st.REPR.allocate(curTC,
                        IOType.st);
                ioHandle.handle = task.handle;
                callback(curTC, task, ioHandle, Str);
            }
View Full Code Here


            /* ...then an array of hashes per attribute... */
            SixModelObject attr_info_list = tc.gc.BOOTArray.st.REPR.allocate(tc, tc.gc.BOOTArray.st);
            type_info.push_boxed(tc, attr_info_list);
            List<SixModelObject> attributes = ((KnowHOWREPRInstance)self).attributes;
            for (int i = 0; i < attributes.size(); i++) {
                KnowHOWAttributeInstance attribute = (KnowHOWAttributeInstance)attributes.get(i);
                SixModelObject attr_info = tc.gc.BOOTHash.st.REPR.allocate(tc, tc.gc.BOOTHash.st);
                SixModelObject name_obj = tc.gc.BOOTStr.st.REPR.allocate(tc, tc.gc.BOOTStr.st);
                name_obj.set_str(tc, attribute.name);
                attr_info.bind_key_boxed(tc, "name", name_obj);
                attr_info.bind_key_boxed(tc, "type", attribute.type);
View Full Code Here

            SixModelObject type_arg = Ops.namedparam_opt_o(cf, csd, args, "type");
            long bt_arg = Ops.namedparam_opt_i(cf, csd, args, "box_target");
   
            /* Allocate attribute object. */
            REPR repr = REPRRegistry.getByName("KnowHOWAttribute");
            KnowHOWAttributeInstance obj = (KnowHOWAttributeInstance)repr.allocate(tc, self.st);
           
            /* Populate it. */
            obj.name = name_arg;
            obj.type = type_arg != null ? type_arg : tc.gc.KnowHOW;
            obj.box_target = bt_arg == 0 ? 0 : 1;
View Full Code Here

        /* We create a KnowHOW instance that can describe itself. This means
         * (once we tie the knot) that .HOW.HOW.HOW.HOW etc will always return
         * that, which closes the model up. */
        STable st = new STable(REPR, null);
        st.WHAT = knowhow;
        KnowHOWREPRInstance knowhow_how = (KnowHOWREPRInstance)REPR.allocate(tc, st);
        st.HOW = knowhow_how;
        knowhow_how.st = st;
       
        /* Add various methods to the KnowHOW's HOW. */
        knowhow_how.methods.put("new_type", knowhowUnit.lookupCodeRef("new_type"));
View Full Code Here

    }

    private static void bootstrapKnowHOWAttribute(ThreadContext tc, CompilationUnit knowhowUnit) {       
        /* Create meta-object. */
        SixModelObject knowhow_how = tc.gc.KnowHOW.st.HOW;
        KnowHOWREPRInstance meta_obj = (KnowHOWREPRInstance)knowhow_how.st.REPR.allocate(tc, knowhow_how.st);
       
        /* Add methods. */
        meta_obj.methods.put("new", knowhowUnit.lookupCodeRef("attr_new"));
        meta_obj.methods.put("compose", knowhowUnit.lookupCodeRef("attr_compose"));
        meta_obj.methods.put("name", knowhowUnit.lookupCodeRef("attr_name"));
View Full Code Here

        tc.gc.KnowHOWAttribute = type_obj;
    }
   
    private static SixModelObject bootType(ThreadContext tc, String typeName, String reprName) {
        SixModelObject knowhow_how = tc.gc.KnowHOW.st.HOW;
        KnowHOWREPRInstance meta_obj = (KnowHOWREPRInstance)knowhow_how.st.REPR.allocate(tc, knowhow_how.st);
        meta_obj.name = typeName;
        REPR repr = REPRRegistry.getByName(reprName);
        SixModelObject type_obj = repr.type_object_for(tc, meta_obj);
        type_obj.st.MethodCache = meta_obj.methods;
        type_obj.st.ModeFlags = STable.METHOD_CACHE_AUTHORITATIVE;
View Full Code Here

      Animation animation) {
    d.printSection(animation.getName());
    d.printKeyValue("DefaultKeyDuration",""+animation.getDefaultKeyDuration());
    Frame[] frames = animation.getFrames();
    for(int fi=0; fi<frames.length; fi++) {
      Frame f = frames[fi];
      d.printKeyValue("KeyData"+(fi+1),f.getName());
      if(f.getKeyDuration()>0)
        d.printKeyValue("KeyDuration"+(fi+1),""+f.getKeyDuration());
    }
    for(int fi=0; fi<frames.length; fi++) {
      Frame f = frames[fi];
      Point offset = f.getOffset();
      if(offset.x!=0 || offset.y!=0) {
        d.printKeyValue("KeyEventName"+(fi+1),"__"+fi);
        d.printKeyValue("__"+fi, "("+offset.x+","+offset.y+",0)");       
      }
    }
View Full Code Here

    return null;
  }

  @Override
  public long getFrameDelay(int index) {
    Frame frame = getFrame(index);
    return (long) (frame.getFinalFrameDuration()*1000);
  }
 
View Full Code Here

        for(Frame frame: animation.getFrames()) {
          paintFrame(g, frame);
        }
      }
      if (selected instanceof Frame) {
        Frame frame = (Frame) selected;
        paintFrame(g,frame);
      }   
    }
    if(freeOffsetStart != null && freeOffsetEnd != null) {
      Point base = toScreen(freeOffsetStart);
View Full Code Here

  private int snap(int snapMe){
    return java.lang.Math.round( snapMe/parent.SnapSlider.getValue() )*parent.SnapSlider.getValue();
  }
 
  @Override public void mouseDragged(MouseEvent e) {
    Frame selected = getSelectedFrame();
    if(selected==null) return;
    if((e.getModifiersEx() & MouseEvent.BUTTON3_DOWN_MASK) == MouseEvent.BUTTON3_DOWN_MASK) {
      if(parent.isSettingOffsetDirectly())
        handleEditOffset(selected,e);     
      if(parent.isSettingOffsetWithRelativePos())
        freeOffsetEnd = getViewPoint(e);
      if(parent.isSettingPivot()) 
        selected.setPivot(new Point(getViewX(e),getViewY(e)));
      if(parent.isRectangleLocked()) {
        int x = snap(getViewX(e)), y = snap(getViewY(e))

        selected.setRectangle(new Rectangle(x,y,parent.lockRectButton.lastRect.width,parent.lockRectButton.lastRect.height));
        selected.setImageFile(editorFrame.getData().getProject().getRelativeFile(imageFile));

        int PivotDX = parent.lockRectButton.lastPivot.x - parent.lockRectButton.lastRect.x;
        int PivotDY = parent.lockRectButton.lastPivot.y - parent.lockRectButton.lastRect.y;
        selected.setPivot(new Point(x+PivotDX,y+PivotDY));
      }
      if(parent.isEditingRectangle()){
       
        Rectangle rect = selected.getRectangle();
        int x = snap(rect.x), y = snap(rect.y);
        int dx = snap(getViewX(e)-x), dy = snap(getViewY(e)-y);
        Rectangle newRectangle = new Rectangle(x,y,dx,dy);
        selected.setRectangle(newRectangle);
        selected.setImageFile(editorFrame.getData().getProject().getRelativeFile(imageFile));
      }
      if(parent.isSettingOffsetWithTemporaryPivot()) {
        if(parent.temporaryPivotOffsetButton.getPivot2()!=null) {
          parent.temporaryPivotOffsetButton.setPivot2(getViewPoint(e));
          selected.setOffset(parent.temporaryPivotOffsetButton.getOffset());
        }
        else
          parent.temporaryPivotOffsetButton.setPivot1(getViewPoint(e));
      }
    }
View Full Code Here

TOP

Related Classes of org.perl6.nqp.runtime.ResumeStatus$Frame

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.