X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-keypad.c;h=6f7865eb770afd775187a6cef0e4f10de5a0292c;hb=b6ff9071cb7359e7d6b06ee01064116117876c16;hp=c68307c98cae7c0aecc9cc06012251610325fcfc;hpb=146997e1690f055481e2003529eaa4f8848ca4a8;p=pspp diff --git a/src/ui/gui/psppire-keypad.c b/src/ui/gui/psppire-keypad.c index c68307c98c..6f7865eb77 100644 --- a/src/ui/gui/psppire-keypad.c +++ b/src/ui/gui/psppire-keypad.c @@ -1,25 +1,21 @@ -/* PSPP - computes sample statistics. - Copyright (C) 2007 Free Software Foundation, Inc. +/* PSPPIRE - a graphical user interface for PSPP. + Copyright (C) 2007, 2010, 2011 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ - -#include -#include -#include -#include + along with this program. If not, see . */ + +#include +#include #include #include "psppire-keypad.h" @@ -32,7 +28,7 @@ enum { static void psppire_keypad_class_init (PsppireKeypadClass *klass); static void psppire_keypad_init (PsppireKeypad *kp); -static guint keypad_signals[n_SIGNALS] = { 0 }; +static guint keypad_signals [n_SIGNALS] = { 0 }; GType psppire_keypad_get_type (void) @@ -126,7 +122,7 @@ psppire_keypad_class_init (PsppireKeypadClass *klass) The order of these must correspond to the order of the button declarations */ -static const char *keypad_insert_text[] = { +static const char * const keypad_insert_text[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ".", "+", "-", "*", "**", "/", "=", "<>", "<", "<=", ">", ">=", "&", "|", "~", "()", NULL @@ -221,7 +217,7 @@ key_release_callback (GtkWidget *widget, GdkEventKey *event, gpointer user_data) { - if ( ! (GTK_WIDGET_FLAGS (widget) & GTK_HAS_FOCUS) ) + if ( ! gtk_widget_has_focus (widget)) return FALSE; switch (event->keyval) @@ -340,7 +336,7 @@ psppire_keypad_init (PsppireKeypad *kp) { int j = i - 1; char buf[5]; - snprintf (buf, 5, "%d", i); + g_snprintf (buf, 5, "%d", i); kp->digit[i] = gtk_button_new_with_label (buf); if ( i == 0 )