📄 midpservices.h
字号:
/*****************************************************************************
* Copyright Statement:
* --------------------
* This software is protected by Copyright and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of MediaTek Inc. (C) 2005
*
* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/
/*******************************************************************************
* Filename:
* ---------
* midpServices.h
*
* Project:
* --------
* MAUI
*
* Description:
* ------------
*
*
* Author:
* -------
*
*
*==============================================================================
* HISTORY
* Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*------------------------------------------------------------------------------
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
*------------------------------------------------------------------------------
* Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*==============================================================================
*******************************************************************************/
/*
* @(#)midpServices.h 1.14 02/09/11 @(#)
*
* Copyright (c) 2001-2002 Sun Microsystems, Inc. All rights reserved.
* PROPRIETARY/CONFIDENTIAL
* Use is subject to license terms.
*/
#ifndef _MIDPSERVICES
#define _MIDPSERVICES
#include <kni.h>
#include <midpServices_md.h>
/*=========================================================================
* Event handling
*=======================================================================*/
/* The type of event a native thread is waiting for */
enum midp_EventType {
uiEvent = 1,
networkEvent = 2
};
/* Structure to be passed back to the VM */
struct EventInfo_struct {
enum midp_EventType type;
};
typedef struct EventInfo_struct midp_EventInfo;
/* Initialize event sub-system */
void InitializeEvents(void);
/* Signal an event is waiting to be processed */
void midp_signalEvent(void);
/* Store a VM event */
void midp_storeVMEvent(jint type, int argCount, ...);
/* Read the next word (4-bytes) from the event queue */
jint midp_getNextEventWord(void);
/* Check if there is an event waiting in the event queue */
jboolean midp_hasStoredEvent(void);
/*=========================================================================
* VM helper functions
*=======================================================================*/
/* Terminate the VM with the specified status code */
void midp_exitVM(int status);
/* Determine if the VM has been stopped */
jboolean midp_isVmStopped(void);
/* Parse VM arguments */
jint midp_parseVmArg(jint currentArg, jint argc, char* argv[]);
/* Print VM usage text */
void midp_printVmUsage(void);
/* Signal MIDP should be shutdown */
void midp_shutdown(void);
/* Determine if MIDP has been stopped */
jboolean midp_isMidpStopped(void);
/* Get the current time in millis */
jlong midp_getCurrentTime(void);
/* Show the help */
void midpPrintUsage(char *);
/*=========================================================================
* Resource helper functions
*=======================================================================*/
/* Open a resource file */
int midp_openResourceFile(char* resourceName, int* size);
/* Close a previously opened resource file */
void midp_closeResourceFile(int fd);
/* Read a byte from a previously opened resource file */
int midp_readResourceFile(int fd);
/* Read 'size' bytes from a previously opened resource file */
int midp_readallResourceFile(int fd, int offset, int size, jobject* outArray,
int pos);
/*=========================================================================
* Compression helper functions
*=======================================================================*/
/* Decompress a PNG image buffer */
jboolean midp_pngInflate(void *data, int compLen, unsigned char** outFileH,
int decompLen, int type);
/*=========================================================================
* JAR helper functions
*=======================================================================*/
/* Read a single file from a JAR file */
jboolean midp_readJarEntry(char* jarName, char* entryName, jobject* entry);
/*=========================================================================
* Synchronization functions
*=======================================================================*/
#if USE_MIDP_MONITOR
/* Initialize monitor */
void midp_monitorInitialize(void);
/* Finalize monitor */
void midp_monitorFinalize(void);
/* Enter a monitor */
void midp_monitorEnter(void);
/* Leave a monitor */
void midp_monitorExit(void);
#else
#define midp_monitorEnter() /* no-op */
#define midp_monitorLeave() /* no-op */
#define midp_monitorInitialize() /* no-op */
#define midp_monitorFinalize() /* no-op */
#endif /* USE_MIDP_MONITOR */
#endif /* _MIDPSERVICES */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -