From tobias at ...692... Wed Mar 28 22:14:53 2012 From: tobias at ...692... (tobi) Date: Wed, 28 Mar 2012 22:14:53 +0200 Subject: [Gambas-devel] ncurses component Message-ID: <20120328201453.GA25613@...693...> hi, i'm getting started writing an ncurses component for gambas which in turn gets me started with programming my first gambas component in c. as being redirected from the gambas-user list by Beno?t, this message is almost the same as there: after having to read about those nifty configure scripts, i'm to face the first obstacle. this code works: ----- ' Gambas module file Public Sub Main() NCurses.On() NCurses.Print("this is text", 10, 10) NCurses.Attributes = NCurses.Bold Or NCurses.Reverse Print " this is a brave test." NCurses.Print("next line", , 11) NCurses.WaitKey() NCurses.Off() End ----- but as the docs about programming components in c/c++ reasonably say, this is rather c-style and not suitable for the gambas language. (at the moment, there is one static object NCurses - i want to discover the api further before writing any serious classes). the Print() _function_ takes optionally x,y coordinates from which to print the text using ncurses. i thought, it would be better to just use the Print instruction to print text instead of this function all over again - this is just not aesthetic (but bearable?). while the Print _instruction_ works fine so far - tried also with multiple ncurses WINDOWs present - it always prints after the current cursor position, no matter what's there. that's the same with the ncurses functions, the main and actual problem is that i turned on some attributes which are handled by the library, too. the text from the Print instruction doesn't get bold and video reversed. consequently, one may never use Print instruction to stdout in ncurses mode and this option has departed... i had the weirdest ideas of redirecting stdout to a stream object inside the ncurses component, reading from that and printing the data with the ncurses functions, but that's way too strange... any suggestions/ideas about a suitable interface for something that fundamental? or may the above code fit? (i appear to not often use the ncurses mvwprintw() in any bigger thing without having built a wrapper around it or controlled it via a loop, so this may really fit as is...) what is your opinion now? From gambas at ...1... Wed Mar 28 23:04:20 2012 From: gambas at ...1... (=?ISO-8859-1?Q?Beno=EEt_Minisini?=) Date: Wed, 28 Mar 2012 23:04:20 +0200 Subject: [Gambas-devel] ncurses component In-Reply-To: <20120328201453.GA25613@...693...> References: <20120328201453.GA25613@...693...> Message-ID: <4F737CD4.7050305@...1...> Le 28/03/2012 22:14, tobi a ?crit : > hi, > > i'm getting started writing an ncurses component for gambas which in turn gets me started with > programming my first gambas component in c. as being redirected from the gambas-user list by > Beno?t, this message is almost the same as there: I told you to come there just not to mix user questions and development questions. > > after having to read about those nifty configure scripts, i'm to face the first obstacle. > this code works: > > ----- > ' Gambas module file > > Public Sub Main() > > NCurses.On() > NCurses.Print("this is text", 10, 10) > NCurses.Attributes = NCurses.Bold Or NCurses.Reverse > Print " this is a brave test." > NCurses.Print("next line", , 11) > NCurses.WaitKey() > NCurses.Off() > > End > ----- > > but as the docs about programming components in c/c++ reasonably say, this is rather c-style and > not suitable for the gambas language. (at the moment, there is one static object NCurses - i want > to discover the api further before writing any serious classes). One must study the NCurses API to see if we can make it easier for the final user, and/or make it object-oriented (i.e. does the API manipulate some kind of objects through pointer to structures?) > > the Print() _function_ takes optionally x,y coordinates from which to print the text using ncurses. > i thought, it would be better to just use the Print instruction to print text instead of this > function all over again - this is just not aesthetic (but bearable?). > while the Print _instruction_ works fine so far - tried also with multiple ncurses WINDOWs > present - it always prints after the current cursor position, no matter what's there. that's the > same with the ncurses functions, the main and actual problem is that i turned on some attributes > which are handled by the library, too. the text from the Print instruction doesn't get bold and > video reversed. consequently, one may never use Print instruction to stdout in ncurses mode and > this option has departed... > i had the weirdest ideas of redirecting stdout to a stream object inside the ncurses component, > reading from that and printing the data with the ncurses functions, but that's way too strange... > > any suggestions/ideas about a suitable interface for something that fundamental? or may the above > code fit? (i appear to not often use the ncurses mvwprintw() in any bigger thing without having > built a wrapper around it or controlled it via a loop, so this may really fit as is...) > > what is your opinion now? > You can create a Window class that will represent a ncurses window, and put all window related methods and properties in it. You could have a special Window object that represent the default screen. A funny thing: the Window class could have methods and properties to mimic the old Basic syntax: LOCATE (to move the cursor), CLS (to clear the screen), PEN and PAPER (to change the foreground and background color, this is the AMSTRAD syntax). Like the gb.net component with the Socket class, you can make a Window object that will inherit Stream. When using PRINT on the Window object, your stream write function will be called. Then you will be able to call the ncurses function from there and print to the window. That does not prevent your Window class from having a Print method. It just allows the user to use two different ways to do the same thing. Now I will add a gb.ncurses component directory to the source code with nothing in it (except the basic files). Then you will modify them, adding what you have already written, and so on, by using subversion. For that, I need your sourceforge account name to grant you a write access to the repository. Regards, -- Beno?t Minisini From tobias at ...692... Wed Mar 28 23:21:30 2012 From: tobias at ...692... (tobi) Date: Wed, 28 Mar 2012 23:21:30 +0200 Subject: [Gambas-devel] ncurses component In-Reply-To: <4F737CD4.7050305@...1...> References: <20120328201453.GA25613@...693...> <4F737CD4.7050305@...1...> Message-ID: <20120328212130.GA25680@...693...> On Wed, 28 Mar 2012, Beno?t Minisini wrote: > Le 28/03/2012 22:14, tobi a ?crit : > > hi, > > > > i'm getting started writing an ncurses component for gambas which in turn gets me started with > > programming my first gambas component in c. as being redirected from the gambas-user list by > > Beno?t, this message is almost the same as there: > > I told you to come there just not to mix user questions and development > questions. yes, i had an odd feeling asking that question there, too... > > > > > after having to read about those nifty configure scripts, i'm to face the first obstacle. > > this code works: > > > > ----- > > ' Gambas module file > > > > Public Sub Main() > > > > NCurses.On() > > NCurses.Print("this is text", 10, 10) > > NCurses.Attributes = NCurses.Bold Or NCurses.Reverse > > Print " this is a brave test." > > NCurses.Print("next line", , 11) > > NCurses.WaitKey() > > NCurses.Off() > > > > End > > ----- > > > > but as the docs about programming components in c/c++ reasonably say, this is rather c-style and > > not suitable for the gambas language. (at the moment, there is one static object NCurses - i want > > to discover the api further before writing any serious classes). > > One must study the NCurses API to see if we can make it easier for the > final user, and/or make it object-oriented (i.e. does the API manipulate > some kind of objects through pointer to structures?) > > > > > the Print() _function_ takes optionally x,y coordinates from which to print the text using ncurses. > > i thought, it would be better to just use the Print instruction to print text instead of this > > function all over again - this is just not aesthetic (but bearable?). > > while the Print _instruction_ works fine so far - tried also with multiple ncurses WINDOWs > > present - it always prints after the current cursor position, no matter what's there. that's the > > same with the ncurses functions, the main and actual problem is that i turned on some attributes > > which are handled by the library, too. the text from the Print instruction doesn't get bold and > > video reversed. consequently, one may never use Print instruction to stdout in ncurses mode and > > this option has departed... > > i had the weirdest ideas of redirecting stdout to a stream object inside the ncurses component, > > reading from that and printing the data with the ncurses functions, but that's way too strange... > > > > any suggestions/ideas about a suitable interface for something that fundamental? or may the above > > code fit? (i appear to not often use the ncurses mvwprintw() in any bigger thing without having > > built a wrapper around it or controlled it via a loop, so this may really fit as is...) > > > > what is your opinion now? > > > > You can create a Window class that will represent a ncurses window, and > put all window related methods and properties in it. > > You could have a special Window object that represent the default screen. > > A funny thing: the Window class could have methods and properties to > mimic the old Basic syntax: LOCATE (to move the cursor), CLS (to clear > the screen), PEN and PAPER (to change the foreground and background > color, this is the AMSTRAD syntax). > > Like the gb.net component with the Socket class, you can make a Window > object that will inherit Stream. When using PRINT on the Window object, > your stream write function will be called. Then you will be able to call > the ncurses function from there and print to the window. > > That does not prevent your Window class from having a Print method. It > just allows the user to use two different ways to do the same thing. > > Now I will add a gb.ncurses component directory to the source code with > nothing in it (except the basic files). Then you will modify them, > adding what you have already written, and so on, by using subversion. > For that, I need your sourceforge account name to grant you a write > access to the repository. > > Regards, > > -- > Beno?t Minisini > i'm already probing with that very Window class, but had a slightly different approach just because i don't know of the old basic syntaxes (the funning thing i thought of was mirroring parts of the gb.qt4/gb.gtk Windows to ncurses), i'll take a look on the basic syntaxes soon, it's kind of general knowledge... maybe as soon as i'll create an account on sourceforge... (the most probably tomorrow, sorry) i tried to figure out something like the inheritance of a Stream but i lacked knowledge of internal stream behaviour, i.e. if i could overwrite whatever is used to process incoming data. regards, tobi From gambas at ...1... Thu Mar 29 02:49:45 2012 From: gambas at ...1... (=?ISO-8859-1?Q?Beno=EEt_Minisini?=) Date: Thu, 29 Mar 2012 02:49:45 +0200 Subject: [Gambas-devel] ChangeLog and gb.gsl Message-ID: <4F73B1A9.4040109@...1...> I'm currently making the ChangeLog for Gambas 3.1 This ChangeLog is automatically generated from the subversion commit log. That works only if the developer *carefully* follow the log syntax described in the wiki. Here is the generated ChangeLog for gb.gsl: --8<-------------------------------------------------------------------- [GB.GSL] * FIX: Reverting back to 4430 to solve issue with mistaken template files. testing function. testing function. I still have a Null "THIS" Pointer in class methods. Hoping for some clarification from someone. Anyone? As to why this occurs in the GslComplex_Add method. Also moved THIS declaration to source file And declared complex_create() in header. * DEV: Experimenting with memory allocation for polynomial coefficients. Moved frexp to c_gsl where it belongs. Renamed static *create_complex() in the complex class to GSLComplex_create() so that it could be used in other compenent files. Added initial methods to CPolynomial class. CPolynomial_SolveQuadratic methods. values from internal data array. Also added Out of bounds error if the number of coefficients is incorrect for the called method. the subversion repository. * BUG: Fix implementation and declaration of Gsl.IntPow2(). * BUG: Add missing files. * BUG: Forgot one file yet. * BUG: Fixed return value for Fcpmb function. * BUG: Fixed error including development file. * BUG: Changed the name of the method LogLP to Log1p and Expml to Expm1. * BUG: Fixed case in method name Log1p. * BUG: Removed call to development file. * BUG: Renamed IsINF to IsInf and IsNAN to IsNan for consistancy. * BUG: Uploaded bare minimum code for review. I still have a Null "THIS" Pointer in class methods. Hoping for some clarification from someone. Anyone? As to why this occurs in the GslComplex_Add method. * BUG: Update Makefile.am with new source files. * BUG: Changed function prototypes in all files to use upper case variable names (xf) to (X)f. Moved frexp to c_gsl where it belongs. * BUG: Fixed filenames in file headers. Renamed static *create_complex() in the complex class to GSLComplex_create() so that it could be used in other compenent files. * BUG: Fixed error in GslComplex_Pow method declaration. * BUG: Fixed issue with incorrect return type in CPolynomial_SolveCudic and CPolynomial_SolveQuadratic methods. * BUG: Commented out bad line of code that cause the component to fail to compile. * BUG: Remove from the Test project the files that must not be present in the subversion repository. * NEW: Skeleton for a new component based on the GNU Scientific Library. It will be developed by Randall Morgan. * NEW: Added elementary math function and number testing function. * NEW: Added additional elementary math function and number testing function. * NEW: Added IntPow() function to library. * NEW: Added gsl_complex development files. * NEW: Added Complex method skeletons still under development. * NEW: Added Class Constance. * NEW: Add a complex dynamic constructor. * NEW: Add a complex static constructor _call(). * NEW: Add Complex.Copy(). * NEW: Add Complex.ToString(). * NEW: Alpha release of Complex Number class. * NEW: Added Set, Rect, and Polar Methods. Also moved THIS declaration to source file And declared complex_create() in header. * NEW: Added skeleton Polynomial Class. * NEW: Added Frexp function to Complex Class. * NEW: Changed Frexp function to Static method. * NEW: Testing Array data handling methods for Polynomial class. * NEW: Added ComplexPolynomial and NewtonPolynomial class files. * NEW: Added Arg, Abs, Abs2, and LogAbs methods to Complex class. * NEW: Added Hypot3 function to GSL class. Added initial methods to CPolynomial class. * NEW: Change CPolynomial_SolveQuadratic and CPolynomial_SolveCubic to use values from internal data array. Also added Out of bounds error if the number of coefficients is incorrect for the called method. * NEW: Added Test Suite Gambas Project to GSL Component. * NEW: Updating development code. [GB.GSL] * FIX: Reverting back to 4430 to solve issu] [GB.GSL] * NEW: Initial commit of working code. Currentl] --8<-------------------------------------------------------------------- So please Randall: try to be careful so that I don't lose half an hour to reformat all that mess! This is not serious as for now gb.gsl is in alpha state, but next time I will call Chuck Norris. :-) -- Beno?t Minisini From gambas at ...1... Thu Mar 29 03:09:56 2012 From: gambas at ...1... (=?ISO-8859-1?Q?Beno=EEt_Minisini?=) Date: Thu, 29 Mar 2012 03:09:56 +0200 Subject: [Gambas-devel] ChangeLog and gb.gsl In-Reply-To: <4F73B1A9.4040109@...1...> References: <4F73B1A9.4040109@...1...> Message-ID: <4F73B664.1@...1...> Le 29/03/2012 02:49, Beno?t Minisini a ?crit : > I'm currently making the ChangeLog for Gambas 3.1 > > This ChangeLog is automatically generated from the subversion commit > log. That works only if the developer *carefully* follow the log syntax > described in the wiki. > > Here is the generated ChangeLog for gb.gsl: >... > > So please Randall: try to be careful so that I don't lose half an hour > to reformat all that mess! This is not serious as for now gb.gsl is in > alpha state, but next time I will call Chuck Norris. :-) > Randall : can you just tell me the list of features currently implemented in gb.gsl. I will just add that to the ChangeLog. Thanks in advance. Regards, -- Beno?t Minisini From rmorgan62 at ...176... Thu Mar 29 06:44:20 2012 From: rmorgan62 at ...176... (Randall Morgan) Date: Wed, 28 Mar 2012 21:44:20 -0700 Subject: [Gambas-devel] ChangeLog and gb.gsl In-Reply-To: <4F73B664.1@...1...> References: <4F73B1A9.4040109@...1...> <4F73B664.1@...1...> Message-ID: Currently the project is still under development. The basic math functions are mostly complete as well as the basic complex number functions. Work has taken me away from this project at the moment but I will continue development as soon as possible. 2012/3/28 Beno?t Minisini > Le 29/03/2012 02:49, Beno?t Minisini a ?crit : > > I'm currently making the ChangeLog for Gambas 3.1 > > > > This ChangeLog is automatically generated from the subversion commit > > log. That works only if the developer *carefully* follow the log syntax > > described in the wiki. > > > > Here is the generated ChangeLog for gb.gsl: > >... > > > > So please Randall: try to be careful so that I don't lose half an hour > > to reformat all that mess! This is not serious as for now gb.gsl is in > > alpha state, but next time I will call Chuck Norris. :-) > > > > Randall : can you just tell me the list of features currently > implemented in gb.gsl. I will just add that to the ChangeLog. > > Thanks in advance. > > Regards, > > -- > Beno?t Minisini > > > ------------------------------------------------------------------------------ > This SF email is sponsosred by: > Try Windows Azure free for 90 days Click Here > http://p.sf.net/sfu/sfd2d-msazure > _______________________________________________ > Gambas-devel mailing list > Gambas-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-devel > -- If you ask me if it can be done. The answer is YES, it can always be done. The correct questions however are... What will it cost, and how long will it take? -------------- next part -------------- An HTML attachment was scrubbed... URL: