Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 52bf690

Browse files
author
Ali Lloyd
committed
refactored bitmap effects properties
1 parent bcf6820 commit 52bf690

File tree

9 files changed

+502
-701
lines changed

9 files changed

+502
-701
lines changed

engine/src/bitmapeffect.cpp

Lines changed: 302 additions & 285 deletions
Large diffs are not rendered by default.

engine/src/bitmapeffect.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
1818
#define __MC_BITMAP_EFFECT__
1919

2020
struct MCBitmapEffects;
21+
struct MCExecValue;
2122
typedef MCBitmapEffects *MCBitmapEffectsRef;
2223

2324
void MCBitmapEffectsInitialize(MCBitmapEffectsRef& r_dst);
@@ -39,13 +40,8 @@ bool MCBitmapEffectsSetProperties(MCBitmapEffectsRef& self, Properties which_typ
3940
bool MCBitmapEffectsGetPropertyElement(MCBitmapEffectsRef& self, Properties which_type, MCNameRef p_prop, MCValueRef& r_setting);
4041
bool MCBitmapEffectsGetProperties(MCBitmapEffectsRef& self, Properties which_type, MCArrayRef& r_props);
4142

42-
bool MCBitmapEffectsGetColorProperty(MCBitmapEffectsRef& self, MCNameRef p_index, Properties which, MCColor*& r_color);
43-
bool MCBitmapEffectsGetEnumProperty(MCBitmapEffectsRef& self, MCNameRef p_index, Properties which, intenum_t*& r_value);
44-
bool MCBitmapEffectsGetUIntProperty(MCBitmapEffectsRef& self, MCNameRef p_index, Properties which, uinteger_t*& r_value);
45-
46-
bool MCBitmapEffectsSetColorProperty(MCBitmapEffectsRef& self, MCNameRef p_index, Properties which, MCColor p_color, bool& r_dirty);
47-
bool MCBitmapEffectsSetEnumProperty(MCBitmapEffectsRef& self, MCNameRef p_index, Properties which, intenum_t p_value, bool& r_dirty);
48-
bool MCBitmapEffectsSetUIntProperty(MCBitmapEffectsRef& self, MCNameRef p_index, Properties which, uinteger_t p_value, bool& r_dirty);
43+
bool MCBitmapEffectsGetProperty(MCExecContext& ctxt, MCBitmapEffectsRef& self, MCNameRef p_index, Properties which, MCExecValue& r_color);
44+
bool MCBitmapEffectsSetProperty(MCExecContext& ctxt, MCBitmapEffectsRef& self, MCNameRef p_index, Properties which, MCExecValue p_color, bool& r_dirty);
4945

5046
uint32_t MCBitmapEffectsWeigh(MCBitmapEffectsRef self);
5147
IO_stat MCBitmapEffectsPickle(MCBitmapEffectsRef self, MCObjectOutputStream& p_stream);

engine/src/control.cpp

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,11 @@ MCPropertyInfo MCControl::kProperties[] =
6565
DEFINE_RW_OBJ_NON_EFFECTIVE_ENUM_PROPERTY(P_LAYER_MODE, InterfaceLayerMode, MCControl, LayerMode)
6666
DEFINE_RO_OBJ_EFFECTIVE_ENUM_PROPERTY(P_LAYER_MODE, InterfaceLayerMode, MCControl, LayerMode)
6767

68-
//DEFINE_RW_OBJ_ARRAY_PROPERTY(P_BITMAP_EFFECT_DROP_SHADOW, Any, MCControl, DropShadowElement)
69-
DEFINE_RW_OBJ_PROPERTY(P_BITMAP_EFFECT_DROP_SHADOW, Array, MCControl, DropShadow)
70-
//DEFINE_RW_OBJ_ARRAY_PROPERTY(P_BITMAP_EFFECT_INNER_SHADOW, Any, MCControl, InnerShadowElement)
71-
DEFINE_RW_OBJ_PROPERTY(P_BITMAP_EFFECT_INNER_SHADOW, Array, MCControl, InnerShadow)
72-
//DEFINE_RW_OBJ_ARRAY_PROPERTY(P_BITMAP_EFFECT_OUTER_GLOW, Any, MCControl, OuterGlowElement)
73-
DEFINE_RW_OBJ_PROPERTY(P_BITMAP_EFFECT_OUTER_GLOW, Array, MCControl, OuterGlow)
74-
//DEFINE_RW_OBJ_ARRAY_PROPERTY(P_BITMAP_EFFECT_INNER_GLOW, Any, MCControl, InnerGlowElement)
75-
DEFINE_RW_OBJ_PROPERTY(P_BITMAP_EFFECT_INNER_GLOW, Array, MCControl, InnerGlow)
76-
//DEFINE_RW_OBJ_ARRAY_PROPERTY(P_BITMAP_EFFECT_COLOR_OVERLAY, Any, MCControl, ColorOverlayElement)
77-
DEFINE_RW_OBJ_PROPERTY(P_BITMAP_EFFECT_COLOR_OVERLAY, Array, MCControl, ColorOverlay)
78-
79-
DEFINE_RW_OBJ_RECORD_PROPERTY(P_BITMAP_EFFECT_DROP_SHADOW, InterfaceBitmapEffectDropShadow, MCControl, DropShadow)
68+
DEFINE_RW_OBJ_RECORD_PROPERTY(P_BITMAP_EFFECT_DROP_SHADOW, MCControl, DropShadow)
69+
DEFINE_RW_OBJ_RECORD_PROPERTY(P_BITMAP_EFFECT_OUTER_GLOW, MCControl, OuterGlow)
70+
DEFINE_RW_OBJ_RECORD_PROPERTY(P_BITMAP_EFFECT_INNER_GLOW, MCControl, InnerGlow)
71+
DEFINE_RW_OBJ_RECORD_PROPERTY(P_BITMAP_EFFECT_COLOR_OVERLAY, MCControl, ColorOverlay)
72+
DEFINE_RW_OBJ_RECORD_PROPERTY(P_BITMAP_EFFECT_INNER_SHADOW, MCControl, InnerShadow)
8073
};
8174

8275
MCObjectPropertyTable MCControl::kPropertyTable =

engine/src/control.h

Lines changed: 13 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ enum MCLayerModeHint
4343
};
4444

4545
struct MCInterfaceMargins;
46+
union MCBitmapEffect;
4647

4748
class MCControl : public MCObject
4849
{
@@ -330,11 +331,6 @@ class MCControl : public MCObject
330331
void DoSetHScrollbar(MCExecContext& ctxt, MCScrollbar*& hsb, uint2& sbw);
331332
void DoSetVScrollbar(MCExecContext& ctxt, MCScrollbar*& vsb, uint2& sbw);
332333
void DoSetScrollbarWidth(MCExecContext& ctxt, uint2& sbw, uinteger_t p_width);
333-
334-
void DoGetBitmapEffectArray(MCExecContext& ctxt, Properties which, MCArrayRef& r_array);
335-
void DoSetBitmapEffectArray(MCExecContext& ctxt, Properties which, MCArrayRef p_array);
336-
//void DoGetBitmapEffectElement(MCExecContext& ctxt, Properties which, MCNameRef p_prop, MCValueRef& r_value);
337-
//void DoSetBitmapEffectElement(MCExecContext& ctxt, Properties which, MCNameRef p_prop, MCValueRef p_value);
338334

339335
void EffectRedraw(MCRectangle p_old_rect);
340336

@@ -363,33 +359,17 @@ class MCControl : public MCObject
363359
virtual void SetShowFocusBorder(MCExecContext& ctxt, bool setting);
364360
virtual void SetOpaque(MCExecContext& ctxt, bool setting);
365361
virtual void SetShadow(MCExecContext& ctxt, const MCInterfaceShadow& p_shadow);
366-
367-
void GetDropShadow(MCExecContext& ctxt, MCArrayRef& r_array);
368-
void SetDropShadow(MCExecContext& ctxt, MCArrayRef p_array);
369-
void GetInnerShadow(MCExecContext& ctxt, MCArrayRef& r_array);
370-
void SetInnerShadow(MCExecContext& ctxt, MCArrayRef p_array);
371-
void GetOuterGlow(MCExecContext& ctxt, MCArrayRef& r_array);
372-
void SetOuterGlow(MCExecContext& ctxt, MCArrayRef p_array);
373-
void GetInnerGlow(MCExecContext& ctxt, MCArrayRef& r_array);
374-
void SetInnerGlow(MCExecContext& ctxt, MCArrayRef p_array);
375-
void GetColorOverlay(MCExecContext& ctxt, MCArrayRef& r_array);
376-
void SetColorOverlay(MCExecContext& ctxt, MCArrayRef p_array);
377-
378-
void GetBitmapEffectDropShadowColor(MCExecContext& ctxt, MCNameRef index, MCColor*& r_color);
379-
void SetBitmapEffectDropShadowColor(MCExecContext& ctxt, MCNameRef index, MCColor* p_color);
380-
void GetBitmapEffectDropShadowBlendMode(MCExecContext& ctxt, MCNameRef index, intenum_t*& r_value);
381-
void SetBitmapEffectDropShadowBlendMode(MCExecContext& ctxt, MCNameRef index, intenum_t* p_value);
382-
void GetBitmapEffectDropShadowOpacity(MCExecContext& ctxt, MCNameRef index, uinteger_t*& r_value);
383-
void SetBitmapEffectDropShadowOpacity(MCExecContext& ctxt, MCNameRef index, uinteger_t* p_value);
384-
void GetBitmapEffectDropShadowFilter(MCExecContext& ctxt, MCNameRef index, intenum_t*& r_value);
385-
void SetBitmapEffectDropShadowFilter(MCExecContext& ctxt, MCNameRef index, intenum_t* p_value);
386-
void GetBitmapEffectDropShadowSize(MCExecContext& ctxt, MCNameRef index, uinteger_t*& r_value);
387-
void SetBitmapEffectDropShadowSize(MCExecContext& ctxt, MCNameRef index, uinteger_t* p_value);
388-
void GetBitmapEffectDropShadowSpread(MCExecContext& ctxt, MCNameRef index, uinteger_t*& r_value);
389-
void SetBitmapEffectDropShadowSpread(MCExecContext& ctxt, MCNameRef index, uinteger_t* p_value);
390-
void GetBitmapEffectDropShadowDistance(MCExecContext& ctxt, MCNameRef index, uinteger_t*& r_value);
391-
void SetBitmapEffectDropShadowDistance(MCExecContext& ctxt, MCNameRef index, uinteger_t* p_value);
392-
void GetBitmapEffectDropShadowAngle(MCExecContext& ctxt, MCNameRef index, uinteger_t*& r_value);
393-
void SetBitmapEffectDropShadowAngle(MCExecContext& ctxt, MCNameRef index, uinteger_t* p_value);
362+
363+
void GetDropShadowProperty(MCExecContext& ctxt, MCNameRef index, MCExecValue& r_value);
364+
void SetDropShadowProperty(MCExecContext& ctxt, MCNameRef index, MCExecValue p_value);
365+
void GetInnerShadowProperty(MCExecContext& ctxt, MCNameRef index, MCExecValue& r_value);
366+
void SetInnerShadowProperty(MCExecContext& ctxt, MCNameRef index, MCExecValue p_value);
367+
void GetInnerGlowProperty(MCExecContext& ctxt, MCNameRef index, MCExecValue& r_value);
368+
void SetInnerGlowProperty(MCExecContext& ctxt, MCNameRef index, MCExecValue p_value);
369+
void GetOuterGlowProperty(MCExecContext& ctxt, MCNameRef index, MCExecValue& r_value);
370+
void SetOuterGlowProperty(MCExecContext& ctxt, MCNameRef index, MCExecValue p_value);
371+
void GetColorOverlayProperty(MCExecContext& ctxt, MCNameRef index, MCExecValue& r_value);
372+
void SetColorOverlayProperty(MCExecContext& ctxt, MCNameRef index, MCExecValue p_value);
373+
394374
};
395375
#endif

0 commit comments

Comments
 (0)