Re: Inlining Gtk2::Gdk::Keysyms ?




j g karssenberg student utwente nl wrote:
Hi,

I need a few key-codes from Gtk2::Gdk::Keysyms in my app.
In an effort to reduce memory usage I was checking data structures,
and it seems to me that the Keysyms hash is quite large.

Can I just take the key codes from the hash and define these as
constants in my program, or is this e.g. platform dependent ?

We could've folded that whole hash into something in the XS code, but it would
not actually have saved any memory usage.  At least with the giant hash in a
separate file, you don't have to load it if you don't need it.

The code in Keysyms.pm is generated at build time from gdkkeysyms.h.  Since
gtk+ is API-stable, i would have to imagine that the values of the keycodes
cannot change.  I don't know if that extends to using the exact same keycodes
for X and Win32, but if you only need a few keycodes, you ought to be safe
creating your own mapping for just those.

Officially:  I do not endorse this duplication, as it is duplication and i'm
not convinced you'll actually save much memory.


-- 
muppet <scott at asofyet dot org>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]