[DEVELOPMENT ENVIRONMENT]
* NEW: New gb.complex component [INTERPRETER] * BUG: Automatic array conversion now works with not yet loaded array classes. [GB.COMPLEX] * NEW: New component that implements a rudimentary management of complex numbers. This component is automatically loaded if a complex number constant is encountered and no loaded component can already handle complex numbers. git-svn-id: svn://localhost/gambas/trunk@4924 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
ad823d98cf
commit
fa552f69c1
@ -31,258 +31,262 @@ msgid "Chart drawing"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:81
|
||||
msgid "Compression & decompression"
|
||||
msgid "Complex numbers management"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:82
|
||||
msgid "Compression & decompression"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:83
|
||||
msgid "MD5/DES crypting"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:83 FCreateProject.form:292
|
||||
#: CComponent.class:84 FCreateProject.form:292
|
||||
msgid "Database access"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:84
|
||||
#: CComponent.class:85
|
||||
msgid "Firebird database driver"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:85
|
||||
#: CComponent.class:86
|
||||
msgid "Data bound controls"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:86
|
||||
#: CComponent.class:87
|
||||
msgid "MySQL database driver"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:87
|
||||
#: CComponent.class:88
|
||||
msgid "ODBC database driver"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:88
|
||||
#: CComponent.class:89
|
||||
msgid "PostgreSQL database driver"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:89
|
||||
#: CComponent.class:90
|
||||
msgid "SQLite 2 database driver"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:90
|
||||
#: CComponent.class:91
|
||||
msgid "SQLite 3 database driver"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:91
|
||||
#: CComponent.class:92
|
||||
msgid "Application debugger helper"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:92
|
||||
#: CComponent.class:93
|
||||
msgid "Desktop-neutral routines from Portland project"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:93
|
||||
#: CComponent.class:94
|
||||
msgid "D-Bus interface"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:94
|
||||
#: CComponent.class:95
|
||||
msgid "Expression evaluator"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:95
|
||||
#: CComponent.class:96
|
||||
msgid "Syntax highlighter routines"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:96
|
||||
#: CComponent.class:97
|
||||
msgid "More controls for graphical components"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:97
|
||||
#: CComponent.class:98
|
||||
msgid "Enhanced standard dialogs"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:98
|
||||
#: CComponent.class:99
|
||||
msgid "Multi Document Interface"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:99
|
||||
#: CComponent.class:100
|
||||
msgid "Default icon theme"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:100
|
||||
#: CComponent.class:101
|
||||
msgid "GNU Scientific Library"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:101
|
||||
#: CComponent.class:102
|
||||
msgid "GTK+ toolkit"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:102
|
||||
#: CComponent.class:103
|
||||
msgid "GTK+ toolkit extension"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:103
|
||||
#: CComponent.class:104
|
||||
msgid "OpenGL with GTK+ toolkit"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:104
|
||||
#: CComponent.class:105
|
||||
msgid "GTK+ SVG renderer"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:105
|
||||
#: CComponent.class:106
|
||||
msgid "QT/GTK+ switcher component"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:106
|
||||
#: CComponent.class:107
|
||||
msgid "OpenGL with QT/GTK+ switcher component"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:107
|
||||
#: CComponent.class:108
|
||||
msgid "Image management"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:108
|
||||
#: CComponent.class:109
|
||||
msgid "Image filtering component"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:109
|
||||
#: CComponent.class:110
|
||||
msgid "Image routines from the Imlib2 library"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:110 FPropertyComponent.form:138
|
||||
#: CComponent.class:111 FPropertyComponent.form:138
|
||||
msgid "Image loading and saving"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:111
|
||||
#: CComponent.class:112
|
||||
msgid "OpenLDAP client"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:112
|
||||
#: CComponent.class:113
|
||||
msgid "GStreamer multimedia component"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:113
|
||||
#: CComponent.class:114
|
||||
msgid "MySQL specific routines"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:114
|
||||
#: CComponent.class:115
|
||||
msgid "NCurses library"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:115 FCreateProject.form:298
|
||||
#: CComponent.class:116 FCreateProject.form:298
|
||||
msgid "Network programming"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:116
|
||||
#: CComponent.class:117
|
||||
msgid "Network high-level protocols management"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:117
|
||||
#: CComponent.class:118
|
||||
msgid "SMTP client"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:118
|
||||
#: CComponent.class:119
|
||||
msgid "3D programming with OpenGL"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:119
|
||||
#: CComponent.class:120
|
||||
msgid "OpenGL utility component"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:120
|
||||
#: CComponent.class:121
|
||||
msgid "OpenGL shaders management"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:121
|
||||
#: CComponent.class:122
|
||||
msgid "GNU command option parser"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:122
|
||||
#: CComponent.class:123
|
||||
msgid "Perl-compatible Regular Expression Matching"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:123
|
||||
#: CComponent.class:124
|
||||
msgid "PDF renderer based on Poppler library"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:124
|
||||
#: CComponent.class:125
|
||||
msgid "QT4 toolkit"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:125
|
||||
#: CComponent.class:126
|
||||
msgid "QT4 toolkit extension"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:126
|
||||
#: CComponent.class:127
|
||||
msgid "QT4 WebKit component"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:127
|
||||
#: CComponent.class:128
|
||||
msgid "OpenGL with QT4 toolkit"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:128
|
||||
#: CComponent.class:129
|
||||
msgid "Report designer"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:129
|
||||
#: CComponent.class:130
|
||||
msgid "SDL library"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:130
|
||||
#: CComponent.class:131
|
||||
msgid "SDL sound & CD-ROM management"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:131
|
||||
#: CComponent.class:132
|
||||
msgid "Application settings management"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:132
|
||||
#: CComponent.class:133
|
||||
msgid "Signals management"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:133
|
||||
#: CComponent.class:134
|
||||
msgid "Video capture"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:134
|
||||
#: CComponent.class:135
|
||||
msgid "Visual Basic compatibility"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:135
|
||||
#: CComponent.class:136
|
||||
msgid "XML tools based on libxml"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:136
|
||||
#: CComponent.class:137
|
||||
msgid "XML tools"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:137
|
||||
#: CComponent.class:138
|
||||
msgid "HTML generator"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:138
|
||||
#: CComponent.class:139
|
||||
msgid "XML-RPC protocol"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:139
|
||||
#: CComponent.class:140
|
||||
msgid "XSLT tools based on libxslt and libxml"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:140
|
||||
#: CComponent.class:141
|
||||
msgid "Web applications tools"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:146 FPropertyComponent.form:126
|
||||
#: CComponent.class:147 FPropertyComponent.form:126
|
||||
msgid "Graphical form management"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:147 FPropertyComponent.form:132
|
||||
#: CComponent.class:148 FPropertyComponent.form:132
|
||||
msgid "Event loop management"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:149 FPropertyComponent.form:144
|
||||
#: CComponent.class:150 FPropertyComponent.form:144
|
||||
msgid "OpenGL display"
|
||||
msgstr ""
|
||||
|
||||
#: CComponent.class:443
|
||||
#: CComponent.class:444
|
||||
msgid "Loading information on component &1..."
|
||||
msgstr ""
|
||||
|
||||
|
Binary file not shown.
@ -795,7 +795,7 @@ msgstr "<h2 align=center>Auteurs</h2>\n"
|
||||
msgid "<h2 align=center>Licence</h2>\n\n<p align=center>This program is FREE SOFTWARE; you can redistribute it AND/OR modify it under the terms of the GNU General Public License as published by the Free Software Foundation ; either version 2, or (at your option) any later version.</p>\n\n<p align=center>This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</p>\n"
|
||||
msgstr "<h2 align=center>Licence</h2><p align=center>Ce programme est un LOGICIEL LIBRE. Vous pouvez le redistribuer ET/OU le modifier selon les termes de la Licence Publique Générale GNU telle qu'elle est publiée par la Free Software Foundation ; soit la version 2, ou bien n'importe quelle version ultérieure de votre choix.</p><p align=center>Ce programme est distribué en espérant qu'il soit utile MAIS SANS GARANTIE D'AUCUNE SORTE ; y compris les garanties implicites de COMMERCIABILITÉ ET DE CONFORMITÉ À UNE UTILISATION PARTICULIÈRE. Se reporter à la Licence Publique Générale GNU pour plus d'information.</p>\n"
|
||||
|
||||
#: CComponent.class:118
|
||||
#: CComponent.class:119
|
||||
msgid "3D programming with OpenGL"
|
||||
msgstr "Programmation 3D avec OpenGL"
|
||||
|
||||
@ -955,11 +955,11 @@ msgstr "Expression ambigüe. Veuillez utiliser des parenthèses"
|
||||
msgid "Amethyst"
|
||||
msgstr "Améthiste"
|
||||
|
||||
#: CComponent.class:91
|
||||
#: CComponent.class:92
|
||||
msgid "Application debugger helper"
|
||||
msgstr "Debogueur intégré"
|
||||
|
||||
#: CComponent.class:131
|
||||
#: CComponent.class:132
|
||||
msgid "Application settings management"
|
||||
msgstr "Gestion des fichiers de configuration"
|
||||
|
||||
@ -1647,6 +1647,10 @@ msgstr "Tout compiler"
|
||||
msgid "Compiling project"
|
||||
msgstr "Compilation du projet"
|
||||
|
||||
#: CComponent.class:81
|
||||
msgid "Complex numbers management"
|
||||
msgstr "Gestion des nombres complexes"
|
||||
|
||||
#: FPropertyProject.form:171
|
||||
msgid "Component"
|
||||
msgstr "Composant"
|
||||
@ -1679,7 +1683,7 @@ msgstr "Composants"
|
||||
msgid "Compress file"
|
||||
msgstr "Compresser le fichier"
|
||||
|
||||
#: CComponent.class:81
|
||||
#: CComponent.class:82
|
||||
msgid "Compression & decompression"
|
||||
msgstr "Compression et décompression"
|
||||
|
||||
@ -1859,7 +1863,7 @@ msgstr "Couper"
|
||||
msgid "Czech (Czech Republic)"
|
||||
msgstr "Tchèque (République Tchèque)"
|
||||
|
||||
#: CComponent.class:93
|
||||
#: CComponent.class:94
|
||||
msgid "D-Bus interface"
|
||||
msgstr "Interfaçage avec D-Bus"
|
||||
|
||||
@ -1871,7 +1875,7 @@ msgstr "Danois (Danemark)"
|
||||
msgid "Data"
|
||||
msgstr "Données"
|
||||
|
||||
#: CComponent.class:85
|
||||
#: CComponent.class:86
|
||||
msgid "Data bound controls"
|
||||
msgstr "Contrôles liés aux données"
|
||||
|
||||
@ -1883,7 +1887,7 @@ msgstr "Types de données"
|
||||
msgid "Database"
|
||||
msgstr "Bases de données"
|
||||
|
||||
#: CComponent.class:83 FCreateProject.form:292
|
||||
#: CComponent.class:84 FCreateProject.form:292
|
||||
msgid "Database access"
|
||||
msgstr "Accès aux bases de données"
|
||||
|
||||
@ -1915,7 +1919,7 @@ msgstr "Le cas par défaut doit être le dernier"
|
||||
msgid "Default font size"
|
||||
msgstr "Taille de police par défaut"
|
||||
|
||||
#: CComponent.class:99
|
||||
#: CComponent.class:100
|
||||
msgid "Default icon theme"
|
||||
msgstr "Thème d'icônes par défaut"
|
||||
|
||||
@ -1975,7 +1979,7 @@ msgstr "Bureau"
|
||||
msgid "Desktop configuration file"
|
||||
msgstr "Fichier de configuration du bureau"
|
||||
|
||||
#: CComponent.class:92
|
||||
#: CComponent.class:93
|
||||
msgid "Desktop-neutral routines from Portland project"
|
||||
msgstr "Routines indépendantes du bureau du projet Portland"
|
||||
|
||||
@ -2251,7 +2255,7 @@ msgstr "Anglais (U.S.A.)"
|
||||
msgid "English (United Kingdom)"
|
||||
msgstr "Anglais (Royaume Uni)"
|
||||
|
||||
#: CComponent.class:97
|
||||
#: CComponent.class:98
|
||||
msgid "Enhanced standard dialogs"
|
||||
msgstr "Boîtes de dialogue standard améliorées"
|
||||
|
||||
@ -2295,7 +2299,7 @@ msgstr "Evènement"
|
||||
msgid "Event loop"
|
||||
msgstr "Boucle d'évènements"
|
||||
|
||||
#: CComponent.class:147 FPropertyComponent.form:132
|
||||
#: CComponent.class:148 FPropertyComponent.form:132
|
||||
msgid "Event loop management"
|
||||
msgstr "Gestion de la boucle d'évènements"
|
||||
|
||||
@ -2367,7 +2371,7 @@ msgstr "Classes exportées"
|
||||
msgid "Expression"
|
||||
msgstr "Expression"
|
||||
|
||||
#: CComponent.class:94
|
||||
#: CComponent.class:95
|
||||
msgid "Expression evaluator"
|
||||
msgstr "Evaluateur d'expressions"
|
||||
|
||||
@ -2511,7 +2515,7 @@ msgstr "Finlandais (Finlande)"
|
||||
msgid "Firebird"
|
||||
msgstr "-"
|
||||
|
||||
#: CComponent.class:84
|
||||
#: CComponent.class:85
|
||||
msgid "Firebird database driver"
|
||||
msgstr "Pilote de base de données Firebird"
|
||||
|
||||
@ -2723,11 +2727,11 @@ msgstr "Obtenir depuis un fichier 'VERSION'"
|
||||
msgid "GIF"
|
||||
msgstr "-"
|
||||
|
||||
#: CComponent.class:121
|
||||
#: CComponent.class:122
|
||||
msgid "GNU command option parser"
|
||||
msgstr "Analyseur d'options de ligne de commande GNU"
|
||||
|
||||
#: CComponent.class:100
|
||||
#: CComponent.class:101
|
||||
msgid "GNU Scientific Library"
|
||||
msgstr "Bibliothèque scientifique GNU"
|
||||
|
||||
@ -2755,7 +2759,7 @@ msgstr "Aller à la ligne..."
|
||||
msgid "Graphical application"
|
||||
msgstr "Application graphique"
|
||||
|
||||
#: CComponent.class:146 FPropertyComponent.form:126
|
||||
#: CComponent.class:147 FPropertyComponent.form:126
|
||||
msgid "Graphical form management"
|
||||
msgstr "Gestion de formulaires graphiques"
|
||||
|
||||
@ -2767,7 +2771,7 @@ msgstr "Grec (Grèce)"
|
||||
msgid "Groups"
|
||||
msgstr "Groupes"
|
||||
|
||||
#: CComponent.class:112
|
||||
#: CComponent.class:113
|
||||
msgid "GStreamer multimedia component"
|
||||
msgstr "Composant multimedia GStreamer"
|
||||
|
||||
@ -2775,15 +2779,15 @@ msgstr "Composant multimedia GStreamer"
|
||||
msgid "GTK+ graphical application"
|
||||
msgstr "Application graphique GTK+"
|
||||
|
||||
#: CComponent.class:104
|
||||
#: CComponent.class:105
|
||||
msgid "GTK+ SVG renderer"
|
||||
msgstr "Affichage de fichiers SVG pour GTK+"
|
||||
|
||||
#: CComponent.class:101
|
||||
#: CComponent.class:102
|
||||
msgid "GTK+ toolkit"
|
||||
msgstr "Bibliothèque GTK+"
|
||||
|
||||
#: CComponent.class:102
|
||||
#: CComponent.class:103
|
||||
msgid "GTK+ toolkit extension"
|
||||
msgstr "Extension du toolkit GTK+"
|
||||
|
||||
@ -2855,7 +2859,7 @@ msgstr "Fichier HTML"
|
||||
msgid "HTML files"
|
||||
msgstr "Fichiers HTML"
|
||||
|
||||
#: CComponent.class:137
|
||||
#: CComponent.class:138
|
||||
msgid "HTML generator"
|
||||
msgstr "Générateur HTML"
|
||||
|
||||
@ -2923,15 +2927,15 @@ msgstr "Éditeur d'images"
|
||||
msgid "Image files"
|
||||
msgstr "Fichiers images"
|
||||
|
||||
#: CComponent.class:108
|
||||
#: CComponent.class:109
|
||||
msgid "Image filtering component"
|
||||
msgstr "Composant de filtrage d'images"
|
||||
|
||||
#: CComponent.class:110 FPropertyComponent.form:138
|
||||
#: CComponent.class:111 FPropertyComponent.form:138
|
||||
msgid "Image loading and saving"
|
||||
msgstr "Chargement et sauvegarde d'images"
|
||||
|
||||
#: CComponent.class:107
|
||||
#: CComponent.class:108
|
||||
msgid "Image management"
|
||||
msgstr "Gestion des images"
|
||||
|
||||
@ -2939,7 +2943,7 @@ msgstr "Gestion des images"
|
||||
msgid "Image processing"
|
||||
msgstr "Traitement d'images"
|
||||
|
||||
#: CComponent.class:109
|
||||
#: CComponent.class:110
|
||||
msgid "Image routines from the Imlib2 library"
|
||||
msgstr "Gestion des images basée sur la librairie Imlib2"
|
||||
|
||||
@ -3239,7 +3243,7 @@ msgstr "Lithuanien (Lithuanie)"
|
||||
msgid "Loading &1..."
|
||||
msgstr "Chargement de &1..."
|
||||
|
||||
#: CComponent.class:443
|
||||
#: CComponent.class:444
|
||||
msgid "Loading information on component &1..."
|
||||
msgstr "Chargement des informations sur le composant &1..."
|
||||
|
||||
@ -3335,7 +3339,7 @@ msgstr "Erreur mathématique"
|
||||
msgid "Max. version"
|
||||
msgstr "Version max."
|
||||
|
||||
#: CComponent.class:82
|
||||
#: CComponent.class:83
|
||||
msgid "MD5/DES crypting"
|
||||
msgstr "Chiffrement MD5/DES"
|
||||
|
||||
@ -3431,7 +3435,7 @@ msgstr "Les modules sont publics par défaut"
|
||||
msgid "Modules"
|
||||
msgstr "Modules"
|
||||
|
||||
#: CComponent.class:96
|
||||
#: CComponent.class:97
|
||||
msgid "More controls for graphical components"
|
||||
msgstr "Controles supplémentaires pour les composants graphiques"
|
||||
|
||||
@ -3471,7 +3475,7 @@ msgstr "Déplacer tout en haut"
|
||||
msgid "Move up"
|
||||
msgstr "Déplacer vers le haut"
|
||||
|
||||
#: CComponent.class:98
|
||||
#: CComponent.class:99
|
||||
msgid "Multi Document Interface"
|
||||
msgstr "Interface multi-documents"
|
||||
|
||||
@ -3483,11 +3487,11 @@ msgstr "Multimedia"
|
||||
msgid "MySQL"
|
||||
msgstr "-"
|
||||
|
||||
#: CComponent.class:86
|
||||
#: CComponent.class:87
|
||||
msgid "MySQL database driver"
|
||||
msgstr "Pilote de base de données MySQL"
|
||||
|
||||
#: CComponent.class:113
|
||||
#: CComponent.class:114
|
||||
msgid "MySQL specific routines"
|
||||
msgstr "Routines spécifiques pour MySQL"
|
||||
|
||||
@ -3499,15 +3503,15 @@ msgstr "Nom"
|
||||
msgid "native code"
|
||||
msgstr "code natif"
|
||||
|
||||
#: CComponent.class:114
|
||||
#: CComponent.class:115
|
||||
msgid "NCurses library"
|
||||
msgstr "Bibliothèque NCurses"
|
||||
|
||||
#: CComponent.class:116
|
||||
#: CComponent.class:117
|
||||
msgid "Network high-level protocols management"
|
||||
msgstr "Gestion de protocoles réseaux de haut-niveau"
|
||||
|
||||
#: CComponent.class:115 FCreateProject.form:298
|
||||
#: CComponent.class:116 FCreateProject.form:298
|
||||
msgid "Network programming"
|
||||
msgstr "Programmation réseau"
|
||||
|
||||
@ -3719,7 +3723,7 @@ msgstr "Obsidienne"
|
||||
msgid "ODBC"
|
||||
msgstr "-"
|
||||
|
||||
#: CComponent.class:87
|
||||
#: CComponent.class:88
|
||||
msgid "ODBC database driver"
|
||||
msgstr "Pilote de base de données ODBC"
|
||||
|
||||
@ -3783,7 +3787,7 @@ msgstr "Ouvrir un projet..."
|
||||
msgid "OpenGL"
|
||||
msgstr "OpenGL"
|
||||
|
||||
#: CComponent.class:149 FPropertyComponent.form:144
|
||||
#: CComponent.class:150 FPropertyComponent.form:144
|
||||
msgid "OpenGL display"
|
||||
msgstr "Affichage OpenGL"
|
||||
|
||||
@ -3791,27 +3795,27 @@ msgstr "Affichage OpenGL"
|
||||
msgid "OpenGL programming"
|
||||
msgstr "Programmation OpenGL"
|
||||
|
||||
#: CComponent.class:120
|
||||
#: CComponent.class:121
|
||||
msgid "OpenGL shaders management"
|
||||
msgstr "Gestion des shaders OpenGL"
|
||||
|
||||
#: CComponent.class:119
|
||||
#: CComponent.class:120
|
||||
msgid "OpenGL utility component"
|
||||
msgstr "composant utilitaire OpenGL"
|
||||
|
||||
#: CComponent.class:103
|
||||
#: CComponent.class:104
|
||||
msgid "OpenGL with GTK+ toolkit"
|
||||
msgstr "OpenGL avec GTK+"
|
||||
|
||||
#: CComponent.class:106
|
||||
#: CComponent.class:107
|
||||
msgid "OpenGL with QT/GTK+ switcher component"
|
||||
msgstr "Sélection du composant graphique OpenGL selon le bureau"
|
||||
|
||||
#: CComponent.class:127
|
||||
#: CComponent.class:128
|
||||
msgid "OpenGL with QT4 toolkit"
|
||||
msgstr "OpenGL avec QT4"
|
||||
|
||||
#: CComponent.class:111
|
||||
#: CComponent.class:112
|
||||
msgid "OpenLDAP client"
|
||||
msgstr "Client OpenLDAP"
|
||||
|
||||
@ -3931,11 +3935,11 @@ msgstr "Emplacement"
|
||||
msgid "Pause"
|
||||
msgstr "Pause"
|
||||
|
||||
#: CComponent.class:123
|
||||
#: CComponent.class:124
|
||||
msgid "PDF renderer based on Poppler library"
|
||||
msgstr "Lecture de PDF basée sur la bibliothèque Poppler"
|
||||
|
||||
#: CComponent.class:122
|
||||
#: CComponent.class:123
|
||||
msgid "Perl-compatible Regular Expression Matching"
|
||||
msgstr "Expression rationnelles compatibles avec Perl"
|
||||
|
||||
@ -4075,7 +4079,7 @@ msgstr "Portugais (Portugal)"
|
||||
msgid "PostgreSQL"
|
||||
msgstr "-"
|
||||
|
||||
#: CComponent.class:88
|
||||
#: CComponent.class:89
|
||||
msgid "PostgreSQL database driver"
|
||||
msgstr "Pilote de base de données PostgreSQL"
|
||||
|
||||
@ -4223,19 +4227,19 @@ msgstr "-"
|
||||
msgid "QT graphical application"
|
||||
msgstr "Application graphique QT"
|
||||
|
||||
#: CComponent.class:105
|
||||
#: CComponent.class:106
|
||||
msgid "QT/GTK+ switcher component"
|
||||
msgstr "Sélection du composant graphique selon le bureau"
|
||||
|
||||
#: CComponent.class:124
|
||||
#: CComponent.class:125
|
||||
msgid "QT4 toolkit"
|
||||
msgstr "Bibliothèque QT4"
|
||||
|
||||
#: CComponent.class:125
|
||||
#: CComponent.class:126
|
||||
msgid "QT4 toolkit extension"
|
||||
msgstr "Controles supplémentaires basés sur la bibliothèque QT4"
|
||||
|
||||
#: CComponent.class:126
|
||||
#: CComponent.class:127
|
||||
msgid "QT4 WebKit component"
|
||||
msgstr "Composant WebKit de QT4"
|
||||
|
||||
@ -4375,7 +4379,7 @@ msgstr "Remplacement de couleur"
|
||||
msgid "Report"
|
||||
msgstr "État"
|
||||
|
||||
#: CComponent.class:128
|
||||
#: CComponent.class:129
|
||||
msgid "Report designer"
|
||||
msgstr "Générateur d'états"
|
||||
|
||||
@ -4531,11 +4535,11 @@ msgstr "Déplacer"
|
||||
msgid "SDL application"
|
||||
msgstr "Application SDL"
|
||||
|
||||
#: CComponent.class:129
|
||||
#: CComponent.class:130
|
||||
msgid "SDL library"
|
||||
msgstr "Bibliothèque SDL"
|
||||
|
||||
#: CComponent.class:130
|
||||
#: CComponent.class:131
|
||||
msgid "SDL sound & CD-ROM management"
|
||||
msgstr "Gestion du son et du CD-ROM basé sur la bibliothèque SDL"
|
||||
|
||||
@ -4755,7 +4759,7 @@ msgstr "Afficher les astuces au démarrage"
|
||||
msgid "Show tooltips"
|
||||
msgstr "Afficher les bulles d'aide"
|
||||
|
||||
#: CComponent.class:132
|
||||
#: CComponent.class:133
|
||||
msgid "Signals management"
|
||||
msgstr "Gestion des signaux"
|
||||
|
||||
@ -4783,7 +4787,7 @@ msgstr "Petite"
|
||||
msgid "Small font size"
|
||||
msgstr "Petite taille de police"
|
||||
|
||||
#: CComponent.class:117
|
||||
#: CComponent.class:118
|
||||
msgid "SMTP client"
|
||||
msgstr "Client SMTP"
|
||||
|
||||
@ -4799,7 +4803,7 @@ msgstr "Proxy SOCKS5"
|
||||
msgid "Sol&ve"
|
||||
msgstr "&Résoudre"
|
||||
|
||||
#: Project.module:3162
|
||||
#: FPropertyProject.class:421 Project.module:3162
|
||||
msgid "Some components are missing: &1"
|
||||
msgstr "Certains composants ne sont pas installés : &1"
|
||||
|
||||
@ -4887,11 +4891,11 @@ msgstr "Requête SQL"
|
||||
msgid "SQLite"
|
||||
msgstr "-"
|
||||
|
||||
#: CComponent.class:89
|
||||
#: CComponent.class:90
|
||||
msgid "SQLite 2 database driver"
|
||||
msgstr "Pilote de base de données SQLite 2"
|
||||
|
||||
#: CComponent.class:90
|
||||
#: CComponent.class:91
|
||||
msgid "SQLite 3 database driver"
|
||||
msgstr "Pilote de base de données SQLite 3"
|
||||
|
||||
@ -5107,7 +5111,7 @@ msgstr "Erreur de syntaxe. Le &1 champ n'est pas un identificateur valide."
|
||||
msgid "Syntax error. VarPtr() takes only one identifier"
|
||||
msgstr "Erreur de syntaxe. VarPtr() ne prend qu'un seul identificateur."
|
||||
|
||||
#: CComponent.class:95
|
||||
#: CComponent.class:96
|
||||
msgid "Syntax highlighter routines"
|
||||
msgstr "Routines de coloration syntaxique"
|
||||
|
||||
@ -6015,7 +6019,7 @@ msgstr "Séparation verticale"
|
||||
msgid "Video"
|
||||
msgstr "Vidéo"
|
||||
|
||||
#: CComponent.class:133
|
||||
#: CComponent.class:134
|
||||
msgid "Video capture"
|
||||
msgstr "Capture vidéo"
|
||||
|
||||
@ -6035,7 +6039,7 @@ msgstr "-"
|
||||
msgid "Visual"
|
||||
msgstr "Visuel"
|
||||
|
||||
#: CComponent.class:134
|
||||
#: CComponent.class:135
|
||||
msgid "Visual Basic compatibility"
|
||||
msgstr "Compatibilité avec Visual Basic"
|
||||
|
||||
@ -6063,7 +6067,7 @@ msgstr "Surveiller"
|
||||
msgid "Watch expression"
|
||||
msgstr "Surveiller des expressions"
|
||||
|
||||
#: CComponent.class:140
|
||||
#: CComponent.class:141
|
||||
msgid "Web applications tools"
|
||||
msgstr "Outils pour les applications Web"
|
||||
|
||||
@ -6111,15 +6115,15 @@ msgstr "Programmation XML / XSLT"
|
||||
msgid "XML file"
|
||||
msgstr "Fichier XML"
|
||||
|
||||
#: CComponent.class:136
|
||||
#: CComponent.class:137
|
||||
msgid "XML tools"
|
||||
msgstr "Outils XML"
|
||||
|
||||
#: CComponent.class:135
|
||||
#: CComponent.class:136
|
||||
msgid "XML tools based on libxml"
|
||||
msgstr "Outils XML basés sur la bibliothèque libxml"
|
||||
|
||||
#: CComponent.class:138
|
||||
#: CComponent.class:139
|
||||
msgid "XML-RPC protocol"
|
||||
msgstr "Protocole XML-RPC"
|
||||
|
||||
@ -6127,7 +6131,7 @@ msgstr "Protocole XML-RPC"
|
||||
msgid "XPM"
|
||||
msgstr "-"
|
||||
|
||||
#: CComponent.class:139
|
||||
#: CComponent.class:140
|
||||
msgid "XSLT tools based on libxslt and libxml"
|
||||
msgstr "Outils XSLT basés sur libxslt et libxml"
|
||||
|
||||
|
@ -78,6 +78,7 @@ Static Private Sub InitComponentNames()
|
||||
$cName["gb"] = ("Internal native classes")
|
||||
$cName["gb.cairo"] = ("Cairo graphic library")
|
||||
$cName["gb.chart"] = ("Chart drawing")
|
||||
$cName["gb.complex"] = ("Complex numbers management")
|
||||
$cName["gb.compress"] = ("Compression & decompression")
|
||||
$cName["gb.crypt"] = ("MD5/DES crypting")
|
||||
$cName["gb.db"] = ("Database access")
|
||||
|
@ -480,8 +480,10 @@ GB_DESC ComplexDesc[] =
|
||||
// Utility Methods
|
||||
GB_METHOD("_new", NULL, Complex_new, "[(Real)f(Imag)f]"),
|
||||
GB_STATIC_METHOD("_call", "Complex", Complex_call, "[(Real)f(Imag)f]"),
|
||||
GB_STATIC_METHOD("Polar", "Complex", Complex_Polar, "[(Abs)f(Arg)f]"),
|
||||
|
||||
GB_METHOD("Copy", "Complex", Complex_Copy, NULL),
|
||||
GB_STATIC_METHOD("Polar", "Complex", Complex_Polar, "[(Real)f(Imag)f]"),
|
||||
|
||||
GB_METHOD("Conj", "Complex", Complex_Conjugate, NULL),
|
||||
GB_METHOD("Neg", "Complex", Complex_Negative, NULL),
|
||||
GB_METHOD("Inv", "Complex", Complex_Inverse, NULL),
|
||||
|
@ -1,5 +1,5 @@
|
||||
[Component]
|
||||
Key=__COMPONENT
|
||||
Name=__DESCRIPTION
|
||||
Author=
|
||||
Key=gb.gsl
|
||||
Author=Randall Morgan,Benoît Minisini
|
||||
Alpha=1
|
||||
Implements=Complex
|
||||
|
@ -110,6 +110,7 @@ lib/gui.opengl/Makefile \
|
||||
lib/image/Makefile \
|
||||
lib/image.effect/Makefile \
|
||||
lib/signal/Makefile \
|
||||
lib/complex/Makefile \
|
||||
])
|
||||
AC_OUTPUT
|
||||
|
||||
|
@ -1395,27 +1395,32 @@ END_METHOD
|
||||
|
||||
static CARRAY *_converted_array;
|
||||
|
||||
static void error_array_convert()
|
||||
static void error_convert()
|
||||
{
|
||||
OBJECT_UNREF(_converted_array, "error_array_convert");
|
||||
}
|
||||
|
||||
static bool array_convert(CARRAY *src, CLASS *class, VALUE *conv)
|
||||
static bool _convert(CARRAY *src, CLASS *class, VALUE *conv)
|
||||
{
|
||||
CARRAY *array;
|
||||
int i;
|
||||
void *data;
|
||||
VALUE temp;
|
||||
|
||||
if (!src || !TYPE_is_pure_object((TYPE)class) || !CLASS_inherits(class, CLASS_Array))
|
||||
if (!src || !TYPE_is_pure_object((TYPE)class))
|
||||
return TRUE;
|
||||
|
||||
CLASS_load(class); // Force creation of array classes
|
||||
|
||||
if (!class->is_array) //CLASS_inherits(class, CLASS_Array))
|
||||
return TRUE;
|
||||
|
||||
_converted_array = array = OBJECT_create(class, NULL, NULL, 0);
|
||||
|
||||
ARRAY_add_many_void(&array->data, src->count);
|
||||
array->count = src->count;
|
||||
|
||||
ON_ERROR(error_array_convert)
|
||||
|
||||
ON_ERROR(error_convert)
|
||||
{
|
||||
for (i = 0; i < src->count; i++)
|
||||
{
|
||||
@ -1437,7 +1442,7 @@ static bool array_convert(CARRAY *src, CLASS *class, VALUE *conv)
|
||||
|
||||
#include "gbx_c_array.h"
|
||||
|
||||
#define array_convert NULL
|
||||
#define _convert NULL
|
||||
|
||||
#endif /* #ifndef GBX_INFO */
|
||||
|
||||
@ -1485,7 +1490,7 @@ GB_DESC NATIVE_Array[] =
|
||||
GB_METHOD("Delete", "Array", Array_Extract, "(Start)i[(Length)i]"),
|
||||
GB_METHOD("Fill", NULL, Array_Fill, "(Value)v[(Start)i(Length)i]"),*/
|
||||
|
||||
GB_INTERFACE("_convert", array_convert),
|
||||
GB_INTERFACE("_convert", _convert),
|
||||
|
||||
GB_END_DECLARE
|
||||
};
|
||||
|
@ -1978,7 +1978,7 @@ void EXEC_push_complex(void)
|
||||
{
|
||||
if (COMPONENT_get_info("PUSH_COMPLEX", POINTER(&func)))
|
||||
{
|
||||
COMPONENT_load(COMPONENT_create("gb.gsl"));
|
||||
COMPONENT_load(COMPONENT_create("gb.complex"));
|
||||
if (COMPONENT_get_info("PUSH_COMPLEX", POINTER(&func)))
|
||||
THROW(E_MATH);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
SUBDIRS = . debug eval db compress vb option draw image gui gui.opengl image.effect signal
|
||||
SUBDIRS = . debug eval db compress vb option draw image gui gui.opengl image.effect signal complex
|
||||
|
||||
dist_gblib_DATA = gb.component
|
||||
gblib_DATA = gb.component
|
||||
|
14
main/lib/complex/Makefile.am
Normal file
14
main/lib/complex/Makefile.am
Normal file
@ -0,0 +1,14 @@
|
||||
COMPONENT = gb.complex
|
||||
include $(top_srcdir)/component.am
|
||||
|
||||
gblib_LTLIBRARIES = gb.complex.la
|
||||
|
||||
gb_complex_la_LIBADD = @MATH_LIB@
|
||||
gb_complex_la_LDFLAGS = -module @LD_FLAGS@
|
||||
gb_complex_la_CFLAGS = -I$(top_srcdir)/share $(AM_CFLAGS)
|
||||
|
||||
gb_complex_la_SOURCES = \
|
||||
ccomplex.h ccomplex.c \
|
||||
main.h main.c
|
||||
|
||||
|
388
main/lib/complex/ccomplex.c
Normal file
388
main/lib/complex/ccomplex.c
Normal file
@ -0,0 +1,388 @@
|
||||
/***************************************************************************
|
||||
|
||||
ccomplex.c
|
||||
|
||||
(c) 2000-2012 Benoît Minisini <gambas@users.sourceforge.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
MA 02110-1301, USA.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#define __CCOMPLEX_C
|
||||
|
||||
#include "ccomplex.h"
|
||||
|
||||
#define THIS ((CCOMPLEX *)_object)
|
||||
#define RE(_c) ((_c)->v[0])
|
||||
#define IM(_c) ((_c)->v[1])
|
||||
#define ABS(_c) (hypot(RE(_c), IM(_c)))
|
||||
#define ABS2(_c) (RE(_c) * RE(_c) + IM(_c) * IM(_c))
|
||||
#define ZERO(_c) (RE(_c) == 0.0 && IM(_c) == 0.0)
|
||||
|
||||
|
||||
//---- Complex number creation ----------------------------------------------
|
||||
|
||||
CCOMPLEX *COMPLEX_create(double re, double im)
|
||||
{
|
||||
static GB_CLASS CLASS_Complex = (GB_CLASS)NULL;
|
||||
CCOMPLEX *c;
|
||||
|
||||
if (!CLASS_Complex)
|
||||
CLASS_Complex = GB.FindClass("Complex");
|
||||
|
||||
c = (CCOMPLEX *)GB.New(CLASS_Complex, NULL, NULL);
|
||||
c->v[0] = re;
|
||||
c->v[1] = im;
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
CCOMPLEX *COMPLEX_push_complex(double value)
|
||||
{
|
||||
return COMPLEX_create(0, value);
|
||||
}
|
||||
|
||||
//---- Arithmetic operators -------------------------------------------------
|
||||
|
||||
static CCOMPLEX *_addf(CCOMPLEX *a, double f)
|
||||
{
|
||||
return COMPLEX_create(RE(a) + f, IM(a));
|
||||
}
|
||||
|
||||
static CCOMPLEX *_add(CCOMPLEX *a, CCOMPLEX *b)
|
||||
{
|
||||
return COMPLEX_create(RE(a) + RE(b), IM(a) + IM(b));
|
||||
}
|
||||
|
||||
static CCOMPLEX *_subf(CCOMPLEX *a, double f)
|
||||
{
|
||||
return COMPLEX_create(RE(a) - f, IM(a));
|
||||
}
|
||||
|
||||
static CCOMPLEX *_sub(CCOMPLEX *a, CCOMPLEX *b)
|
||||
{
|
||||
return COMPLEX_create(RE(a) - RE(b), IM(a) - IM(b));
|
||||
}
|
||||
|
||||
static CCOMPLEX *_mulf(CCOMPLEX *a, double f)
|
||||
{
|
||||
return COMPLEX_create(RE(a) * f, IM(a) * f);
|
||||
}
|
||||
|
||||
static CCOMPLEX *_mul(CCOMPLEX *a, CCOMPLEX *b)
|
||||
{
|
||||
return COMPLEX_create(RE(a) * RE(b) - IM(a) * IM(b), RE(a) * IM(b) + IM(a) * RE(b));
|
||||
}
|
||||
|
||||
static CCOMPLEX *_divf(CCOMPLEX *a, double f)
|
||||
{
|
||||
if (f == 0.0)
|
||||
return NULL;
|
||||
|
||||
return COMPLEX_create(RE(a) / f, IM(a) / f);
|
||||
}
|
||||
|
||||
static CCOMPLEX *_idivf(CCOMPLEX *a, double f)
|
||||
{
|
||||
if (ZERO(a))
|
||||
return NULL;
|
||||
|
||||
double s = ABS2(a);
|
||||
double re, im;
|
||||
|
||||
re = RE(a) / s;
|
||||
im = -IM(a) / s;
|
||||
|
||||
return COMPLEX_create(re * f, im * f);
|
||||
}
|
||||
|
||||
static CCOMPLEX *_div(CCOMPLEX *a, CCOMPLEX *b)
|
||||
{
|
||||
double ar = RE(a), ai = IM(a);
|
||||
double br = RE(b), bi = IM(b);
|
||||
|
||||
if (br == 0.0 && bi == 0.0)
|
||||
return NULL;
|
||||
|
||||
double s = 1.0 / ABS(b);
|
||||
|
||||
double sbr = s * br;
|
||||
double sbi = s * bi;
|
||||
|
||||
double zr = (ar * sbr + ai * sbi) * s;
|
||||
double zi = (ai * sbr - ar * sbi) * s;
|
||||
|
||||
return COMPLEX_create(zr, zi);
|
||||
}
|
||||
|
||||
static int _equal(CCOMPLEX *a, CCOMPLEX *b)
|
||||
{
|
||||
return RE(a) == RE(b) && IM(a) == IM(b);
|
||||
}
|
||||
|
||||
static int _equalf(CCOMPLEX *a, double f)
|
||||
{
|
||||
return RE(a) == f && IM(a) == 0;
|
||||
}
|
||||
|
||||
static double _abs(CCOMPLEX *a)
|
||||
{
|
||||
return ABS(a);
|
||||
}
|
||||
|
||||
static CCOMPLEX *_neg(CCOMPLEX *a)
|
||||
{
|
||||
return COMPLEX_create(-RE(a), -IM(a));
|
||||
}
|
||||
|
||||
static GB_OPERATOR_DESC _operators =
|
||||
{
|
||||
add: (void *)_add,
|
||||
addf: (void *)_addf,
|
||||
sub: (void *)_sub,
|
||||
subf: (void *)_subf,
|
||||
mul: (void *)_mul,
|
||||
mulf: (void *)_mulf,
|
||||
div: (void *)_div,
|
||||
divf: (void *)_divf,
|
||||
idivf: (void *)_idivf,
|
||||
equal: (void *)_equal,
|
||||
equalf: (void *)_equalf,
|
||||
abs: (void *)_abs,
|
||||
neg: (void *)_neg
|
||||
};
|
||||
|
||||
//---- Conversions ----------------------------------------------------------
|
||||
|
||||
char *COMPLEX_to_string(double real, double imag, bool local)
|
||||
{
|
||||
char buffer[64];
|
||||
char *p;
|
||||
char *str;
|
||||
int len;
|
||||
|
||||
if (real == 0.0 && imag == 0.0)
|
||||
return GB.NewString("0", 1);
|
||||
|
||||
p = buffer;
|
||||
|
||||
if (real != 0.0)
|
||||
{
|
||||
GB.NumberToString(local, real, NULL, &str, &len);
|
||||
strncpy(p, str, len);
|
||||
p += len;
|
||||
}
|
||||
|
||||
if (imag != 0.0)
|
||||
{
|
||||
if (imag < 0.0)
|
||||
{
|
||||
*p++ = '-';
|
||||
imag = (-imag);
|
||||
}
|
||||
else if (p != buffer)
|
||||
*p++ = '+';
|
||||
|
||||
if (imag != 1.0)
|
||||
{
|
||||
GB.NumberToString(local, imag, NULL, &str, &len);
|
||||
strncpy(p, str, len);
|
||||
p += len;
|
||||
}
|
||||
*p++ = 'i';
|
||||
}
|
||||
|
||||
return GB.NewString(buffer, p - buffer);
|
||||
}
|
||||
|
||||
static bool _convert(CCOMPLEX *a, GB_TYPE type, GB_VALUE *conv)
|
||||
{
|
||||
if (a)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case GB_T_FLOAT:
|
||||
conv->_float.value = ABS(a);
|
||||
return FALSE;
|
||||
|
||||
case GB_T_SINGLE:
|
||||
conv->_single.value = ABS(a);
|
||||
return FALSE;
|
||||
|
||||
case GB_T_INTEGER:
|
||||
case GB_T_SHORT:
|
||||
case GB_T_BYTE:
|
||||
conv->_integer.value = ABS(a);
|
||||
return FALSE;
|
||||
|
||||
case GB_T_LONG:
|
||||
conv->_long.value = ABS(a);
|
||||
return FALSE;
|
||||
|
||||
case GB_T_STRING:
|
||||
case GB_T_CSTRING:
|
||||
conv->_string.value.addr = COMPLEX_to_string(RE(a), IM(a), type == GB_T_CSTRING);
|
||||
conv->_string.value.start = 0;
|
||||
conv->_string.value.len = GB.StringLength(conv->_string.value.addr);
|
||||
return FALSE;
|
||||
|
||||
default:
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case GB_T_FLOAT:
|
||||
conv->_object.value = COMPLEX_create(conv->_float.value, 0);
|
||||
return FALSE;
|
||||
|
||||
case GB_T_SINGLE:
|
||||
conv->_object.value = COMPLEX_create(conv->_single.value, 0);
|
||||
return FALSE;
|
||||
|
||||
case GB_T_INTEGER:
|
||||
case GB_T_SHORT:
|
||||
case GB_T_BYTE:
|
||||
conv->_object.value = COMPLEX_create(conv->_integer.value, 0);
|
||||
return FALSE;
|
||||
|
||||
default:
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
BEGIN_METHOD(Complex_new, GB_FLOAT real; GB_FLOAT imag)
|
||||
|
||||
THIS->v[0] = VARGOPT(real, 0.0);
|
||||
THIS->v[1] = VARGOPT(imag, 0.0);
|
||||
|
||||
END_METHOD
|
||||
|
||||
|
||||
BEGIN_METHOD(Complex_call, GB_FLOAT real; GB_FLOAT imag)
|
||||
|
||||
GB.ReturnObject(COMPLEX_create(VARG(real), VARG(imag)));
|
||||
|
||||
END_METHOD
|
||||
|
||||
|
||||
BEGIN_METHOD_VOID(Complex_Copy)
|
||||
|
||||
GB.ReturnObject(COMPLEX_create(RE(THIS), IM(THIS)));
|
||||
|
||||
END_METHOD
|
||||
|
||||
|
||||
BEGIN_METHOD(Complex_Polar, GB_FLOAT abs; GB_FLOAT arg)
|
||||
|
||||
double mod = VARG(abs);
|
||||
double arg = VARG(arg);
|
||||
|
||||
GB.ReturnObject(COMPLEX_create(cos(arg) * mod, sin(arg) * mod));
|
||||
|
||||
END_METHOD
|
||||
|
||||
|
||||
BEGIN_METHOD_VOID(Complex_Arg)
|
||||
|
||||
if (ZERO(THIS))
|
||||
GB.ReturnFloat(0.0);
|
||||
else
|
||||
GB.ReturnFloat(atan2(IM(THIS), RE(THIS)));
|
||||
|
||||
END_METHOD
|
||||
|
||||
|
||||
BEGIN_METHOD_VOID(Complex_Abs)
|
||||
|
||||
GB.ReturnFloat(ABS(THIS));
|
||||
|
||||
END_METHOD
|
||||
|
||||
|
||||
BEGIN_METHOD_VOID(Complex_Abs2)
|
||||
|
||||
GB.ReturnFloat(ABS2(THIS));
|
||||
|
||||
END_METHOD
|
||||
|
||||
|
||||
BEGIN_PROPERTY(Complex_Real)
|
||||
|
||||
if (READ_PROPERTY)
|
||||
GB.ReturnFloat(RE(THIS));
|
||||
else
|
||||
THIS->v[0] = VPROP(GB_FLOAT);
|
||||
|
||||
END_PROPERTY
|
||||
|
||||
|
||||
BEGIN_PROPERTY(Complex_Imag)
|
||||
|
||||
if (READ_PROPERTY)
|
||||
GB.ReturnFloat(IM(THIS));
|
||||
else
|
||||
THIS->v[1] = VPROP(GB_FLOAT);
|
||||
|
||||
END_PROPERTY
|
||||
|
||||
|
||||
BEGIN_METHOD_VOID(Complex_Inv)
|
||||
|
||||
GB.ReturnObject(_divf(THIS, 1));
|
||||
|
||||
END_METHOD
|
||||
|
||||
|
||||
BEGIN_METHOD_VOID(Complex_Conj)
|
||||
|
||||
GB.ReturnObject(COMPLEX_create(RE(THIS), -IM(THIS)));
|
||||
|
||||
END_METHOD
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
GB_DESC ComplexDesc[] =
|
||||
{
|
||||
GB_DECLARE("Complex", sizeof(CCOMPLEX)),
|
||||
|
||||
// Utility Methods
|
||||
GB_METHOD("_new", NULL, Complex_new, "[(Real)f(Imag)f]"),
|
||||
GB_STATIC_METHOD("_call", "Complex", Complex_call, "[(Real)f(Imag)f]"),
|
||||
GB_STATIC_METHOD("Polar", "Complex", Complex_Polar, "[(Abs)f(Arg)f]"),
|
||||
|
||||
GB_METHOD("Copy", "Complex", Complex_Copy, NULL),
|
||||
|
||||
GB_METHOD("Conj", "Complex", Complex_Conj, NULL),
|
||||
GB_METHOD("Inv", "Complex", Complex_Inv, NULL),
|
||||
|
||||
GB_PROPERTY("Real", "f", Complex_Real),
|
||||
GB_PROPERTY("Imag", "f", Complex_Imag),
|
||||
|
||||
GB_METHOD("Abs", "f", Complex_Abs, NULL),
|
||||
GB_METHOD("Abs2", "f", Complex_Abs2, NULL),
|
||||
GB_METHOD("Arg", "f", Complex_Arg, NULL),
|
||||
|
||||
GB_INTERFACE("_operators", &_operators),
|
||||
GB_INTERFACE("_convert", &_convert),
|
||||
|
||||
GB_END_DECLARE
|
||||
};
|
44
main/lib/complex/ccomplex.h
Normal file
44
main/lib/complex/ccomplex.h
Normal file
@ -0,0 +1,44 @@
|
||||
/***************************************************************************
|
||||
|
||||
ccomplex.h
|
||||
|
||||
(c) 2000-2012 Benoît Minisini <gambas@users.sourceforge.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
MA 02110-1301, USA.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __CCOMPLEX_H
|
||||
#define __CCOMPLEX_H
|
||||
|
||||
#include "gambas.h"
|
||||
#include "main.h"
|
||||
|
||||
#ifndef __CDEBUG_C
|
||||
extern GB_DESC ComplexDesc[];
|
||||
#endif
|
||||
|
||||
typedef
|
||||
struct {
|
||||
GB_BASE ob;
|
||||
double v[2];
|
||||
}
|
||||
CCOMPLEX;
|
||||
|
||||
CCOMPLEX *COMPLEX_create(double re, double im);
|
||||
CCOMPLEX *COMPLEX_push_complex(double value);
|
||||
|
||||
#endif
|
4
main/lib/complex/gb.complex.component
Normal file
4
main/lib/complex/gb.complex.component
Normal file
@ -0,0 +1,4 @@
|
||||
[Component]
|
||||
Key=gb.component
|
||||
Author=Benoît Minisini
|
||||
Implements=Complex
|
58
main/lib/complex/main.c
Normal file
58
main/lib/complex/main.c
Normal file
@ -0,0 +1,58 @@
|
||||
/***************************************************************************
|
||||
|
||||
main.c
|
||||
|
||||
(c) 2000-2012 Benoît Minisini <gambas@users.sourceforge.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
MA 02110-1301, USA.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#define __MAIN_C
|
||||
|
||||
#include "gambas.h"
|
||||
#include "ccomplex.h"
|
||||
#include "main.h"
|
||||
|
||||
GB_INTERFACE GB EXPORT;
|
||||
|
||||
GB_DESC *GB_CLASSES[] EXPORT =
|
||||
{
|
||||
ComplexDesc,
|
||||
NULL
|
||||
};
|
||||
|
||||
int EXPORT GB_INIT(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EXPORT GB_EXIT()
|
||||
{
|
||||
}
|
||||
|
||||
int EXPORT GB_INFO(const char *key, void **value)
|
||||
{
|
||||
if (!strcasecmp(key, "PUSH_COMPLEX"))
|
||||
{
|
||||
*value = (void *)COMPLEX_push_complex;
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
34
main/lib/complex/main.h
Normal file
34
main/lib/complex/main.h
Normal file
@ -0,0 +1,34 @@
|
||||
/***************************************************************************
|
||||
|
||||
main.h
|
||||
|
||||
(c) 2000-2012 Benoît Minisini <gambas@users.sourceforge.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
MA 02110-1301, USA.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __MAIN_H
|
||||
#define __MAIN_H
|
||||
|
||||
#include "gambas.h"
|
||||
#include "gb_common.h"
|
||||
|
||||
#ifndef __MAIN_C
|
||||
extern GB_INTERFACE GB;
|
||||
#endif
|
||||
|
||||
#endif
|
Loading…
x
Reference in New Issue
Block a user