[DEVELOPMENT ENVIRONMENT]

* NEW: The startup class icon is now just drawn with a dark outline.
* NEW: Error messages updated.
* NEW: French translation updated.

[INTERPRETER]
* NEW: Inheritance is stricter now: the child symbol must have exactly the
  same kind than the parent symbol.
* BUG: A child method must return the same datatype as its parent method 
  now.
* NEW: Gambas 3 executable mime description file and icon have been renamed
  so that they do not conflict with Gambas 2 files.

[GB.FORM]
* BUG: IconView.Find() has been renamed as IconView.FindAt(), to avoid the
  conflict with the inherited UserControl.Find() method.

[GB.FORM.MDI]
* BUG: Workspace.Children has been renamed as Workspace.Windows, because 
  the Workspace.Children property was in conflict with the inherited
  Container.Children property.

[GB.GTK]
* NEW: ListView, TreeView and ColumnView Find() method has been renamed as
  'FindAt' to match the IconView class.

[GB.IMAGE]
* NEW: Color.SetRGB() and Color.SetHSV() are two new methods that takes a
  color as an integer, modifies one of its component, and returns it. They
  are faster than using the ColorInfo class.
* NEW: Color.GetAlpha() returns the alpha component of a color from its
  integer value.

[GB.QT4]
* NEW: ListView, TreeView and ColumnView Find() method has been renamed as
  'FindAt' to match the IconView class.


git-svn-id: svn://localhost/gambas/trunk@4015 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2011-08-20 00:33:36 +00:00
parent 4d0acf6f72
commit 93137105d3
25 changed files with 872 additions and 708 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
# Gambas Project File 3.0
# Compiled with Gambas 2.99.2
Title=Gambas 3
Startup=Project
Startup=MErrorMessage
Icon=img/logo/logo-ide.png
Version=2.99.2
VersionProgram=gbx3 -V

View File

@ -1333,7 +1333,7 @@ Public Sub tvwProject_DragMove()
Dim sKey As String
If Not tvwProject.Find(Drag.X, Drag.Y) Then
If Not tvwProject.FindAt(Drag.X, Drag.Y) Then
$sKey = tvwProject.Item.Key
If Project.IsLocked($sKey) Then Goto STOP_EVENT
If Drag.Format = MMime.DATA And If Drag.Source Then
@ -1441,7 +1441,7 @@ Public Sub tvwProject_MouseDrag()
If Not Mouse.Left Then Return
If tvwProject.Find(Mouse.StartX, Mouse.StartY) Then Return
If tvwProject.FindAt(Mouse.StartX, Mouse.StartY) Then Return
sKey = tvwProject.Item.Key
If tvwProject.Key <> sKey Then Return
'If Project.IsSourcePath(sKey) Then Return

View File

@ -13,7 +13,7 @@ Private Const ERR_009 As String = ("&1: syntax error")
Private Const ERR_010 As String = ("&1: syntax error in form file")
Private Const ERR_011 As String = ("&1: too many nested containers")
Private Const ERR_012 As String = ("'&1' already declared")
Private Const ERR_013 As String = ("'&1.&2' is badly overridden in class '&3'")
Private Const ERR_013 As String = ("'&1.&2' is incorrectly overridden in class '&3'")
Private Const ERR_014 As String = ("'&1.&2' is not a property")
Private Const ERR_015 As String = ("'&1.&2' is not static")
Private Const ERR_016 As String = ("'&1.&2' is read only")
@ -56,159 +56,161 @@ Private Const ERR_052 As String = ("Cannot inherit twice")
Private Const ERR_053 As String = ("Cannot instantiate native types")
Private Const ERR_054 As String = ("Cannot load class '&1': &2&3")
Private Const ERR_055 As String = ("Cannot load component '&1': &2")
Private Const ERR_056 As String = ("Cannot make executable: &1: &2")
Private Const ERR_057 As String = ("Cannot mix NEW and embedded array")
Private Const ERR_058 As String = ("Cannot mix NEW and embedded structure")
Private Const ERR_059 As String = ("Cannot open file '&1': &2")
Private Const ERR_060 As String = ("Cannot open file: &1")
Private Const ERR_061 As String = ("Cannot raise events in static function")
Private Const ERR_062 As String = ("Cannot read file: &1")
Private Const ERR_063 As String = ("Cannot read file: &1: &2")
Private Const ERR_064 As String = ("Cannot register class '&1'")
Private Const ERR_065 As String = ("Cannot remove file '&1': &2")
Private Const ERR_066 As String = ("Cannot rename file '&1' to '&2': &3")
Private Const ERR_067 As String = ("Cannot set file owner: &1: &2")
Private Const ERR_068 As String = ("Cannot use NEW operator there")
Private Const ERR_069 As String = ("Cannot use TRY twice")
Private Const ERR_070 As String = ("Class '&1' is not creatable")
Private Const ERR_071 As String = ("Comparison operator expected")
Private Const ERR_072 As String = ("Component not found: &1")
Private Const ERR_073 As String = ("Device is full")
Private Const ERR_074 As String = ("Division by zero")
Private Const ERR_075 As String = ("Dynamic symbols cannot be used in static function")
Private Const ERR_076 As String = ("Embedded array")
Private Const ERR_077 As String = ("Embedded arrays are forbidden here")
Private Const ERR_078 As String = ("End of file")
Private Const ERR_079 As String = ("Equality or inequality operator expected")
Private Const ERR_080 As String = ("Expression too complex")
Private Const ERR_081 As String = ("Expression too complex. Too many operands")
Private Const ERR_082 As String = ("File already exists")
Private Const ERR_083 As String = ("File is a directory")
Private Const ERR_084 As String = ("File is locked")
Private Const ERR_085 As String = ("File name is too long")
Private Const ERR_086 As String = ("File or directory does not exist")
Private Const ERR_087 As String = ("Forbidden GOTO")
Private Const ERR_088 As String = ("Illegal instruction")
Private Const ERR_089 As String = ("Internal compiler error: Bad stack usage computed!")
Private Const ERR_090 As String = ("Invalid assignment")
Private Const ERR_091 As String = ("Invalid date")
Private Const ERR_092 As String = ("Invalid object")
Private Const ERR_093 As String = ("Invalid path")
Private Const ERR_094 As String = ("Label '&1' not declared")
Private Const ERR_095 As String = ("Library name must be a string")
Private Const ERR_096 As String = ("Loop variable already in use")
Private Const ERR_097 As String = ("Loop variable must be local")
Private Const ERR_098 As String = ("ME cannot be used in a static function")
Private Const ERR_099 As String = ("Mathematic error")
Private Const ERR_100 As String = ("Missing #Endif")
Private Const ERR_101 As String = ("Missing &1")
Private Const ERR_102 As String = ("Missing operator")
Private Const ERR_103 As String = ("Missing right brace")
Private Const ERR_104 As String = ("NEW cannot have arguments passed by reference")
Private Const ERR_105 As String = ("No instantiation method")
Private Const ERR_106 As String = ("No parent class")
Private Const ERR_107 As String = ("No return value")
Private Const ERR_108 As String = ("No startup method")
Private Const ERR_109 As String = ("Non terminated string")
Private Const ERR_110 As String = ("Not a directory: &1")
Private Const ERR_111 As String = ("Not a function")
Private Const ERR_112 As String = ("Not an array")
Private Const ERR_113 As String = ("Not an enumeration")
Private Const ERR_114 As String = ("Not an object")
Private Const ERR_115 As String = ("Not enough argument to New()")
Private Const ERR_116 As String = ("Not enough arguments")
Private Const ERR_117 As String = ("Not enough arguments to &1()")
Private Const ERR_118 As String = ("Null object")
Private Const ERR_119 As String = ("Out of bounds")
Private Const ERR_120 As String = ("Out of memory")
Private Const ERR_121 As String = ("Out of range")
Private Const ERR_122 As String = ("Overflow")
Private Const ERR_123 As String = ("Read error")
Private Const ERR_124 As String = ("Return value datatype not specified in function declaration")
Private Const ERR_125 As String = ("STOP instruction encountered")
Private Const ERR_126 As String = ("SUPER cannot be used alone")
Private Const ERR_127 As String = ("Serialization error")
Private Const ERR_128 As String = ("Stack overflow")
Private Const ERR_129 As String = ("Stream is closed")
Private Const ERR_130 As String = ("String expected")
Private Const ERR_131 As String = ("Structures must be public")
Private Const ERR_132 As String = ("Subroutine arguments cannot be passed by reference")
Private Const ERR_133 As String = ("Syntax error")
Private Const ERR_134 As String = ("Syntax error at function declaration")
Private Const ERR_135 As String = ("Syntax error in event name")
Private Const ERR_136 As String = ("Syntax error in file open mode")
Private Const ERR_137 As String = ("Syntax error in return type")
Private Const ERR_138 As String = ("Syntax error. &1 expected")
Private Const ERR_139 As String = ("Syntax error. '...' must be the last argument")
Private Const ERR_140 As String = ("Syntax error. Bad property type")
Private Const ERR_141 As String = ("Syntax error. CASE or DEFAULT expected after SELECT")
Private Const ERR_142 As String = ("Syntax error. CLASS needs an identifier")
Private Const ERR_143 As String = ("Syntax error. Cannot use this syntax in assignment")
Private Const ERR_144 As String = ("Syntax error. INHERITS needs a class name")
Private Const ERR_145 As String = ("Syntax error. Identifier expected.")
Private Const ERR_146 As String = ("Syntax error. Invalid identifier in function name")
Private Const ERR_147 As String = ("Syntax error. Invalid identifier in property name")
Private Const ERR_148 As String = ("Syntax error. Invalid optional parameter")
Private Const ERR_149 As String = ("Syntax error. Invalid return type")
Private Const ERR_150 As String = ("Syntax error. Invalid type description of &1 argument")
Private Const ERR_151 As String = ("Syntax error. Invalid type description of &1 field")
Private Const ERR_152 As String = ("Syntax error. Missing &1")
Private Const ERR_153 As String = ("Syntax error. Needless arguments")
Private Const ERR_154 As String = ("Syntax error. Point syntax used outside of WITH / END WITH")
Private Const ERR_155 As String = ("Syntax error. STRUCT needs an identifier")
Private Const ERR_156 As String = ("Syntax error. The &1 argument is not a valid identifier")
Private Const ERR_157 As String = ("Syntax error. The &1 field is not a valid identifier")
Private Const ERR_158 As String = ("Syntax error. VarPtr() takes only one identifier")
Private Const ERR_159 As String = ("System error #&1: &2")
Private Const ERR_160 As String = ("The '!' operator must be followed by an identifier")
Private Const ERR_161 As String = ("The '.' operator must be followed by an identifier")
Private Const ERR_162 As String = ("The special method &1 cannot be a function")
Private Const ERR_163 As String = ("The special method &1 cannot be implemented")
Private Const ERR_164 As String = ("The special method &1 cannot be static")
Private Const ERR_165 As String = ("The special method &1 must be a function")
Private Const ERR_166 As String = ("The special method &1 must be public")
Private Const ERR_167 As String = ("The special method &1 must be static")
Private Const ERR_168 As String = ("The special method &1 must take a variable number of arguments only")
Private Const ERR_169 As String = ("The special method &1 must take at least one argument")
Private Const ERR_170 As String = ("The special method &1 takes no arguments")
Private Const ERR_171 As String = ("The special method must return an integer")
Private Const ERR_172 As String = ("The special method must take exactly one argument")
Private Const ERR_173 As String = ("The special method must take exactly two arguments")
Private Const ERR_174 As String = ("The special method signature is incorrect")
Private Const ERR_175 As String = ("This expression cannot be a statement")
Private Const ERR_176 As String = ("This expression cannot be passed by reference")
Private Const ERR_177 As String = ("Too many arguments")
Private Const ERR_178 As String = ("Too many arguments to &1()")
Private Const ERR_179 As String = ("Too many array declarations")
Private Const ERR_180 As String = ("Too many constants")
Private Const ERR_181 As String = ("Too many different classes used")
Private Const ERR_182 As String = ("Too many dimensions")
Private Const ERR_183 As String = ("Too many dynamic variables")
Private Const ERR_184 As String = ("Too many events")
Private Const ERR_185 As String = ("Too many expressions in CASE")
Private Const ERR_186 As String = ("Too many external functions")
Private Const ERR_187 As String = ("Too many functions")
Private Const ERR_188 As String = ("Too many imbricated #If...#Endif")
Private Const ERR_189 As String = ("Too many nested control structures.")
Private Const ERR_190 As String = ("Too many simultaneous new strings")
Private Const ERR_191 As String = ("Too many static variables")
Private Const ERR_192 As String = ("Too many unknown symbols")
Private Const ERR_193 As String = ("Type mismatch")
Private Const ERR_194 As String = ("Type mismatch: wanted &1, got &2 instead")
Private Const ERR_195 As String = ("Unexpected &1")
Private Const ERR_196 As String = ("Unexpected end of line")
Private Const ERR_197 As String = ("Unexpected string")
Private Const ERR_198 As String = ("Unknown error")
Private Const ERR_199 As String = ("Unknown event")
Private Const ERR_200 As String = ("Unknown file extension")
Private Const ERR_201 As String = ("Unknown identifier: &1")
Private Const ERR_202 As String = ("Unknown operator")
Private Const ERR_203 As String = ("Unknown symbol '&1' in class '&2'")
Private Const ERR_204 As String = ("Unsupported string conversion")
Private Const ERR_205 As String = ("Useless LOCK")
Private Const ERR_206 As String = ("VarPtr() argument must be a dynamic, a static or a local variable")
Private Const ERR_207 As String = ("Void key")
Private Const ERR_208 As String = ("Write error")
Private Const ERR_056 As String = ("Cannot load source file: &1")
Private Const ERR_057 As String = ("Cannot make executable: &1: &2")
Private Const ERR_058 As String = ("Cannot mix NEW and embedded array")
Private Const ERR_059 As String = ("Cannot mix NEW and embedded structure")
Private Const ERR_060 As String = ("Cannot open file '&1': &2")
Private Const ERR_061 As String = ("Cannot open file: &1")
Private Const ERR_062 As String = ("Cannot raise events in static function")
Private Const ERR_063 As String = ("Cannot read file: &1")
Private Const ERR_064 As String = ("Cannot read file: &1: &2")
Private Const ERR_065 As String = ("Cannot register class '&1'")
Private Const ERR_066 As String = ("Cannot remove file '&1': &2")
Private Const ERR_067 As String = ("Cannot rename file '&1' to '&2': &3")
Private Const ERR_068 As String = ("Cannot set file owner: &1: &2")
Private Const ERR_069 As String = ("Cannot use NEW operator there")
Private Const ERR_070 As String = ("Cannot use TRY twice")
Private Const ERR_071 As String = ("Class '&1' is not creatable")
Private Const ERR_072 As String = ("Comparison operator expected")
Private Const ERR_073 As String = ("Component not found: &1")
Private Const ERR_074 As String = ("Device is full")
Private Const ERR_075 As String = ("Division by zero")
Private Const ERR_076 As String = ("Dynamic symbols cannot be used in static function")
Private Const ERR_077 As String = ("Embedded array")
Private Const ERR_078 As String = ("Embedded arrays are forbidden here")
Private Const ERR_079 As String = ("End of file")
Private Const ERR_080 As String = ("Equality or inequality operator expected")
Private Const ERR_081 As String = ("Expression too complex")
Private Const ERR_082 As String = ("Expression too complex. Too many operands")
Private Const ERR_083 As String = ("File already exists")
Private Const ERR_084 As String = ("File is a directory")
Private Const ERR_085 As String = ("File is locked")
Private Const ERR_086 As String = ("File name is too long")
Private Const ERR_087 As String = ("File or directory does not exist")
Private Const ERR_088 As String = ("Forbidden GOTO")
Private Const ERR_089 As String = ("Illegal instruction")
Private Const ERR_090 As String = ("Internal compiler error: Bad stack usage computed!")
Private Const ERR_091 As String = ("Invalid assignment")
Private Const ERR_092 As String = ("Invalid date")
Private Const ERR_093 As String = ("Invalid object")
Private Const ERR_094 As String = ("Invalid path")
Private Const ERR_095 As String = ("Label '&1' not declared")
Private Const ERR_096 As String = ("Library name must be a string")
Private Const ERR_097 As String = ("Loop variable already in use")
Private Const ERR_098 As String = ("Loop variable must be local")
Private Const ERR_099 As String = ("ME cannot be used in a static function")
Private Const ERR_100 As String = ("Mathematic error")
Private Const ERR_101 As String = ("Missing #Endif")
Private Const ERR_102 As String = ("Missing &1")
Private Const ERR_103 As String = ("Missing operator")
Private Const ERR_104 As String = ("Missing right brace")
Private Const ERR_105 As String = ("NEW cannot have arguments passed by reference")
Private Const ERR_106 As String = ("No instantiation method")
Private Const ERR_107 As String = ("No parent class")
Private Const ERR_108 As String = ("No return value")
Private Const ERR_109 As String = ("No startup method")
Private Const ERR_110 As String = ("Non terminated string")
Private Const ERR_111 As String = ("Not a directory: &1")
Private Const ERR_112 As String = ("Not a function")
Private Const ERR_113 As String = ("Not an array")
Private Const ERR_114 As String = ("Not an enumeration")
Private Const ERR_115 As String = ("Not an object")
Private Const ERR_116 As String = ("Not enough argument to New()")
Private Const ERR_117 As String = ("Not enough arguments")
Private Const ERR_118 As String = ("Not enough arguments to &1()")
Private Const ERR_119 As String = ("Null object")
Private Const ERR_120 As String = ("Out of bounds")
Private Const ERR_121 As String = ("Out of memory")
Private Const ERR_122 As String = ("Out of range")
Private Const ERR_123 As String = ("Overflow")
Private Const ERR_124 As String = ("Read error")
Private Const ERR_125 As String = ("Return value datatype not specified in function declaration")
Private Const ERR_126 As String = ("STOP instruction encountered")
Private Const ERR_127 As String = ("SUPER cannot be used alone")
Private Const ERR_128 As String = ("Serialization error")
Private Const ERR_129 As String = ("Stack overflow")
Private Const ERR_130 As String = ("Stream is closed")
Private Const ERR_131 As String = ("String expected")
Private Const ERR_132 As String = ("Structures must be public")
Private Const ERR_133 As String = ("Subroutine arguments cannot be passed by reference")
Private Const ERR_134 As String = ("Syntax error")
Private Const ERR_135 As String = ("Syntax error at function declaration")
Private Const ERR_136 As String = ("Syntax error in event name")
Private Const ERR_137 As String = ("Syntax error in file open mode")
Private Const ERR_138 As String = ("Syntax error in return type")
Private Const ERR_139 As String = ("Syntax error. &1 expected")
Private Const ERR_140 As String = ("Syntax error. '...' must be the last argument")
Private Const ERR_141 As String = ("Syntax error. Bad property type")
Private Const ERR_142 As String = ("Syntax error. CASE or DEFAULT expected after SELECT")
Private Const ERR_143 As String = ("Syntax error. CLASS needs an identifier")
Private Const ERR_144 As String = ("Syntax error. Cannot use this syntax in assignment")
Private Const ERR_145 As String = ("Syntax error. INHERITS needs a class name")
Private Const ERR_146 As String = ("Syntax error. Identifier expected.")
Private Const ERR_147 As String = ("Syntax error. Invalid identifier in function name")
Private Const ERR_148 As String = ("Syntax error. Invalid identifier in property name")
Private Const ERR_149 As String = ("Syntax error. Invalid optional parameter")
Private Const ERR_150 As String = ("Syntax error. Invalid return type")
Private Const ERR_151 As String = ("Syntax error. Invalid type description of &1 argument")
Private Const ERR_152 As String = ("Syntax error. Invalid type description of &1 field")
Private Const ERR_153 As String = ("Syntax error. Missing &1")
Private Const ERR_154 As String = ("Syntax error. Needless arguments")
Private Const ERR_155 As String = ("Syntax error. Point syntax used outside of WITH / END WITH")
Private Const ERR_156 As String = ("Syntax error. STRUCT needs an identifier")
Private Const ERR_157 As String = ("Syntax error. The &1 argument is not a valid identifier")
Private Const ERR_158 As String = ("Syntax error. The &1 field is not a valid identifier")
Private Const ERR_159 As String = ("Syntax error. VarPtr() takes only one identifier")
Private Const ERR_160 As String = ("System error #&1: &2")
Private Const ERR_161 As String = ("The '!' operator must be followed by an identifier")
Private Const ERR_162 As String = ("The '.' operator must be followed by an identifier")
Private Const ERR_163 As String = ("The special method &1 cannot be a function")
Private Const ERR_164 As String = ("The special method &1 cannot be implemented")
Private Const ERR_165 As String = ("The special method &1 cannot be static")
Private Const ERR_166 As String = ("The special method &1 must be a function")
Private Const ERR_167 As String = ("The special method &1 must be public")
Private Const ERR_168 As String = ("The special method &1 must be static")
Private Const ERR_169 As String = ("The special method &1 must return a boolean")
Private Const ERR_170 As String = ("The special method &1 must take a variable number of arguments only")
Private Const ERR_171 As String = ("The special method &1 must take at least one argument")
Private Const ERR_172 As String = ("The special method &1 takes no arguments")
Private Const ERR_173 As String = ("The special method must return an integer")
Private Const ERR_174 As String = ("The special method must take exactly one argument")
Private Const ERR_175 As String = ("The special method must take exactly two arguments")
Private Const ERR_176 As String = ("The special method signature is incorrect")
Private Const ERR_177 As String = ("This expression cannot be a statement")
Private Const ERR_178 As String = ("This expression cannot be passed by reference")
Private Const ERR_179 As String = ("Too many arguments")
Private Const ERR_180 As String = ("Too many arguments to &1()")
Private Const ERR_181 As String = ("Too many array declarations")
Private Const ERR_182 As String = ("Too many constants")
Private Const ERR_183 As String = ("Too many different classes used")
Private Const ERR_184 As String = ("Too many dimensions")
Private Const ERR_185 As String = ("Too many dynamic variables")
Private Const ERR_186 As String = ("Too many events")
Private Const ERR_187 As String = ("Too many expressions in CASE")
Private Const ERR_188 As String = ("Too many external functions")
Private Const ERR_189 As String = ("Too many functions")
Private Const ERR_190 As String = ("Too many imbricated #If...#Endif")
Private Const ERR_191 As String = ("Too many nested control structures.")
Private Const ERR_192 As String = ("Too many simultaneous new strings")
Private Const ERR_193 As String = ("Too many static variables")
Private Const ERR_194 As String = ("Too many unknown symbols")
Private Const ERR_195 As String = ("Type mismatch")
Private Const ERR_196 As String = ("Type mismatch: wanted &1, got &2 instead")
Private Const ERR_197 As String = ("Unexpected &1")
Private Const ERR_198 As String = ("Unexpected end of line")
Private Const ERR_199 As String = ("Unexpected string")
Private Const ERR_200 As String = ("Unknown error")
Private Const ERR_201 As String = ("Unknown event")
Private Const ERR_202 As String = ("Unknown file extension")
Private Const ERR_203 As String = ("Unknown identifier: &1")
Private Const ERR_204 As String = ("Unknown operator")
Private Const ERR_205 As String = ("Unknown symbol '&1' in class '&2'")
Private Const ERR_206 As String = ("Unsupported string conversion")
Private Const ERR_207 As String = ("Useless LOCK")
Private Const ERR_208 As String = ("VarPtr() argument must be a dynamic, a static or a local variable")
Private Const ERR_209 As String = ("Void key")
Private Const ERR_210 As String = ("Write error")
'}
Public Sub Main()

View File

@ -660,7 +660,7 @@ Private Function CloseProject() As Boolean
Design.WriteBreakpoints
Config.Clear("/OpenFile")
For Each hForm In Workspace.Children
For Each hForm In Workspace.Windows
If Not hForm.Closed Then
@ -776,7 +776,34 @@ Private Sub AddLinkEmblem(hSource As Image) As Image
End
Public Sub MakeModuleIcon(sModule As String, Optional iSize As Integer) As Image
Private Sub MakeStartupIcon(hImage As Image)
Dim X, Y As Integer
Dim iCol As Integer
Dim iGray As Integer
Dim hColorInfo As ColorInfo
For X = 0 To hImage.W - 1
For Y = 0 To hImage.H - 1
iCol = hImage[X, Y]
' With Color[Color.Desaturate(iCol)]
' iGray = (255 - .Blue) * (255 - .Alpha) / 255
' End With
' Print Mid$(" .,-~+=oOINS8&%@", iGray \ 16 + 1, 1);
If Color.GetAlpha(iCol) = 255 Then Continue
If X = 0 Or If X = (hImage.W - 1) Or If Y = 0 Or If Y = (hImage.H - 1) Or If Color[hImage[X - 1, Y]].Alpha = 255 Or If Color[hImage[X + 1, Y]].Alpha = 255 Or If Color[hImage[X, Y - 1]].Alpha = 255 Or If Color[hImage[X, Y + 1]].Alpha = 255 Then
hColorInfo = Color[Color.Darker(iCol)]
hColorInfo.Alpha = hColorInfo.Alpha \ 2
hImage[X, Y] = hColorInfo.Color
Endif
Next
Next
End
Public Sub MakeModuleIcon(sModule As String, iSize As Integer, Optional bStartup As Boolean) As Image
Dim hImage As Image
Dim hImageModule As Image
@ -786,13 +813,16 @@ Public Sub MakeModuleIcon(sModule As String, Optional iSize As Integer) As Image
If iSize = 0 Then iSize = 16
sKey = sModule & "-" & iSize & ".png"
sKey = sModule & "-" & iSize & If(bStartup, "-s", "") & ".png"
hImage = $cImageCache[sKey]
If Not hImage Then
hImage = $cImageCache["base"]
hImage = hImage.Stretch(iSize, iSize)
hImageModule = Image.Load("img/module" &/ sModule & ".png") '.Stretch(iSize / 2, iSize / 2)
hImage.PaintImage(hImageModule, iSize / 4, iSize / 4, iSize / 2, iSize / 2)
If bStartup Then
MakeStartupIcon(hImage)
Endif
$cImageCache[sKey] = hImage
Endif
@ -956,7 +986,7 @@ Public Sub GetFileIcon(sPath As String, Optional iSize As Integer) As Picture
If Not hPict Then
If sModule Then
hImage = MakeModuleIcon(sModule, iSize)
hImage = MakeModuleIcon(sModule, iSize, bStartup)
Else
Try hImage = Picture[sIcon].Image
If Error Then hImage = Picture[sPrefix &/ "file"].Image
@ -965,7 +995,7 @@ Public Sub GetFileIcon(sPath As String, Optional iSize As Integer) As Picture
'If Not hPict Then hPict = Picture["img/16/unknown.png"]
'hPict = hPict.Copy()
If bStartup Then hImage = AddEmblem(hImage, "icon:/32/play")
'If bStartup Then hImage = AddEmblem(hImage, "icon:/32/play")
If bConflict Then hImage = AddEmblem(hImage, "icon:/32/warning")
If bLocked Then hImage = AddEmblem(hImage, "icon:/32/lock")
If bAdded Then hImage = AddEmblem(hImage, "icon:/32/add")

View File

@ -111,7 +111,7 @@ ActiveWindow
p
Window
Children
Windows
r
Window[]

View File

@ -1,8 +1,8 @@
# Gambas Project File 3.0
# Compiled with Gambas 2.99.1
# Compiled with Gambas 2.99.2
Title=Multiple document interface management
Startup=FMain
Version=2.99.1
Version=2.99.2
VersionProgram=gbx3 -V
Component=gb.image
Component=gb.gui

View File

@ -12,7 +12,7 @@ Event Activate
'EVENT WindowMenu
Property ActiveWindow As Window
Property Read Children As Window[]
Property Read Windows As Window[]
Property Font As Font
Property Background As Integer
Property Orientation As Integer
@ -66,7 +66,7 @@ Private Sub ActiveWindow_Write(Value As Window)
End
Private Function Children_Read() As Window[]
Private Function Windows_Read() As Window[]
Return hWorkspace.GetWindows()

View File

@ -1236,7 +1236,7 @@ Exist
m
b
(Key)s
Find
FindAt
m
b
(X)i(Y)i

View File

@ -138,7 +138,7 @@ Public Sub Exist(Key As String) As Boolean
End
Public Sub Find(X As Integer, Y As Integer) As Boolean
Public Sub FindAt(X As Integer, Y As Integer) As Boolean
$iIntern = FindIconAccurate(X, Y)
Return $iIntern < 0

View File

@ -1109,7 +1109,7 @@ GB_DESC CListViewDesc[] =
GB_METHOD("Add", ".ListViewItem", CLISTVIEW_add, "(Key)s(Text)s[(Picture)Picture;(After)s]"),
GB_METHOD("Remove", 0, CTREEVIEW_remove, "(Key)s"),
GB_METHOD("Exist", "b", CTREEVIEW_exist, "(Key)s"),
GB_METHOD("Find", "b", CTREEVIEW_find, "(X)i(Y)i"),
GB_METHOD("FindAt", "b", CTREEVIEW_find, "(X)i(Y)i"),
//GB_METHOD("FindText", "b", CTREEVIEW_find, "(X)i(Y)i"),
GB_METHOD("SelectAll", NULL, TreeView_SelectAll, NULL),
GB_METHOD("UnselectAll", NULL, TreeView_UnselectAll, NULL),
@ -1182,7 +1182,7 @@ GB_DESC CTreeViewDesc[] =
GB_METHOD("Add", ".TreeViewItem", CTREEVIEW_add, "(Key)s(Text)s[(Picture)Picture;(Parent)s(After)s]"),
GB_METHOD("Remove", 0, CTREEVIEW_remove, "(Key)s"),
GB_METHOD("Exist", "b", CTREEVIEW_exist, "(Key)s"),
GB_METHOD("Find", "b", CTREEVIEW_find, "(X)i(Y)i"),
GB_METHOD("FindAt", "b", CTREEVIEW_find, "(X)i(Y)i"),
GB_METHOD("SelectAll", NULL, TreeView_SelectAll, NULL),
GB_METHOD("UnselectAll", NULL, TreeView_UnselectAll, NULL),
@ -1278,7 +1278,7 @@ GB_DESC CColumnViewDesc[] =
GB_METHOD("Add", ".ColumnViewItem", CTREEVIEW_add, "(Key)s(Text)s[(Picture)Picture;(Parent)s(After)s]"),
GB_METHOD("Remove", 0, CTREEVIEW_remove, "(Key)s"),
GB_METHOD("Exist", "b", CTREEVIEW_exist, "(Key)s"),
GB_METHOD("Find", "b", CTREEVIEW_find, "(X)i(Y)i"),
GB_METHOD("FindAt", "b", CTREEVIEW_find, "(X)i(Y)i"),
GB_METHOD("SelectAll", NULL, TreeView_SelectAll, NULL),
GB_METHOD("UnselectAll", NULL, TreeView_UnselectAll, NULL),

View File

@ -1733,7 +1733,7 @@ GB_DESC CListViewDesc[] =
GB_METHOD("Add", ".ListViewItem", CLISTVIEW_add, "(Key)s(Text)s[(Picture)Picture;(After)s]"),
GB_METHOD("Remove", NULL, CTREEVIEW_remove, "(Key)s"),
GB_METHOD("Exist", "b", CTREEVIEW_exist, "(Key)s"),
GB_METHOD("Find", "b", CTREEVIEW_find, "(X)i(Y)i"),
GB_METHOD("FindAt", "b", CTREEVIEW_find, "(X)i(Y)i"),
//GB_METHOD("FindText", "b", CTREEVIEW_find, "(X)i(Y)i"),
GB_METHOD("SelectAll", NULL, TreeView_SelectAll, NULL),
GB_METHOD("UnselectAll", NULL, TreeView_UnselectAll, NULL),
@ -1818,7 +1818,7 @@ GB_DESC CTreeViewDesc[] =
GB_METHOD("Add", ".TreeViewItem", CTREEVIEW_add, "(Key)s(Text)s[(Picture)Picture;(Parent)s(After)s]"),
GB_METHOD("Remove", NULL, CTREEVIEW_remove, "(Key)s"),
GB_METHOD("Exist", "b", CTREEVIEW_exist, "(Key)s"),
GB_METHOD("Find", "b", CTREEVIEW_find, "(X)i(Y)i"),
GB_METHOD("FindAt", "b", CTREEVIEW_find, "(X)i(Y)i"),
GB_METHOD("SelectAll", NULL, TreeView_SelectAll, NULL),
GB_METHOD("UnselectAll", NULL, TreeView_UnselectAll, NULL),
@ -1913,7 +1913,7 @@ GB_DESC CColumnViewDesc[] =
GB_METHOD("Add", ".ColumnViewItem", CTREEVIEW_add, "(Key)s(Text)s[(Picture)Picture;(Parent)s(After)s]"),
GB_METHOD("Remove", NULL, CTREEVIEW_remove, "(Key)s"),
GB_METHOD("Exist", "b", CTREEVIEW_exist, "(Key)s"),
GB_METHOD("Find", "b", CTREEVIEW_find, "(X)i(Y)i"),
GB_METHOD("FindAt", "b", CTREEVIEW_find, "(X)i(Y)i"),
GB_METHOD("SelectAll", NULL, TreeView_SelectAll, NULL),
GB_METHOD("UnselectAll", NULL, TreeView_UnselectAll, NULL),

View File

@ -19,9 +19,9 @@ install-exec-local:
@if test x"$(XDG_UTILS)" != x; then \
echo "Registering Gambas executable mimetype"; \
$(INSTALL) -d $(DESTDIR)$(gbdatadir)/icons; \
cp -f $(srcdir)/mime/application-x-gambas.png $(DESTDIR)$(gbdatadir)/icons; \
xdg-icon-resource install --context mimetypes --size 64 $(DESTDIR)$(gbdatadir)/icons/application-x-gambas.png application-x-gambas; \
xdg-mime install $(srcdir)/mime/application-x-gambas.xml; \
cp -f $(srcdir)/mime/application-x-gambas3.png $(DESTDIR)$(gbdatadir)/icons; \
xdg-icon-resource install --context mimetypes --size 64 $(DESTDIR)$(gbdatadir)/icons/application-x-gambas3.png application-x-gambas3; \
xdg-mime install $(srcdir)/mime/application-x-gambas3.xml; \
fi
uninstall-local:

View File

@ -109,7 +109,7 @@ static const char *_message[67] =
/* 60 E_EXTLIB */ ".2Cannot find dynamic library '&1': &2",
/* 61 E_EXTSYM */ ".2Cannot find symbol '&2' in dynamic library '&1'",
/* 62 E_BYREF */ "Argument cannot be passed by reference",
/* 63 E_OVERRIDE */ ".3'&1.&2' is badly overridden in class '&3'",
/* 63 E_OVERRIDE */ ".3'&1.&2' is incorrectly overridden in class '&3'",
/* 64 E_NKEY */ "Void key",
/* 65 E_SARRAY */ "Embedded array",
/* 66 E_EXTCB */ ".1Cannot create callback: &1"

View File

@ -882,7 +882,7 @@ void CLASS_inheritance(CLASS *class, CLASS *parent)
const char *CLASS_DESC_get_type_name(CLASS_DESC *desc)
const char *CLASS_DESC_get_type_name(const CLASS_DESC *desc)
{
switch (desc->gambas.val4)
{
@ -895,30 +895,66 @@ const char *CLASS_DESC_get_type_name(CLASS_DESC *desc)
case CD_CONSTANT_ID: return "C";
case CD_EVENT_ID: return ":";
case CD_EXTERN_ID: return "X";
default: return "?";
default:
fprintf(stderr, "CLASS_DESC_get_type_name: %s: %ld\n", desc->gambas.name, desc->gambas.val4);
return "?";
}
}
// A symbol can be overridden by a more powerful one:
// - A read-only property can be overridden by a read-write property.
// - A constant can be overridden by any property.
static bool check_override(char parent_type, char type)
static bool check_signature(char type, const CLASS_DESC *desc, const CLASS_DESC *pdesc)
{
if (parent_type == type)
return FALSE;
if (parent_type == 'r' && type == 'p')
return FALSE;
if (parent_type == 'R' && type == 'P')
return FALSE;
if (parent_type == 'C' && (type == 'R' || type == 'P'))
return FALSE;
/*TYPE *sd, *sp;
int nsd, nsp;*/
if (desc->property.type != pdesc->property.type)
{
//fprintf(stderr, "type! %ld / %ld\n", desc->property.type, pdesc->property.type);
return TRUE;
}
else
return FALSE;
#if 0
switch (type)
{
case CD_METHOD:
case CD_STATIC_METHOD:
sd = desc->method.signature;
nsd = desc->method.npmax;
sp = pdesc->method.signature;
nsp = pdesc->method.npmax;
break;
case CD_EVENT:
sd = desc->event.signature;
nsd = desc->event.npmax;
sp = pdesc->event.signature;
nsp = pdesc->event.npmax;
break;
case CD_EXTERN:
sd = desc->ext.signature;
nsd = desc->ext.npmax;
sp = pdesc->ext.signature;
nsp = pdesc->ext.npmax;
break;
default:
return FALSE;
}
if (TYPE_compare_signature(sd, nsd, sp, nsp))
return TRUE;
else
return FALSE;
#endif
}
void CLASS_make_description(CLASS *class, CLASS_DESC *desc, int n_desc, int *first)
void CLASS_make_description(CLASS *class, const CLASS_DESC *desc, int n_desc, int *first)
{
static const char *nonher[] = { "_new", "_free", "_init", "_exit", NULL };
@ -961,6 +997,10 @@ void CLASS_make_description(CLASS *class, CLASS_DESC *desc, int n_desc, int *fir
{
name = &(desc[j].gambas.name[1]);
type = CLASS_DESC_get_type(&desc[j]);
//ptype = (const char*)desc[j].gambas.type;
//fprintf(stderr, "%s -> ", ptype);
//desc[j].gambas.type = TYPE_from_string(&ptype);
//fprintf(stderr, "%p\n", (void *)desc[j].gambas.type);
}
else
{
@ -976,8 +1016,9 @@ void CLASS_make_description(CLASS *class, CLASS_DESC *desc, int n_desc, int *fir
while ((parent = parent->parent))
{
ind = CLASS_find_symbol(parent, name);
if (ind != NO_SYMBOL)
{
if (ind == NO_SYMBOL)
continue;
cds = &parent->table[ind];
// The parent class public symbols of non-native classes were replaced by the symbol kind returned by CLASS_DESC_get_type_name()
@ -986,33 +1027,35 @@ void CLASS_make_description(CLASS *class, CLASS_DESC *desc, int n_desc, int *fir
{
parent_type = CLASS_DESC_get_type(cds->desc);
if (check_override(parent_type, type))
if (parent_type != type)
{
#if DEBUG_DESC
fprintf(stderr, "type = '%c' parent_type = '%c'\n", type, parent_type);
#endif
THROW(E_OVERRIDE, parent->name, cds->name, class->name);
}
if (!CLASS_is_native(class) && check_signature(type, &desc[j], cds->desc))
THROW(E_OVERRIDE, parent->name, cds->name, class->name);
}
cds = &class->table[ind];
#if DEBUG_DESC
fprintf(stderr, "%s: [%d] (%p %d) := (%p %d)\n", name, ind, cds->desc, cds->desc ? cds->desc->gambas.val1 : 0, &desc[j], desc[j].gambas.val1);
fprintf(stderr, "%s: [%d] (%p %ld) := (%p %ld)\n", name, ind, cds->desc, cds->desc ? cds->desc->gambas.val1 : 0, &desc[j], desc[j].gambas.val1);
#endif
cds->desc = &desc[j];
cds->desc = (CLASS_DESC *)&desc[j];
cds->name = ".";
cds->len = 1;
if (!desc[j].gambas.val1 && index(CD_CALL_SOMETHING_LIST, type) != NULL)
/*if (!desc[j].gambas.val1 && index(CD_CALL_SOMETHING_LIST, type) != NULL)
{
#if DEBUG_DESC
fprintf(stderr, "'%s' gambas.val1: %d -> %d\n", desc[j].gambas.name, desc[j].gambas.val1, class->parent->table[ind].desc->gambas.val1);
#endif
desc[j].gambas.val1 = class->parent->table[ind].desc->gambas.val1;
}
}
//#if DEBUG_DESC
fprintf(stderr, "CLASS_make_description: '%s.%s' gambas.val1: %ld -> %ld\n", class->name, desc[j].gambas.name, desc[j].gambas.val1, class->parent->table[ind].desc->gambas.val1);
//#endif
((CLASS_DESC *)desc)[j].gambas.val1 = class->parent->table[ind].desc->gambas.val1;
}*/
}
}
@ -1033,7 +1076,7 @@ void CLASS_make_description(CLASS *class, CLASS_DESC *desc, int n_desc, int *fir
for (j = 0; j < n_desc; j++, i++)
{
class->table[i].desc = &desc[j];
class->table[i].desc = (CLASS_DESC *)&desc[j];
/* On saute le caractère de type de symbole */
if (CLASS_is_native(class))

View File

@ -462,7 +462,7 @@ int CLASS_return_zero();
void CLASS_sort(CLASS *class);
void CLASS_inheritance(CLASS *class, CLASS *parent);
void CLASS_make_description(CLASS *class, CLASS_DESC *desc, int n_desc, int *first);
void CLASS_make_description(CLASS *class, const CLASS_DESC *desc, int n_desc, int *first);
void CLASS_make_event(CLASS *class, int *first);
void CLASS_calc_info(CLASS *class, int n_event, int size_dynamic, bool all, int size_static);

View File

@ -198,6 +198,6 @@ typedef
#define CLASS_DESC_SELF (-1)
char *CLASS_DESC_get_signature(CLASS_DESC *cd);
const char *CLASS_DESC_get_type_name(CLASS_DESC *desc);
const char *CLASS_DESC_get_type_name(const CLASS_DESC *desc);
#endif

View File

@ -502,7 +502,7 @@ __MISMATCH:
}
static void load_and_relocate(CLASS *class, int len_data, int *pndesc, int *pfirst)
static void load_and_relocate(CLASS *class, int len_data, CLASS_DESC **pstart, int *pndesc)
{
char *section;
CLASS_INFO *info;
@ -879,14 +879,11 @@ static void load_and_relocate(CLASS *class, int len_data, int *pndesc, int *pfir
//if (info->s_dynamic == 0)
// class->no_create = TRUE;
/* Descriptions */
CLASS_make_description(class, start, n_desc, pfirst);
/* Class size and offsets */
CLASS_calc_info(class, class->n_event, info->s_dynamic, FALSE, info->s_static);
*pstart = start;
*pndesc = n_desc;
}
@ -908,6 +905,8 @@ void CLASS_load_without_init(CLASS *class)
int first;
int first_event;
COMPONENT *save;
CLASS_DESC *start;
char kind;
//size_t alloc = MEMORY_size;
@ -991,7 +990,7 @@ void CLASS_load_without_init(CLASS *class)
class->init_dynamic = TRUE;
load_and_relocate(class, len_data, &n_desc, &first);
load_and_relocate(class, len_data, &start, &n_desc);
/* Information on static and dynamic variables */
@ -1059,15 +1058,20 @@ void CLASS_load_without_init(CLASS *class)
/* Class public description */
for (i = first; i < class->n_desc; i++)
for (i = 0; i < n_desc; i++)
{
desc = class->table[i].desc;
desc = &start[i]; //class->table[i].desc;
desc->gambas.name = (char *)CLASS_DESC_get_type_name(desc);
//desc->gambas.name = (char *)CLASS_DESC_get_type_name(desc);
conv_type(class, &desc->gambas.type);
switch (CLASS_DESC_get_type(desc))
kind = *CLASS_DESC_get_type_name(desc);
if (!desc->gambas.val1 && index(CD_CALL_SOMETHING_LIST, kind) != NULL)
fprintf(stderr, "CLASS_load_without_init: '%s.%s' gambas.val1 == 0\n", class->name, desc->gambas.name);
switch (kind)
{
case CD_METHOD:
case CD_STATIC_METHOD:
@ -1098,7 +1102,7 @@ void CLASS_load_without_init(CLASS *class)
case CD_VARIABLE:
case CD_STATIC_VARIABLE:
if (CLASS_DESC_get_type(desc) == CD_STATIC_VARIABLE)
if (kind == CD_STATIC_VARIABLE)
var = &class->load->stat[desc->gambas.val1];
else
var = &class->load->dyn[desc->gambas.val1];
@ -1150,7 +1154,18 @@ void CLASS_load_without_init(CLASS *class)
THROW(E_CLASS, ClassName, "Bad description", "");
}
}
/* Inheritance */
CLASS_make_description(class, start, n_desc, &first);
/* Transfer symbol kind into symbol name (which is stored in the symbol table now), like native classes */
for (i = 0; i < n_desc; i++)
{
desc = &start[i];
desc->gambas.name = (char *)CLASS_DESC_get_type_name(desc);
desc->method.class = class;
}

View File

@ -67,7 +67,7 @@ CLASS *CLASS_register_class(GB_DESC *ptr, CLASS *class)
CLASS_EVENT *event;
const char *ptype;
const char *type;
//const char *type;
int first_event, nsign;
TYPE *sign;
int first;
@ -156,20 +156,13 @@ CLASS *CLASS_register_class(GB_DESC *ptr, CLASS *class)
for(desc = start, n_desc = 0; desc->gambas.name != NULL; desc++, n_desc++);
CLASS_make_description(class, start, n_desc, &first);
/* Description analysis */
/* Analyse de la description :
- Calcul du nombre de signatures
- Calcul du nombre d'<EFBFBD><EFBFBD>ements
*/
for (i = first; i < class->n_desc; i++)
for (i = 0; i < n_desc; i++)
{
desc = class->table[i].desc;
desc = &start[i];
ptype = (char *)desc->gambas.type;
type = ptype;
desc->gambas.type = TYPE_from_string(&ptype);
switch (CLASS_DESC_get_type(desc))
@ -229,9 +222,13 @@ CLASS *CLASS_register_class(GB_DESC *ptr, CLASS *class)
CLASS_calc_info(class, class->n_event, size_dynamic, TRUE, 0);
// Inheritance
CLASS_make_description(class, start, n_desc, &first);
CLASS_make_event(class, &first_event);
/* Transfert des évènements et signatures */
// Transfer events and signatures
if (nsign)
{

View File

@ -397,7 +397,6 @@ __NORMAL:
return GB_DEBUG_ACCESS_NORMAL;
}
void DEBUG_print_backtrace(ERROR_INFO *err)
{
int i, n;
@ -414,6 +413,38 @@ void DEBUG_print_backtrace(ERROR_INFO *err)
}
}
#if 0
const char *DEBUG_get_current_backtrace(void)
{
char *result = NULL;
int i, n;
ERROR_INFO err;
STACK_CONTEXT *sc;
err.cp = CP;
err.fp = FP;
err.pc = PC;
err.bt_count = STACK_frame_count;
sc = (STACK_CONTEXT *)(STACK_base + STACK_size) - err.bt_count;
STRING_add(&result, DEBUG_get_position(err.cp, err.fp, err.pc), 0);
STRING_add_char(&result, '\n');
for (i = 0, n = 0; i < err.bt_count; i++)
{
//fprintf(stderr, "%d: %s\n", i, DEBUG_get_position(bt[i].cp, bt[i].fp, bt[i].pc));
if (!sc[i].pc)
continue;
n++;
STRING_add(&result, DEBUG_get_position(sc[i].cp, sc[i].fp, sc[i].pc), 0);
STRING_add_char(&result, '\n');
}
STRING_free_later(result);
return result;
}
#endif
GB_ARRAY DEBUG_get_string_array_from_backtrace(ERROR_INFO *err)
{

View File

@ -85,26 +85,26 @@ void COLOR_rgb_to_hsv(int r, int g, int b, int *H, int *S, int *V)
}
}
static void gt_rgb_to_hsv_cached(int r, int g, int b, int *H, int *S, int *V)
static void gt_rgb_to_hsv_cached(int r, int g, int b, int *h, int *s, int *v)
{
static int old_r = 0, old_g = 0, old_b = 0, old_h = -1, old_s = 0, old_v = 0;
if (r == old_r && g == old_g && b == old_b)
{
*H = old_h;
*S = old_s;
*V = old_v;
*h = old_h;
*s = old_s;
*v = old_v;
return;
}
COLOR_rgb_to_hsv(r, g, b, H, S, V);
COLOR_rgb_to_hsv(r, g, b, h, s, v);
old_r = r;
old_g = g;
old_b = b;
old_h = *H;
old_s = *S;
old_v = *V;
old_h = *h;
old_s = *s;
old_v = *v;
}
void COLOR_hsv_to_rgb(int h, int s, int v, int *R, int *G, int *B)
@ -232,13 +232,21 @@ GB_COLOR COLOR_darker(GB_COLOR color)
return v;
}
BEGIN_METHOD(CCOLOR_rgb, GB_INTEGER r; GB_INTEGER g; GB_INTEGER b; GB_INTEGER a)
BEGIN_METHOD(Color_RGB, GB_INTEGER r; GB_INTEGER g; GB_INTEGER b; GB_INTEGER a)
GB.ReturnInteger(gt_rgba_to_color(VARG(r), VARG(g), VARG(b), VARGOPT(a, 0)));
END_METHOD
BEGIN_METHOD(CCOLOR_hsv, GB_INTEGER h; GB_INTEGER s; GB_INTEGER v; GB_INTEGER a)
BEGIN_METHOD(Color_SetRGB, GB_INTEGER color; GB_INTEGER red; GB_INTEGER green; GB_INTEGER blue; GB_INTEGER alpha)
int r, g, b, a;
gt_color_to_rgba(VARG(color), &r, &g, &b, &a);
GB.ReturnInteger(gt_rgba_to_color(VARGOPT(red, r), VARGOPT(green, g), VARGOPT(blue, b), VARGOPT(alpha, a)));
END_METHOD
BEGIN_METHOD(Color_HSV, GB_INTEGER h; GB_INTEGER s; GB_INTEGER v; GB_INTEGER a)
int r, g, b;
COLOR_hsv_to_rgb(VARG(h), VARG(s), VARG(v), &r, &g, &b);
@ -246,7 +254,17 @@ BEGIN_METHOD(CCOLOR_hsv, GB_INTEGER h; GB_INTEGER s; GB_INTEGER v; GB_INTEGER a)
END_METHOD
BEGIN_METHOD(CCOLOR_get, GB_INTEGER color)
BEGIN_METHOD(Color_SetHSV, GB_INTEGER color; GB_INTEGER hue; GB_INTEGER saturation; GB_INTEGER value; GB_INTEGER alpha)
int r, g, b, a, h, s, v;
gt_color_to_rgba(VARG(color), &r, &g, &b, &a);
gt_rgb_to_hsv_cached(r, g, b, &h, &s, &v);
COLOR_hsv_to_rgb(VARGOPT(hue, h), VARGOPT(saturation, s), VARGOPT(value, v), &r, &g, &b);
GB.ReturnInteger(gt_rgba_to_color(r, g, b, VARGOPT(alpha, a)));
END_METHOD
BEGIN_METHOD(Color_get, GB_INTEGER color)
CCOLOR *info;
@ -361,19 +379,19 @@ BEGIN_PROPERTY(CCOLOR_info_color)
END_PROPERTY
BEGIN_METHOD(CCOLOR_lighter, GB_INTEGER color)
BEGIN_METHOD(Color_Lighter, GB_INTEGER color)
GB.ReturnInteger(COLOR_lighter(VARG(color)));
END_METHOD
BEGIN_METHOD(CCOLOR_darker, GB_INTEGER color)
BEGIN_METHOD(Color_Darker, GB_INTEGER color)
GB.ReturnInteger(COLOR_darker(VARG(color)));
END_METHOD
BEGIN_METHOD(CCOLOR_merge, GB_INTEGER color1; GB_INTEGER color2; GB_FLOAT weight)
BEGIN_METHOD(Color_Merge, GB_INTEGER color1; GB_INTEGER color2; GB_FLOAT weight)
GB.ReturnInteger(COLOR_merge(VARG(color1), VARG(color2), VARGOPT(weight, 0.5)));
@ -389,7 +407,7 @@ BEGIN_METHOD(Color_Desaturate, GB_INTEGER color)
END_METHOD
BEGIN_METHOD(CCOLOR_blend, GB_INTEGER src; GB_INTEGER dst)
BEGIN_METHOD(Color_Blend, GB_INTEGER src; GB_INTEGER dst)
uint src = VARG(src);
uint dst = VARG(dst);
@ -432,8 +450,17 @@ BEGIN_METHOD(CCOLOR_blend, GB_INTEGER src; GB_INTEGER dst)
END_METHOD
BEGIN_METHOD(Color_GetAlpha, GB_INTEGER color)
int r, g, b, a;
gt_color_to_rgba(VARG(color), &r, &g, &b, &a);
GB.ReturnInteger(a);
END_METHOD
BEGIN_METHOD(Color_SetAlpha, GB_INTEGER color; GB_INTEGER alpha)
int r, g, b, a;
gt_color_to_rgba(VARG(color), &r, &g, &b, &a);
@ -496,19 +523,22 @@ GB_DESC CColorDesc[] =
GB_CONSTANT("Transparent", "i", 0xFFFFFFFF),
GB_STATIC_METHOD("RGB", "i", CCOLOR_rgb, "(Red)i(Green)i(Blue)i[(Alpha)i]"),
GB_STATIC_METHOD("HSV", "i", CCOLOR_hsv, "(Hue)i(Saturation)i(Value)i[(Alpha)i]"),
GB_STATIC_METHOD("RGB", "i", Color_RGB, "(Red)i(Green)i(Blue)i[(Alpha)i]"),
GB_STATIC_METHOD("HSV", "i", Color_HSV, "(Hue)i(Saturation)i(Value)i[(Alpha)i]"),
GB_STATIC_METHOD("Lighter", "i", CCOLOR_lighter, "(Color)i"),
GB_STATIC_METHOD("Darker", "i", CCOLOR_darker, "(Color)i"),
GB_STATIC_METHOD("Merge", "i", CCOLOR_merge, "(Color1)i(Color2)i[(Weight)f]"),
GB_STATIC_METHOD("Blend", "i", CCOLOR_blend, "(Source)i(Destination)i"),
GB_STATIC_METHOD("Lighter", "i", Color_Lighter, "(Color)i"),
GB_STATIC_METHOD("Darker", "i", Color_Darker, "(Color)i"),
GB_STATIC_METHOD("Merge", "i", Color_Merge, "(Color1)i(Color2)i[(Weight)f]"),
GB_STATIC_METHOD("Blend", "i", Color_Blend, "(Source)i(Destination)i"),
GB_STATIC_METHOD("Desaturate", "i", Color_Desaturate, "(Color)i"),
GB_STATIC_METHOD("SetAlpha", "i", Color_SetAlpha, "(Color)i(Alpha)i"),
GB_STATIC_METHOD("SetRGB", "i", Color_SetRGB, "(Color)i[(Red)i(Green)i(Blue)i(Alpha)i]"),
GB_STATIC_METHOD("SetHSV", "i", Color_SetHSV, "(Color)i[(Hue)i(Saturation)i(Value)i(Alpha)i]"),
GB_STATIC_METHOD("GetAlpha", "i", Color_GetAlpha, "(Color)i"),
GB_STATIC_METHOD("_get", "ColorInfo", CCOLOR_get, "(Color)i"),
//GB_STATIC_METHOD("_call", "ColorInfo", CCOLOR_get, "(Color)i"),
GB_STATIC_METHOD("_get", "ColorInfo", Color_get, "(Color)i"),
//GB_STATIC_METHOD("_call", "ColorInfo", Color_get, "(Color)i"),
GB_END_DECLARE
};

View File

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/x-gambas">
<mime-type type="application/x-gambas3">
<sub-class-of type="application/x-executable"/>
<comment>Gambas executable</comment>
<comment xml:lang="fr">Exécutable Gambas</comment>
<comment>Gambas 3 executable</comment>
<comment xml:lang="fr">Exécutable Gambas 3</comment>
<magic priority="50">
<match type="string" value="#!/usr/bin/env gbr3" offset="0"/>
</magic>