some redesign

git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@572 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-11-02 20:42:06 +00:00
parent 95771fddd9
commit 263e26ceb9
24 changed files with 113 additions and 720 deletions

View File

@@ -11,7 +11,7 @@ typedef struct _MwRect MwRect;
typedef struct _MwSizeHints MwSizeHints;
typedef struct _MwFont MwFont;
typedef struct _MwCursor MwCursor;
typedef struct _MwRGB MwRGB;
typedef struct _MwRGB MwRGB;
typedef unsigned char MwBool;
#define MwTRUE ((MwBool)1)

View File

@@ -106,7 +106,7 @@ MWDECL void MwLLNextEvent(MwLL handle);
MWDECL void MwLLSleep(int ms);
MWDECL MwLLPixmap MwLLCreatePixmap(MwLL handle, unsigned char* data, int width, int height);
MWDECL void MwLLPixmapUpdate(MwLL handle, MwLLPixmap pixmap);
MWDECL void MwLLPixmapUpdate(MwLLPixmap pixmap);
MWDECL void MwLLDestroyPixmap(MwLLPixmap pixmap);
MWDECL void MwLLDrawPixmap(MwLL handle, MwRect* rect, MwLLPixmap pixmap);
MWDECL void MwLLSetIcon(MwLL handle, MwLLPixmap pixmap);

View File

@@ -1,134 +0,0 @@
/* $Id$ */
/*!
* @file Mw/LowLevelMath.h
* @brief A few portable functions for simultaneously supporting SIMD and not supporting it
* @warning This is mostly used internally. Anything undocumented, and/or anything with an _ prefix (that doesn't have a corresponding typedef) should be avoided.
*/
#ifndef __MW_LOWLEVEL_MATH_H__
#define __MW_LOWLEVEL_MATH_H__
#include <Mw/BaseTypes.h>
#include <Mw/MachDep.h>
#if defined(__i386__) || defined(__x86_64__) || defined(__WATCOMC__)
#define MwLLMath_x86
#endif
/*!
* @brief SIMD vector
*/
typedef struct _MwLLVec MwLLVec;
/*!
* @brief SIMD vector type
* @warning Not exhaustive, enums subject to be added later.
*/
enum MwLLVecType {
MwLLVecTypeU8 = 0,
MwLLVecTypeU16,
MwLLVecTypeU32,
MwLLVecTypeU64,
MwLLVecTypeI8,
MwLLVecTypeI16,
MwLLVecTypeI32,
MwLLVecTypeI64,
MwLLVecType_Max,
};
/*!
* @brief Create a SIMD Vector (variadic)
* @warning Prefer using the macro version.
*/
MWDECL MwLLVec* MwLLVaVecCreate(int ty, MwU64 size, ...);
/*!
* @brief Destroy the given SIMD Vector
*/
MWDECL void MwLLVecDestroy(MwLLVec* vec);
/*!
* @brief index the given SIMD Vector (u8)
*/
MWDECL MwU8 MwLLVecIndexU8(MwLLVec* vec, MwU64 index);
/*!
* @brief index the given SIMD Vector (u16)
*/
MWDECL MwU16 MwLLVecIndexU16(MwLLVec* vec, MwU64 index);
/*!
* @brief index the given SIMD Vector (u32)
*/
MWDECL MwU32 MwLLVecIndexU32(MwLLVec* vec, MwU64 index);
/*!
* @brief index the given SIMD Vector (u64)
*/
MWDECL MwU64 MwLLVecIndexU64(MwLLVec* vec, MwU64 index);
/*!
* @brief index the given SIMD Vector (i8)
*/
MWDECL MwI8 MwLLVecIndexI8(MwLLVec* vec, MwU64 index);
/*!
* @brief index the given SIMD Vector (i16)
*/
MWDECL MwI16 MwLLVecIndexI16(MwLLVec* vec, MwU64 index);
/*!
* @brief index the given SIMD Vector (i32)
*/
MWDECL MwI32 MwLLVecIndexI32(MwLLVec* vec, MwU64 index);
/*!
* @brief index the given SIMD Vector (i64)
*/
MWDECL MwI64 MwLLVecIndexI64(MwLLVec* vec, MwU64 index);
/*!
* @brief SIMD Vector add
*/
MWDECL void MwLLMathAdd(MwLLVec* a, MwLLVec* b, MwLLVec* out);
/*!
* @brief SIMD Vector multiply
*/
MWDECL void MwLLMathMultiply(MwLLVec* a, MwLLVec* b, MwLLVec* out);
/*!
* @brief SIMD Vector subtract
*/
MWDECL void MwLLMathSub(MwLLVec* a, MwLLVec* b, MwLLVec* out);
/*!
* @brief SIMD Vector reciprocal
*/
MWDECL void MwLLMathReciprocal(MwLLVec* a, MwLLVec* out);
/*!
* @brief SIMD Vector square root
*/
MWDECL void MwLLMathSquareRoot(MwLLVec* a, MwLLVec* out);
/*!
* @brief SIMD Vector bitwise and
*/
MWDECL void MwLLMathAnd(MwLLVec* a, MwLLVec* b, MwLLVec* out);
/*!
* @brief SIMD Vector bitwise or
*/
MWDECL void MwLLMathOr(MwLLVec* a, MwLLVec* b, MwLLVec* out);
/*!
* @brief SIMD Vector bitwise shift right
*/
MWDECL void MwLLMathShiftRight(MwLLVec* a, MwLLVec* b, MwLLVec* out);
/*!
* @brief SIMD Vector bitwise shift left
*/
MWDECL void MwLLMathShiftLeft(MwLLVec* a, MwLLVec* b, MwLLVec* out);
/*!
* @brief SIMD Vector bitwise equal
*/
MWDECL void MwLLMathEqual(MwLLVec* a, MwLLVec* b, MwLLVec* out);
/*!
* @brief SIMD Vector greater then
*/
MWDECL void MwLLMathGreaterThen(MwLLVec* a, MwLLVec* b, MwLLVec* out);
/*!
* @brief SIMD Vector lesser then
*/
MWDECL void MwLLMathLesserThen(MwLLVec* a, MwLLVec* b, MwLLVec* out);
#endif

View File

@@ -39,20 +39,20 @@
#define MwNfont "Vfont"
#define MwNboldFont "VboldFont"
#define MwNactivateHandler "Cactivate" /* NULL/int* (MwListBox) */
#define MwNresizeHandler "Cresize" /* NULL */
#define MwNtickHandler "Ctick" /* NULL */
#define MwNmenuHandler "Cmenu" /* MwMenu */
#define MwNmouseDownHandler "CmouseDown" /* MwLLMouse* */
#define MwNmouseUpHandler "CmouseUp" /* same as MwNmouseDownHandler */
#define MwNmouseMoveHandler "CmouseMove" /* MwPoint* */
#define MwNchangedHandler "Cchanged" /* NULL */
#define MwNkeyHandler "Ckey" /* int* (MwLLKeyEnum or character code) */
#define MwNkeyReleaseHandler "CkeyRelease" /* same as MwNkeyHandler */
#define MwNcloseHandler "Cclose" /* NULL */
#define MwNfocusInHandler "CfocusIn" /* NULL */
#define MwNfocusOutHandler "CfocusOut" /* NULL */
#define MwNfileChosenHandler "CfileChosen" /* char* */
#define MwNactivateHandler "Cactivate" /* NULL/int* (MwListBox) */
#define MwNresizeHandler "Cresize" /* NULL */
#define MwNtickHandler "Ctick" /* NULL */
#define MwNmenuHandler "Cmenu" /* MwMenu */
#define MwNmouseDownHandler "CmouseDown" /* MwLLMouse* */
#define MwNmouseUpHandler "CmouseUp" /* same as MwNmouseDownHandler */
#define MwNmouseMoveHandler "CmouseMove" /* MwPoint* */
#define MwNchangedHandler "Cchanged" /* NULL */
#define MwNkeyHandler "Ckey" /* int* (MwLLKeyEnum or character code) */
#define MwNkeyReleaseHandler "CkeyRelease" /* same as MwNkeyHandler */
#define MwNcloseHandler "Cclose" /* NULL */
#define MwNfocusInHandler "CfocusIn" /* NULL */
#define MwNfocusOutHandler "CfocusOut" /* NULL */
#define MwNfileChosenHandler "CfileChosen" /* char* */
#define MwNcolorChosenHandler "CcolorChosen" /* MwRGB* */
#endif