{ $"Text Files", "txt", never }
] };
-static char * iconNames[] =
+static const char * iconNames[] =
{
"<:ecere>constructs/class.png",
"<:ecere>constructs/data.png",
ClassFunction insideFunction;
ClassDef insideDef;
Type instanceType;
-char * instanceName;
+const char * instanceName;
Type functionType;
int paramsID;
bool insideInstance;
GENERATING
****************************************************************************/
-static void OutputString(File f, char * string)
+static void OutputString(File f, const char * string)
{
int c;
for(c = 0; string[c]; c++)
}
}
+// Consider merging with PrintType ?
void OutputType(File f, Type type, bool outputName)
{
if(type)
{
+ if(type.kind != pointerType && type.constant)
+ f.Printf("const ");
switch(type.kind)
{
case voidType:
case pointerType:
OutputType(f, type.type, false);
f.Printf(" *");
+ if(type.constant)
+ f.Printf(" const");
break;
case ellipsisType:
f.Printf("...");
f.Printf(""); // Make the stream point to where the editbox is
}
+static int64 GetI64EnumValue(Class dataType, DataValue dataForm)
+{
+ int64 i64Value = 0;
+ switch(dataType.typeSize)
+ {
+ case 1:
+ if(!strcmp(dataType.dataTypeString, "byte"))
+ i64Value = dataForm.uc;
+ else
+ i64Value = dataForm.c;
+ break;
+ case 2:
+ if(!strcmp(dataType.dataTypeString, "uint16"))
+ i64Value = dataForm.us;
+ else
+ i64Value = dataForm.s;
+ break;
+ case 4:
+ if(!strcmp(dataType.dataTypeString, "uint"))
+ i64Value = dataForm.ui;
+ else
+ i64Value = dataForm.i;
+ break;
+ case 8:
+ if(!strcmp(dataType.dataTypeString, "uint64"))
+ i64Value = *(int64 *)&dataForm.ui64;
+ else
+ i64Value = dataForm.i64;
+ break;
+ }
+ return i64Value;
+}
+
void Code_FixProperty(Property prop, Instance object)
{
Designer::FixProperty(prop, object);
result = true;
}
- if(freeDataForm) delete dataForm;
- if(freeDataTest) delete dataTest;
+ // Temporary work around until we standardize how properties should manage memory
+ if(!strcmp(prop.name, "strings") && !strcmp(prop._class.name, "DirectoriesBox"))
+ freeDataForm = freeDataTest = true;
+ if(dataType.type == normalClass && dataType.structSize)
+ {
+ if(freeDataForm) eInstance_Delete(dataForm);
+ if(freeDataTest) eInstance_Delete(dataTest);
+ }
+ else
+ {
+ if(freeDataForm) delete dataForm;
+ if(freeDataTest) delete dataTest;
+ }
}
else if(dataType && dataType._vTbl)
{
return result;
}
-bool Code_IsPropertyDisabled(ObjectInfo selected, char * name)
+bool Code_IsPropertyDisabled(ObjectInfo selected, const char * name)
{
bool disabled = false;
if(selected.oClass == selected)
method.dataType.thisClass = selectedClass;
}
//result = MatchTypes(method.dataType, type, null, regClass, regClass, false);
- result = MatchTypes(type, method.dataType, null, regClass, regClass, false, true, true, false);
+ result = MatchTypes(type, method.dataType, null, regClass, regClass, false, true, true, false, true);
if(reset)
method.dataType.thisClass = null;
return result;
OldList * ast;
Context globalContext { };
- OldList excludedSymbols { offset = (uint)&((Symbol)0).left };
+ OldList excludedSymbols { offset = (uint)(uintptr)&((Symbol)0).left };
OldList defines;
OldList imports;
hide = true;
else
{
- char * buffer = membersLine.text;
int c;
if(charPos - 1 < membersLoc.start.charPos)
hide = true;
else if(charPos - 1 > membersLoc.end.charPos)
{
- char * buffer = membersLine.text;
+ const char * buffer = membersLine.text;
//if(membersList.currentRow)
// hide = true;
//else
{
int c;
// HOW WE MIGHT WANT TO DO IT:
- char * text = before.line.text;
+ const char * text = before.line.text;
for(c = Min(before.line.count, before.x-1); c>= 0; c--)
if(!isspace(text[c]))
break;
hide = true;
else
{
- char * buffer = membersLine.text;
+ const char * buffer = membersLine.text;
int c;
bool firstChar = true;
bool addedChar = false;
// Accept current string if hiding typing char
if(hide && row && row.selected)
{
- char * string = row.string;
+ const char * string = row.string;
int len = strlen(string);
membersLoc.end.charPos -= after.x - before.x;
editBox.GoToPosition(membersLine, membersLoc.start.line, membersLoc.start.charPos);
if(/*after.x - before.x == 1 && */after.y == before.y && !membersListShown)
{
EditLine line = editBox.line;
- char * text = line.text;
+ const char * text = line.text;
char ch = text[after.x-1];
if(ch == '.' || (ch == '>' && after.x-1 > 0 && text[after.x-1-1] == '-') || (ch == ':' && after.x-1 > 0 && text[after.x-1-1] == ':'))
{
hide = true;
else
{
- char * buffer = membersLine.text;
+ const char * buffer = membersLine.text;
int c;
bool firstChar = true;
char string[1024];
DataRow row = listBox.currentRow;
if(row)
{
- char * string = row.string;
+ const char * string = row.string;
editBox.GoToPosition(membersLine, membersLoc.start.line, membersLoc.start.charPos);
editBox.Delete(
DataRow row = currentRow;
if(row && row.selected)
{
- char * string = row.string;
+ const char * string = row.string;
editor.editBox.GoToPosition(editor.membersLine, editor.membersLoc.start.line, editor.membersLoc.start.charPos);
editor.editBox.Delete(
editBox.recordUndoEvent = true;
for(line = editBox.firstLine; line; line = line.next, y++)
{
- String buffer = line.text;
+ const String buffer = line.text;
int count = line.count, i = count-1;
while(i >= 0 && isspace(buffer[i])) i--;
if(i < count - 1)
return true;
}
- bool OnSaveFile(char * fileName)
+ bool OnSaveFile(const char * fileName)
{
File f;
if(designer)
return false;
}
- bool OnFileModified(FileChange fileChange, char * param)
+ bool OnFileModified(FileChange fileChange, const char * param)
{
bool reload = false;
if(visible == false && inUseDebug == true)
if(editBox.syntaxHighlighting && fileName && ide.projectView)
{
- bool error, bpOnCursor, bpOnTopFrame, breakpointEnabled[128];
+ bool error, bpOnTopFrame, breakpointEnabled[128];
int lineCursor, lineTopFrame, breakpointLines[128];
int count, i, lineH, boxH, scrollY; //, firstLine; firstLine = editBox.firstLine;
Debugger debugger = ide.debugger;
scrollY = editBox.scroll.y;
displaySystem.FontExtent(editBox.font.font, " ", 1, null, &lineH);
- bpOnCursor = bpOnTopFrame = false;
+ bpOnTopFrame = false;
count = debugger.GetMarginIconsLineNumbers(fileName, breakpointLines, breakpointEnabled, 128, &error, &lineCursor, &lineTopFrame);
if(count)
{
if(breakpointLines[i] == lineCursor || breakpointLines[i] == lineTopFrame)
{
bmpRes = breakpointEnabled[i] ? ide.bmpBpHalf : ide.bmpBpHalfDisabled;
- if(breakpointLines[i] == lineCursor)
- bpOnCursor = true;
if(breakpointLines[i] == lineTopFrame)
bpOnTopFrame = true;
}
watch(fileName)
{
char ext[MAX_EXTENSION];
- char * fileName = property::fileName;
+ const char * fileName = property::fileName;
if(SearchString(fileName, 0, "Makefile", false, true))
editBox.useTab = true;
return true;
}
- bool LoadFile(char * filePath)
+ bool LoadFile(const char * filePath)
{
File f = FileOpen(filePath, read);
if(f)
CodeEditor()
{
CodeObjectType c;
- ProjectView projectView = ide.projectView;
globalData.classes.CompareKey = (void *)BinaryTree::CompareString;
globalData.defines.CompareKey = (void *)BinaryTree::CompareString;
Designer backDesigner;
char oldWorkDir[MAX_LOCATION];
char mainModuleName[MAX_FILENAME] = "";
- char * fileName;
+ const char * fileName;
ImportedModule module;
char extension[MAX_EXTENSION];
PathBackup pathBackup { };
next = _class.next;
- for(;object = _class.instances.first;)
+ while((object = _class.instances.first))
{
if(object.instance)
{
}
else
{
- switch(GetRuntimePlatform())
+ switch(__runtimePlatform)
{
case win32: SetSymbolsDir("obj/debug.win32"); break;
case tux: SetSymbolsDir("obj/debug.linux"); break;
classDefinition = _class;
oClass = classObject;
};
- Symbol symbol;
classes.Add(classObject);
incref instance;
if(selectedName)
{
ObjectInfo check;
- int pos = 0;
for(check = this.oClass.instances.first; check; check = check.next)
{
if((prop.IsSet && !prop.IsSet(test)) || ((int (*)(void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnCompare])(dataType, dataForm, dataTest))
{
char tempString[1024] = "";
- char * string = "";
+ const char * string = "";
bool needClass = true;
if(*prev)
f.Printf(", ");
if((prop.IsSet && !prop.IsSet(test)) || ((int (*)(void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnCompare])(dataType, dataForm, dataTest))
{
char tempString[1024] = "";
- char * string = "";
+ const char * string = "";
if(*prev)
f.Printf(", ");
if(dataType.type == enumClass)
{
- NamedLink value;
+ NamedLink64 value;
Class enumClass = eSystem_FindClass(privateModule, "enum");
EnumClassData e = ACCESS_CLASSDATA(dataType, enumClass);
+ int64 i64Value = GetI64EnumValue(dataType, dataForm);
for(value = e.values.first; value; value = value.next)
{
- if((int)value.data == dataForm.i)
+ if(value.data == i64Value)
{
string = value.name;
break;
Window control = (Window)object.instance;
bool prev = false;
bool methodPresent = false;
- Class _class;
bool lastIsMethod = true;
- ObjectInfo classObject = object.oClass;
if(inst)
{
{
int count = 0;
int toDelete = 0;
- int toAdd = 0;
+ //int toAdd = 0;
f.Seek(-1, current);
DeleteJunkBefore(f, position, &position);
toDelete += count - 6;
count = 6;
}
- else
- toAdd = 6 - count;
+ /*else
+ toAdd = 6 - count;*/
break;
}
}
if(!keptMember || !members.next)
{
char ch = 0;
- int count = 0;
if(keptMember && lastKept != members.dataMembers->last)
{
bool needClass = true;
if(dataType.type == enumClass)
{
- NamedLink value;
+ NamedLink64 value;
Class enumClass = eSystem_FindClass(privateModule, "enum");
EnumClassData e = ACCESS_CLASSDATA(dataType, enumClass);
+ int64 i64Value = GetI64EnumValue(dataType, dataForm);
for(value = e.values.first; value; value = value.next)
{
- if((int)value.data == dataForm.i)
+ if(value.data == i64Value)
{
string = value.name;
break;
for(classObject = classes.first; classObject; classObject = classObject.next)
{
- Class _class;
ClassDefinition classDef = classObject.classDefinition;
Class regClass = eSystem_FindClass(this.privateModule, ((Specifier)classDef.baseSpecs->first).name);
Instance test;
if(!keptMember)
{
char ch = 0;
- int count = 0;
f.Seek(def.loc.end.pos - position - 1, current);
f.Getc(&ch);
method = null;
}
- int FindMethod(char * methodName /*Method method*/, ClassFunction*functionPtr, Location propLoc)
+ int FindMethod(const char * methodName /*Method method*/, ClassFunction*functionPtr, Location propLoc)
{
int found = 0;
ClassFunction function = null;
return found;
}
- void GoToMethod(char * methodName /*Method method*/)
+ void GoToMethod(const char * methodName /*Method method*/)
{
if(methodName)
{
sheet.DeleteObject(object);
}
- void RenameObject(ObjectInfo object, char * name)
+ void RenameObject(ObjectInfo object, const char * name)
{
bool valid = false;
for(_class = whatClass; _class && _class.type != systemClass; _class = _class.base)
{
Method method;
- Property prop;
- DataMember member;
for(method = (Method)_class.methods.first; method; method = (Method)((BTNode)method).next)
{
if(!method.dataType)
method.dataType = ProcessTypeString(method.dataTypeString, false);
- if(MatchTypes(method.dataType, methodType, null, whatClass, /*null, */whatClass, false, true, false, false))
+ if(MatchTypes(method.dataType, methodType, null, whatClass, /*null, */whatClass, false, true, false, false, true))
{
DataRow row = membersList.FindString(method.name);
if(!row)
}
}
- void ListClassPropertiesAndVirtual(Class whatClass, String curString)
+ void ListClassPropertiesAndVirtual(Class whatClass, const String curString)
{
Class _class;
bool isPrivate = false;
for(_class = whatClass; _class /*&& _class.type != systemClass*/; _class = _class.base)
{
Method method;
- Property prop;
DataMember member;
for(method = (Method)_class.methods.first; method; method = (Method)((BTNode)method).next)
{
if(type && (type.kind == classType || type.kind == structType || type.kind == unionType))
{
- Class _class;
-
if(type.kind == classType)
{
if(type._class)
for(link = (BTNamedLink)nameSpace.defines.first; link; link = (BTNamedLink)((BTNode)link).next )
{
- DefinedExpression definedExp = link.data;
+ //DefinedExpression definedExp = link.data;
DataRow row = membersList.AddString(link /*definedExp*/.name);
row.icon = icons[typeData];
}
for(link = (BTNamedLink)nameSpace.functions.first; link; link = (BTNamedLink)((BTNode)link).next)
{
- GlobalFunction function = link.data;
+ //GlobalFunction function = link.data;
DataRow row = membersList.AddString(link /*function*/.name);
row.icon = icons[typeMethod];
}
for(_class : classes)
{
EnumClassData enumeration = (EnumClassData)_class.data;
- NamedLink item;
+ NamedLink64 item;
for(item = enumeration.values.first; item; item = item.next)
{
DataRow row = membersList.AddString(item.name);
return result;
}
- void ListNameSpaceByString(Module mainModule, char * string)
+ void ListNameSpaceByString(Module mainModule, const char * string)
{
NameSpace * nameSpace;
Module module;
Type type { };
type.kind = classType;
type._class = FindClass(_class.name);
- if(MatchTypes(type, dest, &conversions, null, null, true, false, false, false))
+ if(MatchTypes(type, dest, &conversions, null, null, true, false, false, false, true))
{
ListEnumValues(_class);
result = true;
return result;
}
- NameSpace * FindNameSpace(NameSpace nameSpace, char * name)
+ NameSpace * FindNameSpace(NameSpace nameSpace, const char * name)
{
int start = 0, c;
char ch;
return (NameSpace *)nameSpace;
}
- void ListSymbols(Expression exp, bool enumOnly, char * string, Identifier realIdentifier)
+ void ListSymbols(Expression exp, bool enumOnly, const char * string, Identifier realIdentifier)
{
bool listedEnums = false;
Type destType = (exp && exp.destType && !exp.destType.truth) ? exp.destType : null;
}
}
- if(this.privateModule && destType && (destType.kind != pointerType || destType.type.kind != voidType) && destType.kind != ellipsisType)
+ if(this.privateModule && destType && (destType.kind == _BoolType || destType.kind == classType || destType.kind == enumType || destType.kind == structType || destType.kind == templateType || destType.kind == thisClassType || destType.kind == unionType ||
+ (destType.kind == pointerType && destType.type.kind != voidType)))
+ //if(this.privateModule && destType && (destType.kind != pointerType || destType.type.kind != voidType) && destType.kind != ellipsisType)
{
listedEnums = ListEnumsModule(this.privateModule, destType);
}
}
else if(destType && destType.kind == enumType)
{
- NamedLink value;
+ NamedLink64 value;
for(value = destType.members.first; value; value = value.next)
{
void OverrideVirtualFunction(ClassFunction function, Method method, Class _class, bool isInstance, bool extraIndent)
{
EditBoxStream f { editBox = editBox };
- uint position = 0;
+ int position = 0;
EditLine l1, l2;
int x1,y1,x2,y2;
{
bool didOverride = false;
EditLine line = editBox.line;
- char * text = line.text;
int lineNum, charPos;
Expression exp = null;
EditLine l1, l2;
if(membersListShown)
{
- char * buffer = membersLine.text;
+ const char * buffer = membersLine.text;
int c;
bool firstChar = true;
int len = 0;
string = tempString;
for(y = lineNum-1; y >= 0; y--)
{
- char * buffer = editLine.text;
+ const char * buffer = editLine.text;
int lineCount = editLine.count;
for(x = (y == lineNum-1) ? (Min(charPos, lineCount) - 1 ): lineCount-1; x >= 0; x--)
{
DataRow row = string ? membersList.FindSubString(string) : null;
if(row && !membersList.FindSubStringAfter(row, string) && !caretMove)
{
- char * newString = row.string;
+ const char * newString = row.string;
if(!membersListShown)
{
membersLoc.start.line = idStart.line-1;
void InvokeParameters(bool exact, bool reposition, bool caretMove)
{
- EditLine line = editBox.line;
- char * text = line.text;
int lineNum, charPos;
- Expression exp = null;
EditLine l1, l2;
int x1,y1, x2,y2;