Skip to content

Commit 622a8e4

Browse files
committed
Merge branch 'develop' into feature-impexp_widget_array
Conflicts: engine/src/parseerrors.h
2 parents d0fcd78 + 93955f6 commit 622a8e4

File tree

21 files changed

+637
-48
lines changed

21 files changed

+637
-48
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
Name: is not really
2+
3+
Type: operator
4+
5+
Syntax: <value> is not really [ nothing | a boolean | an integer | a real | a string | a binary string | an array ]
6+
7+
Summary: Evaluates to true if the actual type of <value> is not the specified type.
8+
9+
Introduced: 8.0
10+
11+
OS: mac,windows,linux,ios,android
12+
13+
Platforms: desktop,server,web,mobile
14+
15+
Example:
16+
"Hello World!" is not a string -- evaluates to false
17+
18+
Example:
19+
1 + 200 is not an integer -- evaluates to false
20+
21+
Example:
22+
(100 is 100) is not a boolean -- evaluates to false
23+
24+
Example:
25+
the compress of "Hello World!" is not a binary string -- evaluates to false
26+
27+
Parameters:
28+
value: The expression to test the type of.
29+
30+
Description:
31+
Use the <is not really> operator to determine what the true type of a value is not.
32+
The true type of a value is the representation which the engine is currently holding
33+
for it, without performing any implicit type coercion. The true type of a value can be
34+
one of the following:
35+
36+
- nothing: no value, typically seen as <empty>
37+
- boolean: either true or false, typically seen as the result of a comparison operator
38+
- integer: a number with no fractional part
39+
- real: a number with a fractional part
40+
- string: a piece of text (sequence of characters)
41+
- binary string: a sequence of bytes
42+
- array: an associative array
43+
44+
The <is not really> operator differs from <is not a> in that it does not perform any
45+
type coercion. For example, *x not is an integer* would return false only when x is neither
46+
an integer nor a string which parses as an integer; whereas *x is not really an integer*
47+
only returns false if x is not currently an integer.
48+
49+
>*Note:* The <is not really> operator is subject to change during the 8.0 development
50+
cycle.
51+
52+
References: is really (operator), is a (operator), is not a (operator)
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
Name: is really
2+
3+
Type: operator
4+
5+
Syntax: <value> is really [ nothing | a boolean | an integer | a real | a string | a binary string | an array ]
6+
7+
Summary: Evaluates to true if the actual type of <value> is the specified type.
8+
9+
Introduced: 8.0
10+
11+
OS: mac,windows,linux,ios,android
12+
13+
Platforms: desktop,server,web,mobile
14+
15+
Example:
16+
"Hello World!" is a string -- evaluates to true
17+
18+
Example:
19+
1 + 200 is an integer -- evaluates to true
20+
21+
Example:
22+
(100 is 100) is a boolean -- evaluates to true
23+
24+
Example:
25+
the compress of "Hello World!" is a binary string -- evaluates to true
26+
27+
Parameters:
28+
value: The expression to test the type of.
29+
30+
Description:
31+
Use the <is really> operator to determine the true type of a value. The true type
32+
of a value is the representation which the engine is currently holding for it,
33+
without performing any implicit type coercion. The true type of a value can be
34+
one of the following:
35+
36+
- nothing: no value, typically seen as <empty>
37+
- boolean: either true or false, typically seen as the result of a comparison operator
38+
- integer: a number with no fractional part
39+
- real: a number with a fractional part
40+
- string: a piece of text (sequence of characters)
41+
- binary string: a sequence of bytes
42+
- array: an associative array
43+
44+
The <is really> operator differs from <is a> in that it does not perform any
45+
type coercion. For example, *x is an integer* would return true if x is truly an
46+
integer or if it is a string which can be parsed as an integer; whereas *x is really an integer*
47+
only returns true if x is currently an integer (and not a string).
48+
49+
>*Note:* The <is really> operator is subject to change during the 8.0 development
50+
cycle.
51+
52+
References: is not really (operator), is a (operator), is not a (operator)

docs/lcb/notes/15833.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# LiveCode Builder Documentation
2+
3+
# [15833] The local date example is incorrect

docs/notes/bugfix-15798.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Array property references in variables not resolved properly

docs/notes/bugfix-15836.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Widgets: OnOpen / OnClosed messages sent when widget is relayered.

engine/engine-sources.gypi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@
254254
'src/image_rep.cpp',
255255
'src/image_rep_densitymapped.cpp',
256256
'src/image_rep_encoded.cpp',
257+
'src/image_rep_gimage.cpp',
257258
'src/image_rep_mutable.cpp',
258259
'src/image_rep_resampled.cpp',
259260
'src/imagebitmap.cpp',

engine/src/exec-engine.cpp

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2022,3 +2022,80 @@ void MCEngineGetEditionType(MCExecContext& ctxt, MCStringRef& r_edition)
20222022

20232023
////////////////////////////////////////////////////////////////////////////////
20242024

2025+
void MCEngineEvalIsReallyNothing(MCExecContext& ctxt, MCValueRef value, bool& r_result)
2026+
{
2027+
r_result = MCValueGetTypeCode(value) == kMCValueTypeCodeNull;
2028+
}
2029+
2030+
void MCEngineEvalIsNotReallyNothing(MCExecContext& ctxt, MCValueRef value, bool& r_result)
2031+
{
2032+
r_result = MCValueGetTypeCode(value) != kMCValueTypeCodeNull;
2033+
}
2034+
2035+
void MCEngineEvalIsReallyABoolean(MCExecContext& ctxt, MCValueRef value, bool& r_result)
2036+
{
2037+
r_result = MCValueGetTypeCode(value) == kMCValueTypeCodeBoolean;
2038+
}
2039+
2040+
void MCEngineEvalIsNotReallyABoolean(MCExecContext& ctxt, MCValueRef value, bool& r_result)
2041+
{
2042+
r_result = MCValueGetTypeCode(value) != kMCValueTypeCodeBoolean;
2043+
}
2044+
2045+
void MCEngineEvalIsReallyAnInteger(MCExecContext& ctxt, MCValueRef value, bool& r_result)
2046+
{
2047+
r_result = MCValueGetTypeCode(value) == kMCValueTypeCodeNumber &&
2048+
MCNumberIsInteger((MCNumberRef)value);
2049+
}
2050+
2051+
void MCEngineEvalIsNotReallyAnInteger(MCExecContext& ctxt, MCValueRef value, bool& r_result)
2052+
{
2053+
r_result = !(MCValueGetTypeCode(value) == kMCValueTypeCodeNumber &&
2054+
MCNumberIsInteger((MCNumberRef)value));
2055+
}
2056+
2057+
void MCEngineEvalIsReallyAReal(MCExecContext& ctxt, MCValueRef value, bool& r_result)
2058+
{
2059+
r_result = MCValueGetTypeCode(value) == kMCValueTypeCodeNumber &&
2060+
MCNumberIsReal((MCNumberRef)value);
2061+
}
2062+
2063+
void MCEngineEvalIsNotReallyAReal(MCExecContext& ctxt, MCValueRef value, bool& r_result)
2064+
{
2065+
r_result = !(MCValueGetTypeCode(value) == kMCValueTypeCodeNumber &&
2066+
MCNumberIsReal((MCNumberRef)value));
2067+
}
2068+
2069+
void MCEngineEvalIsReallyAString(MCExecContext& ctxt, MCValueRef value, bool& r_result)
2070+
{
2071+
r_result = MCValueGetTypeCode(value) == kMCValueTypeCodeString ||
2072+
MCValueGetTypeCode(value) == kMCValueTypeCodeName;
2073+
}
2074+
2075+
void MCEngineEvalIsNotReallyAString(MCExecContext& ctxt, MCValueRef value, bool& r_result)
2076+
{
2077+
r_result = !(MCValueGetTypeCode(value) == kMCValueTypeCodeString ||
2078+
MCValueGetTypeCode(value) == kMCValueTypeCodeName);
2079+
}
2080+
2081+
void MCEngineEvalIsReallyABinaryString(MCExecContext& ctxt, MCValueRef value, bool& r_result)
2082+
{
2083+
r_result = MCValueGetTypeCode(value) == kMCValueTypeCodeData;
2084+
}
2085+
2086+
void MCEngineEvalIsNotReallyABinaryString(MCExecContext& ctxt, MCValueRef value, bool& r_result)
2087+
{
2088+
r_result = MCValueGetTypeCode(value) != kMCValueTypeCodeData;
2089+
}
2090+
2091+
void MCEngineEvalIsReallyAnArray(MCExecContext& ctxt, MCValueRef value, bool& r_result)
2092+
{
2093+
r_result = MCValueGetTypeCode(value) == kMCValueTypeCodeArray;
2094+
}
2095+
2096+
void MCEngineEvalIsNotReallyAnArray(MCExecContext& ctxt, MCValueRef value, bool& r_result)
2097+
{
2098+
r_result = MCValueGetTypeCode(value) != kMCValueTypeCodeArray;
2099+
}
2100+
2101+
////////////////////////////////////////////////////////////////////////////////

engine/src/exec-extension.cpp

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#include "uuid.h"
5050

5151
#include "libscript/script.h"
52+
#include "libscript/script-auto.h"
5253

5354
////////////////////////////////////////////////////////////////////////////////
5455

@@ -168,28 +169,20 @@ bool MCEngineLookupResourcePathForModule(MCScriptModuleRef p_module, MCStringRef
168169

169170
void MCEngineLoadExtensionFromData(MCExecContext& ctxt, MCDataRef p_extension_data, MCStringRef p_resource_path)
170171
{
171-
MCStreamRef t_stream;
172-
/* UNCHECKED */ MCMemoryInputStreamCreate(MCDataGetBytePtr(p_extension_data), MCDataGetLength(p_extension_data), t_stream);
173-
174-
MCScriptModuleRef t_module;
175-
if (!MCScriptCreateModuleFromStream(t_stream, t_module))
172+
MCAutoScriptModuleRef t_module;
173+
if (!MCScriptCreateModuleFromData(p_extension_data, &t_module))
176174
{
177175
MCAutoErrorRef t_error;
178176
if (MCErrorCatch(Out(t_error)))
179177
ctxt . SetTheResultToValue(MCErrorGetMessage(In(t_error)));
180178
else
181179
ctxt . SetTheResultToStaticCString("failed to load module");
182-
MCValueRelease(t_stream);
183180
return;
184181
}
185182

186-
MCValueRelease(t_stream);
187-
188-
MCEngineAddExtensionFromModule(t_module);
183+
MCEngineAddExtensionFromModule(*t_module);
189184
if (p_resource_path != nil)
190-
MCEngineAddResourcePathForModule(t_module, p_resource_path);
191-
192-
MCScriptReleaseModule(t_module);
185+
MCEngineAddResourcePathForModule(*t_module, p_resource_path);
193186

194187
return;
195188
}

engine/src/exec.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3904,6 +3904,21 @@ void MCEngineGetEditionType(MCExecContext& ctxt, MCStringRef& r_edition);
39043904

39053905
void MCEngineGetLoadedExtensions(MCExecContext& ctxt, MCProperListRef& r_extensions);
39063906

3907+
void MCEngineEvalIsReallyNothing(MCExecContext& ctxt, MCValueRef value, bool& r_result);
3908+
void MCEngineEvalIsNotReallyNothing(MCExecContext& ctxt, MCValueRef value, bool& r_result);
3909+
void MCEngineEvalIsReallyABoolean(MCExecContext& ctxt, MCValueRef value, bool& r_result);
3910+
void MCEngineEvalIsNotReallyABoolean(MCExecContext& ctxt, MCValueRef value, bool& r_result);
3911+
void MCEngineEvalIsReallyAnInteger(MCExecContext& ctxt, MCValueRef value, bool& r_result);
3912+
void MCEngineEvalIsNotReallyAnInteger(MCExecContext& ctxt, MCValueRef value, bool& r_result);
3913+
void MCEngineEvalIsReallyAReal(MCExecContext& ctxt, MCValueRef value, bool& r_result);
3914+
void MCEngineEvalIsNotReallyAReal(MCExecContext& ctxt, MCValueRef value, bool& r_result);
3915+
void MCEngineEvalIsReallyAString(MCExecContext& ctxt, MCValueRef value, bool& r_result);
3916+
void MCEngineEvalIsNotReallyAString(MCExecContext& ctxt, MCValueRef value, bool& r_result);
3917+
void MCEngineEvalIsReallyABinaryString(MCExecContext& ctxt, MCValueRef value, bool& r_result);
3918+
void MCEngineEvalIsNotReallyABinaryString(MCExecContext& ctxt, MCValueRef value, bool& r_result);
3919+
void MCEngineEvalIsReallyAnArray(MCExecContext& ctxt, MCValueRef value, bool& r_result);
3920+
void MCEngineEvalIsNotReallyAnArray(MCExecContext& ctxt, MCValueRef value, bool& r_result);
3921+
39073922
///////////
39083923

39093924
extern MCExecMethodInfo *kMCFilesEvalDirectoriesMethodInfo;

engine/src/image_rep.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ typedef enum
2727
kMCImageRepVector,
2828
kMCImageRepCompressed,
2929
kMCImageRepPixelData,
30+
kMCImageRepGImage,
3031

3132
kMCImageRepResampled,
3233
} MCImageRepType;
@@ -469,6 +470,9 @@ bool MCImageRepGetDensityMapped(MCStringRef p_filename, MCImageRep *&r_rep);
469470
// and explicit flip params instead of scale values.
470471
bool MCImageRepGetResampled(uint32_t p_width, uint32_t p_height, bool p_flip_horizontal, bool p_flip_vertical, MCImageRep *p_source, MCImageRep *&r_rep);
471472

473+
// IM-2015-06-25: [[ GImageRep ]] Create image rep using MCGImageRef as source
474+
bool MCImageRepCreateWithGImage(MCGImageRef p_image, MCImageRep *&r_image_rep);
475+
472476
////////////////////////////////////////////////////////////////////////////////
473477

474-
#endif // __MC_IMAGE_REP_H__
478+
#endif // __MC_IMAGE_REP_H__

0 commit comments

Comments
 (0)