paintstruct.java

来自「java 调用windows的api」· Java 代码 · 共 52 行

JAVA
52
字号
//******************************************************************
// Released under the DevelopMentor OpenSource Software License.
// Please consult the LICENSE file in the project root directory,
// or at http://www.develop.com for details before using this
// software.
//******************************************************************

package org.jawin.donated.win32;

import org.jawin.marshal.*;
import org.jawin.io.*;
import java.io.*;
import java.util.*;

public class PAINTSTRUCT {
    public int        hdc;
    public boolean    fErase;
    public RECT       rcPaint = new RECT();
    public boolean    fRestore;
    public boolean    fIncUpdate;
    public byte[]     rgbReserved = new byte[32];

    public static final String marshal = "64";
    public static final int token = GenericStub.registerCustomString(marshal);

    public void marshal(LittleEndianOutputStream leos, ArrayList objs)
            throws IOException
    {
        leos.writeInt(hdc);
        leos.writeInt(fErase ? 1: 0);
        rcPaint.marshal(leos, objs);
        leos.writeInt(fRestore? 1: 0);
        leos.writeInt(fIncUpdate ? 1 : 0);
        //COMEBACK move array handling into streams?
        for (int n=0; n<32; n++) {
            leos.writeByte(rgbReserved[n]);
        }
    }
    public void marshalOut(LittleEndianInputStream leis, ArrayList objs)
            throws IOException
    {
        hdc = leis.readInt();
        fErase = leis.readInt() != 0;
        rcPaint.marshalOut(leis, objs);
        fRestore = leis.readInt() != 0;
        fIncUpdate = leis.readInt() != 0;
        for (int n=0; n<32; n++) {
            rgbReserved[n] = leis.readByte();
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?