|
Post by alexfish on Jul 20, 2014 1:32:32 GMT 1
Hi Joe looking good , also tested some of U'r bits on Elementary thread , can almost qualify , Bacon now = +0.98, Judges do not often give marks greater than 9.5 , hence in Linux terms +1 not far away for BaCon. Alex. Attachments:
|
|
|
Post by vovchik on Jul 20, 2014 9:45:10 GMT 1
Dear Alex, Very nice. As is Joe's set of demos. Your proto stuff works perfectly, although I have a problem with the drawing bits using GOO in Hug3 - get a runtime segfault. I am looking into that, since the bit that shows the bacon icon works but he other bits do not. With kind regards, vovchik
|
|
|
Post by bigbass on Jul 20, 2014 16:42:50 GMT 1
Hey vovchik I have a problem with the drawing bits using GOO in Hug3 - There are a few more steps needed to get it all working at the moment this is the latest basic-converter.proboards.com/post/6610/threadHUG3DEMOS-1.0.tar.gz (207.3 KB) PAST The first step was to see if the canvas gtk3 code works in pure C The next step was to get the code ported to BaCon's syntax and test all the new gtk3 functions and events PRESENT Now the next step is port the code to HUG syntax but still stand alone using PROTO so as not to get lost in hundreds of lines of HUG code keeping the code snippet small FUTURE After that the next and final step is make it fit in nicely with HUG3 and convert whatever is needed so it can be adapted into HUG cleanly following the defined HUG syntax Joe
|
|
|
Post by bigbass on Jul 22, 2014 15:35:12 GMT 1
Hey guys I got it converted to HUG syntax with some new typedef structs added new GdkEventConfigure,GdkEventMotion *may need to add some new hug_gui_properties to the list later PRESENT PAST! HUG syntax but still stand alone using PROTO so as not to get lost in hundreds of lines of HUG code keeping the code snippet small wiki.basic-converter.org/index.php?title=Gtk3canvasproto-hugalmost there just have to add this to HUG3 having a stand alone section of the code is easier for debugging stuff and adding features as Alex mentioned its easy to get lost in all the bits moving the code closer to HUG syntax makes it better to adapt and read the code we can do this now directly IF (event_motion->state & GDK_BUTTON1_MASK) THEN draw_brush (da, event_motion->x, event_motion->y) END IF Joe
|
|
|
Post by bigbass on Jul 31, 2014 6:35:25 GMT 1
Hey guys progress report on getting the gtk3 canvas in HUG3 I removed "almost" all the casting and this looks closer to HUG syntax I got around casting by using TYPE void for the widgets (even for cairos difficult structs) '--- Surface to store current scribbles 'DECLARE *surface TYPE cairo_surface_t DECLARE *surface TYPE void
notice I included the headers and removed casting with the void trick wiki.basic-converter.org/index.php?title=Gtk3canvasproto2only need to remove the G_CALLBACK cast and its done these are the last 4 lines I need to port to BaCon or figure out another way to get this to work inside the HUG code g_signal_connect(da, "draw", G_CALLBACK (draw_cb), NULL) g_signal_connect (da,"configure-event", G_CALLBACK (configure_event_cb), NULL) g_signal_connect (da, "motion-notify-event", G_CALLBACK (motion_notify_event_cb), NULL) g_signal_connect (da, "button-press-event", G_CALLBACK (button_press_event_cb), NULL) da is the drawing area
|
|
|
Post by bigbass on Jul 31, 2014 14:34:02 GMT 1
Hey Guys removed the last casting replaced the G_CALLBACK to void a nice workaround to gtk's headers forcing ugly casting everywhere '--- Signals used to handle the backing surface g_signal_connect_data((void *)da, "draw", (void *)draw_cb, 0, 0, 0) g_signal_connect_data((void *)da, "configure-event", (void *)configure_event_cb, 0, 0, 0) '--- Event signals g_signal_connect_data((void *)da, "motion-notify-event", (void *)motion_notify_event_cb, 0, 0, 0) g_signal_connect_data((void *)da, "button-press-event", (void *)button_press_event_cb, 0, 0, 0)
Here is a heavy test of OPTION PARSE FALSE in action wiki.basic-converter.org/index.php?title=Gtk3canvasproto3now just have to splice the code into HUG3 (mainly getting the syntax to work) and do some testing I dont know if we can compile HUG with option parse false but we could proto or import if needed since the code snippet works Joe
|
|
|
Post by bigbass on Aug 8, 2014 18:53:35 GMT 1
Hey Guys I have been very busy but had a chance to work on HUG3 today wiki.basic-converter.org/index.php?title=Gtk3canvascairoRemoved the gtk gdk headers and just added the cairo header instead Reasons are HUG will have casting if you include the gtk/gdk headers but cairo is clean and we can do the TYPE void* trick if needed getting this in HUG is quite a process! but a lot of progress was made today some gory details removed this miserable difficult error *** BUG *** In pixman_region32_init_rect: Invalid rectangle passed Set a breakpoint on '_pixman_log_error' to debug
by doing this '--- added this line to get the drawing to work bigbass !! gtk_widget_queue_draw ((void *)da)
and commented out this line that was giving the problem '--- Now invalidate the affected region of the drawing area. 'gtk_widget_queue_draw_area (hug_widget, x - 3, y - 3, 6, 6)
|
|
|
Post by vovchik on Aug 8, 2014 19:09:34 GMT 1
Dear Joe, Works beautifully for me....and now have to look at the code. Great job! Wtih kind regards, vovchik
|
|
|
Post by bigbass on Aug 10, 2014 6:02:45 GMT 1
made some decent progress HUG3 updated fixed gdk3 stuff and the gtk3.bac now all widgets working still small problems with canvas but all widgets close now correctly without hanging getting closer just have to focus on goocanvas now removed many errors but need more example widgets to test As is we can make a lot of things already HUG3DEMOS-2.0.tar.gz (117.61 KB) Joe
|
|
|
Post by vovchik on Aug 10, 2014 11:40:42 GMT 1
Dear Joe,
Very nice job - thanks. I have a little problem with gdk3:
Runtime error: statement 'IMPORT' at line 2 in 'gdk3.bac': Symbol not found in library /usr/lib/i386-linux-gnu/libgdk-3.so: undefined symbol: gdk_add_client_message_filter
and the goo canvas stuff - segfault, but image.bac works. Wondering why....
With kind regards, vovchik
PS. I suspect gtk3 is still kind of a moving target and my versions in Mint16 is older than yours.
|
|
|
Post by bigbass on Aug 10, 2014 15:32:51 GMT 1
Hey vovchik No,there are big problems still porting stuff but this will work at least compile or no runtime errors now sourceforge.net/p/baconproto/wiki/gdk3.bac/about goo there is a goo 2 package but have to get the package name right try apt-cache search goocanvas
and see if its there somwhere will check later on mint 17 I am testing on LMDE mint 17 LTS 5 year supportsomeone finally woke up .People are really tired of constant updates and just want to do some work or compile apps now with phones doing most of what people want we need a stable OS apt-cache search goocanvas gir1.2-goocanvas-2.0-9 - Typelib file for goocanvas libgoo-canvas-perl - Perl interface to the GooCanvas libgoocanvas-2.0-9 - canvas widget for GTK+ that uses the cairo 2D library libgoocanvas-2.0-9-common - translations for goocanvas libgoocanvas-2.0-dev - development libraries, include files and documentation for goocanvas
Thanks for the report! Joe
|
|
|
Post by vovchik on Aug 10, 2014 17:21:41 GMT 1
Dear Joe,
Yes, and I will have to bite the bullet and install Mint 17 soon. Right now I have an urgent job - a rather elderly lady (70+) has lost her inet connection and has asked me to come and fix it as her son failed. The technical guy at the ISP said he could come only on Thursday. It is a Windows setup - and I have not used M$ for at least 10 years, but I will give it a try. I will report back later...and thanks for the links go goocanvas etc., which I will need.
With kind regards, vovchik
|
|
|
Post by bigbass on Aug 12, 2014 18:25:16 GMT 1
Goocanvas 2 is working with HUG3 here is a old demo by Alex updated to use Gdk3 ,goo2 and HUG3 only had to update just 2 lines of code for the demo to work this means we will be able to update some more code demos to goo2 I hope ! INCLUDE hug3.bac HUGOPTIONS("NOSCALING") 'Goo$="libgoocanvas.so" Goo$="libgoocanvas-2.0.so"
change hug for hug3then change libgoocanvas.so for libgoocanvas-2.0.so ' @ GooCanvas Animation Demo1 ' @ alexfish BaCon ConVerter Forums '-------------------------------------------------- '@ Click Start , click on moving canvas widget to score
INCLUDE hug3.bac HUGOPTIONS("NOSCALING") 'Goo$="libgoocanvas.so"
Goo$="libgoocanvas-2.0.so"
'@ bits required for GooCanvas demo IMPORT "goo_canvas_new" FROM Goo$ TYPE long IMPORT "goo_canvas_rect_new(long,double,double,double,double,...)" FROM Goo$ TYPE long IMPORT "goo_canvas_get_root_item(long)" FROM Goo$ TYPE long IMPORT "goo_canvas_set_bounds(long,double,double,double,double)" FROM Goo$ TYPE void IMPORT "goo_canvas_widget_new(long,long,double,double,double,double,...)" FROM Goo$ TYPE long IMPORT "goo_canvas_item_animate(long,double,double,double,double,int,int,int,int)" FROM Goo$ TYPE void IMPORT "goo_canvas_item_set_child_properties(long,long,...)" FROM Goo$ TYPE void
'@ setting for animation GOO_CANVAS_ANIMATE_FREEZE = 0 GOO_CANVAS_ANIMATE_RESET = 1 GOO_CANVAS_ANIMATE_RESTART = 2 GOO_CANVAS_ANIMATE_BOUNCE = 3
'@ global score score=0
'@ set up GooCavas using HUG type format FUNCTION GooCanvas(int hug_xsize, int hug_ysize)
LOCAL canvas ,root canvas = goo_canvas_new() goo_canvas_set_bounds(canvas,0,0,hug_xsize,hug_ysize)
IF HUG_WIDGET_SHOW THEN gtk_widget_show_all(canvas)
hug_widget_image(STR$(canvas)) = canvas hug_widget_xsize(STR$(canvas)) = hug_xsize hug_widget_ysize(STR$(canvas)) = hug_ysize hug_widget_signal(STR$(canvas)) = 4 hug_widget_s_widget(STR$(canvas)) = canvas hug_widget_type$(STR$(canvas)) = "canvas"
RETURN canvas
END FUNCTION
'@ this is a callback to the Canvas item rectangle score SUB rect_click() PRINT "Rectangle Clicked" INCR score TEXT(entry,STR$(score)) END SUB
SUB animate goo_canvas_item_animate(rect_item,500,300,2,360,TRUE,1000,5,GOO_CANVAS_ANIMATE_BOUNCE) /* '@ this is the structure goo_canvas_item_animate (GooCanvasItem *item, gdouble x, gdouble y, gdouble scale, gdouble degrees, gboolean absolute, gint duration, gint step_time, GooCanvasAnimateType type
*/
'@ try setting the values + use @ setting for animation '-------------------------------------------------------------------------
END SUB
'@ set up a normal hug window win=WINDOW("test",600,400)
'@ add a GooCanvas Widget Canvas1= GooCanvas(600,400) ATTACH (win,Canvas1,0,0)
'@ get the Root of the GooCanvas Root_Canvas1= goo_canvas_get_root_item(Canvas1)
rect_item = goo_canvas_rect_new (Root_Canvas1, 5, 5, 50, 50, "can-focus",1,"line-width", 2.0,"radius-x", 6.0, "radius-y", 6.0,"fill-color", "brown","stroke-color", "gray",0) '@ set a callback to the canvas rect_item score g_signal_connect_data(rect_item, "button-press-event", rect_click, 0, 0, 0)
'@ Add some hug widgets to the canvas '@ make a hug entry entry=ENTRY("Score",100,30) '@ add the ENTRY widget to the canvas canvas_entry=goo_canvas_widget_new(Root_Canvas1,entry,120,360,-1,-1,0,0)
but1=BUTTON("Start",100,30) '@ set callback to animate the rectangle CALLBACK(but1, animate) canvas_but=goo_canvas_widget_new(Root_Canvas1,but1,10,360,100,30,0,0)
DISPLAY
|
|
|
Post by bigbass on Aug 13, 2014 16:28:13 GMT 1
Have a functional HUG3 for gtk3 gdk3 and goo2 the gdk3 code compiles for the canvas but will have to tune things for HUG syntax of course I will have to walk through all of the great demos Alex and vovchik did for goocanvas and fix up things as I go (to get stuff to compile and run with the new libs) but the demos I tested are working with just changing to the new libs and compiling against HUG3 HUG3DEMOS-2.1.tar.gz (401.25 KB) you will have to have goo2 installed to compile those apps libgoocanvas-2.0-dev - development libraries, include files and documentation for goocanvas but I included some binaries for testing since HUG is fast now we don't need a special hug lib so using HUG3.bac is more transparent and easy for anyone to edit P.S I see this as a community project where Peter made and is author of HUG Alex added goocanvas . vovchik made many example demos I added the gtk3 gdk3 demos and modified HUG for the new libs so like I said we all added stuff here and its a community thing maybe Peter will pick it up clean up things and make it official someday maybe not ? but anyway its out there for just testing purposes and proof of concept that HUG can be updated for gtk3 tested these demos so there is something to get started with action-types.bac aster.bac asteroid.bac button1.bac canvas.bac checkbox.bac combobox.bac dynamic-combobox.bac dynamic-listbox.bac edit2.bac edit.bac entry.bac goo2.bac goocanvas.bac gootest3.bac Gtk3canvascairo.bac hello.bac hslider.bac image.bac input.bac label.bac listbox.bac markup.bac messagedialog.bac notebook.bac progressbar.bac radio.bac resize-window.bac spinbox.bac spinner.bac spinner_INCLUDE.bac vslider.bac * gdk3.bac this is an include file Joe
|
|
|
Post by vovchik on Aug 13, 2014 16:48:18 GMT 1
Dear Joe, Great work. Everything I have tested - inluding the goocanvas stuff - works great. And it compiles very quickly, which is a joy. Thanks... With kind regards, vovchik
|
|