[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/kdevelop/3.4/languages/cpp/app_templates/gtk2mmapp
From: Alexander Dymo <cloudtemple () mksat ! net>
Date: 2005-11-09 16:27:51
Message-ID: 1131553671.584438.13845.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 479204 by dymo:
Updated gtkmm template to work with recent (gtkmm24-2.8.0) versions of
Gtk and Gtkmm.
M +1 -1 Makefile.am
M +1 -2 configure.in
M +3 -4 gtk2mm.cc
M +6 -0 gtk2mm.glade
M +1 -0 gtk2mm.gladep
D gtk2mmapp
M +1 -1 gtk2mmapp.kdevtemplate
M +2 -5 main_window.cc
M +2 -2 main_window.hh
M +21 -10 main_window_glade.cc
M +10 -11 main_window_glade.hh
--- branches/kdevelop/3.4/languages/cpp/app_templates/gtk2mmapp/Makefile.am \
#479203:479204 @@ -1,7 +1,7 @@
dataFiles = acconfig.h autogen.sh gtk2mm.glade main_window.cc \
main_window_glade.hh Makefile.am app-Makefile.am \
configure.in gtk2mm.gladep main_window.hh \
- app.kdevelop gtk2mm.cc gtk2mmapp main_window_glade.cc\
+ app.kdevelop gtk2mm.cc main_window_glade.cc\
src-Makefile.am config.h gtk2mmapp.png
templateName = gtk2mmapp
--- branches/kdevelop/3.4/languages/cpp/app_templates/gtk2mmapp/configure.in \
#479203:479204 @@ -14,7 +14,6 @@
AC_LANG_CPLUSPLUS
-AM_PATH_GTKMM(1.2.8,,
- AC_MSG_ERROR(Cannot find a matching GTK-- library: Please install version 1.2.8 or \
newer)) +PKG_CHECK_MODULES([GTKMM], [gtkmm-2.4 >= 2.8.0])
AC_OUTPUT(Makefile src/Makefile )
--- branches/kdevelop/3.4/languages/cpp/app_templates/gtk2mmapp/gtk2mm.cc \
#479203:479204 @@ -1,6 +1,6 @@
%{CC_TEMPLATE}
-#include <gtk--/main.h>
+#include <gtkmm/main.h>
#include "main_window.hh"
@@ -9,8 +9,7 @@
Gtk::Main m(&argc, &argv);
- main_window *main_window = new class main_window();
- m.run();
- delete main_window;
+ main_window main_window;
+ Gtk::Main::run(main_window);
return 0;
}
--- branches/kdevelop/3.4/languages/cpp/app_templates/gtk2mmapp/gtk2mm.glade \
#479203:479204 @@ -14,6 +14,12 @@
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
<signal name="delete_event" handler="quit"/>
<child>
--- branches/kdevelop/3.4/languages/cpp/app_templates/gtk2mmapp/gtk2mm.gladep \
#479203:479204 @@ -6,4 +6,5 @@
<program_name>%{APPNAMELC}</program_name>
<language>C++</language>
<gnome_support>FALSE</gnome_support>
+ <gettext_support>FALSE</gettext_support>
</glade-project>
--- branches/kdevelop/3.4/languages/cpp/app_templates/gtk2mmapp/gtk2mmapp.kdevtemplate \
#479203:479204 @@ -11,7 +11,7 @@
Name[zh_CN]=Gtk-- 应用程序框架
Category=C++/GTK+
Icon=gtk2mmapp.png
-Comment=Generates a simple Gtk-- application. Gtkmm >= 1.2.8 and < 1.3.0 should be \
installed. To edit glade file glade-- (http://home.wtal.de/petig/Gtk/) is required. \
+Comment=Generates a simple Gtk-- application. Gtkmm >= 2.8.0 should be installed. To \
edit glade file glade-- (http://home.wtal.de/petig/Gtk/) is required. \
Comment[da]=Genererer et simpelt Gtk-- program. Gtkmm >= 1.2.8 og < 1.3.0 skal være \
installeret. For at redigere glade file glade-- kræves \
(http://home.wtal.de/petig/Gtk/). Comment[de]=Erstellt eine einfache Gtk-Anwendung. \
Gtkmm >= 1.2.8 und < 1.3.0 sollte installiert sein. Zum Bearbeiten der glade-Datei \
ist glade-- (http://home.wtal.de/petig/Gtk/) erforderlich. Comment[et]=Lihtsa Gtk-- \
rakenduse loomine. Paigaldatud peab olema Gtkmm >= 1.2.8 ja < 1.3.0. Glade-faili \
redigeerimiseks on vajalik glade-- (http://home.wtal.de/petig/Gtk/).
--- branches/kdevelop/3.4/languages/cpp/app_templates/gtk2mmapp/main_window.cc \
#479203:479204 @@ -7,9 +7,6 @@
#include "config.h"
#include "main_window.hh"
-#include <gtk--/main.h>
-
-gint main_window::quit(GdkEventAny *ev)
-{
- Gtk::Main::quit();
+bool main_window::quit(GdkEventAny *ev)
+{ return 0;
}
--- branches/kdevelop/3.4/languages/cpp/app_templates/gtk2mmapp/main_window.hh \
#479203:479204 @@ -13,7 +13,7 @@
# define _MAIN_WINDOW_HH
class main_window : public main_window_glade
{
-protected:
- virtual gint quit(GdkEventAny *ev);
+
+ bool quit(GdkEventAny *ev);
};
#endif
--- branches/kdevelop/3.4/languages/cpp/app_templates/gtk2mmapp/main_window_glade.cc \
#479203:479204 @@ -1,27 +1,38 @@
%{CC_TEMPLATE}
-// DO NOT EDIT THIS FILE ! It was created using
-// glade-- /home/amp8165/Projects/gtk2mm/gtk2mm.glade
-// for gtk 2.2.4 and gtkmm 1.2.10
+// DO NOT EDIT THIS FILE ! It was created using glade--
+// for gtk 2.8.3 and gtkmm 2.8.0
//
// Please modify the corresponding derived classes in ./src/main_window.cc
+
+#if defined __GNUC__ && __GNUC__ < 3
+#error This program will crash if compiled with g++ 2.x
+// see the dynamic_cast bug in the gtkmm FAQ
+#endif //
#include "config.h"
+#include <gtkmmconfig.h>
+#if GTKMM_MAJOR_VERSION==2 && GTKMM_MINOR_VERSION>2
+#include <sigc++/compatibility.h>
+#define GMM_GTKMM_22_24(a,b) b
+#else //gtkmm 2.2
+#define GMM_GTKMM_22_24(a,b) a
+#endif //
#include "main_window_glade.hh"
#include <gdk/gdkkeysyms.h>
-#include <gtk--/accelgroup.h>
+#include <gtkmm/accelgroup.h>
main_window_glade::main_window_glade(
-) : Gtk::Window(GTK_WINDOW_TOPLEVEL)
+) : Gtk::Window(Gtk::WINDOW_TOPLEVEL)
{ main_window = this;
-
- Gtk::AccelGroup *main_window_accgrp = Gtk::AccelGroup::create();
- gmm_data = new GlademmData(main_window_accgrp);
+ gmm_data = new GlademmData(get_accel_group());
main_window->set_title("%{APPNAME} Project");
main_window->set_modal(false);
- main_window->add_accel_group(*(gmm_data->getAccelGroup()));
+ main_window->property_window_position().set_value(Gtk::WIN_POS_CENTER);
+ main_window->set_resizable(true);
+ main_window->property_destroy_with_parent().set_value(false);
main_window->show();
- main_window->delete_event.connect(SigC::slot(this, &main_window_glade::quit));
+ main_window->signal_delete_event().connect(SigC::slot(*this, \
&main_window_glade::quit), false); }
main_window_glade::~main_window_glade()
--- branches/kdevelop/3.4/languages/cpp/app_templates/gtk2mmapp/main_window_glade.hh \
#479203:479204 @@ -1,8 +1,7 @@
%{HH_TEMPLATE}
-// DO NOT EDIT THIS FILE ! It was created using
-// glade-- /home/amp8165/Projects/gtk2mm/gtk2mm.glade
-// for gtk 2.2.4 and gtkmm 1.2.10
+// DO NOT EDIT THIS FILE ! It was created using glade--
+// for gtk 2.8.3 and gtkmm 2.8.0
//
// Please modify the corresponding derived classes in ./src/main_window.hh \
and./src/main_window.cc
@@ -12,38 +11,38 @@
#if !defined(GLADEMM_DATA)
#define GLADEMM_DATA
-#include <gtk--/accelgroup.h>
+#include <gtkmm/accelgroup.h>
class GlademmData
{
- Gtk::AccelGroup *accgrp;
+ Glib::RefPtr<Gtk::AccelGroup> accgrp;
public:
- GlademmData(Gtk::AccelGroup *ag) : accgrp(ag)
+ GlademmData(Glib::RefPtr<Gtk::AccelGroup> ag) : accgrp(ag)
{
}
- Gtk::AccelGroup * getAccelGroup()
+ Glib::RefPtr<Gtk::AccelGroup> getAccelGroup()
{ return accgrp;
}
};
#endif //GLADEMM_DATA
-#include <gtk--/window.h>
+#include <gtkmm/window.h>
class main_window_glade : public Gtk::Window
{
GlademmData *gmm_data;
public:
- class Gtk::Window *main_window;
+ class Gtk::Window * main_window;
protected:
main_window_glade();
~main_window_glade();
-
- virtual gint quit(GdkEventAny *ev) = 0;
+private:
+ virtual bool quit(GdkEventAny *ev) = 0;
};
#endif
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic