git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@546 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-11-01 05:14:03 +00:00
parent 0b5463e1d1
commit db98104aa0
9 changed files with 32 additions and 23 deletions

View File

@@ -1,10 +1,7 @@
/* $Id$ */
#include <Mw/Milsko.h>
#include "color_picker.h"
#include "Mw/Core.h"
#include <stdlib.h>
#include <string.h>
#include <Mw/LowLevelMath.h>
static MwRGB hsv2rgb(MwHSV in) {
@@ -94,6 +91,8 @@ static void color_picker_click(MwWidget handle, void* user, void* call) {
MwLLMouse* mouse = (MwLLMouse*)call;
char* hexColor;
int i, r, g, b, a;
char* fgColor;
int fr, fg, fb;
(void)handle;
(void)user;
@@ -111,12 +110,12 @@ static void color_picker_click(MwWidget handle, void* user, void* call) {
(void)a;
hexColor = malloc(8);
char* fgColor = malloc(8);
fgColor = malloc(8);
snprintf(hexColor, 8, "#%02X%02X%02X", r, g, b);
int fr = r > 128 ? 0 : 255;
int fg = g > 128 ? 0 : 255;
int fb = b > 128 ? 0 : 255;
fr = r > 128 ? 0 : 255;
fg = g > 128 ? 0 : 255;
fb = b > 128 ? 0 : 255;
snprintf(fgColor, 8, "#%02X%02X%02X", fr, fg, fb);
MwSetText(picker->inner.color_display, MwNbackground, hexColor);
@@ -202,6 +201,7 @@ MwWidget MwColorPicker(MwWidget handle, const char* title) {
MwPoint p;
color_picker* wheel;
MwWidget window;
int ww, wh;
// remove later
MwLLVec test_1 = MwLLVecU32x2(2, 5);
@@ -214,8 +214,8 @@ MwWidget MwColorPicker(MwWidget handle, const char* title) {
printf("%d + %d = %d\n", test_1.un.u32.a, test_2.un.u32.a, test_out.un.u32.a);
printf("%d + %d = %d\n", test_1.un.u32.b, test_2.un.u32.b, test_out.un.u32.b);
int ww = MwGetInteger(handle, MwNwidth);
int wh = MwGetInteger(handle, MwNheight);
ww = MwGetInteger(handle, MwNwidth);
wh = MwGetInteger(handle, MwNheight);
p.x = p.y = 0;
window = MwVaCreateWidget(MwWindowClass, "main", handle, MwDEFAULT, MwDEFAULT,

View File

@@ -32,6 +32,7 @@ struct _color_picker_inner {
};
struct _color_picker_vtable {
void* reserved;
};
struct _color_picker {

View File

@@ -47,7 +47,7 @@ static cpuFeatures getCPUFeatures(void) {
__asm {
cpuid
mov _eax, eax
mov _edx, edx
// mov _edx, edx
}
#else
__asm__ __volatile__(

View File

@@ -29,6 +29,7 @@ struct _cpuFeatures {
MwBool pse36 : 1; /* 36-Bit Page Size Extension */
MwBool psn : 1; /* Processor Serial Number */
MwBool clflush : 1; /* CLFLUSH instr */
MwBool pad1 : 1;
MwBool ds : 1; /* Debug Store */
MwBool acpi : 1; /* Thermal Monitor and Software Controlled Clock Facilities */
MwBool mmx : 1; /* Intel MMX Technology */
@@ -38,6 +39,7 @@ struct _cpuFeatures {
MwBool ss : 1; /* Self Snoop */
MwBool hit : 1; /* Max APIC IDs */
MwBool tm : 1; /* Thermal Monitor */
MwBool pad2 : 1;
MwBool pbe : 1; /* Pending Break Enable */
};
#endif