new MW_16 define for stuff that won't be done on Any 16-bit platform
This commit is contained in:
parent
c8cdaecf72
commit
74f17d71a2
13 changed files with 21 additions and 26 deletions
2
WatMakefile
generated
2
WatMakefile
generated
|
|
@ -11,7 +11,7 @@ MW_LDFLAGS = system nt_dll
|
|||
EXE_CFLAGS = -i=include
|
||||
EXE_LDFLAGS = system nt
|
||||
!else
|
||||
MW_CFLAGS = -bd -i=include -i=external/libz/include -d_MILSKO -d_MILSKO_BUILD -dUSE_GDI -dSTBI_NO_SIMD -dNO_IMAGE
|
||||
MW_CFLAGS = -bd -i=include -i=external/libz/include -d_MILSKO -d_MILSKO_BUILD -dUSE_GDI -dSTBI_NO_SIMD -dNO_IMAGE -dMW_16
|
||||
MW_LDFLAGS = system windows_dll
|
||||
EXE_LDFLAGS = system windows
|
||||
!endif
|
||||
|
|
|
|||
|
|
@ -4,14 +4,14 @@ MwWidget fpicker;
|
|||
MwWidget window;
|
||||
|
||||
/* This example does nothing on Win16 because we don't support the color picker on it (yet?) */
|
||||
#ifdef __WINDOWS__
|
||||
#ifdef MW_16
|
||||
MwWidget missing_text;
|
||||
#else
|
||||
MwWidget button;
|
||||
#endif
|
||||
|
||||
/* don't bother with color picker on win16 */
|
||||
#ifndef __WINDOWS__
|
||||
/* don't bother with color picker on 16-bit */
|
||||
#ifndef MW_16
|
||||
void MWAPI file_callback(MwWidget handle, void* user_data, void* call_data) {
|
||||
char hexColor[8];
|
||||
MwRGB* rgb = call_data;
|
||||
|
|
@ -46,7 +46,7 @@ int main() {
|
|||
MwDEFAULT, 640, 480, MwNtitle, "color picker", NULL);
|
||||
MwSetText(window, MwNbackground, MwGetInteger(window, MwNdarkTheme) ? MwDefaultBackground : MwDefaultDarkBackground);
|
||||
|
||||
#ifndef __WINDOWS__
|
||||
#ifndef MW_16
|
||||
button = MwVaCreateWidget(MwButtonClass, "button", window, 160, 180, 320, 120,
|
||||
MwNtext, "change window background",
|
||||
NULL);
|
||||
|
|
|
|||
2
external/stb_ds.h
generated
vendored
2
external/stb_ds.h
generated
vendored
|
|
@ -1647,7 +1647,7 @@ typedef struct {
|
|||
|
||||
static char buffer[256];
|
||||
char* strkey(int n) {
|
||||
#if defined(_WIN32) || defined(__WINDOWS__) && defined(__STDC_WANT_SECURE_LIB__)
|
||||
#if defined(_WIN32) && defined(__STDC_WANT_SECURE_LIB__)
|
||||
sprintf_s(buffer, sizeof(buffer), "test_%d", n);
|
||||
#else
|
||||
sprintf(buffer, "test_%d", n);
|
||||
|
|
|
|||
6
external/stb_image.h
generated
vendored
6
external/stb_image.h
generated
vendored
|
|
@ -1275,12 +1275,12 @@ static void stbi__float_postprocess(float* result, int* x, int* y, int* comp, in
|
|||
|
||||
#ifndef STBI_NO_STDIO
|
||||
|
||||
#if defined(_WIN32) || defined(__WINDOWS__) && defined(STBI_WINDOWS_UTF8)
|
||||
#if defined(_WIN32) && defined(STBI_WINDOWS_UTF8)
|
||||
STBI_EXTERN __declspec(dllimport) int __stdcall MultiByteToWideChar(unsigned int cp, unsigned long flags, const char* str, int cbmb, wchar_t* widestr, int cchwide);
|
||||
STBI_EXTERN __declspec(dllimport) int __stdcall WideCharToMultiByte(unsigned int cp, unsigned long flags, const wchar_t* widestr, int cchwide, char* str, int cbmb, const char* defchar, int* used_default);
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) || defined(__WINDOWS__) && defined(STBI_WINDOWS_UTF8)
|
||||
#if defined(_WIN32) && defined(STBI_WINDOWS_UTF8)
|
||||
STBIDEF int stbi_convert_wchar_to_utf8(char* buffer, size_t bufferlen, const wchar_t* input) {
|
||||
return WideCharToMultiByte(65001 /* UTF8 */, 0, input, -1, buffer, (int)bufferlen, NULL, NULL);
|
||||
}
|
||||
|
|
@ -1288,7 +1288,7 @@ STBIDEF int stbi_convert_wchar_to_utf8(char* buffer, size_t bufferlen, const wch
|
|||
|
||||
static FILE* stbi__fopen(char const* filename, char const* mode) {
|
||||
FILE* f;
|
||||
#if defined(_WIN32) || defined(__WINDOWS__) && defined(STBI_WINDOWS_UTF8)
|
||||
#if defined(_WIN32) && defined(STBI_WINDOWS_UTF8)
|
||||
wchar_t wMode[64];
|
||||
wchar_t wFilename[1024];
|
||||
if(0 == MultiByteToWideChar(65001 /* UTF8 */, 0, filename, -1, wFilename, sizeof(wFilename) / sizeof(*wFilename)))
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ typedef __int8 MwI8;
|
|||
typedef unsigned __int8 MwU8;
|
||||
|
||||
#define MW_OTHER_TYPES_DEFINED
|
||||
#elif defined(__WINDOWS__)
|
||||
#elif defined(MW_16)
|
||||
typedef long long MwI64;
|
||||
typedef unsigned long long MwU64;
|
||||
#else
|
||||
|
|
@ -61,7 +61,7 @@ typedef unsigned long MwU64;
|
|||
#ifdef MW_OTHER_TYPES_DEFINED
|
||||
#undef MW_OTHER_TYPES_DEFINED
|
||||
#else
|
||||
#ifdef __WINDOWS__
|
||||
#ifdef MW_16
|
||||
typedef long MwI32;
|
||||
typedef unsigned long MwU32;
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ enum MwALIGNMENT {
|
|||
/*!
|
||||
* @brief Default
|
||||
*/
|
||||
#ifdef __WINDOWS__
|
||||
#ifdef MW_16
|
||||
#define MwDEFAULT 0x0ffff
|
||||
#else
|
||||
#define MwDEFAULT 0x0fffffff
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
#error Color Picker Widget is not avaliable on Win16
|
||||
#ifdef MW_16
|
||||
#error Color Picker Widget is not avaliable on 16-bit platforms
|
||||
#else
|
||||
/*!
|
||||
* @brief Creates a color picker
|
||||
|
|
|
|||
|
|
@ -162,7 +162,6 @@ MWDECL unsigned char* MWAPI MwPixmapGetRaw(MwLLPixmap pixmap);
|
|||
*/
|
||||
MWDECL void MWAPI MwPixmapGetSize(MwLLPixmap pixmap, MwRect* rect);
|
||||
|
||||
#ifndef __WINDOWS__
|
||||
/*!
|
||||
* @brief Creates a pixmap from XPM data
|
||||
* @param handle Widget
|
||||
|
|
@ -170,7 +169,6 @@ MWDECL void MWAPI MwPixmapGetSize(MwLLPixmap pixmap, MwRect* rect);
|
|||
* @return Pixmap
|
||||
*/
|
||||
MWDECL MwLLPixmap MWAPI MwLoadXPM(MwWidget handle, char** data);
|
||||
#endif
|
||||
|
||||
/*!
|
||||
* @brief Creates a pixmap from icon data
|
||||
|
|
|
|||
|
|
@ -343,7 +343,7 @@ MWDECL void (*MwLLRaise)(MwLL handle);
|
|||
MWDECL void (*MwLLClip)(MwLL handle, MwRect* rect);
|
||||
|
||||
/* font renderer */
|
||||
#ifndef __WINDOWS__
|
||||
#ifndef MW_16
|
||||
MWDECL void MwFLSetup(void);
|
||||
|
||||
#ifdef USE_FREETYPE2
|
||||
|
|
|
|||
|
|
@ -957,11 +957,7 @@ void MwSetDefault(MwWidget handle) {
|
|||
}
|
||||
|
||||
void MwHideCursor(MwWidget handle) {
|
||||
#ifndef __WINDOWS__
|
||||
MwLLSetCursor(handle->lowlevel, &MwCursorHidden, &MwCursorHiddenMask);
|
||||
#else
|
||||
MwLLSetCursor(handle->lowlevel, NULL, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
void MwDispatchUserHandler(MwWidget handle, const char* key, void* handler_data) {
|
||||
|
|
@ -1100,7 +1096,8 @@ int MwLibraryInit(void) {
|
|||
#if defined(_WIN32) || defined(__WINDOWS__)
|
||||
/*
|
||||
There's no Windows configuration that Milsko supports that doesn't have winmm.
|
||||
This could maybe be removed?
|
||||
This could maybe be removed? However if we ever get any proof of concept working on Win2.0
|
||||
this could be useful.
|
||||
*/
|
||||
MwLL_winmmLib = LoadLibrary("winmm.dll");
|
||||
MwLL_PFN_timeGetTime = (void*)GetProcAddress(MwLL_winmmLib, "timeGetTime");
|
||||
|
|
@ -1121,7 +1118,7 @@ int MwLibraryInit(void) {
|
|||
|
||||
MwColorTableInit();
|
||||
|
||||
#ifndef __WINDOWS__
|
||||
#ifndef MW_16
|
||||
MwFLSetup();
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include <Mw/Milsko.h>
|
||||
|
||||
#ifndef __WINDOWS__
|
||||
#ifndef MW_16
|
||||
|
||||
#define WIN_SIZE 464
|
||||
#define PICKER_SIZE 364
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ void* (*MwFLFontLoad)(unsigned char* data, unsigned int size, int px)
|
|||
void (*MwFLFontFree)(void* handle) = NULL;
|
||||
#endif
|
||||
|
||||
#if (defined(USE_FREETYPE2) || defined(USE_STB_TRUETYPE)) && !defined(__WINDOWS__)
|
||||
#if (defined(USE_FREETYPE2) || defined(USE_STB_TRUETYPE))
|
||||
#define TTF
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ sub generate {
|
|||
print(OUT "EXE_LDFLAGS = $exe\n");
|
||||
if ($type eq "Watcom") {
|
||||
print(OUT "!else\n");
|
||||
print(OUT "MW_CFLAGS = -bd ${inc}include ${inc}external/libz/include ${def}_MILSKO ${def}_MILSKO_BUILD ${def}USE_GDI ${def}STBI_NO_SIMD ${def}NO_IMAGE\n");
|
||||
print(OUT "MW_CFLAGS = -bd ${inc}include ${inc}external/libz/include ${def}_MILSKO ${def}_MILSKO_BUILD ${def}USE_GDI ${def}STBI_NO_SIMD ${def}NO_IMAGE ${def}MW_16\n");
|
||||
print(OUT "MW_LDFLAGS = system windows_dll\n");
|
||||
print(OUT "EXE_LDFLAGS = system windows\n");
|
||||
print(OUT "!endif\n");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue