|
Post by alexfish on Aug 23, 2014 10:26:16 GMT 1
Hi Vovchik
on U'r system can Convert , convert from png / jpg to svg
BR Alex
|
|
|
Post by vovchik on Aug 23, 2014 10:43:32 GMT 1
Dear Alex, On my system convert won't convert a png/jpg to an svg. It creates a file with an svg extension but retains the properties of the original png/jpg. the only real way to convert bitmaps is to use potrace or autotrace - and perhaps a gui front end such as svgpage. The results are very varied. With kind regards, vovchik
|
|
|
Post by alexfish on Aug 23, 2014 11:49:02 GMT 1
Hi Vovchik
been going through the elm source packages
can not find svg generic loader in 1.10(generic loaders) . which is this build, now need to look further since in 1.9 there is a svg loader
now looking further.
BR Alex
|
|
|
Post by vovchik on Aug 23, 2014 12:33:16 GMT 1
Dar Alex, It would have been stupid for them to get rid of the svg loader in 1.10 since it was working fine in previous versions. But, then, stupidity sometimes has no bounds. With kind regards, vovchik
|
|
|
Post by alexfish on Aug 23, 2014 13:40:20 GMT 1
Hi Vovchik hard to explain . infact still trying to get my head around this have got the generic(generic) as in the evas_generic_loaders-1.10.0 , in it is a svg loader these are in the bin . according to info they are there 'to which may be called by the generic loader' what I do not see within the evas loaders... efl-1.10.1/src/modules/evas/loaders / ' a svg loader' per say. have got bmp,eet,genric,gif,ico,jp2k,jpeg,pmaps,png,psd,tga,tgv,tiff,wbmp,webp,xpm so need to go back through earlier libs / or try see what diffs if any are in the evas loaders would be interesting if these be traceable on U'r distro version did see somewhere a header or a svg type loader to which has dependency of librsvg . still looking , again , since had done a compare to see if any diff , at the time they looked the same. added , just kind of wondering what U'r thumbnail views are like int the file browsers see my screen shot / the majority are like that. BR Alex Attachments:
|
|
|
Post by vovchik on Aug 23, 2014 14:05:40 GMT 1
Dear Alex,
I have got the following in /usr/lib/evas/modules/:
bmp eet generic gif ico jpeg pmaps png psd tga tiff wbmp xpm
No svg there but psd (photoshop!). However, svgs work, so they could be handled by eet or generic.
With kind regards, vovchik
|
|
|
Post by alexfish on Aug 23, 2014 21:36:16 GMT 1
Hi Vovchik
done a strip back to distro version elm 1.7.7
the svg loaders work. that be good since for me it be a first , the bad news , the gif with transparency not good,
will now look at emotion.. but will post back on the efl thread.
have also pulled most of the last work done on goo canvas off the old HD , so can do some testing with hug GTK3 , most of the demo's done , worked as 'in' specific to gfx 'based on gtk3' . but like I say they need to be tested with Joes Version.
Can remember U saying , got some problems, is there anything Specific? RE Goo Canvas.
BR Alex
|
|
|
Post by vovchik on Aug 23, 2014 23:26:25 GMT 1
Dear Alex,
It's not so much a goo problem but a gtk3 one. I am unable, as of yet, to set an inline svg or png as a backround image on the top window. gtk3 uses css for this and I have tried using the css inline base64 method and have so far not had any success. Setting the background to a simple colour is easy, but getting an image there is not so easy since pixmap as not used any more. I have not been able to find any good examples. Setting from a file is easy, and Joe has provided several good examples. I have also put up a few things that require either cairo or a gtk layout, but those are, in some respect, kluges. What I am after is something that can make use of:
gtk_widget_set_app_paintable
on the main window and use either a pixbuf or a cairo context.
I think that is my main problem in porting. Any ideas?
With kind regards, vovchik
|
|
|
Post by alexfish on Aug 24, 2014 1:29:59 GMT 1
Hi Vovchik did some digging , found this link developer.gnome.org/gtk3/stable/GtkCssProvider.htmlbest that i got in the short time looking is this c example bit like cairo context but in gtk usual quacky context ADDED:: did a couple of Linea so can see what the @ colour does " (linear, 0 0, 0 1,color-stop(0, #FF5800),color-stop(0.5,#FF5800),color-stop(1, #FF00CA)) ;\n" " (linear, 0 0, 0 1,color-stop(0, #FF5800),color-stop(0.5, @blue),color-stop(1, #FF00CA)) ;\n" HTH Alex /* Compile with: gcc -Wall -o gtk3bgtest `pkg-config --cflags --libs gtk+-3.0` gtk3bgtest.c */
#include <gtk/gtk.h> char* b$; int main(int argc, char *argv[]) { GtkWidget *window;
/*----- CSS ----------- */ GtkCssProvider *provider; GdkDisplay *display; GdkScreen *screen; /*-----------------------*/
gtk_init (&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL); /* gtk_window_set_default_size (GTK_WINDOW(window), 500, 300); */
g_signal_connect (GTK_WIDGET(window), "destroy", G_CALLBACK (gtk_main_quit), NULL);
/*------------- CSS --------------------------------------------------------------------------------------------------*/
provider = gtk_css_provider_new (); display = gdk_display_get_default (); screen = gdk_display_get_default_screen (display);
gtk_style_context_add_provider_for_screen (screen, GTK_STYLE_PROVIDER(provider), GTK_STYLE_PROVIDER_PRIORITY_USER);
gtk_css_provider_load_from_data (GTK_CSS_PROVIDER (provider), " GtkWindow {\n" "background-image: -gtk-gradient " " (radial, 0.4 0.4, 0.1, 0.6 0.6, 0.7, color-stop (0, #f00), color-stop (0.1, #a0f),color-stop (0.2, @yellow),color-stop (1, @green)) ;\n" "}\n", -1, NULL); g_object_unref (provider); /*----------------------------------------------------------------------------------------------------------------------*/
gtk_widget_show_all (window); gtk_main (); return(0); }
/* gboolean gtk_css_provider_load_from_data (GtkCssProvider *css_provider, const gchar *data, gssize length, GError **error); Loads data into css_provider, making it clear any previously loaded information.
css_provider :
a GtkCssProvider data :
CSS data loaded in memory. [array length=length][element-type guint8] length :
the length of data in bytes, or -1 for NUL terminated strings. If length is not -1, the code will assume it is not NUL terminated and will potentially do a copy. error :
return location for a GError, or NULL. [out][allow-none] Returns :
TRUE. The return value is deprecated and FALSE will only be returned for backwards compatibility reasons if an error is not NULL and a loading error occured. To track errors while loading CSS, connect to the GtkCssProvider::parsing-error signal. */
|
|
|
Post by bigbass on Aug 24, 2014 3:41:18 GMT 1
Thanks Alex!
I ported it to the hybrid bacon version nuking the casting part to keep it simple
Joe
PRAGMA OPTIONS `pkg-config --cflags gtk+-3.0` PRAGMA LDFLAGS `pkg-config --libs gtk+-3.0`
'--- Ported the example alexfish posted gtk3bgtest.c '--- to bacon and modified by bigbass OPTION PARSE FALSE
DECLARE *window TYPE void
'-------- CSS ----------- DECLARE provider TYPE void* DECLARE display TYPE void* DECLARE screen TYPE void*
CONST GTK_STYLE_PROVIDER_PRIORITY_FALLBACK = 1 CONST GTK_STYLE_PROVIDER_PRIORITY_THEME = 200 CONST GTK_STYLE_PROVIDER_PRIORITY_SETTINGS = 400 CONST GTK_STYLE_PROVIDER_PRIORITY_APPLICATION = 600 CONST GTK_STYLE_PROVIDER_PRIORITY_USER = 800
GTK_WINDOW_TOPLEVEL = 0
'========================================== SUB close_window (void) '========================================== gtk_main_quit () END SUB
gtk_init (0,0)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (window, 300, 300) g_signal_connect_data(window, "delete-event", close_window, 0, 0, 0)
provider = gtk_css_provider_new () display = gdk_display_get_default () screen = gdk_display_get_default_screen (display)
gtk_style_context_add_provider_for_screen (screen, provider, \ GTK_STYLE_PROVIDER_PRIORITY_USER)
gtk_css_provider_load_from_data (provider, \ " GtkWindow {\n" \ "background-image: -gtk-gradient " \ " (radial, 0.4 0.4, 0.1, 0.6 0.6, 0.7, color-stop (0, #f00), color-stop \ (0.1, #a0f),color-stop (0.2, @yellow),color-stop (1, @green)) ;\n" \ "}\n", -1, NULL) g_object_unref (provider) gtk_widget_show_all (window) gtk_main ()
|
|
|
Post by vovchik on Aug 24, 2014 13:39:57 GMT 1
Dear Alex and Joe, I managed to get the bg grad fill thingy to work with hug3 - a few imports and voila! Looks good, but there must be a way to disable action on some child widgets - e.g. tooltips, which now look rather exotic. And I am still wondering how to get a base64-encoded img to appear (it is possible with css). With kind regards, vovchik PS. We could parametrize SET_BG to include radial/linear and also include some dimensions. We did that once for GOO GFX with Alex. Attachments:hugradfill.tar.gz (42.58 KB)
|
|
|
Post by bigbass on Aug 24, 2014 21:00:15 GMT 1
double post
|
|
|
Post by bigbass on Aug 24, 2014 21:00:56 GMT 1
|
|
|
Post by vovchik on Aug 24, 2014 21:59:14 GMT 1
Dear Joe,
The bse64 thing is needed only for the GtkWindow, since pixbufs still work for other purposes, just not for the top window - and that would usually be done only once at startup, so slowness would not really be a problem with the method, I think. We still have to figure out how to do it nicely.
And we would need something like this:
' ------------------ FUNCTION B64$(STRING dat$) ' ------------------ ' the Base64 constant LOCAL BASE64$ TYPE STRING BASE64$ = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" WHILE LEN(dat$) > 0 DO ' Find ASCII values IF LEN(dat$) = 1 THEN byte1 = ASC(MID$(dat$, 1, 1)) byte2 = 0 byte3 = 0 ELIF LEN(dat$) = 2 THEN byte1 = ASC(MID$(dat$, 1, 1)) byte2 = ASC(MID$(dat$, 2, 1)) byte3 = 0 ELSE byte1 = ASC(MID$(dat$, 1, 1)) byte2 = ASC(MID$(dat$, 2, 1)) byte3 = ASC(MID$(dat$, 3, 1)) END IF ' Create Base64 values base1 = byte1 / 4 base2 = (byte1 & 3) * 16 + (byte2 & 240) / 16 base3 = (byte2 & 15) * 4 + (byte3 & 192) / 64 base4 = byte3 & 63 ' Find Base64 characters IF LEN(dat$) = 1 THEN enc$ = enc$ & MID$(BASE64$, base1 + 1, 1) & MID$(BASE64$, base2 + 1, 1) & "==" dat$ = "" ELIF LEN(dat$) = 2 THEN enc$ = enc$ & MID$(BASE64$, base1 + 1, 1) & MID$(BASE64$, base2 + 1, 1) & MID$(BASE64$, base3 + 1, 1) & "=" dat$ = "" ELSE enc$ = enc$ & MID$(BASE64$, base1 + 1, 1) & MID$(BASE64$, base2 + 1, 1) & MID$(BASE64$, base3 + 1, 1) & MID$(BASE64$, base4 + 1, 1) dat$ = RIGHT$(dat$, LEN(dat$) - 3) END IF WEND RETURN enc$ END FUNCTION
Still mucking about..
With kind regards, vovchik
|
|
|
Post by vovchik on Aug 25, 2014 7:42:27 GMT 1
Dear Joe and Alex, The fill sub now handles both linear and radial fills (mode parameter). It still needs a bit of work so that dimension arguments can be passed - as well as more than two stop colors. I am thinking of how best to do this.... Any ideas? With kind regards, vovchik Attachments:hugradfill1.tar.gz (42.76 KB)
|
|