* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
-#include <config.h>
-#include <glib/gprintf.h>
-#include <stdlib.h>
-#include <string.h>
+#include "config.h"
-#include "gdkalias.h"
#include "gdkkeysyms.h"
#include "gdkinternals.h"
#include "keyname-table.h"
-#define GDK_NUM_KEYS (sizeof (gdk_keys_by_keyval) / sizeof (gdk_keys_by_keyval[0]))
+#include <glib/gprintf.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define GDK_NUM_KEYS G_N_ELEMENTS (gdk_keys_by_keyval)
static int
gdk_keys_keyval_compare (const void *pkey, const void *pbase)
{
- return (*(int *) pkey) - ((struct gdk_key *) pbase)->keyval;
+ return (*(int *) pkey) - ((gdk_key *) pbase)->keyval;
}
-gchar*
-gdk_keyval_name (guint keyval)
+static gchar*
+_gdk_keyval_name (guint keyval)
{
static gchar buf[100];
- struct gdk_key *found;
+ gdk_key *found;
/* Check for directly encoded 24-bit UCS characters: */
if ((keyval & 0xff000000) == 0x01000000)
}
found = bsearch (&keyval, gdk_keys_by_keyval,
- GDK_NUM_KEYS, sizeof (struct gdk_key),
+ GDK_NUM_KEYS, sizeof (gdk_key),
gdk_keys_keyval_compare);
if (found != NULL)
gdk_keys_name_compare (const void *pkey, const void *pbase)
{
return strcmp ((const char *) pkey,
- (const char *) (keynames + ((const struct gdk_key *) pbase)->offset));
+ (const char *) (keynames + ((const gdk_key *) pbase)->offset));
}
-guint
-gdk_keyval_from_name (const gchar *keyval_name)
+static guint
+_gdk_keyval_from_name (const gchar *keyval_name)
{
- struct gdk_key *found;
+ gdk_key *found;
g_return_val_if_fail (keyval_name != NULL, 0);
found = bsearch (keyval_name, gdk_keys_by_name,
- GDK_NUM_KEYS, sizeof (struct gdk_key),
+ GDK_NUM_KEYS, sizeof (gdk_key),
gdk_keys_name_compare);
if (found != NULL)
return found->keyval;
else
- return GDK_VoidSymbol;
+ return GDK_KEY_VoidSymbol;
}
-