[Gtk-sharp-list] gtk_icon_size_lookup

Mathias Hasselmann mathias.hasselmann@gmx.de
09 Mar 2003 03:38:46 +0100


--=-QeCVJw68FBYoqJO79ZTT
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Realized that Gtk# leaks a mapping of gtk_icon_size_lookup as found in
gtkiconfactory.h. Attached you'll find a .custom file to add this
functionally to Gtk#. gtk_icon_size_lookup requires two out parameters
(width and height) as arguments. Since I'm unsure what's the preferred
way in Gtk# of wrapping this kind of stuff I've provide a version with
out arguments and another version with System.Drawing.Size as result
type. The one is efficient, the other one nice and convenient to use.
I let it up to use to decide which to merge....

Ciao,
Mathias

--=-QeCVJw68FBYoqJO79ZTT
Content-Disposition: attachment; filename=IconFactory.custom
Content-Type: text/plain; name=IconFactory.custom; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

                [DllImport("libgtk-win32-2.0-0.dll")]
                extern static void gtk_icon_size_lookup (IconSize size, out int width, out int height);

                /// <summary> Query icon dimensions </summary>
                /// <remarks> Queries dimensions for icons of the specified size. </remarks>
                public void LookupIconSize (IconSize size, out int width, out int height)
                {
                    gtk_icon_size_lookup (size, out width, out height);
                }

                /// <summary> Query icon dimensions </summary>
                /// <remarks> Queries dimensions for icons of the specified size. </remarks>
                public System.Drawing.Size LookupIconSize (IconSize size)
                {
                    int width, height;
                    gtk_icon_size_lookup (size, out width, out height);
                    return new System.Drawing.Size(width, height);
                }

--=-QeCVJw68FBYoqJO79ZTT--