[GB.GSL]
* NEW: Skeleton for a new component based on the GNU Scientific Library. It will be developed by Randall Morgan. git-svn-id: svn://localhost/gambas/trunk@4428 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
0a9b6abe82
commit
d99b88d451
10 changed files with 286 additions and 1 deletions
76
TEMPLATE/conf/gb.gsl.conf
Normal file
76
TEMPLATE/conf/gb.gsl.conf
Normal file
|
@ -0,0 +1,76 @@
|
||||||
|
/* Copyrights */
|
||||||
|
#define __COPYRIGHT (c) 2012
|
||||||
|
#define __AUTHOR Randall Morgan
|
||||||
|
#define __EMAIL <rmorgan62@gmail.com>
|
||||||
|
|
||||||
|
/* Name of the component */
|
||||||
|
#define __COMPONENT gb.gsl
|
||||||
|
|
||||||
|
/* Name of the component with points replaced by underscore */
|
||||||
|
#define __COMPONENT_UNDERSCORE gb_gsl
|
||||||
|
|
||||||
|
/* Short name of the component */
|
||||||
|
#define __NAME gsl
|
||||||
|
|
||||||
|
/* Short name of the component in uppercase */
|
||||||
|
#define __UNAME GSL
|
||||||
|
|
||||||
|
/* Description of the component */
|
||||||
|
#define __DESCRIPTION GNU Scientific Library component
|
||||||
|
|
||||||
|
/* If the component detection uses pkg-config */
|
||||||
|
#define __USE_PKGCONFIG 1
|
||||||
|
|
||||||
|
#if __USE_PKGCONFIG
|
||||||
|
|
||||||
|
/* Name of the package for pkg-config */
|
||||||
|
#define __PKGCONFIG_NAME gsl
|
||||||
|
|
||||||
|
/* Minimum version needed */
|
||||||
|
#define __PKGCONFIG_VERSION
|
||||||
|
|
||||||
|
#else /* __USE_PKGCONFIG */
|
||||||
|
|
||||||
|
/* If your component uses C */
|
||||||
|
#define __USE_C 1
|
||||||
|
|
||||||
|
/* If your component uses C++ */
|
||||||
|
#define __USE_CPLUSPLUS 1
|
||||||
|
|
||||||
|
/* If your component uses multi-threading */
|
||||||
|
#define __USE_THREAD 0
|
||||||
|
|
||||||
|
/* If your component uses X-Window */
|
||||||
|
#define __USE_XWINDOW 0
|
||||||
|
|
||||||
|
/* Includes to search for */
|
||||||
|
#define __SEARCH_INCLUDE
|
||||||
|
|
||||||
|
/* Includes directories search path */
|
||||||
|
#define __SEARCH_INCLUDE_PATH /usr/local/lib /usr/local /usr/lib /usr
|
||||||
|
|
||||||
|
/* Includes sub-directories search */
|
||||||
|
#define __SEARCH_INCLUDE_DIR /usr/local/include gsl/include include gsl*/include gsl/*/include
|
||||||
|
|
||||||
|
/* Libraries to search for */
|
||||||
|
#define __SEARCH_LIBRARY libgsl.$SHLIBEXT
|
||||||
|
|
||||||
|
/* Libraries directories search path */
|
||||||
|
#define __SEARCH_LIBRARY_PATH /usr/local /usr
|
||||||
|
|
||||||
|
/* Libraries sub-directories search path */
|
||||||
|
#define __SEARCH_LIBRARY_DIR local/lib lib
|
||||||
|
|
||||||
|
/* Libraries to link with */
|
||||||
|
#define __LIBRARY libgsl
|
||||||
|
|
||||||
|
/* Includes to link with */
|
||||||
|
#define __INCLUDE libgsl
|
||||||
|
|
||||||
|
#endif /* __USE_PKGCONFIG */
|
||||||
|
|
||||||
|
/* Source file list */
|
||||||
|
#define __SOURCES main.c main.h c_gsl.c c_gsl.h
|
||||||
|
|
||||||
|
/* Main C/C++ source basename in uppercase */
|
||||||
|
#define __MAIN_UNAME MAIN
|
0
gb.gsl/NEWS
Normal file
0
gb.gsl/NEWS
Normal file
1
gb.gsl/component.am
Symbolic link
1
gb.gsl/component.am
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../component.am
|
11
gb.gsl/src/Makefile.am
Normal file
11
gb.gsl/src/Makefile.am
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
COMPONENT = gb.gsl
|
||||||
|
include $(top_srcdir)/component.am
|
||||||
|
|
||||||
|
INCLUDES = @GSL_INC@
|
||||||
|
|
||||||
|
gblib_LTLIBRARIES = gb.gsl.la
|
||||||
|
|
||||||
|
gb_gsl_la_LIBADD = @GSL_LIB@
|
||||||
|
gb_gsl_la_LDFLAGS = -module @LD_FLAGS@ @GSL_LDFLAGS@
|
||||||
|
|
||||||
|
gb_gsl_la_SOURCES = main.c main.h c_gsl.c c_gsl.h
|
58
gb.gsl/src/c_gsl.c
Normal file
58
gb.gsl/src/c_gsl.c
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
/***************************************************************************
|
||||||
|
|
||||||
|
gsl.c
|
||||||
|
|
||||||
|
gb.gsl component
|
||||||
|
|
||||||
|
(c) 2012 Randall Morgan <rmorgan62@gmail.com>
|
||||||
|
|
||||||
|
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 1, 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 __C_GSL_C
|
||||||
|
#define __C_GSL_C
|
||||||
|
|
||||||
|
#include "gambas.h"
|
||||||
|
#include "gb_common.h"
|
||||||
|
#include "c_gsl.h"
|
||||||
|
//#include "/usr/local/include/gsl/gsl_math.h"
|
||||||
|
#include <gsl/gsl_sf.h>
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*-----------------------------------------------
|
||||||
|
Small Integer Power Functions
|
||||||
|
-----------------------------------------------*/
|
||||||
|
BEGIN_METHOD(GSL_INTPOW2, GB_INTEGER x;)
|
||||||
|
// Return x^2 using a small int safe method
|
||||||
|
// call gsl native function double gsl_pow_2(int x)
|
||||||
|
GB.ReturnFloat(gsl_pow_2(VARG(x)));
|
||||||
|
END_METHOD
|
||||||
|
|
||||||
|
/**************************************************
|
||||||
|
Describe Class properties and methods to Gambas
|
||||||
|
**************************************************/
|
||||||
|
GB_DESC CGslDesc[] =
|
||||||
|
{
|
||||||
|
GB_DECLARE("GSL",0), GB_NOT_CREATABLE(),
|
||||||
|
|
||||||
|
GB_METHOD("IntPow", "f", GSL_INTPOW2, "(x)f"),
|
||||||
|
|
||||||
|
GB_END_DECLARE
|
||||||
|
};
|
||||||
|
|
||||||
|
|
37
gb.gsl/src/c_gsl.h
Normal file
37
gb.gsl/src/c_gsl.h
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
/***************************************************************************
|
||||||
|
|
||||||
|
c_gsl.h
|
||||||
|
|
||||||
|
gb.gsl component
|
||||||
|
|
||||||
|
(c) 2012 Randall Morgan <rmorgan62@gmail.com>
|
||||||
|
|
||||||
|
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 1, 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 __C_GSL_H
|
||||||
|
#define __C_GSL_H
|
||||||
|
|
||||||
|
#include "gambas.h"
|
||||||
|
|
||||||
|
GB_INTERFACE GB EXPORT;
|
||||||
|
|
||||||
|
extern GB_DESC CGslDesc[];
|
||||||
|
|
||||||
|
//extern GSL_INTPOW2;
|
||||||
|
|
||||||
|
#endif /* __C_GSL_H */
|
5
gb.gsl/src/gb.gsl.component
Normal file
5
gb.gsl/src/gb.gsl.component
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
[Component]
|
||||||
|
Key=__COMPONENT
|
||||||
|
Name=__DESCRIPTION
|
||||||
|
Author=
|
||||||
|
Alpha=1
|
60
gb.gsl/src/main.c
Normal file
60
gb.gsl/src/main.c
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
/***************************************************************************
|
||||||
|
|
||||||
|
main.c
|
||||||
|
|
||||||
|
gb.gsl component
|
||||||
|
|
||||||
|
(c) 2012 Randall Morgan <rmorgan62@gmail.com>
|
||||||
|
|
||||||
|
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 1, 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 "main.h"
|
||||||
|
#include "c_gsl.h"
|
||||||
|
#include "gambas.h"
|
||||||
|
#include "gb_common.h"
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
GB_INTERFACE GB EXPORT;
|
||||||
|
|
||||||
|
GB_DESC *GB_CLASSES[] EXPORT =
|
||||||
|
{
|
||||||
|
CGslDesc,
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
int EXPORT GB_INIT(void)
|
||||||
|
{
|
||||||
|
//CLASS_GSL = GB.FindClass("CGsl");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void EXPORT GB_EXIT()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef _cpluscplus
|
||||||
|
}
|
||||||
|
#endif
|
37
gb.gsl/src/main.h
Normal file
37
gb.gsl/src/main.h
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
/***************************************************************************
|
||||||
|
|
||||||
|
main.h
|
||||||
|
|
||||||
|
gb.gsl component
|
||||||
|
|
||||||
|
(c) 2012 Randall Morgan <rmorgan62@gmail.com>
|
||||||
|
|
||||||
|
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 1, 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 "c_gsl.h"
|
||||||
|
|
||||||
|
#ifndef __MAIN_C
|
||||||
|
extern GB_CLASS CGslDesc[];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __MAIN_H */
|
|
@ -191,7 +191,7 @@ GEditor::GEditor(QWidget *parent)
|
||||||
updateFont();
|
updateFont();
|
||||||
|
|
||||||
blinkTimer = new QTimer(this);
|
blinkTimer = new QTimer(this);
|
||||||
//connect(blinkTimer, SIGNAL(timeout()), this, SLOT(blinkTimerTimeout()));
|
connect(blinkTimer, SIGNAL(timeout()), this, SLOT(blinkTimerTimeout()));
|
||||||
//startBlink();
|
//startBlink();
|
||||||
|
|
||||||
scrollTimer = new QTimer(this);
|
scrollTimer = new QTimer(this);
|
||||||
|
|
Loading…
Reference in a new issue