[gcalctool/gcalctool-newui2] ...



commit f5ff84e558cf63731ea6c05801ef168afcc51d1d
Author: Robert Ancell <robert ancell gmail com>
Date:   Fri Sep 11 09:32:43 2009 +1000

    ...

 configure.in |   59 +++++++++++++++++++++++++++++++++++----------------------
 src/gtk.c    |    9 +++++--
 2 files changed, 42 insertions(+), 26 deletions(-)
---
diff --git a/configure.in b/configure.in
index b54d3a7..b37f9c2 100644
--- a/configure.in
+++ b/configure.in
@@ -14,49 +14,52 @@ AC_PROG_CC
 AM_PROG_CC_STDC
 AC_HEADER_STDC
 
-PKG_CHECK_MODULES(ATK, atk >= 1.5)
-AC_SUBST(ATK_CFLAGS)
-AC_SUBST(ATK_LIBS)
+dnl ###########################################################################
+dnl Dependencies
+dnl ###########################################################################
 
-pkg_modules="gtk+-2.0 >= 2.14.0 gobject-2.0 gdk-x11-2.0 glib-2.0 atk gdk-pixbuf-2.0 gmodule-export-2.0"
-PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
-AC_SUBST(PACKAGE_CFLAGS)
-AC_SUBST(PACKAGE_LIBS)
+PKG_CHECK_MODULES(PACKAGE, [
+    gtk+-2.0 >= 2.17.5
+    gobject-2.0
+    gdk-x11-2.0
+    glib-2.0
+    gconf-2.0 >= 1.1.9
+    atk >= 1.5
+    gdk-pixbuf-2.0
+    gmodule-export-2.0
+])
+
+dnl ###########################################################################
+dnl Determine if a usable lex is available on this system
+dnl ###########################################################################
 
 AM_PROG_LEX
 if [[ "$LEX" != "flex" ]]; then
 	AC_MSG_ERROR(flex is required to create the gcalctool scanners)
 fi
-LFLAGS="-8"
-AC_SUBST(LFLAGS)
+
+dnl ###########################################################################
+dnl Determine if a usable yacc is available on this system
+dnl ###########################################################################
 
 AC_PROG_YACC
-dnl determine if a usable yacc is available on this system
 AC_CHECK_PROG(HAVE_YACC, $YACC, yes, no)
 if [[ "$HAVE_YACC" = "no" ]]; then
 	AC_MSG_ERROR($YACC is not usable as yacc - consider using bison)
 fi
 
 dnl ###########################################################################
-dnl PKG_CONFIG and required versions
-dnl ###########################################################################
-
-PKG_CHECK_MODULES(GCONF, gconf-2.0 >= 1.1.9)
-AC_SUBST(GCONF_CFLAGS)
-AC_SUBST(GCONF_LIBS)
-
-dnl ********************
 dnl scrollkeeper checks
-dnl ********************
+dnl ###########################################################################
 
 AC_PATH_PROG(SCROLLKEEPER_CONFIG, scrollkeeper-config,no)
 if test x$SCROLLKEEPER_CONFIG = xno; then
   AC_MSG_ERROR(Couldn't find scrollkeeper-config. Please install the scrollkeeper package)
 fi
 
-dnl *******************************
+dnl ###########################################################################
 dnl Internationalization
-dnl *******************************
+dnl ###########################################################################
 
 GETTEXT_PACKAGE=gcalctool
 AC_PREREQ(2.53)
@@ -66,7 +69,10 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE")
 AM_PROG_LIBTOOL
 AM_GLIB_GNU_GETTEXT
 
+dnl ###########################################################################
 dnl Use -Wall if we have gcc.
+dnl ###########################################################################
+
 changequote(,)dnl
 if test "x$GCC" = "xyes"; then
   case " $CFLAGS " in
@@ -76,7 +82,10 @@ if test "x$GCC" = "xyes"; then
 fi
 changequote([,])dnl
 
+dnl ###########################################################################
 dnl Checking for gconftool-2
+dnl ###########################################################################
+
 AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
 
 if test "x$GCONFTOOL" = xno; then
@@ -85,12 +94,16 @@ fi
 
 AM_GCONF_SOURCE_2
 
-dnl *****************
+dnl ###########################################################################
 dnl API Documentation
-dnl *****************
+dnl ###########################################################################
 
 GNOME_DOC_INIT
 
+dnl ###########################################################################
+dnl Files to generate
+dnl ###########################################################################
+
 AC_OUTPUT([
 Makefile
 src/Makefile
diff --git a/src/gtk.c b/src/gtk.c
index ec07f04..506500e 100644
--- a/src/gtk.c
+++ b/src/gtk.c
@@ -957,9 +957,12 @@ popup_cb(GtkWidget *widget, GdkEventButton *event)
 
     menu = (GtkWidget *)g_object_get_data(G_OBJECT(widget), "calc_menu");
     if (event == NULL) {
+        GtkAllocation allocation;
+        
         gdk_window_get_origin(gtk_widget_get_window(widget), &loc.x, &loc.y);
-        loc.x += widget->allocation.x;
-        loc.y += widget->allocation.y;
+        gtk_widget_get_allocation(widget, &allocation);
+        loc.x += allocation.x;
+        loc.y += allocation.y;
         gtk_menu_popup(GTK_MENU(menu), NULL, NULL, menu_pos_func,
                        (gpointer) &loc, 0, gtk_get_current_event_time());
     } else if (event->button == 1) {
@@ -1277,7 +1280,7 @@ G_MODULE_EXPORT
 void
 insert_ascii_cb(GtkWidget *widget)
 {
-    if (!GTK_WIDGET_VISIBLE(X.ascii_dialog))
+    if (!gtk_widget_get_visible(X.ascii_dialog))
         position_popup(X.main_window, X.ascii_dialog, POPUP_LEFT);
     gtk_widget_grab_focus(GTK_WIDGET(X.ascii_entry));
     gtk_widget_show(X.ascii_dialog);



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