From tobias at ...692... Sun Apr 1 20:13:13 2012 From: tobias at ...692... (tobi) Date: Sun, 1 Apr 2012 20:13:13 +0200 Subject: [Gambas-devel] component documentation Message-ID: <20120401181313.GF577@...693...> hi, i just wanted to ask if there is any preferred format of documentation for a new component. more precisely: how would i document a component so that it may get onto gambasdoc.org easily? i looked at most components and none provided any sort of useful documentation... (i'm afraid, there is no automatism ;)) regards, tobi From gambas at ...1... Sun Apr 1 20:48:51 2012 From: gambas at ...1... (=?ISO-8859-1?Q?Beno=EEt_Minisini?=) Date: Sun, 01 Apr 2012 20:48:51 +0200 Subject: [Gambas-devel] component documentation In-Reply-To: <20120401181313.GF577@...693...> References: <20120401181313.GF577@...693...> Message-ID: <4F78A313.8020802@...1...> Le 01/04/2012 20:13, tobi a ?crit : > hi, > > i just wanted to ask if there is any preferred format of documentation for a new component. more > precisely: how would i document a component so that it may get onto gambasdoc.org easily? > i looked at most components and none provided any sort of useful documentation... > (i'm afraid, there is no automatism ;)) > > regards, > tobi > You should write your documentation entirely inside the wiki. The wiki generates for you the list of classes in the component page, the lists of symbols in a class page, and the syntax in the symbol documentation page. Everything is based on the *.info and *.list files of the component generated by the gbi3 program. But nothing prevents you from adding more documentation than just a brief description of all methods, properties, constants and events. Regards, -- Beno?t Minisini From gambas at ...1... Sun Apr 1 21:13:52 2012 From: gambas at ...1... (=?ISO-8859-1?Q?Beno=EEt_Minisini?=) Date: Sun, 01 Apr 2012 21:13:52 +0200 Subject: [Gambas-devel] ncurses component In-Reply-To: <20120328212130.GA25680@...693...> References: <20120328201453.GA25613@...693...> <4F737CD4.7050305@...1...> <20120328212130.GA25680@...693...> Message-ID: <4F78A8F0.1060404@...1...> Le 28/03/2012 23:21, tobi a ?crit : > > > 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 > As an example of how to implement a stream class, you can look at the Socket class in the gb.net sources ('CSocket.h' & 'CSocket.c' files). In a few words: (1) You must declare your object structure that way: typedef struct { GB_BASE ob; GB_STREAM stream; ... } MYCLASS; (2) You must declare a structure that represents all stream methods: GB_STREAM_DESC MyClassStream = { open: MyClassStream_open, close: MyClassStream_close, read: MyClassStream_read, write: MyClassStream_write, seek: MyClassStream_seek, tell: MyClassStream_tell, flush: MyClassStream_flush, eof: MyClassStream_eof, lof: MyClassStream_lof, handle: MyClassStream_handle }; Each stream method must have a specific declaration, as specified in the GB_STREAM_DESC declaration in 'gambas.h' (3) When you open the stream (in your case it should be as soon as the object is created, inside the constructor), you must initialize your object with the previous structure: #define THIS ((MYCLASS *)_object) BEGIN_METHOD_VOID(MyClass_new) ... THIS->stream.desc = &MyClassStream; END_METHOD I hope that things are clearer now. Regards, -- Beno?t Minisini From tobias at ...692... Sun Apr 1 21:28:20 2012 From: tobias at ...692... (tobi) Date: Sun, 1 Apr 2012 21:28:20 +0200 Subject: [Gambas-devel] ncurses component In-Reply-To: <4F78A8F0.1060404@...1...> References: <20120328201453.GA25613@...693...> <4F737CD4.7050305@...1...> <20120328212130.GA25680@...693...> <4F78A8F0.1060404@...1...> Message-ID: <20120401192820.GI577@...693...> On Sun, 01 Apr 2012, Beno?t Minisini wrote: > Le 28/03/2012 23:21, tobi a ?crit : > > > > > > 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 > > > > As an example of how to implement a stream class, you can look at the > Socket class in the gb.net sources ('CSocket.h' & 'CSocket.c' files). > > In a few words: > > > (1) You must declare your object structure that way: > > typedef > struct { > GB_BASE ob; > GB_STREAM stream; > ... > } > MYCLASS; > > > (2) You must declare a structure that represents all stream methods: > > GB_STREAM_DESC MyClassStream = > { > open: MyClassStream_open, > close: MyClassStream_close, > read: MyClassStream_read, > write: MyClassStream_write, > seek: MyClassStream_seek, > tell: MyClassStream_tell, > flush: MyClassStream_flush, > eof: MyClassStream_eof, > lof: MyClassStream_lof, > handle: MyClassStream_handle > }; > > Each stream method must have a specific declaration, as specified in the > GB_STREAM_DESC declaration in 'gambas.h' > > > (3) When you open the stream (in your case it should be as soon as the > object is created, inside the constructor), you must initialize your > object with the previous structure: > > #define THIS ((MYCLASS *)_object) > > BEGIN_METHOD_VOID(MyClass_new) > > ... > THIS->stream.desc = &MyClassStream; > > END_METHOD > > > I hope that things are clearer now. > > 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 > i learned almost entirely about the api until now from the CSocket class (virtual classes from gb.pcre). it covers pretty much things. (btw: a comment on the GB_BASE structure should be added to the howto page on c/c++ development, i wondered why my pointers were incremented after object instanciation ;)) thanks for the introduction, it will save me a considerable amount of time. From tobias at ...692... Wed Apr 4 18:54:52 2012 From: tobias at ...692... (tobi) Date: Wed, 4 Apr 2012 18:54:52 +0200 Subject: [Gambas-devel] Provide special auto-instance of a class Message-ID: <20120404165452.GM8434@...693...> Hi, I have a non-static class and want to derive a special object of it upon class load. The GB_AUTO_CREATABLE() macro doesn't really help because it's not about an ordinary object, I have to insert special values. The best would be if I could derive an object from that class, modify it behind the scenes and provide it for project-global use under a certain name. I read that there are no project-global variables in Gambas (I actually never needed them) so this is not an option. As an alternative I'd create a new static auto-creatable class that just inherits my ordinary class and overwrites its _new() special method. Despite I'm optimistic about that approach I want to ask if there is an even more elegant way? (I also can't think of any class that does suchlike, it's maybe just beyond my daily use of Gambas) In particular, if it helps, it is about: The ncurses library provides an stdscr window after being initialised which represents the terminal in full dimensions. I wrote an (almost working) window class in which stdscr shall be encapsulated upon ncurses instanciation. Regards, Tobi From tobias at ...692... Thu Apr 5 01:25:28 2012 From: tobias at ...692... (tobi) Date: Thu, 5 Apr 2012 01:25:28 +0200 Subject: [Gambas-devel] Provide special auto-instance of a class In-Reply-To: <20120404165452.GM8434@...693...> References: <20120404165452.GM8434@...693...> Message-ID: <20120404232528.GI12143@...693...> Me again, > Hi, > > I have a non-static class and want to derive a special object of it upon class load. The > GB_AUTO_CREATABLE() macro doesn't really help because it's not about an ordinary object, I have to > insert special values. The best would be if I could derive an object from that class, modify it > behind the scenes and provide it for project-global use under a certain name. I read that there are > no project-global variables in Gambas (I actually never needed them) so this is not an option. > As an alternative I'd create a new static auto-creatable class that just inherits my ordinary class > and overwrites its _new() special method. Despite I'm optimistic about that approach I want to ask > if there is an even more elegant way? (I also can't think of any class that does suchlike, it's > maybe just beyond my daily use of Gambas) > > In particular, if it helps, it is about: The ncurses library provides an stdscr window after being > initialised which represents the terminal in full dimensions. I wrote an (almost working) window > class in which stdscr shall be encapsulated upon ncurses instanciation. > > Regards, > Tobi > I wonder what's wrong with this: GB_DESC CWindowDesc[] = { GB_DECLARE("Window", sizeof(struct nc_window)), ... GB_METHOD("_new", NULL, CWindow_new, "(x)i(y)i(w)i(h)i"), ... }; GB_DESC CStdscrDesc[] = { GB_DECLARE("Stdscr", sizeof(struct nc_window)), GB_INHERITS("Window"), GB_AUTO_CREATABLE(), GB_METHOD("_new", NULL, CStdscr_new, NULL), GB_END_DECLARE }; It gives a "Not enough arguments" error as soon as I use the Stdscr class, thus on its auto-creation. If i replace GB_AUTO_CREATABLE() with GB_NOT_CREATABLE() the program starts but of course I can't do anything with its properties (wait a minute, not-creatable means that _new() isn't called at all?). I am able to overwrite the inherited function? I'm sure I misunderstand something about inheritance or those IDs. Could anyone point me to the right way? Regards, Tobi From gambas at ...1... Thu Apr 5 02:20:40 2012 From: gambas at ...1... (=?ISO-8859-1?Q?Beno=EEt_Minisini?=) Date: Thu, 05 Apr 2012 02:20:40 +0200 Subject: [Gambas-devel] Provide special auto-instance of a class In-Reply-To: <20120404232528.GI12143@...693...> References: <20120404165452.GM8434@...693...> <20120404232528.GI12143@...693...> Message-ID: <4F7CE558.6060400@...1...> Le 05/04/2012 01:25, tobi a ?crit : > Me again, > > ... > > I wonder what's wrong with this: > > GB_DESC CWindowDesc[] = { GB_DECLARE("Window", sizeof(struct > nc_window)), ... GB_METHOD("_new", NULL, CWindow_new, > "(x)i(y)i(w)i(h)i"), ... }; > > GB_DESC CStdscrDesc[] = { GB_DECLARE("Stdscr", sizeof(struct > nc_window)), GB_INHERITS("Window"), GB_AUTO_CREATABLE(), > > GB_METHOD("_new", NULL, CStdscr_new, NULL), > > GB_END_DECLARE }; > > It gives a "Not enough arguments" error as soon as I use the Stdscr > class, thus on its auto-creation. If i replace GB_AUTO_CREATABLE() > with GB_NOT_CREATABLE() the program starts but of course I can't do > anything with its properties (wait a minute, not-creatable means that > _new() isn't called at all?). I am able to overwrite the inherited > function? I'm sure I misunderstand something about inheritance or > those IDs. Could anyone point me to the right way? > > Regards, Tobi > Because all constructors all called when you use inheritance, and each constructor consume arguments. This is explained in the "Gambas object model" page on the wiki. So I suggest you do differently, as I did in the gb.db component. In the gb.db component, you have a Connection class and a DB static class that has the same methods and properties as the Connection class, except that they are all static. So: 1) Make your 'Window' class as you did. 2) Create a 'StdScr' class with the same methods and properties, except that everything is static. 3) Both Window and StdScr use the same implementation method. 4) In the implementation method, just check the "_object" argument. If it is not null, then you are dealing with a Window object. If it is null, then you are dealing with the StdScr class. Was I clear? -- Beno?t Minisini From tobias at ...692... Thu Apr 5 02:27:19 2012 From: tobias at ...692... (tobi) Date: Thu, 5 Apr 2012 02:27:19 +0200 Subject: [Gambas-devel] Provide special auto-instance of a class In-Reply-To: <4F7CE558.6060400@...1...> References: <20120404165452.GM8434@...693...> <20120404232528.GI12143@...693...> <4F7CE558.6060400@...1...> Message-ID: <20120405002719.GL12143@...693...> On Thu, 05 Apr 2012, Beno?t Minisini wrote: > Le 05/04/2012 01:25, tobi a ?crit : > > Me again, > > > > ... > > > > I wonder what's wrong with this: > > > > GB_DESC CWindowDesc[] = { GB_DECLARE("Window", sizeof(struct > > nc_window)), ... GB_METHOD("_new", NULL, CWindow_new, > > "(x)i(y)i(w)i(h)i"), ... }; > > > > GB_DESC CStdscrDesc[] = { GB_DECLARE("Stdscr", sizeof(struct > > nc_window)), GB_INHERITS("Window"), GB_AUTO_CREATABLE(), > > > > GB_METHOD("_new", NULL, CStdscr_new, NULL), > > > > GB_END_DECLARE }; > > > > It gives a "Not enough arguments" error as soon as I use the Stdscr > > class, thus on its auto-creation. If i replace GB_AUTO_CREATABLE() > > with GB_NOT_CREATABLE() the program starts but of course I can't do > > anything with its properties (wait a minute, not-creatable means that > > _new() isn't called at all?). I am able to overwrite the inherited > > function? I'm sure I misunderstand something about inheritance or > > those IDs. Could anyone point me to the right way? > > > > Regards, Tobi > > > > Because all constructors all called when you use inheritance, and each > constructor consume arguments. This is explained in the "Gambas object > model" page on the wiki. > > So I suggest you do differently, as I did in the gb.db component. > > In the gb.db component, you have a Connection class and a DB static > class that has the same methods and properties as the Connection class, > except that they are all static. > > So: > > 1) Make your 'Window' class as you did. > > 2) Create a 'StdScr' class with the same methods and properties, except > that everything is static. > > 3) Both Window and StdScr use the same implementation method. > > 4) In the implementation method, just check the "_object" argument. If > it is not null, then you are dealing with a Window object. If it is > null, then you are dealing with the StdScr class. > > Was I clear? > All clear, expect that: I need the members of my struct nc_window. If there is no valid _object, I have to declare this struct globally (statically) in the source file of my StdScr object? From gambas at ...1... Thu Apr 5 02:35:29 2012 From: gambas at ...1... (=?ISO-8859-1?Q?Beno=EEt_Minisini?=) Date: Thu, 05 Apr 2012 02:35:29 +0200 Subject: [Gambas-devel] Provide special auto-instance of a class In-Reply-To: <20120405002719.GL12143@...693...> References: <20120404165452.GM8434@...693...> <20120404232528.GI12143@...693...> <4F7CE558.6060400@...1...> <20120405002719.GL12143@...693...> Message-ID: <4F7CE8D1.50606@...1...> Le 05/04/2012 02:27, tobi a ?crit : >> > > All clear, expect that: I need the members of my struct nc_window. If there is no valid _object, I > have to declare this struct globally (statically) in the source file of my StdScr object? > Does StdScr need a 'struct nc_window'? -- Beno?t Minisini From tobias at ...692... Thu Apr 5 03:30:42 2012 From: tobias at ...692... (tobi) Date: Thu, 5 Apr 2012 03:30:42 +0200 Subject: [Gambas-devel] Provide special auto-instance of a class In-Reply-To: <4F7CE8D1.50606@...1...> References: <20120404165452.GM8434@...693...> <20120404232528.GI12143@...693...> <4F7CE558.6060400@...1...> <20120405002719.GL12143@...693...> <4F7CE8D1.50606@...1...> Message-ID: <20120405013042.GM12143@...693...> On Thu, 05 Apr 2012, Beno?t Minisini wrote: > Le 05/04/2012 02:27, tobi a ?crit : > >> > > > > All clear, expect that: I need the members of my struct nc_window. If there is no valid _object, I > > have to declare this struct globally (statically) in the source file of my StdScr object? > > > > Does StdScr need a 'struct nc_window'? > > -- > Beno?t Minisini > > ------------------------------------------------------------------------------ > Better than sec? Nothing is better than sec when it comes to > monitoring Big Data applications. Try Boundary one-second > resolution app monitoring today. Free. > http://p.sf.net/sfu/Boundary-dev2dev > _______________________________________________ > Gambas-devel mailing list > Gambas-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-devel > Yes, as a normal Window object it may make use of my additions to the ncurses WINDOWs which cannot be mapped to ncurses WINDOW structure members, namely: bool border; bool wrap; While the first doesn't seem to be usual to the stdscr, it should be accessible and requires other members of the nc_window to work properly. Wrap is completely independant and controls function operations. Calling the C functions that I wrote is trivial as they all take an _object argument themselves. I could make all the instanciation arguments of the Window class optional to get the StdScr done but I don't deem that very stable, I can't imply any useful defaults for them. I think the world's clearer to me tomorrow... From tobias at ...692... Tue Apr 10 17:23:15 2012 From: tobias at ...692... (tobi) Date: Tue, 10 Apr 2012 17:23:15 +0200 Subject: [Gambas-devel] Provide special auto-instance of a class In-Reply-To: <20120405013042.GM12143@...693...> References: <20120404165452.GM8434@...693...> <20120404232528.GI12143@...693...> <4F7CE558.6060400@...1...> <20120405002719.GL12143@...693...> <4F7CE8D1.50606@...1...> <20120405013042.GM12143@...693...> Message-ID: <20120410152315.GA599@...693...> On Thu, 05 Apr 2012, tobi wrote: > On Thu, 05 Apr 2012, Beno?t Minisini wrote: > > Le 05/04/2012 02:27, tobi a ?crit : > > >> > > > > > > All clear, expect that: I need the members of my struct nc_window. If there is no valid _object, I > > > have to declare this struct globally (statically) in the source file of my StdScr object? > > > > > > > Does StdScr need a 'struct nc_window'? > > > > -- > > Beno?t Minisini > > > > ------------------------------------------------------------------------------ > > Better than sec? Nothing is better than sec when it comes to > > monitoring Big Data applications. Try Boundary one-second > > resolution app monitoring today. Free. > > http://p.sf.net/sfu/Boundary-dev2dev > > _______________________________________________ > > Gambas-devel mailing list > > Gambas-devel at lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/gambas-devel > > > > Yes, as a normal Window object it may make use of my additions to the ncurses WINDOWs which cannot > be mapped to ncurses WINDOW structure members, namely: > bool border; > bool wrap; > While the first doesn't seem to be usual to the stdscr, it should be accessible and requires other > members of the nc_window to work properly. Wrap is completely independant and controls function operations. > Calling the C functions that I wrote is trivial as they all take an _object argument themselves. I > could make all the instanciation arguments of the Window class optional to get the StdScr done but I don't > deem that very stable, I can't imply any useful defaults for them. > I think the world's clearer to me tomorrow... > > > ------------------------------------------------------------------------------ > Better than sec? Nothing is better than sec when it comes to > monitoring Big Data applications. Try Boundary one-second > resolution app monitoring today. Free. > http://p.sf.net/sfu/Boundary-dev2dev > _______________________________________________ > Gambas-devel mailing list > Gambas-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-devel > Well, this is the solution I came up with now: - Declare a fresh (non-inheriting) StdScrDesc with GB_NOT_CREATABLE() - Declare all symbols as STATIC, but link them to the same functions that the normal CWindow uses - Modify the THIS macro to: #define THIS ((struct nc_window *) (_object ? _object : &nc_stdscr)) where nc_stdscr is a static struct nc_window so that its data will be stored there instead of the function parameter which is NULL for all static things I think the THIS-evaluation has less impact on overall-performance than duplicating code and these two are the only options that promised to work. Any objections? :) (If it appears - I'm still debugging - to consume too much CPU, I may introduce a macro that does the evaluation once at the beginning of a Gambas function and then goes on passing the evaluated pointer, so that I can restore the former THIS macro. Thinking about that, I should implement that anyway...) Regards, Tobi From tobias at ...692... Wed Apr 11 21:43:45 2012 From: tobias at ...692... (tobi) Date: Wed, 11 Apr 2012 21:43:45 +0200 Subject: [Gambas-devel] No symlookup warnings for virtual class (r4572) Message-ID: <20120411194345.GJ580@...693...> Hi, I noticed that with my revision #4572 I get no symbol lookup warnings when compiling a C component with a virtual class that does not get exported but used. I can imagine that this belongs to the *_SELF namings to access virtual stuff which means to me: interpreter voodoo that maps virtual symbols to the current object? It's just not clear to me how it works - and isn't that the sense of the macro? I just wanted to ask if no symlookup warning is intended/not to prevent. Regards, Tobi From gambas at ...1... Thu Apr 12 20:25:29 2012 From: gambas at ...1... (=?ISO-8859-1?Q?Beno=EEt_Minisini?=) Date: Thu, 12 Apr 2012 20:25:29 +0200 Subject: [Gambas-devel] No symlookup warnings for virtual class (r4572) In-Reply-To: <20120411194345.GJ580@...693...> References: <20120411194345.GJ580@...693...> Message-ID: <4F871E19.5000905@...1...> Le 11/04/2012 21:43, tobi a ?crit : > Hi, > > I noticed that with my revision #4572 I get no symbol lookup warnings when compiling a C component > with a virtual class that does not get exported but used. I can imagine that this belongs to > the *_SELF namings to access virtual stuff which means to me: interpreter voodoo that maps virtual > symbols to the current object? > It's just not clear to me how it works - and isn't that the sense of the macro? I just wanted > to ask if no symlookup warning is intended/not to prevent. > > Regards, > Tobi > Can you commit your changes so that I look at the source code? -- Beno?t Minisini From tobias at ...692... Fri Apr 13 16:22:16 2012 From: tobias at ...692... (tobi) Date: Fri, 13 Apr 2012 16:22:16 +0200 Subject: [Gambas-devel] No symlookup warnings for virtual class (r4572) In-Reply-To: <4F871E19.5000905@...1...> References: <20120411194345.GJ580@...693...> <4F871E19.5000905@...1...> Message-ID: <20120413142216.GD580@...693...> On Thu, 12 Apr 2012, Beno?t Minisini wrote: > Le 11/04/2012 21:43, tobi a ?crit : > > Hi, > > > > I noticed that with my revision #4572 I get no symbol lookup warnings when compiling a C component > > with a virtual class that does not get exported but used. I can imagine that this belongs to > > the *_SELF namings to access virtual stuff which means to me: interpreter voodoo that maps virtual > > symbols to the current object? > > It's just not clear to me how it works - and isn't that the sense of the macro? I just wanted > > to ask if no symlookup warning is intended/not to prevent. > > > > Regards, > > Tobi > > > > Can you commit your changes so that I look at the source code? > > -- > Beno?t Minisini > > ------------------------------------------------------------------------------ > For Developers, A Lot Can Happen In A Second. > Boundary is the first to Know...and Tell You. > Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! > http://p.sf.net/sfu/Boundary-d2dvs2 > _______________________________________________ > Gambas-devel mailing list > Gambas-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-devel > Regarding the above problem? It all vanished after I realised that I haven't had extern'd the class description. As I said, it was a virtual class accessed via GB_PROPERTY_SELF() and running the corresponding test program resulted in a 'Unknown symbol ... in class ...". I'll try to reproduce the code. Regards, Tobi From gambas at ...1... Fri Apr 13 16:31:06 2012 From: gambas at ...1... (=?ISO-8859-1?Q?Beno=EEt_Minisini?=) Date: Fri, 13 Apr 2012 16:31:06 +0200 Subject: [Gambas-devel] No symlookup warnings for virtual class (r4572) In-Reply-To: <20120413142216.GD580@...693...> References: <20120411194345.GJ580@...693...> <4F871E19.5000905@...1...> <20120413142216.GD580@...693...> Message-ID: <4F8838AA.4050608@...1...> Le 13/04/2012 16:22, tobi a ?crit : > On Thu, 12 Apr 2012, Beno?t Minisini wrote: >> Le 11/04/2012 21:43, tobi a ?crit : >>> Hi, >>> >>> I noticed that with my revision #4572 I get no symbol lookup warnings when compiling a C component >>> with a virtual class that does not get exported but used. I can imagine that this belongs to >>> the *_SELF namings to access virtual stuff which means to me: interpreter voodoo that maps virtual >>> symbols to the current object? >>> It's just not clear to me how it works - and isn't that the sense of the macro? I just wanted >>> to ask if no symlookup warning is intended/not to prevent. >>> >>> Regards, >>> Tobi >>> >> >> Can you commit your changes so that I look at the source code? >> >> -- >> Beno?t Minisini >> > > Regarding the above problem? > It all vanished after I realised that I haven't had extern'd the class description. As I said, it > was a virtual class accessed via GB_PROPERTY_SELF() and running the corresponding test program > resulted in a 'Unknown symbol ... in class ...". > I'll try to reproduce the code. > > Regards, > Tobi > Anyway can you commit your component so that I look at it? :-) -- Beno?t Minisini From tobias at ...692... Fri Apr 13 16:33:42 2012 From: tobias at ...692... (tobi) Date: Fri, 13 Apr 2012 16:33:42 +0200 Subject: [Gambas-devel] No symlookup warnings for virtual class (r4572) In-Reply-To: <4F8838AA.4050608@...1...> References: <20120411194345.GJ580@...693...> <4F871E19.5000905@...1...> <20120413142216.GD580@...693...> <4F8838AA.4050608@...1...> Message-ID: <20120413143342.GE580@...693...> On Fri, 13 Apr 2012, Beno?t Minisini wrote: > Le 13/04/2012 16:22, tobi a ?crit : > > On Thu, 12 Apr 2012, Beno?t Minisini wrote: > >> Le 11/04/2012 21:43, tobi a ?crit : > >>> Hi, > >>> > >>> I noticed that with my revision #4572 I get no symbol lookup warnings when compiling a C component > >>> with a virtual class that does not get exported but used. I can imagine that this belongs to > >>> the *_SELF namings to access virtual stuff which means to me: interpreter voodoo that maps virtual > >>> symbols to the current object? > >>> It's just not clear to me how it works - and isn't that the sense of the macro? I just wanted > >>> to ask if no symlookup warning is intended/not to prevent. > >>> > >>> Regards, > >>> Tobi > >>> > >> > >> Can you commit your changes so that I look at the source code? > >> > >> -- > >> Beno?t Minisini > >> > > > > Regarding the above problem? > > It all vanished after I realised that I haven't had extern'd the class description. As I said, it > > was a virtual class accessed via GB_PROPERTY_SELF() and running the corresponding test program > > resulted in a 'Unknown symbol ... in class ...". > > I'll try to reproduce the code. > > > > Regards, > > Tobi > > > > Anyway can you commit your component so that I look at it? :-) > > -- > Beno?t Minisini > > ------------------------------------------------------------------------------ > For Developers, A Lot Can Happen In A Second. > Boundary is the first to Know...and Tell You. > Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! > http://p.sf.net/sfu/Boundary-d2dvs2 > _______________________________________________ > Gambas-devel mailing list > Gambas-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-devel > It's on the road, but can take a minute, I haven't commited to svn yet ;) From tobias at ...692... Fri Apr 13 17:27:31 2012 From: tobias at ...692... (tobi) Date: Fri, 13 Apr 2012 17:27:31 +0200 Subject: [Gambas-devel] No symlookup warnings for virtual class (r4572) In-Reply-To: <20120413143342.GE580@...693...> References: <20120411194345.GJ580@...693...> <4F871E19.5000905@...1...> <20120413142216.GD580@...693...> <4F8838AA.4050608@...1...> <20120413143342.GE580@...693...> Message-ID: <20120413152731.GG580@...693...> > > > Regarding the above problem? > > > It all vanished after I realised that I haven't had extern'd the class description. As I said, it > > > was a virtual class accessed via GB_PROPERTY_SELF() and running the corresponding test program > > > resulted in a 'Unknown symbol ... in class ...". > > > I'll try to reproduce the code. > > > > > > Regards, > > > Tobi > > > > > > > Anyway can you commit your component so that I look at it? :-) > > > > -- > > Beno?t Minisini > > > > ------------------------------------------------------------------------------ > > For Developers, A Lot Can Happen In A Second. > > Boundary is the first to Know...and Tell You. > > Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! > > http://p.sf.net/sfu/Boundary-d2dvs2 > > _______________________________________________ > > Gambas-devel mailing list > > Gambas-devel at lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/gambas-devel > > > > It's on the road, but can take a minute, I haven't commited to svn yet ;) > > > ------------------------------------------------------------------------------ > For Developers, A Lot Can Happen In A Second. > Boundary is the first to Know...and Tell You. > Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! > http://p.sf.net/sfu/Boundary-d2dvs2 > _______________________________________________ > Gambas-devel mailing list > Gambas-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-devel > Here you are (r4621). If you look into the main.c you will see the .Char.Attrs virtual class commented out in the EXPORTed GB_CLASSES[]. If you would run a program like that: --8<------------------------- ' Gambas Module file Public Sub Main() Dim hW As New Window(0, 0, 10, 10) hW.Attributes[0, 0].Reverse = True End --8<------------------------- (written from scratch) you will encounter the "#11: Unknown symbol 'Reverse' in class '.Char.Attrs'" error. Getting this error, is, of course, a matter of piping stdout from the program to something like hexdump(1). It looks ugly but you can find the message between the terminal control data. As the class description is not exported, it shouldn't exist at all, but there is no compilation warning. I suppose, as previously stated, that this is due to that it is a virtual class, but don't know about the internals... Tobi From contact at ...694... Fri Apr 13 11:50:30 2012 From: contact at ...694... (contact at ...694...) Date: Fri, 13 Apr 2012 11:50:30 +0200 Subject: [Gambas-devel] Twitter API and Gambas Message-ID: <7fc9d51b11fa1536685b27770c5274c3@...102...> Hi all, Any ideas on how to create a client for Twitter (which exposes a REST API) using gambas? Thanks, Hamza From ron at ...572... Fri Apr 13 17:55:29 2012 From: ron at ...572... (Ron) Date: Fri, 13 Apr 2012 17:55:29 +0200 Subject: [Gambas-devel] Twitter API and Gambas In-Reply-To: <7fc9d51b11fa1536685b27770c5274c3@...102...> References: <7fc9d51b11fa1536685b27770c5274c3@...102...> Message-ID: I tried creating one but you need to be able to use oauth. Triedbtobuse extern calls to libauth.so bit no success yet. Until then I call cli tool 'bt' to send tweets, see domotiga.nl So any info/code to do this native is welcome here too. Regards, Ron Op 13 apr. 2012 17:46 schreef het volgende: > Hi all, > > Any ideas on how to create a client for Twitter (which exposes a REST > API) using gambas? > > Thanks, > Hamza > > > > ------------------------------------------------------------------------------ > For Developers, A Lot Can Happen In A Second. > Boundary is the first to Know...and Tell You. > Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! > http://p.sf.net/sfu/Boundary-d2dvs2 > _______________________________________________ > Gambas-devel mailing list > Gambas-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gambas at ...1... Sat Apr 14 00:24:29 2012 From: gambas at ...1... (=?ISO-8859-1?Q?Beno=EEt_Minisini?=) Date: Sat, 14 Apr 2012 00:24:29 +0200 Subject: [Gambas-devel] Fwd: Re: gb.ncurses feedback? In-Reply-To: <4F88A6F7.80208@...1...> References: <4F88A6F7.80208@...1...> Message-ID: <4F88A79D.4080409@...1...> -------- Message original -------- Sujet: Re: gb.ncurses feedback? Date : Sat, 14 Apr 2012 00:21:43 +0200 De : Beno?t Minisini Pour : tobi Le 13/04/2012 23:44, tobi a ?crit : > Hi Beno?t, > > still collecting bugs? ;) > Since you wanted to inspect the code, am I to expect a short feedback (an "OK" would do in the > best case)? > Writing an application to demonstrate the Window class I felt that the class needs some more stuff, > so it was extended and it's really time to know if it is well enough coded to continue or rewrite. > > Regards, > Tobi > > I have just committed some little changes: - I centralize the NCurses initialization and uninitialization in two routines. - I replaced the REFRESH() macro by a function that checks that the library has not been unitialized. Otherwise calling NCurses refresh routines after endwin() does strange things to the terminal. - I added an interpreter "error hook" that calls endwin(), so that the error message is printed by the interpreter on a clean terminal. So that you can install the SIGWINCH signal correctly, I will add to the interpreter API the needed calls to the interpreter routines that will do that for you. Then you will need to create a pipe. The signal handler will write to the pipe, and you will watch the pipe output and raise event from there. Only an object can raise event. I think the Window object that is actually the screen will raise the Resize event when the SIGWINCH signal is received. If you want a window to raise a Read event when a key is pressed, you just have to watch the standard input *once*, and then send the event from the currently focused window. You don't need to change the watch callback! Beware that the standard input is automatically watched by the interpreter if the user defined a global Application_Read function in the startup class. Your callback will replace it, and the Application_Read function will never be called. I will have other remarks about the function and properties name for sure! :-) Regards, -- Beno?t Minisini From gambas at ...1... Sat Apr 14 00:35:00 2012 From: gambas at ...1... (=?ISO-8859-1?Q?Beno=EEt_Minisini?=) Date: Sat, 14 Apr 2012 00:35:00 +0200 Subject: [Gambas-devel] Fwd: Re: gb.ncurses feedback? In-Reply-To: <4F88A79D.4080409@...1...> References: <4F88A6F7.80208@...1...> <4F88A79D.4080409@...1...> Message-ID: <4F88AA14.3000303@...1...> Le 14/04/2012 00:24, Beno?t Minisini a ?crit : > > > -------- Message original -------- > Sujet: Re: gb.ncurses feedback? > Date : Sat, 14 Apr 2012 00:21:43 +0200 > De : Beno?t Minisini > Pour : tobi > > Le 13/04/2012 23:44, tobi a ?crit : >> Hi Beno?t, >> >> still collecting bugs? ;) >> Since you wanted to inspect the code, am I to expect a short feedback (an "OK" would do in the >> best case)? >> Writing an application to demonstrate the Window class I felt that the class needs some more stuff, >> so it was extended and it's really time to know if it is well enough coded to continue or rewrite. >> >> Regards, >> Tobi >> >> > > I have just committed some little changes: > > - I centralize the NCurses initialization and uninitialization in two > routines. > > - I replaced the REFRESH() macro by a function that checks that the > library has not been unitialized. Otherwise calling NCurses refresh > routines after endwin() does strange things to the terminal. > > - I added an interpreter "error hook" that calls endwin(), so that the > error message is printed by the interpreter on a clean terminal. > > So that you can install the SIGWINCH signal correctly, I will add to the > interpreter API the needed calls to the interpreter routines that will > do that for you. > > Then you will need to create a pipe. The signal handler will write to > the pipe, and you will watch the pipe output and raise event from there. > > Only an object can raise event. I think the Window object that is > actually the screen will raise the Resize event when the SIGWINCH signal > is received. > > If you want a window to raise a Read event when a key is pressed, you > just have to watch the standard input *once*, and then send the event > from the currently focused window. You don't need to change the watch > callback! > > Beware that the standard input is automatically watched by the > interpreter if the user defined a global Application_Read function in > the startup class. Your callback will replace it, and the > Application_Read function will never be called. > > I will have other remarks about the function and properties name for > sure! :-) > > Regards, > - I don't understand the Window array accessors. I suggest that you keep the array accessors for accessing character attributes individually, and that you create methods for retrieving some text blocks. - I suggest that you rename the following methods: Window.HLine() -> Window.DrawHLine() Window.VLine() -> Window.DrawVLine() And then, the cool thing would be having a Window.DrawRect() that can draw overlapping rects and manage the character appearance when lines cross. :-) - I think that NCurses should be initialized by default in the main hook, just before the Main() function is called. - NCurses.On() and NCurses.Off() should be removed. Or renamed if we need to exit the ncurses mode temporarily. Regards, -- Beno?t Minisini From tobias at ...692... Sat Apr 14 01:04:05 2012 From: tobias at ...692... (tobi) Date: Sat, 14 Apr 2012 01:04:05 +0200 Subject: [Gambas-devel] Fwd: Re: gb.ncurses feedback? In-Reply-To: <4F88A79D.4080409@...1...> References: <4F88A6F7.80208@...1...> <4F88A79D.4080409@...1...> Message-ID: <20120413230405.GX580@...693...> On Sat, 14 Apr 2012, Beno?t Minisini wrote: > > > -------- Message original -------- > Sujet: Re: gb.ncurses feedback? > Date : Sat, 14 Apr 2012 00:21:43 +0200 > De : Beno?t Minisini > Pour : tobi > > Le 13/04/2012 23:44, tobi a ?crit : > > Hi Beno?t, > > > > still collecting bugs? ;) > > Since you wanted to inspect the code, am I to expect a short feedback (an "OK" would do in the > > best case)? > > Writing an application to demonstrate the Window class I felt that the class needs some more stuff, > > so it was extended and it's really time to know if it is well enough coded to continue or rewrite. > > > > Regards, > > Tobi > > > > > > I have just committed some little changes: > > - I centralize the NCurses initialization and uninitialization in two > routines. > > - I replaced the REFRESH() macro by a function that checks that the > library has not been unitialized. Otherwise calling NCurses refresh > routines after endwin() does strange things to the terminal. > > - I added an interpreter "error hook" that calls endwin(), so that the > error message is printed by the interpreter on a clean terminal. > > So that you can install the SIGWINCH signal correctly, I will add to the > interpreter API the needed calls to the interpreter routines that will > do that for you. > > Then you will need to create a pipe. The signal handler will write to > the pipe, and you will watch the pipe output and raise event from there. > > Only an object can raise event. I think the Window object that is > actually the screen will raise the Resize event when the SIGWINCH signal > is received. > > If you want a window to raise a Read event when a key is pressed, you > just have to watch the standard input *once*, and then send the event > from the currently focused window. You don't need to change the watch > callback! > > Beware that the standard input is automatically watched by the > interpreter if the user defined a global Application_Read function in > the startup class. Your callback will replace it, and the > Application_Read function will never be called. > > I will have other remarks about the function and properties name for > sure! :-) > > Regards, > > -- > Beno?t Minisini > > ------------------------------------------------------------------------------ > For Developers, A Lot Can Happen In A Second. > Boundary is the first to Know...and Tell You. > Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! > http://p.sf.net/sfu/Boundary-d2dvs2 > _______________________________________________ > Gambas-devel mailing list > Gambas-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-devel > Yes, I'm currently exploring svn conflicts, more or less wishing... It's weird that even tough, I reverted everything there are no changes visible... - The thing with the refresh() ncurses routine is that one is able to temporarily leave ncurses mode (endwin()) and come back later to the exact same state as when you left ncurses. The latter is done by a call to refresh(). - For now I did: gbx3 2>err to see what's going on, but a hook seems to be the only user-friendly solution. Great! (Btw: gb.ncurses programs) - You deem it better to have the signal in the interpreter itself (sorry, didn't dig that far into it yet)? Hmm, I have to think about the Resize event, there may be several windows in a screen but only one can be focused. It's easy to let it dispatch the Resize event but if the terminal is resized when another window - which has no corresponding event handler - is focused, it won't work at all. - You mean: Don't call GB.Watch() all over again, you have the @focussed pointer. I definitely missed that approach... (as you can see, I used to change the parameter to the callback with GB.Watch() to reflect the last focused object, but that's just not necessary) - You know better what's an appropriate outward appearance of an object interface, don't hesitate to tell me ;) - Yes, I had Application_Read() in mind, too, but the component takes over the whole terminal upon class load. From then it is obvious that any stdin has to go through that very component. Nevertheless, I worry about pipes and file redirection that are not possible with the current NCurses._init(). I really wish, I could see the code because a few things were added to complete my approach on a Pong game and they rely heavily on the REFRESH() macro :D (But nothing which is not to be fixed within a few minutes with a function) Regards, Tobi From tobias at ...692... Sat Apr 14 01:15:22 2012 From: tobias at ...692... (tobi) Date: Sat, 14 Apr 2012 01:15:22 +0200 Subject: [Gambas-devel] Fwd: Re: gb.ncurses feedback? In-Reply-To: <4F88AA14.3000303@...1...> References: <4F88A6F7.80208@...1...> <4F88A79D.4080409@...1...> <4F88AA14.3000303@...1...> Message-ID: <20120413231522.GY580@...693...> > - I don't understand the Window array accessors. I suggest that you keep > the array accessors for accessing character attributes individually, and > that you create methods for retrieving some text blocks. > > - I suggest that you rename the following methods: > > Window.HLine() -> Window.DrawHLine() > Window.VLine() -> Window.DrawVLine() > > And then, the cool thing would be having a Window.DrawRect() that can > draw overlapping rects and manage the character appearance when lines > cross. :-) > > - I think that NCurses should be initialized by default in the main > hook, just before the Main() function is called. > > - NCurses.On() and NCurses.Off() should be removed. Or renamed if we > need to exit the ncurses mode temporarily. > > Regards, > > -- > Beno?t Minisini > > ------------------------------------------------------------------------------ > For Developers, A Lot Can Happen In A Second. > Boundary is the first to Know...and Tell You. > Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! > http://p.sf.net/sfu/Boundary-d2dvs2 > _______________________________________________ > Gambas-devel mailing list > Gambas-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-devel > - I did the array accessors to do something like: hW[0, 5] = "This is text" which would print the string on line 0, column 5. That's just what the Print() method does, just shorter, no problem to replace it by the hW.Attributes array accessors. - I don't quite understand the DrawRect() feature. You mean overlapping rectangles and what? - OK, main hook. - I personally never exited ncurses mode temporarily, but mutt, my email client, does when I switch to vim to write a mail. I don't know if it could be very useful... From gambas at ...1... Sat Apr 14 03:15:49 2012 From: gambas at ...1... (=?ISO-8859-1?Q?Beno=EEt_Minisini?=) Date: Sat, 14 Apr 2012 03:15:49 +0200 Subject: [Gambas-devel] Fwd: Re: gb.ncurses feedback? In-Reply-To: <20120413230405.GX580@...693...> References: <4F88A6F7.80208@...1...> <4F88A79D.4080409@...1...> <20120413230405.GX580@...693...> Message-ID: <4F88CFC5.10907@...1...> Le 14/04/2012 01:04, tobi a ?crit : > > Yes, I'm currently exploring svn conflicts, more or less wishing... > It's weird that even tough, I reverted everything there are no changes visible... > > - The thing with the refresh() ncurses routine is that one is able to temporarily leave ncurses mode > (endwin()) and come back later to the exact same state as when you left ncurses. The latter is done > by a call to refresh(). So you mean endwin() == leave ncurses and refresh() == come back ? Mmm. Anyway, I think that the "normal" of gb.ncurses should be the common one, i.e. effectively use ncurses. This is the reason why we should enter ncurses mode automatically during the main hook, and leave it at the end of the program. > > - For now I did: gbx3 2>err to see what's going on, but a hook seems to be the only user-friendly > solution. Great! (Btw: gb.ncurses programs) > > - You deem it better to have the signal in the interpreter itself (sorry, didn't dig that far into > it yet)? Hmm, I have to think about the Resize event, there may be several windows in a screen but > only one can be focused. It's easy to let it dispatch the Resize event but if the terminal is > resized when another window - which has no corresponding event handler - is focused, it won't work > at all. I would grant you through the interpreter API two functions : one to register a signal handler, and one to unregister it, with a documentation on how to use it. Because two libraries may want to handle the same signal, so the interpreter must manage that. And then we can imagine that I could make an interpreter API that make the pipe for you, so that you just tell him a callback that would not be a signal handler, but a normal function that can raise event and do whatever you want. I think it is the better solution. > > - You mean: Don't call GB.Watch() all over again, you have the @focussed pointer. > I definitely missed that approach... (as you can see, I used to change the parameter to the > callback with GB.Watch() to reflect the last focused object, but that's just not necessary) Don't forget to reference the focused window while you hold its pointer inside a global variable, and to unreference it when the focus change or when the program ends. > > - You know better what's an appropriate outward appearance of an object interface, don't hesitate to > tell me ;) I will. I have already did. :-) > > - Yes, I had Application_Read() in mind, too, but the component takes over the whole terminal upon > class load. From then it is obvious that any stdin has to go through that very component. > Nevertheless, I worry about pipes and file redirection that are not possible with the current > NCurses._init(). Why? Redirecting standard input and output is not useful with ncurses program, is it? > > I really wish, I could see the code because a few things were added to complete my approach on a > Pong game and they rely heavily on the REFRESH() macro :D (But nothing which is not to be fixed > within a few minutes with a function) You are talking about the conflicts? Sorry for that. Maybe you did a lot of changes that were not committed before I did my own one? I didn't change a lot of thing nevertheless. Regards, -- Beno?t Minisini From tobias at ...692... Sat Apr 14 10:53:05 2012 From: tobias at ...692... (tobi) Date: Sat, 14 Apr 2012 10:53:05 +0200 Subject: [Gambas-devel] Fwd: Re: gb.ncurses feedback? In-Reply-To: <4F88CFC5.10907@...1...> References: <4F88A6F7.80208@...1...> <4F88A79D.4080409@...1...> <20120413230405.GX580@...693...> <4F88CFC5.10907@...1...> Message-ID: <20120414085305.GB583@...693...> On Sat, 14 Apr 2012, Beno?t Minisini wrote: > Le 14/04/2012 01:04, tobi a ?crit : > > > > Yes, I'm currently exploring svn conflicts, more or less wishing... > > It's weird that even tough, I reverted everything there are no changes visible... > > > > - The thing with the refresh() ncurses routine is that one is able to temporarily leave ncurses mode > > (endwin()) and come back later to the exact same state as when you left ncurses. The latter is done > > by a call to refresh(). > > So you mean endwin() == leave ncurses and refresh() == come back ? Mmm. > > Anyway, I think that the "normal" of gb.ncurses should be the common > one, i.e. effectively use ncurses. This is the reason why we should > enter ncurses mode automatically during the main hook, and leave it at > the end of the program. > > > > > - For now I did: gbx3 2>err to see what's going on, but a hook seems to be the only user-friendly > > solution. Great! (Btw: gb.ncurses programs) > > > > - You deem it better to have the signal in the interpreter itself (sorry, didn't dig that far into > > it yet)? Hmm, I have to think about the Resize event, there may be several windows in a screen but > > only one can be focused. It's easy to let it dispatch the Resize event but if the terminal is > > resized when another window - which has no corresponding event handler - is focused, it won't work > > at all. > > I would grant you through the interpreter API two functions : one to > register a signal handler, and one to unregister it, with a > documentation on how to use it. > > Because two libraries may want to handle the same signal, so the > interpreter must manage that. > > And then we can imagine that I could make an interpreter API that make > the pipe for you, so that you just tell him a callback that would not be > a signal handler, but a normal function that can raise event and do > whatever you want. I think it is the better solution. > > > > > - You mean: Don't call GB.Watch() all over again, you have the @focussed pointer. > > I definitely missed that approach... (as you can see, I used to change the parameter to the > > callback with GB.Watch() to reflect the last focused object, but that's just not necessary) > > Don't forget to reference the focused window while you hold its pointer > inside a global variable, and to unreference it when the focus change or > when the program ends. > > > > > - You know better what's an appropriate outward appearance of an object interface, don't hesitate to > > tell me ;) > > I will. I have already did. :-) > > > > > - Yes, I had Application_Read() in mind, too, but the component takes over the whole terminal upon > > class load. From then it is obvious that any stdin has to go through that very component. > > Nevertheless, I worry about pipes and file redirection that are not possible with the current > > NCurses._init(). > > Why? Redirecting standard input and output is not useful with ncurses > program, is it? > > > > > I really wish, I could see the code because a few things were added to complete my approach on a > > Pong game and they rely heavily on the REFRESH() macro :D (But nothing which is not to be fixed > > within a few minutes with a function) > > You are talking about the conflicts? Sorry for that. Maybe you did a lot > of changes that were not committed before I did my own one? I didn't > change a lot of thing nevertheless. > > Regards, > > -- > Beno?t Minisini > > ------------------------------------------------------------------------------ > For Developers, A Lot Can Happen In A Second. > Boundary is the first to Know...and Tell You. > Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! > http://p.sf.net/sfu/Boundary-d2dvs2 > _______________________________________________ > Gambas-devel mailing list > Gambas-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-devel > D'accord with the NCurses.On() and .Off(), they will be removed (see manpage for endwin() for the refresh() thing). With the signal handler as well. And so there shall only be a warning regarding Application_Read() in ncurses programs somewhere. Being new to svn, the only way out for me was to get a fresh copy - I just haven't seen anything in the code I had on my disk regarding conflicts, which I could have solved manually then. (Will visit the documentation which doesn't appear to reside in its manpages). I'll try to incorporate all the suggestions. One word about the naming of internal functions and variables... I have to problem to rename my functions or yours but I just can't stand two different naming schemes in an integral piece of code ;) What'd be the way to go? For my Pong, I added the following: * Window.Refresh(): Refreshes the screen (rationale: s.b.) * Window.Buffered: Whether calls to REFRESH() shall produce any output on the physical screen. If set, they won't and the user has to use Window.Refresh(), as one would do C ncurses (rationale: in games, such as Pong, one may redraw several items after each other in shorter time intervals. With my terminal (180*75) this is a rather flickering concern, so during this redraw routine one may buffer one's changes and plot to screen once at the end - works beautifully with that solution) * Window.Ask(): Gets a string consisting of characters to accept and optionally a @tries variable. When one of the given characters was typed or the tries exceeded, the function will return (Null if exceeded, otherwise a string containing the typed choice) (rationale: saves While loops when the programmer only wants to accept certain keys) * Window.PrintCenter(): Takes a string and places it vertically centered (the whole string. which means that the middle line of the string shall be the closest to the middle of the screen) and horizontally (line by line. means that the middle character of each line is the closest to the horizontal centre of the screen) (rational: looks good for initial prompts (it's the way, I used it however)) The reason for that I'm telling you now is to leave you a chance to improve their names while I'm typing - which seems to be most true for the latter two ;) I was also experimenting with the Timer object. Before I continue: May it be worth to have a Redraw event, generated by a window-internal timer (a Redraw property according)? The same thing can, of course, be accomplished by having a timer in the application and I did that, works. It would be a pure feature reducing application source code variables. Regards, Tobi From gambas at ...1... Sat Apr 14 11:14:43 2012 From: gambas at ...1... (=?ISO-8859-1?Q?Beno=EEt_Minisini?=) Date: Sat, 14 Apr 2012 11:14:43 +0200 Subject: [Gambas-devel] Fwd: Re: gb.ncurses feedback? In-Reply-To: <20120414085305.GB583@...693...> References: <4F88A6F7.80208@...1...> <4F88A79D.4080409@...1...> <20120413230405.GX580@...693...> <4F88CFC5.10907@...1...> <20120414085305.GB583@...693...> Message-ID: <4F894003.6030002@...1...> Le 14/04/2012 10:53, tobi a ?crit : > > D'accord with the NCurses.On() and .Off(), they will be removed (see > manpage for endwin() for the refresh() thing). With the signal > handler as well. And so there shall only be a warning regarding > Application_Read() in ncurses programs somewhere. An explanation in the documentation will be enough I think. And it's logical: if you use NCurses, you should let him handle the input. > > Being new to svn, the only way out for me was to get a fresh copy - I > just haven't seen anything in the code I had on my disk regarding > conflicts, which I could have solved manually then. (Will visit the > documentation which doesn't appear to reside in its manpages). I'll > try to incorporate all the suggestions. In the Gambas wiki I wrote a little documentation about subversion and how to handle conflicts. Did you read it? > One word about the naming of internal functions and variables... I > have to problem to rename my functions or yours but I just can't > stand two different naming schemes in an integral piece of code ;) > What'd be the way to go? Alas you will find two different conventions in the source code. IMHO the better is the more recent one: 1) Implementation functions are named "_", respecting the case. For example, 'NCurses_Cursor' (and not 'CNCurses_cursor' anymore). For special methods ('_new', '_free'...), use '_new', '_free'... 2) Global functions are named starting with a module name in uppercase, and an underscore: 'NCURSES_init' for example. It could have been 'CNURSES_init' if you use the file name as module name. Beware that arguments in symbol signature must follow the "Pascal" convention (i.e. start with an uppercase character). So, for example: GB_METHOD("_new", NULL, Window_new, "(X)i(Y)i(W)i(H)i"), instead of: GB_METHOD("_new", NULL, CWindow_new, "(x)i(y)i(w)i(h)i"), > > For my Pong, I added the following: * Window.Refresh(): Refreshes the > screen (rationale: s.b.) Does it refresh the window or the full screen? > * Window.Buffered: Whether calls to REFRESH() shall produce any > output on the physical screen. If set, they won't and the user has to > use Window.Refresh(), as one would do C ncurses (rationale: in games, > such as Pong, one may redraw several items after each other in > shorter time intervals. With my terminal (180*75) this is a rather > flickering concern, so during this redraw routine one may buffer > one's changes and plot to screen once at the end - works beautifully > with that solution) Seems rational. > * Window.Ask(): Gets a string consisting of characters to accept and > optionally a @tries variable. When one of the given characters was > typed or the tries exceeded, the function will return (Null if > exceeded, otherwise a string containing the typed choice) (rationale: > saves While loops when the programmer only wants to accept certain > keys) Strange, but why not? > * Window.PrintCenter(): Takes a string and places it vertically > centered (the whole string. which means that the middle line of the > string shall be the closest to the middle of the screen) and > horizontally (line by line. means that the middle character of each > line is the closest to the horizontal centre of the screen) > (rational: looks good for initial prompts (it's the way, I used it > however)) Mmfff. You should let a little work to the user. :-) > > The reason for that I'm telling you now is to leave you a chance to > improve their names while I'm typing - which seems to be most true > for the latter two ;) > > I was also experimenting with the Timer object. Before I continue: > May it be worth to have a Redraw event, generated by a > window-internal timer (a Redraw property according)? The same thing > can, of course, be accomplished by having a timer in the application > and I did that, works. It would be a pure feature reducing > application source code variables. Why not? But same remark. Making the timer in Gambas is not a lot of lines of code. Waiting for your commit... Regards, -- Beno?t Minisini From tobias at ...692... Sat Apr 14 11:49:42 2012 From: tobias at ...692... (tobi) Date: Sat, 14 Apr 2012 11:49:42 +0200 Subject: [Gambas-devel] Fwd: Re: gb.ncurses feedback? In-Reply-To: <4F894003.6030002@...1...> References: <4F88A6F7.80208@...1...> <4F88A79D.4080409@...1...> <20120413230405.GX580@...693...> <4F88CFC5.10907@...1...> <20120414085305.GB583@...693...> <4F894003.6030002@...1...> Message-ID: <20120414094942.GC583@...693...> On Sat, 14 Apr 2012, Beno?t Minisini wrote: > Le 14/04/2012 10:53, tobi a ?crit : > > > > D'accord with the NCurses.On() and .Off(), they will be removed (see > > manpage for endwin() for the refresh() thing). With the signal > > handler as well. And so there shall only be a warning regarding > > Application_Read() in ncurses programs somewhere. > > An explanation in the documentation will be enough I think. And it's > logical: if you use NCurses, you should let him handle the input. > > > > > Being new to svn, the only way out for me was to get a fresh copy - I > > just haven't seen anything in the code I had on my disk regarding > > conflicts, which I could have solved manually then. (Will visit the > > documentation which doesn't appear to reside in its manpages). I'll > > try to incorporate all the suggestions. > > In the Gambas wiki I wrote a little documentation about subversion and > how to handle conflicts. Did you read it? > Yes, but I never encountered those conflict comments from svn in the sources. I probably did weird things anyhow just to see the changes. > > For my Pong, I added the following: * Window.Refresh(): Refreshes the > > screen (rationale: s.b.) > > Does it refresh the window or the full screen? > Nasty question. I thought the same yesterday. But there it is, the dilemma: * I cannot call wrefresh() to refresh the particular window as it could mess up the window overlapping. Window redraw should be handled by the panel library * If I call REFRESH(), everything that has changed will be repainted - but with respect to the panel stack. So having it in a window is a bit misleading since hW1.Refresh() will ignore hW2.Buffered = True but this is less pain, I think? Of course, this won't allow buffering on a window when one paints to another but from my point, Buffered is not meant to be enabled throughout the program but only on special places where a lot of changes will assemble and interrupts that would draw on another unbuffered window causing a complete redraw anyway are unlikely to occur. * As a third, I could assume that if a window is buffered, it is the top-most on the panel stack because there are a lot of drawing operations, meaning visual effects, so given I assumed that I could safely call wrefresh() but I don't tend to assume any behaviour of the user. > > * Window.Ask(): Gets a string consisting of characters to accept and > > optionally a @tries variable. When one of the given characters was > > typed or the tries exceeded, the function will return (Null if > > exceeded, otherwise a string containing the typed choice) (rationale: > > saves While loops when the programmer only wants to accept certain > > keys) > > Strange, but why not? > Imagine: hW.Print("Press \'n\' for new game or \'q\' to quit") Select Case hW.Ask("nq") Case "n" NewGame() Case "q" Quit End Select > > I was also experimenting with the Timer object. Before I continue: > > May it be worth to have a Redraw event, generated by a > > window-internal timer (a Redraw property according)? The same thing > > can, of course, be accomplished by having a timer in the application > > and I did that, works. It would be a pure feature reducing > > application source code variables. > > Why not? But same remark. Making the timer in Gambas is not a lot of > lines of code. > This one will be left out. It's overkill and would save just 2/451 lines in my Pong, not worth any work. Regards, Tobi From tobias at ...692... Sat Apr 14 21:45:47 2012 From: tobias at ...692... (tobi) Date: Sat, 14 Apr 2012 21:45:47 +0200 Subject: [Gambas-devel] Fwd: Re: gb.ncurses feedback? In-Reply-To: <4F894003.6030002@...1...> References: <4F88A6F7.80208@...1...> <4F88A79D.4080409@...1...> <20120413230405.GX580@...693...> <4F88CFC5.10907@...1...> <20120414085305.GB583@...693...> <4F894003.6030002@...1...> Message-ID: <20120414194547.GF593@...693...> > > Waiting for your commit... > > Regards, > > -- > Beno?t Minisini > > ------------------------------------------------------------------------------ > For Developers, A Lot Can Happen In A Second. > Boundary is the first to Know...and Tell You. > Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! > http://p.sf.net/sfu/Boundary-d2dvs2 > _______________________________________________ > Gambas-devel mailing list > Gambas-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-devel > It's there. (Sorry, I was told early afternoon that we were going to visit some birthday today). I attached a working - at least on my setup - Pong game. Could someone tell me if it is playable with other terminal dimensions? It was a quick project just to see if it is possible... Could be made an example. I intended a simple Pager for that purpose, too. (I also can't tell if it will work with the IDE, I have no IDE here, just copied and edited the project structure manually - anyway, it won't _run_ from the IDE, as far as I know) Regards, Tobi -------------- next part -------------- A non-text attachment was scrubbed... Name: Pong.tar.xz Type: application/octet-stream Size: 9072 bytes Desc: not available URL: From tobias at ...692... Sat Apr 14 22:20:26 2012 From: tobias at ...692... (tobi) Date: Sat, 14 Apr 2012 22:20:26 +0200 Subject: [Gambas-devel] Get missed svn changes Message-ID: <20120414202026.GG593@...693...> Hi, I appear to re-download the whole source tree the second time within two days so I just ask now: How (the hell) would I get the changes of revisions that I missed between the last time I updated and commited? I tried to svn update -r REV but this just says that I would be at revision REV and does nothing except that. Not even the svn log is different. In future, I will of course take care of getting the latest revision before commiting but there will certainly be a method to fix that. That seems to be an uncommon problem or I used the wrong queries on search engine? I would greatly appreciate any help. Regards, Tobi From Karl.Reinl at ...646... Sat Apr 14 23:55:07 2012 From: Karl.Reinl at ...646... (Charlie Reinl) Date: Sat, 14 Apr 2012 23:55:07 +0200 Subject: [Gambas-devel] Get missed svn changes In-Reply-To: <20120414202026.GG593@...693...> References: <20120414202026.GG593@...693...> Message-ID: <1334440507.2916.8.camel@...102...> Am Samstag, den 14.04.2012, 22:20 +0200 schrieb tobi: > Hi, > > I appear to re-download the whole source tree the second time within two days so I just ask now: > How (the hell) would I get the changes of revisions that I missed between the last time I updated > and commited? > > I tried to svn update -r REV but this just says that I would be at revision REV and does nothing > except that. Not even the svn log is different. > In future, I will of course take care of getting the latest revision before commiting but there will > certainly be a method to fix that. Bad idea, you will be asked for all your changed files! First send your changes. Then ask for update, that should work, that is not a question of the revision. > That seems to be an uncommon problem or I used the wrong queries > on search engine? > I would greatly appreciate any help. > > Regards, > Tobi -- Amicalement Charlie From sebikul at ...176... Sun Apr 15 02:43:42 2012 From: sebikul at ...176... (Sebastian Kulesz) Date: Sat, 14 Apr 2012 21:43:42 -0300 Subject: [Gambas-devel] Twitter API and Gambas Message-ID: Hi. I created a project about a year ago to allow gambas3 applications to interact with social networks and other online services [0] . I could only implement a Facebook and Google URL Shortener class. If you check the source code,?an Oauth2 class binded to the facebook API can be found [1]. The project is really outdated, i'm not sure if the facebook class works with the new introduced changes, and a lot of optimization can be made. I am planning on doing a rework of the project, by making it a whole component, and not separate projects. A twitter library may also be added, but I need to catch up with it's API. If you don't mind waiting a few weeks/months, you may start a twitter client using the available source. I hope this helps! [0]?http://code.google.com/p/gambas-online [1]?http://code.google.com/p/gambas-online/source/browse/trunk/facebook/.src/OAuth2.module From tobias at ...692... Sun Apr 15 07:55:54 2012 From: tobias at ...692... (tobi) Date: Sun, 15 Apr 2012 07:55:54 +0200 Subject: [Gambas-devel] Get missed svn changes In-Reply-To: <1334440507.2916.8.camel@...102...> References: <20120414202026.GG593@...693...> <1334440507.2916.8.camel@...102...> Message-ID: <20120415055554.GL593@...693...> On Sat, 14 Apr 2012, Charlie Reinl wrote: > Am Samstag, den 14.04.2012, 22:20 +0200 schrieb tobi: > > Hi, > > > > I appear to re-download the whole source tree the second time within two days so I just ask now: > > How (the hell) would I get the changes of revisions that I missed between the last time I updated > > and commited? > > > > I tried to svn update -r REV but this just says that I would be at revision REV and does nothing > > except that. Not even the svn log is different. > > In future, I will of course take care of getting the latest revision before commiting but there will > > certainly be a method to fix that. > > Bad idea, you will be asked for all your changed files! > First send your changes. > Then ask for update, that should work, that is not a question of the > revision. > > > That seems to be an uncommon problem or I used the wrong queries > > on search engine? > > I would greatly appreciate any help. > > > > Regards, > > Tobi > > > -- > Amicalement > Charlie > > > ------------------------------------------------------------------------------ > For Developers, A Lot Can Happen In A Second. > Boundary is the first to Know...and Tell You. > Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! > http://p.sf.net/sfu/Boundary-d2dvs2 > _______________________________________________ > Gambas-devel mailing list > Gambas-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-devel > Thanks. I just took a look at the gambas-devel-svn message that accounced the changes to me. I think I was mistaken. The changes that I wanted to take place we actually made in the 3.1 branch not in the trunk branch. No wonder there happened nothing - not even log changes :) Regrets about the confusion. Regards, Tobi From gambas.fr at ...176... Sun Apr 15 09:23:25 2012 From: gambas.fr at ...176... (Fabien Bodard) Date: Sun, 15 Apr 2012 09:23:25 +0200 Subject: [Gambas-devel] Get missed svn changes In-Reply-To: <20120415055554.GL593@...693...> References: <20120414202026.GG593@...693...> <1334440507.2916.8.camel@...102...> <20120415055554.GL593@...693...> Message-ID: 2012/4/15 tobi : > On Sat, 14 Apr 2012, Charlie Reinl wrote: >> Am Samstag, den 14.04.2012, 22:20 +0200 schrieb tobi: >> > Hi, >> > >> > I appear to re-download the whole source tree the second time within two days so I just ask now: >> > How (the hell) would I get the changes of revisions that I missed between the last time I updated >> > and commited? >> > >> > I tried to svn update -r REV but this just says that I would be at revision REV and does nothing >> > except that. Not even the svn log is different. >> > In future, I will of course take care of getting the latest revision before commiting but there will >> > certainly be a method to fix that. >> >> Bad idea, you will be asked for all your changed files! >> First send your changes. >> Then ask for update, that should work, that is not a question of the >> revision. >> >> > That seems to be an uncommon problem or I used the wrong queries >> > on search engine? >> > I would greatly appreciate any help. >> > >> > Regards, >> > Tobi >> >> >> -- >> Amicalement >> Charlie >> >> >> ------------------------------------------------------------------------------ >> For Developers, A Lot Can Happen In A Second. >> Boundary is the first to Know...and Tell You. >> Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! >> http://p.sf.net/sfu/Boundary-d2dvs2 >> _______________________________________________ >> Gambas-devel mailing list >> Gambas-devel at lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/gambas-devel >> > > Thanks. > I just took a look at the gambas-devel-svn message that accounced the changes to me. I think I was > mistaken. The changes that I wanted to take place we actually made in the 3.1 branch not in the > trunk branch. No wonder there happened nothing - not even log changes :) > Regrets about the confusion. > > Regards, > Tobi your change must be in the trunk branch > > ------------------------------------------------------------------------------ > For Developers, A Lot Can Happen In A Second. > Boundary is the first to Know...and Tell You. > Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! > http://p.sf.net/sfu/Boundary-d2dvs2 > _______________________________________________ > Gambas-devel mailing list > Gambas-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-devel -- Fabien Bodard From tobias at ...692... Sun Apr 22 13:28:48 2012 From: tobias at ...692... (tobi) Date: Sun, 22 Apr 2012 13:28:48 +0200 Subject: [Gambas-devel] Problems inheriting Stream Message-ID: <20120422112847.GC586@...693...> Hi, I have problems correctly inheriting Stream. I thought, I followed the instructions, Beno?t gave me: --- struct nc_window { GB_BASE ob; GB_STREAM stream; ... }; --- with --- GB_DESC CWindowDesc[] = { GB_DECLARE("Window", sizeof(struct nc_window)), GB_INHERITS("Stream"), GB_AUTO_CREATABLE(), ... }; --- I have a set of functions and the --- GB_STREAM_DESC WindowStream = { open: Window_stream_open, close: Window_stream_close, read: Window_stream_read, getchar: Window_stream_getchar, write: Window_stream_write, seek: Window_stream_seek, tell: Window_stream_tell, flush: Window_stream_flush, eof: Window_stream_eof, lof: Window_stream_lof, handle: Window_stream_handle }; --- In the class constructor, I do: --- ... THIS->stream.desc = &WindowStream; THIS->tag = THIS; ... --- When, in a test program, I do: --- Dim cBuf As Byte cBuf = Read #Window As Byte --- a segfault occurs: --- Program received signal SIGSEGV, Segmentation fault. 0x0805cc64 in SUBR_read (code=32000) at gbx_subr_file.c:399 399 stream = get_stream(PARAM, TRUE); --- As I don't understand that macro, I've to ask: Any ideas? Regards, Tobi From tobias at ...692... Mon Apr 30 18:28:30 2012 From: tobias at ...692... (tobi) Date: Mon, 30 Apr 2012 18:28:30 +0200 Subject: [Gambas-devel] Problems inheriting Stream In-Reply-To: <20120422112847.GC586@...693...> References: <20120422112847.GC586@...693...> Message-ID: <20120430162830.GC597@...693...> On Sun, 22 Apr 2012, tobi wrote: > Hi, > > I have problems correctly inheriting Stream. I thought, I followed the instructions, Beno?t gave me: > > > [...] > > a segfault occurs: > > --- > Program received signal SIGSEGV, Segmentation fault. > 0x0805cc64 in SUBR_read (code=32000) at gbx_subr_file.c:399 > 399 stream = get_stream(PARAM, TRUE); > --- > > As I don't understand that macro, I've to ask: Any ideas? > Alright! I got some steps forward in the meantime. My class is auto-creatable and while I cannot read anything from that auto-instance, everything works fine with a manually created Window object. I think that's beyond my scope. Anyone to my rescue? Regards, Tobi