Re: Convert png inline into a gdk-pixbuf?

2009-07-09 Thread David Nečas
On Thu, Jul 09, 2009 at 08:46:39AM +0200, Till Harbaum wrote:
> How can i decode a png image stored in a memory buffer into a gdk-pixmap 
> without
> saving it in a file during that process?

Create a GdkPixbufLoader with gdk_pixbuf_loader_new_with_type(), pass
the data with gdk_pixbuf_loader_write(), finish with
gdk_pixbuf_loader_close(), get the pixbuf with
gdk_pixbuf_loader_get_pixbuf(), clean-up.

Yeti

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Re: Convert png inline into a gdk-pixbuf?

2009-07-09 Thread Till Harbaum
Hi,

works like a charm, thanks! 

Till

- original Nachricht 

Betreff: Re: Convert png inline into a gdk-pixbuf?
Gesendet: Do, 09. Jul 2009
Von: David Nečas

> On Thu, Jul 09, 2009 at 08:46:39AM +0200, Till Harbaum wrote:
> > How can i decode a png image stored in a memory buffer into a gdk-pixmap
> without
> > saving it in a file during that process?
> 
> Create a GdkPixbufLoader with gdk_pixbuf_loader_new_with_type(), pass
> the data with gdk_pixbuf_loader_write(), finish with
> gdk_pixbuf_loader_close(), get the pixbuf with
> gdk_pixbuf_loader_get_pixbuf(), clean-up.
> 
> Yeti
> 
> 

--- original Nachricht Ende 

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Re: Convert png inline into a gdk-pixbuf?

2009-07-09 Thread Till Harbaum
Hi,

one more question, please. Regarding your "clean-up". If i want to
continue to use the pixbuf but not the loader i do:

g_object_ref(pixbuf);
g_object_unref(loader);

Does this look good to you?

Till

- original Nachricht 

Betreff: Re: Convert png inline into a gdk-pixbuf?
Gesendet: Do, 09. Jul 2009
Von: David Nečas

> On Thu, Jul 09, 2009 at 08:46:39AM +0200, Till Harbaum wrote:
> > How can i decode a png image stored in a memory buffer into a gdk-pixmap
> without
> > saving it in a file during that process?
> 
> Create a GdkPixbufLoader with gdk_pixbuf_loader_new_with_type(), pass
> the data with gdk_pixbuf_loader_write(), finish with
> gdk_pixbuf_loader_close(), get the pixbuf with
> gdk_pixbuf_loader_get_pixbuf(), clean-up.
> 
> Yeti
> 
> 

--- original Nachricht Ende 

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Convert png inline into a gdk-pixbuf?

2009-07-09 Thread David Nečas
On Thu, Jul 09, 2009 at 10:56:44AM +0200, Till Harbaum wrote:
> one more question, please. Regarding your "clean-up". If i want to
> continue to use the pixbuf but not the loader i do:
> 
> g_object_ref(pixbuf);
> g_object_unref(loader);
> 
> Does this look good to you?

This should be correct, IIRC the pixbuf is owned by the loader.

Yeti

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


trouble with win version of a linux gtk app

2009-07-09 Thread Manu TM

Hi!

I have made a ticker app for linux that I'm trying to port to winxp with 
mingw and msys.
The app reads then renders a text file to a pixmap (a long single-line 
image), then it scrolls the pixmap by drawing a part of it to a 
drawing_area, using gdk_draw_drawable() within a timeout handler.
The problem is it works fine on linux (the scrolling is really smooth) 
but the win version is choppy and flickering.
Does anyone have an idea? Is it a related to threads or drawing_area or 
gtk for win?


Thanks in advance.

Manu Thomas-Maurin

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: gtk_file_chooser_hangs

2009-07-09 Thread Michael Cronenworth
arne on 07/09/2009 12:39 AM wrote:
> I have the problem, that the gtk_file_chooser is not working anymore in
> my application under win32. I get just a sandglass-curser over it.
> I get no warning or errormessage on the console.
> 
> I Setup a new Computer with Mingw and the actual (2009/06/01) All-In ONE
> Bundle.

I just compiled an app with Fedora 11 Mingw (gcc 4.4.0) and I have no
problems with gtk_file_chooser.

It's possible that whatever you have the default path is a network link
or some other path that is not immediately accessible. Is it?
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


g_spawn_async_with_pipes() & ssh based IPC

2009-07-09 Thread Thomas Stover
So as much as I wish there were real (open source) ssh client and server 
C libraries for the ssh infrastructure, the general approach seems to to 
be child process with redirected IO on the client (with ssh on *nix and 
plink.exe on windows). On the server side connecting to a long running 
"server" program would require a helper program launched by the ssh 
server that then connects up via unix socket or something (why on earth 
wasn't unix socket forwarding part of the original idea?). I bet someone 
out there has tried this. Did it work? Anything odd to consider? Any 
alternative ideas? Any way to even imagine a secure server side on 
windows (win named pipes perhapses?). Is all this in anyway better than 
a maybe a custom tls/ssl server or something? I know this is slightly 
off topic, but I know everybody has had to ask themselves this same 
question.



___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: g_spawn_async_with_pipes() & ssh based IPC

2009-07-09 Thread Michael Cronenworth
Thomas Stover on 07/09/2009 02:37 PM wrote:
> Is all this in anyway better than
> a maybe a custom tls/ssl server or something? I know this is slightly
> off topic, but I know everybody has had to ask themselves this same
> question.

It's simple to write a GnuTLS server/client setup. Why don't you want to
do that?
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: g_spawn_async_with_pipes() & ssh based IPC

2009-07-09 Thread Thomas Stover

Michael Cronenworth wrote:

Thomas Stover on 07/09/2009 02:37 PM wrote:
  

Is all this in anyway better than
a maybe a custom tls/ssl server or something? I know this is slightly
off topic, but I know everybody has had to ask themselves this same
question.



It's simple to write a GnuTLS server/client setup. Why don't you want to
do that?
  


I've done an openssl one before, and I'll look at gnutls, but the 
problems with that route as I see it are mainly:
-you have to authenticate connections somehow- portably, and securely. 
Where as with ssh the OS just provides you with UIDs. I'm not a fan of 
the completely separate user database just for the one program 
architecture either.
-(related to authentication) key management - ssh does all that already 
(ssh-agent, etc) (although the gnome-keyring library works for *nix)

-more options for an admin to deal with
-as legacy as ssh is, it does so much so well. It just "feels" like 
leveraging that would be a good idea.


Also I might be thinking of the wrong project, but I have some vague 
memory of GnuTLS taking the downloads on their site down in protest 
after 911 (unless you donated money) or something quacky like that. 
(I'm  pretty sure I shouldn't have said that, but whatever).


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: gtk_file_chooser_hangs

2009-07-09 Thread arne

> I just compiled an app with Fedora 11 Mingw (gcc 4.4.0) and I have no
> problems with gtk_file_chooser.
>
> It's possible that whatever you have the default path is a network link
> or some other path that is not immediately accessible. Is it?
I will make a Test, without any Network and without the card reader which is 
build in.
But I have no problems with Gimp and Glade and all other File-Handling 
Applications.

What is the difference to the older Version of gtk
(libgdk-win32-2.0-0.dll, libgtk-win32-2.0-0.dll) from August 2008?
With this Version I don't have any problems, I just need to change the dll's, and the File-chooser 
works.


Can someone Tell me where I can find the Source of the File-Chooser?
Perhaps I could try to compile it with some Debug-Output.

Best regards
  Arne
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: g_spawn_async_with_pipes() & ssh based IPC

2009-07-09 Thread Michael Cronenworth
Thomas Stover on 07/09/2009 03:16 PM wrote:
> 
> I've done an openssl one before, and I'll look at gnutls, but the
> problems with that route as I see it are mainly:
> -you have to authenticate connections somehow- portably, and securely.
> Where as with ssh the OS just provides you with UIDs. I'm not a fan of
> the completely separate user database just for the one program
> architecture either.
> -(related to authentication) key management - ssh does all that already
> (ssh-agent, etc) (although the gnome-keyring library works for *nix)
> -more options for an admin to deal with
> -as legacy as ssh is, it does so much so well. It just "feels" like
> leveraging that would be a good idea.
> 
> Also I might be thinking of the wrong project, but I have some vague
> memory of GnuTLS taking the downloads on their site down in protest
> after 911 (unless you donated money) or something quacky like that.
> (I'm  pretty sure I shouldn't have said that, but whatever).
> 

You could have a TLS session without x509 auth and just use PAM or LDAP
for user auth. Something like that is not provided by a single function
call though.

Too many options? If you make the server/client yourself then it's
limited to however you program it. I don't understand your reasoning for
this complaint.

SSH is great for remote terminal sessions, but not much more. It sounds
like you just want to be extremely lazy. Suck it up and write your own
implementation using the standard library tools available. It will be
portable -- my GnuTLS apps run on Linux and Windows.

I don't remember anything about GnuTLS and any political agenda as that
was before my time in FOSS, but I wouldn't be surprised.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: g_spawn_async_with_pipes() & ssh based IPC

2009-07-09 Thread Brian J. Tarricone

On 2009/07/09 13:25, Michael Cronenworth wrote:


SSH is great for remote terminal sessions, but not much more.


I think the sshfs guys might beg to differ with you on that one.  As 
would anyone who uses subversion or git (etc.) over ssh.  Or anyone 
who's tunneled various protocols using ssh's port forwarding.



It sounds like you just want to be extremely lazy. Suck it up and write your own
implementation using the standard library tools available.


And here I was thinking that the entire point of writing computer 
programs was so we could be lazy.


Anyway, Thomas: as long as you're able to parse the responses you get 
from the server, using g_spawn_async_with_pipes() and probably 
GIOChannel, you should be able to do what you want.


It probably would be more reliable to write your own TLS server and 
client, but might not be faster or easier.  I'm not sure about the win32 
issues, though.


-brian
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: g_spawn_async_with_pipes() & ssh based IPC

2009-07-09 Thread Thomas Stover

Michael Cronenworth wrote:


You could have a TLS session without x509 auth and just use PAM or LDAP
for user auth. Something like that is not provided by a single function
call though.
  


In a perfect world a password, another private key, or what ever 
wouldn't ever enter the picture. ssh-agent / pageant.exe work so darn 
well once you get up and running. It's already sad enough that there is 
no way to merge this world with https client authentication, somehow. 
SVN is one example of something that let's you keep things simple 
administratively by optionally using the ssh security model. I hate to 
say it, but the windows named pipes over SMB is another good model (the 
implementation however...).


Passwords all over the place = evil. Each application asking you to 
decrypt a private key / cert on its own = annoying. Again 
gnome-keyring-daemon is on the right track, but I need something for the 
windows side.




It sounds  like you just want to be extremely lazy. 


That's the kind of support I need on a 24 hour a day basis.


Suck it up and write your own
implementation using the standard library tools available. It will be
portable -- my GnuTLS apps run on Linux and Windows.

  

This is with a glib event loop right?


--
www.thomasstover.com

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: g_spawn_async_with_pipes() & ssh based IPC

2009-07-09 Thread Michael Cronenworth
Brian J. Tarricone on 07/09/2009 03:45 PM wrote:
> 
> I think the sshfs guys might beg to differ with you on that one.  As
> would anyone who uses subversion or git (etc.) over ssh.  Or anyone
> who's tunneled various protocols using ssh's port forwarding.
> 

That's off-topic. I'm not ignorant to those use cases.

> 
> And here I was thinking that the entire point of writing computer
> programs was so we could be lazy.

Note my word *extreme*. I'm all for easy programming -- but it sounded
like the OP wanted to write three function calls and be done.

> 
> Anyway, Thomas: as long as you're able to parse the responses you get
> from the server, using g_spawn_async_with_pipes() and probably
> GIOChannel, you should be able to do what you want.
> 
> It probably would be more reliable to write your own TLS server and
> client, but might not be faster or easier.  I'm not sure about the win32
> issues, though.

There should be zero win32 issues. One of my Win32 apps uses a GTK gui
to talk to a Linux server daemon using XML-ized data packets. Not
exactly the same but it works perfectly.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: g_spawn_async_with_pipes() & ssh based IPC

2009-07-09 Thread Michael Cronenworth
Thomas Stover on 07/09/2009 03:55 PM wrote:
> 
> In a perfect world a password, another private key, or what ever
> wouldn't ever enter the picture. ssh-agent / pageant.exe work so darn
> well once you get up and running. It's already sad enough that there is
> no way to merge this world with https client authentication, somehow.
> SVN is one example of something that let's you keep things simple
> administratively by optionally using the ssh security model. I hate to
> say it, but the windows named pipes over SMB is another good model (the
> implementation however...).
> 
> Passwords all over the place = evil. Each application asking you to
> decrypt a private key / cert on its own = annoying. Again
> gnome-keyring-daemon is on the right track, but I need something for the
> windows side.
> 

I understand your authentication requirement, but I haven't written a
program myself that masters these interfaces (PAM, LDAP, etc) so this
will be my last comment on this. I have extensive knowledge using these
interfaces across multiple applications however.

There was something that crossed my mind when I first read your OP and
this may or may not be what you are looking for...

http://www.libssh2.org/wiki/index.php/Main_Page

There's packages in Fedora (and probably Debian, etc) for this library,
but I have not used it.

> 
> That's the kind of support I need on a 24 hour a day basis.
> 

I hear you. 99.999% uptime is golden.

> This is with a glib event loop right?
> 

Yep.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


performance degrading with win32 version

2009-07-09 Thread Manu TM

Hi!

I now have another question about the linux app ported to winxp. It's a 
ticker app that reads then renders a text file to a pixmap (a tall 
single-line image), then it kind of scrolls the pixmap by drawing a part 
of it to a drawing_area, using gdk_draw_drawable() within a timeout 
handler set by g_timeout_add().
The problem is it works fine on linux (the scrolling is really smooth) 
but the win version is choppy and flickering and uses at least 90% of 
cpu resources (vs 15% with linux.)
Does anyone have an clue? Is it related to some mingw config or threads 
or drawing_area or gtk for win?


Thank you.

Manu Thomas-Maurin

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


usb plug/unplug notifications

2009-07-09 Thread Garth's KidStuff
Hi All,
I'd like to know how to intercept usb events.  Right now, I'm polling for
changes, but that isn't the "right" way to handle device discovery.  Is
there a way to get a notification when something happens in the usb world?

Thanks in advance.

-Garth

-- 
Garth Upshaw
Garth's KidStuff
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: usb plug/unplug notifications

2009-07-09 Thread John Coppens
On Thu, 9 Jul 2009 17:38:24 -0500
"Garth's KidStuff"  wrote:

> I'd like to know how to intercept usb events.  Right now, I'm polling
> for changes, but that isn't the "right" way to handle device
> discovery.  Is there a way to get a notification when something happens
> in the usb world?

In recent distributions, udev is used. udev manages all hardware events,
and executes rules which are located in (possibly several) locations.
One such location is /usr/udev/rules. You can edit those rules to make
events call your programs, modify things, etc. 

The syntax of the rules is relatively simple and powerful, and you can
edit them with a simple editor. The command

udevadm monitor

will show you the events on the terminal, as a way to look at the events
that are detected. Do a 'man udev' for more info.

John
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: usb plug/unplug notifications

2009-07-09 Thread Ardhan Madras
For desktop application (because we are GTK+ forum) there is HAL (Hardware 
Abstraction Layer) http://www.freedesktop.org/wiki/Software/hal to receive 
events and informations from devices and the kernel, gnome-volume-manager use 
HAL to know when a device has been attached then do some task that the user has 
defined (eg. mount).

--- ajhwb

--- garthskidst...@gmail.com wrote:

From: "Garth's KidStuff" 
To: gtk-app-devel-list@gnome.org
Subject: usb plug/unplug notifications
Date: Thu, 9 Jul 2009 17:38:24 -0500

Hi All,
I'd like to know how to intercept usb events.  Right now, I'm polling for
changes, but that isn't the "right" way to handle device discovery.  Is
there a way to get a notification when something happens in the usb world?

Thanks in advance.

-Garth

-- 
Garth Upshaw
Garth's KidStuff
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




_
Listen to KNAC, Hit the Home page and Tune In Live! ---> http://www.knac.com
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: usb plug/unplug notifications

2009-07-09 Thread Michael Cronenworth

On 07/09/2009 09:14 PM, Ardhan Madras wrote:

For desktop application (because we are GTK+ forum) there is HAL (Hardware 
Abstraction Layer) http://www.freedesktop.org/wiki/Software/hal to receive 
events and informations from devices and the kernel, gnome-volume-manager use 
HAL to know when a device has been attached then do some task that the user has 
defined (eg. mount).
   


I'd advice against programming to HAL unless your environment requires it.

DeviceKit is the future.


P.S. Top posting? :)
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list