Fixed typos in the test program that in turn fixed the gradients; also fixed a few Objective-C-isms in the OS X backend.

This commit is contained in:
Pietro Gagliardi 2015-10-09 18:49:41 -04:00
parent f558319f18
commit 844015f71a
3 changed files with 5 additions and 7 deletions

View File

@ -1,5 +1,5 @@
// 30 march 2014 // 30 march 2014
#include "uipriv_darwin.h" #import "uipriv_darwin.h"
/* /*
Mac OS X uses its own set of hardware key codes that are different from PC keyboard scancodes, but are positional (like PC keyboard scancodes). These are defined in <HIToolbox/Events.h>, a Carbon header. As far as I can tell, there's no way to include this header without either using an absolute path or linking Carbon into the program, so the constant values are used here instead. Mac OS X uses its own set of hardware key codes that are different from PC keyboard scancodes, but are positional (like PC keyboard scancodes). These are defined in <HIToolbox/Events.h>, a Carbon header. As far as I can tell, there's no way to include this header without either using an absolute path or linking Carbon into the program, so the constant values are used here instead.

View File

@ -1,5 +1,5 @@
// 14 august 2015 // 14 august 2015
#include "uipriv_darwin.h" #import "uipriv_darwin.h"
// NSComboBoxes have no intrinsic width; we'll use the default Interface Builder width for them. // NSComboBoxes have no intrinsic width; we'll use the default Interface Builder width for them.
// NSPopUpButton is fine. // NSPopUpButton is fine.

View File

@ -191,8 +191,6 @@ static void d2dColorToRGB(uint32_t color, double *r, double *g, double *b)
#define d2dWhite 0xFFFFFF #define d2dWhite 0xFFFFFF
#define d2dYellowGreen 0x9ACD32 #define d2dYellowGreen 0x9ACD32
#define d2dYellow 0xFFFF00 #define d2dYellow 0xFFFF00
// TODO this color appears wrong on Vista for some reason... either that or the gradients aren't working right
// TODO the gradients don't work on OS X
#define d2dForestGreen 0x228B22 #define d2dForestGreen 0x228B22
#define d2dOliveDrab 0x6B8E23 #define d2dOliveDrab 0x6B8E23
#define d2dLightSkyBlue 0x87CEFA #define d2dLightSkyBlue 0x87CEFA
@ -352,7 +350,7 @@ static void drawD2DLinearBrush(uiAreaDrawParams *p)
stops[0].Pos = 0.0; stops[0].Pos = 0.0;
d2dColorToRGB(d2dYellow, &(stops[0].R), &(stops[0].G), &(stops[0].B)); d2dColorToRGB(d2dYellow, &(stops[0].R), &(stops[0].G), &(stops[0].B));
stops[0].A = 1.0; stops[0].A = 1.0;
stops[1].Pos = 10; stops[1].Pos = 1.0;
d2dColorToRGB(d2dForestGreen, &(stops[1].R), &(stops[1].G), &(stops[1].B)); d2dColorToRGB(d2dForestGreen, &(stops[1].R), &(stops[1].G), &(stops[1].B));
stops[1].A = 1.0; stops[1].A = 1.0;
gradient.Stops = stops; gradient.Stops = stops;
@ -395,7 +393,7 @@ static void drawD2DRadialBrush(uiAreaDrawParams *p)
stops[0].Pos = 0.0; stops[0].Pos = 0.0;
d2dColorToRGB(d2dYellow, &(stops[0].R), &(stops[0].G), &(stops[0].B)); d2dColorToRGB(d2dYellow, &(stops[0].R), &(stops[0].G), &(stops[0].B));
stops[0].A = 1.0; stops[0].A = 1.0;
stops[1].Pos = 10; stops[1].Pos = 1.0;
d2dColorToRGB(d2dForestGreen, &(stops[1].R), &(stops[1].G), &(stops[1].B)); d2dColorToRGB(d2dForestGreen, &(stops[1].R), &(stops[1].G), &(stops[1].B));
stops[1].A = 1.0; stops[1].A = 1.0;
gradient.Stops = stops; gradient.Stops = stops;
@ -450,7 +448,7 @@ static void drawD2DPathGeometries(uiAreaDrawParams *p)
stops[0].Pos = 0.0; stops[0].Pos = 0.0;
d2dColorToRGB(d2dYellow, &(stops[0].R), &(stops[0].G), &(stops[0].B)); d2dColorToRGB(d2dYellow, &(stops[0].R), &(stops[0].G), &(stops[0].B));
stops[0].A = 1.0; stops[0].A = 1.0;
stops[1].Pos = 10; stops[1].Pos = 1.0;
d2dColorToRGB(d2dForestGreen, &(stops[1].R), &(stops[1].G), &(stops[1].B)); d2dColorToRGB(d2dForestGreen, &(stops[1].R), &(stops[1].G), &(stops[1].B));
stops[1].A = 1.0; stops[1].A = 1.0;
radial.Stops = stops; radial.Stops = stops;