On Mar 16, 4:11 pm, mattschinkel <[email protected]> wrote: > I like the jallib standard, it makes my code look pretty :) It also > makes others code pretty, and the entire release looks professional. > It is important to be able to read good code such as yours. It even > makes my own code more readable to myself. It may help you, try it. > > It's like smoking... I can choose to smoke, but then my wife will have > to inhale it. > > Matt.
using all lower case + camelCase / CamelCase as appropriate can make it even prettier. But Beauty is in the eye of the beholder. Only bad programs controlling scary machines is like smoking. CamelCase doesn't kill. ** However I 100% and totally agree that to commit code to distributed libraries you have to 100% go by the rules of the librarians. ** So either I have time to make my code fit the current rules, or we adjust the rules or I don't bother... Sometimes I will submit code to current rules and sometimes I'll not bother submitting. The other issue is the structure of libraries and Jaledit IDE directories. There is no correspondence. I think the actual device files & chipdef.jal should be in a separate directory on PC. Then there should be a "library" directory on PC with same structure as "official" distributed libraries. There also seems to be too much of a split of things into separate libraries rather than a larger one. I don't think it makes much difference to compiler as it seems to quickly decide which bits are actually referenced and then spend most of its time analysing and optimising what is actually called / referenced. I've just spent the afternoon re-doing the split between graphics glcd_ks0108 graphics utilities and print. I suggest only lowest level in the ks0108, print becomes terminal and all text related glcd goes in terminal Terminal also has text buttons and other high level GUI. lcd is gone replaced by ScreenChar pseudo var ( or screen_char if you have terminal as an official library) postion text is now ScreenCharXY (or screen_char_xy) fill, lamp on, init etc lcd on/off is LCD_Cmd pseudo var. using constants const byte PANEL_VIRGIN = 0 const byte PANEL_BUSY = 1 const byte PANEL_LAMP_OFF = 2 const byte PANEL_LAMP_ON = 4 const byte PANEL_OFF = 8 const byte PANEL_ON = 16 const byte PANEL_CLEAR = 32 -- white ink const byte PANEL_FILL = 64 -- black ink const byte PANEL_INIT = 128 These can be added LCD_Cmd = PANEL_INIT + PANEL_FILL + PANEL_LAMP_ON -- this initialises panel, fills with black, and turns light on. some_state = LCD_Cmd -- returns value of current state Precedence is from high value to low. if FILL and CLEAR is set then the screen is filled with alternate lines if On and OFF are both set the Panel is on if Lamp is set on and off, currently it is on. Later I will implement 50% on. if LCD_CMD returns zero then the display has not had any commands. Currently "busy" is ignored. Other glcd commands are replaced by ScreenHome(), WriteScreenChar(byte in ch), psuedo var Terminal=myChar (which does stuff with 1 to 31 and 127 as well as printing a character 32 .. 126 (I'm adding 128 to 255 shortly). if the assigned byte is 32 .. 126 then ScreenChar and Terminal behave the same. ScreenChar ignores < 32 and 127. ScreenCharXY (byte in xPos, byte in yPos) and TerminalXY (byte in xPos, byte in yPos) are separate. Thus ScreenChar and Terminal can update different parts of screen with no side effect as they use separate internal xy positions. Wrap at EOL to start of next line and from end of screen to Home is automatic, for normal or double size text. Next week I'll add proportional font with kerning that takes account of previous character. All the higher level stuff will work on larger panels and colour/ greyscale panels, with the DrawButton (x,y, width, hieght, text, ink) integrating to touch interface. -- You received this message because you are subscribed to the Google Groups "jallib" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/jallib?hl=en.
