[Esbox-commits] r162 - in trunk/org.indt.esbox.ui/templates: . CppDrawExample CppDrawExample/src CppGconfExample CppGconfExample/src CppHelloWorld CppHelloWorld/src CppHelloworldI18n CppHelloworldI18n/po CppHelloworldI18n/src CppNewHelloWorld CppNewHelloWorld/src
pauloromulo at garage.maemo.org
pauloromulo at garage.maemo.org
Sun Oct 21 23:13:36 EEST 2007
Author: pauloromulo
Date: 2007-10-21 23:13:35 +0300 (Sun, 21 Oct 2007)
New Revision: 162
Added:
trunk/org.indt.esbox.ui/templates/CppDrawExample/
trunk/org.indt.esbox.ui/templates/CppDrawExample/Makefile.am
trunk/org.indt.esbox.ui/templates/CppDrawExample/configure.ac
trunk/org.indt.esbox.ui/templates/CppDrawExample/src/
trunk/org.indt.esbox.ui/templates/CppDrawExample/src/Makefile.am
trunk/org.indt.esbox.ui/templates/CppDrawExample/src/main.cc
trunk/org.indt.esbox.ui/templates/CppDrawExample/src/main.cpp
trunk/org.indt.esbox.ui/templates/CppDrawExample/src/mywindow.cc
trunk/org.indt.esbox.ui/templates/CppDrawExample/src/mywindow.cpp
trunk/org.indt.esbox.ui/templates/CppDrawExample/src/mywindow.h
trunk/org.indt.esbox.ui/templates/CppDrawExample/template.properties
trunk/org.indt.esbox.ui/templates/CppDrawExample/template.xml
trunk/org.indt.esbox.ui/templates/CppGconfExample/
trunk/org.indt.esbox.ui/templates/CppGconfExample/Makefile.am
trunk/org.indt.esbox.ui/templates/CppGconfExample/configure.ac
trunk/org.indt.esbox.ui/templates/CppGconfExample/src/
trunk/org.indt.esbox.ui/templates/CppGconfExample/src/Makefile.am
trunk/org.indt.esbox.ui/templates/CppGconfExample/src/main.cc
trunk/org.indt.esbox.ui/templates/CppGconfExample/src/main.cpp
trunk/org.indt.esbox.ui/templates/CppGconfExample/src/mywindow.cc
trunk/org.indt.esbox.ui/templates/CppGconfExample/src/mywindow.cpp
trunk/org.indt.esbox.ui/templates/CppGconfExample/src/mywindow.h
trunk/org.indt.esbox.ui/templates/CppGconfExample/template.properties
trunk/org.indt.esbox.ui/templates/CppGconfExample/template.xml
trunk/org.indt.esbox.ui/templates/CppHelloWorld/
trunk/org.indt.esbox.ui/templates/CppHelloWorld/Makefile.am
trunk/org.indt.esbox.ui/templates/CppHelloWorld/configure.ac
trunk/org.indt.esbox.ui/templates/CppHelloWorld/src/
trunk/org.indt.esbox.ui/templates/CppHelloWorld/src/Makefile.am
trunk/org.indt.esbox.ui/templates/CppHelloWorld/src/main.cc
trunk/org.indt.esbox.ui/templates/CppHelloWorld/src/main.cpp
trunk/org.indt.esbox.ui/templates/CppHelloWorld/src/mywindow.cc
trunk/org.indt.esbox.ui/templates/CppHelloWorld/src/mywindow.cpp
trunk/org.indt.esbox.ui/templates/CppHelloWorld/src/mywindow.h
trunk/org.indt.esbox.ui/templates/CppHelloWorld/template.properties
trunk/org.indt.esbox.ui/templates/CppHelloWorld/template.xml
trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/
trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/Makefile.am
trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/configure.ac
trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/po/
trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/po/LINGUAS.htm
trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/po/POTFILES.in
trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/po/en_GB.po
trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/po/pt_BR.po
trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/src/
trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/src/Makefile.am
trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/src/helloworld.htm
trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/src/main.cc
trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/src/main.cpp
trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/src/mywindow.cc
trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/src/mywindow.cpp
trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/src/mywindow.h
trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/template.properties
trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/template.xml
trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/
trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/Makefile.am
trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/configure.ac
trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/src/
trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/src/Makefile.am
trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/src/main.cc
trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/src/main.cpp
trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/src/mywindow.cc
trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/src/mywindow.cpp
trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/src/mywindow.h
trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/template.properties
trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/template.xml
Log:
more Maemo projects templates added
Added: trunk/org.indt.esbox.ui/templates/CppDrawExample/Makefile.am
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppDrawExample/Makefile.am (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppDrawExample/Makefile.am 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,3 @@
+AUTOMAKE_OPTIONS = foreign
+
+SUBDIRS = src
Added: trunk/org.indt.esbox.ui/templates/CppDrawExample/configure.ac
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppDrawExample/configure.ac (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppDrawExample/configure.ac 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,22 @@
+AC_INIT(draw_example, 0.2)
+AC_PREREQ(2.59)
+
+AM_INIT_AUTOMAKE([1.7.9])
+AC_CONFIG_HEADERS([config.h])
+
+AC_GNU_SOURCE
+AC_CANONICAL_HOST
+AM_MAINTAINER_MODE
+
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+AC_PROG_CXX
+
+AC_CONFIG_FILES([Makefile
+ src/Makefile])
+
+PKG_CHECK_MODULES(LIBHILDONMM, hildonmm >= 0.9.6)
+AC_SUBST(LIBHILDONMM_CFLAGS)
+AC_SUBST(LIBHILDONMM_LIBS)
+
+AC_OUTPUT
Added: trunk/org.indt.esbox.ui/templates/CppDrawExample/src/Makefile.am
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppDrawExample/src/Makefile.am (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppDrawExample/src/Makefile.am 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,9 @@
+AUTOMAKE_OPTIONS = foreign
+
+bin_PROGRAMS = draw_example
+draw_example_SOURCES = main.cpp \
+ mywindow.cpp \
+ mywindow.h
+
+draw_example_LDADD = $(LIBHILDONMM_LIBS)
+draw_example_CXXFLAGS = $(LIBHILDONMM_CFLAGS)
Added: trunk/org.indt.esbox.ui/templates/CppDrawExample/src/main.cc
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppDrawExample/src/main.cc (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppDrawExample/src/main.cc 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,45 @@
+/*
+ ============================================================================
+ Name : main.c
+ Author : $(author)
+ Version :
+ Copyright : $(copyright)
+ Description : Draw Example
+ ============================================================================
+ */
+
+#include "config.h"
+
+#include <hildonmm.h>
+#include <iostream>
+
+#include "mywindow.h"
+
+int main(int argc, char *argv[])
+{
+ /* Initialize gtkmm and checks the arguments passed to your application */
+ Gtk::Main main_loop(&argc, &argv);
+
+ /* Initialize the hildomm libraries */
+ Hildon::init();
+
+ /* Initialize libosso environment */
+ osso_context_t* osso_context = osso_initialize(PACKAGE_NAME, PACKAGE_VERSION, TRUE, 0);
+ if(!osso_context)
+ std::cerr << "osso_initialize() failed." << std::endl;
+
+ /* Set the application name */
+ Glib::set_application_name(PACKAGE_STRING);
+
+ /* Create an object for the main Window and attach it to the program */
+ MyWindow window;
+ Hildon::Program::get_instance()->add_window(window);
+
+ /* Begin the main application */
+ main_loop.run(window);
+
+ /* Clean the libosso environment */
+ osso_deinitialize(osso_context);
+
+ return 0;
+}
Added: trunk/org.indt.esbox.ui/templates/CppDrawExample/src/main.cpp
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppDrawExample/src/main.cpp (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppDrawExample/src/main.cpp 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,45 @@
+/*
+ ============================================================================
+ Name : main.c
+ Author : $(author)
+ Version :
+ Copyright : $(copyright)
+ Description : Draw Example
+ ============================================================================
+ */
+
+#include "config.h"
+
+#include <hildonmm.h>
+#include <iostream>
+
+#include "mywindow.h"
+
+int main(int argc, char *argv[])
+{
+ /* Initialize gtkmm and checks the arguments passed to your application */
+ Gtk::Main main_loop(&argc, &argv);
+
+ /* Initialize the hildomm libraries */
+ Hildon::init();
+
+ /* Initialize libosso environment */
+ osso_context_t* osso_context = osso_initialize(PACKAGE_NAME, PACKAGE_VERSION, TRUE, 0);
+ if(!osso_context)
+ std::cerr << "osso_initialize() failed." << std::endl;
+
+ /* Set the application name */
+ Glib::set_application_name(PACKAGE_STRING);
+
+ /* Create an object for the main Window and attach it to the program */
+ MyWindow window;
+ Hildon::Program::get_instance()->add_window(window);
+
+ /* Begin the main application */
+ main_loop.run(window);
+
+ /* Clean the libosso environment */
+ osso_deinitialize(osso_context);
+
+ return 0;
+}
Added: trunk/org.indt.esbox.ui/templates/CppDrawExample/src/mywindow.cc
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppDrawExample/src/mywindow.cc (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppDrawExample/src/mywindow.cc 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,231 @@
+/*
+ ============================================================================
+ Name : main.c
+ Author : $(author)
+ Version :
+ Copyright : $(copyright)
+ Description : Draw Example
+ ============================================================================
+ */
+
+#include <cmath> // Header for rand()
+#include <gtkmm.h>
+#include <hildonmm.h>
+
+#include "mywindow.h"
+
+/* Class constructor */
+MyWindow::MyWindow() :
+ m_item_exit("Exit"),
+ m_frame_box(false, 10), // homogeneous: false, spacing: 10
+ m_label_border("Border color"),
+ m_label_fill("Fill color"),
+ m_button_draw("Draw"),
+ m_button_clear("Clear")
+{
+ /* "Quit" menu button */
+ m_item_exit.signal_activate().connect(sigc::mem_fun(*this,
+ &MyWindow::on_menu_quit));
+
+ /* Border color button */
+ m_cb_border.connect_property_changed("color", sigc::mem_fun(*this,
+ &MyWindow::on_border_color_button_color_changed));
+
+ /* Fill color button */
+ m_cb_fill.connect_property_changed("color", sigc::mem_fun(*this,
+ &MyWindow::on_fill_color_button_color_changed));
+
+ /* Clear button */
+ m_button_clear.signal_clicked().connect(sigc::mem_fun(*this,
+ &MyWindow::on_button_clear_clicked));
+
+ /* Draw box */
+ m_button_draw.signal_clicked().connect(sigc::mem_fun(*this,
+ &MyWindow::on_button_draw_clicked));
+
+ /* Attach the menu object to the application */
+ set_menu(m_main);
+
+ /* Add items to the menu */
+ m_main.append(m_item_exit);
+ m_main.show_all();
+
+ /* Attach the menu object to the application */
+ set_menu(m_main);
+
+ /* Add the m_frame_box to window: */
+ add(m_frame_box);
+
+ /* Add items to the combo box: */
+ m_combo_box.append_text("Circle");
+ m_combo_box.append_text("Line");
+ m_combo_box.append_text("Rectangle");
+
+ /* Button box get its items: */
+ m_button_box.pack_start(m_combo_box);
+ m_button_box.pack_start(m_label_border);
+ m_button_box.pack_start(m_cb_border);
+ m_button_box.pack_start(m_label_fill);
+ m_button_box.pack_start(m_cb_fill);
+ m_button_box.pack_start(m_button_draw);
+ m_button_box.pack_start(m_button_clear);
+
+ /* frame_box receives button_box and draw_area: */
+ m_frame_box.pack_start(m_button_box, Gtk::PACK_SHRINK);
+ m_frame_box.pack_start(m_draw_area);
+
+ /* Make all menu widgets visible */
+ show_all();
+
+ /* Make all child widgets visible: */
+ show_all_children();
+
+ /* Initialize Cairo context */
+ cairo_ctx = m_draw_area.get_window()->create_cairo_context();
+}
+
+/* Class destructor */
+MyWindow::~MyWindow()
+{
+}
+
+/* Callback methods */
+void MyWindow::on_menu_quit()
+{
+ /* Close the window */
+ hide();
+}
+
+void MyWindow::on_border_color_button_color_changed()
+{
+ /* The border color button gets the properties of the chosen color */
+ m_cb_border.get_property("color", m_color_border);
+}
+
+void MyWindow::on_fill_color_button_color_changed()
+{
+ /* The fill color button gets the properties of the chosen color */
+ m_cb_fill.get_property("color", m_color_fill);
+}
+
+void MyWindow::on_button_draw_clicked()
+{
+ Glib::ustring text = m_combo_box.get_active_text();
+ if (text == "Circle") // If "Circle" option from combo box gets selected
+ on_combo_circle_selected();
+ if (text == "Line") // If "Line" option from combo box gets selected
+ on_combo_line_selected();
+ if (text == "Rectangle") // If "Rectangle" option from combo box gets selected
+ on_combo_rectangle_selected();
+}
+
+void MyWindow::on_button_clear_clicked()
+{
+ /* These variables captures the total width and height of draw_area */
+ const int width = m_draw_area.get_width();
+ const int height = m_draw_area.get_height();
+
+ cairo_ctx->save();
+
+ /* Set background color (from color_bg)
+ Notice that we're getting a percentage (0 to 1) of the color
+ components from color_bg, since it is needed by set_source_rgb */
+ cairo_ctx->set_source_rgb(1, 1, 1);
+ cairo_ctx->paint();
+ cairo_ctx->restore();
+}
+
+void MyWindow::on_combo_circle_selected()
+{
+ const int width = m_draw_area.get_width();
+ const int height = m_draw_area.get_height();
+
+ /* These variables creates a randomic number in order to draw the object on different places */
+ int randx = rand()%width;
+ int randy = rand()%height;
+ int rands = rand()%50;
+
+ cairo_ctx->save();
+
+ /* Set fill color (from color_fill) */
+ cairo_ctx->set_source_rgb(m_color_fill.get_red_p(), m_color_fill.get_green_p(),
+ m_color_fill.get_blue_p());
+
+ /* Here we draw the circle */
+ cairo_ctx->arc(randx, randy, rands, 0.0, 2.0 * M_PI);
+ cairo_ctx->close_path();
+ cairo_ctx->fill();
+ cairo_ctx->stroke();
+
+ /* Set border color */
+ cairo_ctx->set_line_width(rands/4); // Set border line width to 1/4 of rands
+
+ /* Notice that set_source_rgba has a fourth parameter that is the level
+ of alpha you want on the object you're drawing */
+ cairo_ctx->set_source_rgba(m_color_border.get_red_p(), m_color_border.get_green_p(),
+ m_color_border.get_blue_p(), 0.5);
+ cairo_ctx->arc(randx, randy, rands, 0.0, 2.0 * M_PI);
+ cairo_ctx->close_path();
+ cairo_ctx->stroke();
+
+ cairo_ctx->restore();
+}
+
+void MyWindow::on_combo_line_selected()
+{
+ const int width = m_draw_area.get_width();
+ const int height = m_draw_area.get_height();
+
+ int randx = rand()%width;
+ int randy = rand()%height;
+ int randh = rand()%width;
+ int randw = rand()%height;
+
+ cairo_ctx->save();
+
+ /* Set border color (from color_border) */
+ cairo_ctx->set_source_rgb(m_color_border.get_red_p(), m_color_border.get_green_p(),
+ m_color_border.get_blue_p());
+
+ /* Here we draw the line (we only draw the "border" color since it is too
+ thin to have a fill color. */
+ cairo_ctx->move_to(randx, randy);
+ cairo_ctx->line_to(randh, randw);
+ cairo_ctx->close_path();
+ cairo_ctx->stroke();
+
+ cairo_ctx->restore();
+}
+
+void MyWindow::on_combo_rectangle_selected()
+{
+ const int width = m_draw_area.get_width();
+ const int height = m_draw_area.get_height();
+
+ int randx = rand()%width;
+ int randy = rand()%height;
+ int randw = rand()%100;
+ int randh = rand()%100;
+
+ cairo_ctx->save();
+
+ /* Set fill color (from color_fill) */
+ cairo_ctx->set_source_rgb(m_color_fill.get_red_p(), m_color_fill.get_green_p(),
+ m_color_fill.get_blue_p());
+
+ /* Here we draw the rectangle */
+ cairo_ctx->rectangle(randx, randy, randh, randw);
+ cairo_ctx->close_path();
+ cairo_ctx->fill();
+ cairo_ctx->stroke();
+
+ /* Set border color (from color_border) */
+ cairo_ctx->set_line_width(randw/4);
+ cairo_ctx->set_source_rgba(m_color_border.get_red_p(), m_color_border.get_green_p(),
+ m_color_border.get_blue_p(), 0.5);
+ cairo_ctx->rectangle(randx, randy, randh, randw);
+ cairo_ctx->close_path();
+ cairo_ctx->stroke();
+
+ cairo_ctx->restore();
+}
Added: trunk/org.indt.esbox.ui/templates/CppDrawExample/src/mywindow.cpp
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppDrawExample/src/mywindow.cpp (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppDrawExample/src/mywindow.cpp 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,228 @@
+/*
+ ============================================================================
+ Name : main.c
+ Author : $(author)
+ Version :
+ Copyright : $(copyright)
+ Description : Draw Example
+ ============================================================================
+ */
+
+#include <cmath> // Header for rand()
+#include <gtkmm.h>
+#include <hildonmm.h>
+
+#include "mywindow.h"
+
+/* Class constructor */
+MyWindow::MyWindow() :
+ m_item_exit("Exit"),
+ m_frame_box(false, 10), // homogeneous: false, spacing: 10
+ m_label_border("Border color"),
+ m_label_fill("Fill color"),
+ m_button_draw("Draw"),
+ m_button_clear("Clear")
+{
+ /* "Quit" menu button */
+ m_item_exit.signal_activate().connect(sigc::mem_fun(*this,
+ &MyWindow::on_menu_quit));
+
+ /* Border color button */
+ m_cb_border.connect_property_changed("color", sigc::mem_fun(*this,
+ &MyWindow::on_border_color_button_color_changed));
+
+ /* Fill color button */
+ m_cb_fill.connect_property_changed("color", sigc::mem_fun(*this,
+ &MyWindow::on_fill_color_button_color_changed));
+
+ /* Clear button */
+ m_button_clear.signal_clicked().connect(sigc::mem_fun(*this,
+ &MyWindow::on_button_clear_clicked));
+
+ /* Draw box */
+ m_button_draw.signal_clicked().connect(sigc::mem_fun(*this,
+ &MyWindow::on_button_draw_clicked));
+
+ /* Attach the menu object to the application */
+ set_menu(m_main);
+
+ /* Add items to the menu */
+ m_main.append(m_item_exit);
+ m_main.show_all();
+
+ /* Attach the menu object to the application */
+ set_menu(m_main);
+
+ /* Add the m_frame_box to window: */
+ add(m_frame_box);
+
+ /* Add items to the combo box: */
+ m_combo_box.append_text("Circle");
+ m_combo_box.append_text("Line");
+ m_combo_box.append_text("Rectangle");
+
+ /* Button box get its items: */
+ m_button_box.pack_start(m_combo_box);
+ m_button_box.pack_start(m_label_border);
+ m_button_box.pack_start(m_cb_border);
+ m_button_box.pack_start(m_label_fill);
+ m_button_box.pack_start(m_cb_fill);
+ m_button_box.pack_start(m_button_draw);
+ m_button_box.pack_start(m_button_clear);
+
+ /* frame_box receives button_box and draw_area: */
+ m_frame_box.pack_start(m_button_box, Gtk::PACK_SHRINK);
+ m_frame_box.pack_start(m_draw_area);
+
+ /* Make all menu widgets visible */
+ show_all();
+
+ /* Initialize Cairo context */
+ cairo_ctx = m_draw_area.get_window()->create_cairo_context();
+}
+
+/* Class destructor */
+MyWindow::~MyWindow()
+{
+}
+
+/* Callback methods */
+void MyWindow::on_menu_quit()
+{
+ /* Close the window */
+ hide();
+}
+
+void MyWindow::on_border_color_button_color_changed()
+{
+ /* The border color button gets the properties of the chosen color */
+ m_cb_border.get_property("color", m_color_border);
+}
+
+void MyWindow::on_fill_color_button_color_changed()
+{
+ /* The fill color button gets the properties of the chosen color */
+ m_cb_fill.get_property("color", m_color_fill);
+}
+
+void MyWindow::on_button_draw_clicked()
+{
+ Glib::ustring text = m_combo_box.get_active_text();
+ if (text == "Circle") // If "Circle" option from combo box gets selected
+ on_combo_circle_selected();
+ if (text == "Line") // If "Line" option from combo box gets selected
+ on_combo_line_selected();
+ if (text == "Rectangle") // If "Rectangle" option from combo box gets selected
+ on_combo_rectangle_selected();
+}
+
+void MyWindow::on_button_clear_clicked()
+{
+ /* These variables captures the total width and height of draw_area */
+ const int width = m_draw_area.get_width();
+ const int height = m_draw_area.get_height();
+
+ cairo_ctx->save();
+
+ /* Set background color (from color_bg)
+ Notice that we're getting a percentage (0 to 1) of the color
+ components from color_bg, since it is needed by set_source_rgb */
+ cairo_ctx->set_source_rgb(1, 1, 1);
+ cairo_ctx->paint();
+ cairo_ctx->restore();
+}
+
+void MyWindow::on_combo_circle_selected()
+{
+ const int width = m_draw_area.get_width();
+ const int height = m_draw_area.get_height();
+
+ /* These variables creates a randomic number in order to draw the object on different places */
+ int randx = rand()%width;
+ int randy = rand()%height;
+ int rands = rand()%50;
+
+ cairo_ctx->save();
+
+ /* Set fill color (from color_fill) */
+ cairo_ctx->set_source_rgb(m_color_fill.get_red_p(), m_color_fill.get_green_p(),
+ m_color_fill.get_blue_p());
+
+ /* Here we draw the circle */
+ cairo_ctx->arc(randx, randy, rands, 0.0, 2.0 * M_PI);
+ cairo_ctx->close_path();
+ cairo_ctx->fill();
+ cairo_ctx->stroke();
+
+ /* Set border color */
+ cairo_ctx->set_line_width(rands/4); // Set border line width to 1/4 of rands
+
+ /* Notice that set_source_rgba has a fourth parameter that is the level
+ of alpha you want on the object you're drawing */
+ cairo_ctx->set_source_rgba(m_color_border.get_red_p(), m_color_border.get_green_p(),
+ m_color_border.get_blue_p(), 0.5);
+ cairo_ctx->arc(randx, randy, rands, 0.0, 2.0 * M_PI);
+ cairo_ctx->close_path();
+ cairo_ctx->stroke();
+
+ cairo_ctx->restore();
+}
+
+void MyWindow::on_combo_line_selected()
+{
+ const int width = m_draw_area.get_width();
+ const int height = m_draw_area.get_height();
+
+ int randx = rand()%width;
+ int randy = rand()%height;
+ int randh = rand()%width;
+ int randw = rand()%height;
+
+ cairo_ctx->save();
+
+ /* Set border color (from color_border) */
+ cairo_ctx->set_source_rgb(m_color_border.get_red_p(), m_color_border.get_green_p(),
+ m_color_border.get_blue_p());
+
+ /* Here we draw the line (we only draw the "border" color since it is too
+ thin to have a fill color. */
+ cairo_ctx->move_to(randx, randy);
+ cairo_ctx->line_to(randh, randw);
+ cairo_ctx->close_path();
+ cairo_ctx->stroke();
+
+ cairo_ctx->restore();
+}
+
+void MyWindow::on_combo_rectangle_selected()
+{
+ const int width = m_draw_area.get_width();
+ const int height = m_draw_area.get_height();
+
+ int randx = rand()%width;
+ int randy = rand()%height;
+ int randw = rand()%100;
+ int randh = rand()%100;
+
+ cairo_ctx->save();
+
+ /* Set fill color (from color_fill) */
+ cairo_ctx->set_source_rgb(m_color_fill.get_red_p(), m_color_fill.get_green_p(),
+ m_color_fill.get_blue_p());
+
+ /* Here we draw the rectangle */
+ cairo_ctx->rectangle(randx, randy, randh, randw);
+ cairo_ctx->close_path();
+ cairo_ctx->fill();
+ cairo_ctx->stroke();
+
+ /* Set border color (from color_border) */
+ cairo_ctx->set_line_width(randw/4);
+ cairo_ctx->set_source_rgba(m_color_border.get_red_p(), m_color_border.get_green_p(),
+ m_color_border.get_blue_p(), 0.5);
+ cairo_ctx->rectangle(randx, randy, randh, randw);
+ cairo_ctx->close_path();
+ cairo_ctx->stroke();
+
+ cairo_ctx->restore();
+}
Added: trunk/org.indt.esbox.ui/templates/CppDrawExample/src/mywindow.h
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppDrawExample/src/mywindow.h (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppDrawExample/src/mywindow.h 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,70 @@
+/*
+ ============================================================================
+ Name : main.c
+ Author : $(author)
+ Version :
+ Copyright : $(copyright)
+ Description : Draw Example
+ ============================================================================
+ */
+
+#ifndef MYWINDOW_H
+#define MYWINDOW_H
+
+#include <gtkmm.h>
+#include <hildonmm.h>
+
+class MyWindow : public Hildon::Window
+{
+public:
+ MyWindow();
+ virtual ~MyWindow();
+
+protected:
+ /* Signal handlers */
+ void on_menu_quit(); // "Quit" menu button
+ void on_border_color_button_color_changed(); // "Border" color button
+ void on_fill_color_button_color_changed(); // "Fill" color button
+ void on_button_clear_clicked(); // "Clear" button
+ void on_button_draw_clicked(); // "Draw" button
+ void on_combo_circle_selected(); // "Circle" combo option
+ void on_combo_line_selected(); // "Line" combo option
+ void on_combo_rectangle_selected(); // "Rectangle" combo option
+
+ /* Menu object */
+ Gtk::Menu m_main;
+
+ /* The menu items */
+ Gtk::MenuItem m_item_exit;
+
+ /* Main box (parent of all other boxes) */
+ Gtk::HBox m_frame_box;
+
+ /* Button box (Vertical) */
+ Gtk::VButtonBox m_button_box;
+
+ /* Drawing area */
+ Gtk::DrawingArea m_draw_area;
+
+ /* Combo box */
+ Gtk::ComboBoxText m_combo_box;
+
+ /* Border color items */
+ Gdk::Color m_color_border; // Holds selected color
+ Gtk::Label m_label_border; // Label for border color button
+ Hildon::ColorButton m_cb_border; // Border color button itself
+
+ /* Fill color items */
+ Gdk::Color m_color_fill;
+ Gtk::Label m_label_fill;
+ Hildon::ColorButton m_cb_fill;
+
+ /* Action buttons */
+ Gtk::Button m_button_clear;
+ Gtk::Button m_button_draw;
+
+ /* Cairo Context */
+ Cairo::RefPtr<Cairo::Context> cairo_ctx;
+};
+
+#endif /* MYWINDOW_H */
Added: trunk/org.indt.esbox.ui/templates/CppDrawExample/template.properties
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppDrawExample/template.properties (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppDrawExample/template.properties 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,10 @@
+#Template Default Values
+CppDrawExample.Ctemplate.label=Maemo Draw Example Project
+CppDrawExample.Ctemplate.description=A Maemo Draw Example Project
+CppDrawExample.basics.label=Basic Settings
+CppDrawExample.basics.description=Basic properties of a project
+CppDrawExample.author.label=Author
+CppDrawExample.author.description=Name of the author
+CppDrawExample.copyright.label=Copyright notice
+CppDrawExample.copyright.description=Your copyright notice
+CppDrawExample.copyright.default=Your copyright notice
Added: trunk/org.indt.esbox.ui/templates/CppDrawExample/template.xml
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppDrawExample/template.xml (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppDrawExample/template.xml 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<template type="ProjTempl" version="1.0" supplier="Eclipse.org" revision="1.0" author="Intel Corporation"
+ copyright="Copyright (c) 2007 Intel Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html"
+ id="CppDrawExampleProject" label="%CppDrawExample.Ctemplate.label" description="%CppDrawExample.Ctemplate.description"
+ help="help.html">
+
+ <property-group id="basics" label="%CppDrawExample.basics.label" description="%CppDrawExample.basics.description" type="PAGES-ONLY" help="help.html">
+ <property id="author"
+ label="%CppDrawExample.author.label"
+ description="%CppDrawExample.author.description"
+ type="input"
+ pattern=".*"
+ default=""
+ hidden="false"
+ persist="true"/>
+ <property id="copyright"
+ label="%CppDrawExample.copyright.label"
+ description="%CppDrawExample.copyright.description"
+ type="input"
+ pattern=".*"
+ default="%CppDrawExample.copyright.default"
+ hidden="false"
+ persist="true"/>
+ </property-group>
+
+ <process type="org.eclipse.cdt.core.CreateSourceFolder">
+ <simple name="projectName" value="$(projectName)"/>
+ <simple name="path" value="src"/>
+ </process>
+
+ <process type="org.eclipse.cdt.core.AddFiles">
+ <simple name="projectName" value="$(projectName)"/>
+ <complex-array name="files">
+ <element>
+ <simple name="source" value="configure.ac"/>
+ <simple name="target" value="configure.ac"/>
+ <simple name="replaceable" value="false"/>
+ </element>
+ <element>
+ <simple name="source" value="Makefile.am"/>
+ <simple name="target" value="Makefile.am"/>
+ <simple name="replaceable" value="false"/>
+ </element>
+ <element>
+ <simple name="source" value="src/main.cc"/>
+ <simple name="target" value="src/main.cc"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/main.cpp"/>
+ <simple name="target" value="src/main.cpp"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/mywindow.cc"/>
+ <simple name="target" value="src/mywindow.cc"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/mywindow.cpp"/>
+ <simple name="target" value="src/mywindow.cpp"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/mywindow.h"/>
+ <simple name="target" value="src/mywindow.h"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/Makefile.am"/>
+ <simple name="target" value="src/Makefile.am"/>
+ <simple name="replaceable" value="false"/>
+ </element>
+ </complex-array>
+ </process>
+
+</template>
+
Added: trunk/org.indt.esbox.ui/templates/CppGconfExample/Makefile.am
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppGconfExample/Makefile.am (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppGconfExample/Makefile.am 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,3 @@
+AUTOMAKE_OPTIONS = foreign
+
+SUBDIRS = src
Added: trunk/org.indt.esbox.ui/templates/CppGconfExample/configure.ac
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppGconfExample/configure.ac (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppGconfExample/configure.ac 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,26 @@
+AC_INIT(gconf_example, 0.1)
+AC_PREREQ(2.59)
+
+AM_INIT_AUTOMAKE([1.7.9])
+AC_CONFIG_HEADERS([config.h])
+
+AC_GNU_SOURCE
+AC_CANONICAL_HOST
+AM_MAINTAINER_MODE
+
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+AC_PROG_CXX
+
+AC_CONFIG_FILES([Makefile
+ src/Makefile])
+
+PKG_CHECK_MODULES(LIBHILDONMM, hildonmm >= 0.9.6)
+AC_SUBST(LIBHILDONMM_CFLAGS)
+AC_SUBST(LIBHILDONMM_LIBS)
+
+PKG_CHECK_MODULES(LIBGCONFMM, gconfmm-2.6 >= 2.20.0)
+AC_SUBST(LIBGCONFMM_CFLAGS)
+AC_SUBST(LIBGCONFMM_LIBS)
+
+AC_OUTPUT
Added: trunk/org.indt.esbox.ui/templates/CppGconfExample/src/Makefile.am
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppGconfExample/src/Makefile.am (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppGconfExample/src/Makefile.am 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,9 @@
+AUTOMAKE_OPTIONS = foreign
+
+bin_PROGRAMS = gconf_example
+gconf_example_SOURCES = main.cpp \
+ mywindow.cpp \
+ mywindow.h
+
+gconf_example_LDADD = $(LIBHILDONMM_LIBS) $(LIBGCONFMM_LIBS)
+gconf_example_CXXFLAGS = $(LIBHILDONMM_CFLAGS) $(LIBGCONFMM_CFLAGS)
Added: trunk/org.indt.esbox.ui/templates/CppGconfExample/src/main.cc
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppGconfExample/src/main.cc (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppGconfExample/src/main.cc 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,47 @@
+/*
+ ============================================================================
+ Name : main.c
+ Author : $(author)
+ Version :
+ Copyright : $(copyright)
+ Description : Gconf Example
+ ============================================================================
+ */
+
+#include "config.h"
+
+#include <gconfmm.h>
+#include <hildonmm.h>
+#include <iostream>
+
+#include "mywindow.h"
+
+int main(int argc, char *argv[])
+{
+ /* Initialize gtkmm and checks the arguments passed to your application */
+ Gnome::Conf::init();
+ Gtk::Main main_loop(&argc, &argv);
+
+ /* Initialize the hildomm libraries */
+ Hildon::init();
+
+ /* Initialize libosso environment */
+ osso_context_t* osso_context = osso_initialize(PACKAGE_NAME, PACKAGE_VERSION, TRUE, 0);
+ if(!osso_context)
+ std::cerr << "osso_initialize() failed." << std::endl;
+
+ /* Set the application name */
+ Glib::set_application_name(PACKAGE_STRING);
+
+ /* Create an object for the main Window and attach it to the program */
+ MyWindow window;
+ Hildon::Program::get_instance()->add_window(window);
+
+ /* Begin the main application */
+ main_loop.run(window);
+
+ /* Clean the libosso environment */
+ osso_deinitialize(osso_context);
+
+ return 0;
+}
Added: trunk/org.indt.esbox.ui/templates/CppGconfExample/src/main.cpp
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppGconfExample/src/main.cpp (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppGconfExample/src/main.cpp 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,47 @@
+/*
+ ============================================================================
+ Name : main.c
+ Author : $(author)
+ Version :
+ Copyright : $(copyright)
+ Description : Gconf Example
+ ============================================================================
+ */
+
+#include "config.h"
+
+#include <gconfmm.h>
+#include <hildonmm.h>
+#include <iostream>
+
+#include "mywindow.h"
+
+int main(int argc, char *argv[])
+{
+ /* Initialize gtkmm and checks the arguments passed to your application */
+ Gnome::Conf::init();
+ Gtk::Main main_loop(&argc, &argv);
+
+ /* Initialize the hildomm libraries */
+ Hildon::init();
+
+ /* Initialize libosso environment */
+ osso_context_t* osso_context = osso_initialize(PACKAGE_NAME, PACKAGE_VERSION, TRUE, 0);
+ if(!osso_context)
+ std::cerr << "osso_initialize() failed." << std::endl;
+
+ /* Set the application name */
+ Glib::set_application_name(PACKAGE_STRING);
+
+ /* Create an object for the main Window and attach it to the program */
+ MyWindow window;
+ Hildon::Program::get_instance()->add_window(window);
+
+ /* Begin the main application */
+ main_loop.run(window);
+
+ /* Clean the libosso environment */
+ osso_deinitialize(osso_context);
+
+ return 0;
+}
Added: trunk/org.indt.esbox.ui/templates/CppGconfExample/src/mywindow.cc
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppGconfExample/src/mywindow.cc (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppGconfExample/src/mywindow.cc 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,94 @@
+/*
+ ============================================================================
+ Name : main.c
+ Author : $(author)
+ Version :
+ Copyright : $(copyright)
+ Description : Gconf Example
+ ============================================================================
+ */
+
+#include <gconfmm.h>
+#include <glibmm.h>
+#include <gtkmm.h>
+#include <hildonmm.h>
+
+#include "mywindow.h"
+
+/* Class constructor */
+MyWindow::MyWindow():
+ m_checkbutton ("Check Button State"),
+ m_label ("Text Box Entry"),
+ m_save("Save"),
+ m_item_exit("Exit"),
+ gconf_textentry("/apps/gconf_example/textentry"), /* Define where GConf will store the text entry */
+ gconf_checkbox("/apps/gconf_example/checkbox") /* Define where GConf will store the check box state */
+{
+
+ /* Add items to the menu */
+ m_main.append(m_item_exit);
+ m_main.show_all();
+
+ set_menu(m_main);
+
+ /* Create the widgets */
+ add(vbox);
+ vbox.set_border_width(50);
+
+ vbox.pack_start(hbox1);
+ vbox.pack_start(hbox2);
+ vbox.pack_start(hbox3);
+
+ hbox1.pack_start(m_label);
+ hbox1.pack_start(m_entry);
+ hbox2.pack_start(m_checkbutton);
+ hbox3.pack_start(m_save);
+
+ /* Returns the GConf handler */
+ gconf = Gnome::Conf::Client::get_default_client();
+
+ /* Attach the callback functions to the activate signal */
+ m_save.signal_clicked().connect(sigc::mem_fun(*this, &MyWindow::on_save_clicked));
+ m_item_exit.signal_activate().connect(sigc::mem_fun(*this, &MyWindow::on_menu_quit));
+
+ /* Call the method to load the application information */
+ restore();
+
+ /* Show all widgets on the screen */
+ show_all();
+}
+
+/* Class destructor */
+MyWindow::~MyWindow()
+{
+}
+
+/* Callback function, which will be called to close the application */
+void MyWindow::on_menu_quit()
+{
+ hide();
+}
+
+/* Save current status */
+void MyWindow::on_save_clicked()
+{
+ /* Get the check button state and store it on GConf */
+ if (m_checkbutton.get_active())
+ gconf->set(gconf_checkbox, true, error);
+ else
+ gconf->set(gconf_checkbox, false, error);
+
+ /* Store the text entry content on GConf */
+ gconf->set(gconf_textentry, m_entry.get_text(), error);
+}
+
+/* Load configuration status */
+void MyWindow::restore(void)
+{
+ /* Get the stored check button state and set the widget accordingly */
+ if (gconf->get_bool(gconf_checkbox, error))
+ m_checkbutton.set_active();
+
+ /* Get the stored text entry content and set the widget accordingly */
+ m_entry.set_text(gconf->get_string(gconf_textentry, error));
+}
Added: trunk/org.indt.esbox.ui/templates/CppGconfExample/src/mywindow.cpp
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppGconfExample/src/mywindow.cpp (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppGconfExample/src/mywindow.cpp 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,94 @@
+/*
+ ============================================================================
+ Name : main.c
+ Author : $(author)
+ Version :
+ Copyright : $(copyright)
+ Description : Gconf Example
+ ============================================================================
+ */
+
+#include <gconfmm.h>
+#include <glibmm.h>
+#include <gtkmm.h>
+#include <hildonmm.h>
+
+#include "mywindow.h"
+
+/* Class constructor */
+MyWindow::MyWindow():
+ m_checkbutton ("Check Button State"),
+ m_label ("Text Box Entry"),
+ m_save("Save"),
+ m_item_exit("Exit"),
+ gconf_textentry("/apps/gconf_example/textentry"), /* Define where GConf will store the text entry */
+ gconf_checkbox("/apps/gconf_example/checkbox") /* Define where GConf will store the check box state */
+{
+
+ /* Add items to the menu */
+ m_main.append(m_item_exit);
+ m_main.show_all();
+
+ set_menu(m_main);
+
+ /* Create the widgets */
+ add(vbox);
+ vbox.set_border_width(50);
+
+ vbox.pack_start(hbox1);
+ vbox.pack_start(hbox2);
+ vbox.pack_start(hbox3);
+
+ hbox1.pack_start(m_label);
+ hbox1.pack_start(m_entry);
+ hbox2.pack_start(m_checkbutton);
+ hbox3.pack_start(m_save);
+
+ /* Returns the GConf handler */
+ gconf = Gnome::Conf::Client::get_default_client();
+
+ /* Attach the callback functions to the activate signal */
+ m_save.signal_clicked().connect(sigc::mem_fun(*this, &MyWindow::on_save_clicked));
+ m_item_exit.signal_activate().connect(sigc::mem_fun(*this, &MyWindow::on_menu_quit));
+
+ /* Call the method to load the application information */
+ restore();
+
+ /* Show all widgets on the screen */
+ show_all();
+}
+
+/* Class destructor */
+MyWindow::~MyWindow()
+{
+}
+
+/* Callback function, which will be called to close the application */
+void MyWindow::on_menu_quit()
+{
+ hide();
+}
+
+/* Save current status */
+void MyWindow::on_save_clicked()
+{
+ /* Get the check button state and store it on GConf */
+ if (m_checkbutton.get_active())
+ gconf->set(gconf_checkbox, true, error);
+ else
+ gconf->set(gconf_checkbox, false, error);
+
+ /* Store the text entry content on GConf */
+ gconf->set(gconf_textentry, m_entry.get_text(), error);
+}
+
+/* Load configuration status */
+void MyWindow::restore(void)
+{
+ /* Get the stored check button state and set the widget accordingly */
+ if (gconf->get_bool(gconf_checkbox, error))
+ m_checkbutton.set_active();
+
+ /* Get the stored text entry content and set the widget accordingly */
+ m_entry.set_text(gconf->get_string(gconf_textentry, error));
+}
Added: trunk/org.indt.esbox.ui/templates/CppGconfExample/src/mywindow.h
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppGconfExample/src/mywindow.h (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppGconfExample/src/mywindow.h 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,48 @@
+/*
+ ============================================================================
+ Name : main.c
+ Author : $(author)
+ Version :
+ Copyright : $(copyright)
+ Description : Gconf Example
+ ============================================================================
+ */
+
+#ifndef MYWINDOW_H
+#define MYWINDOW_H
+
+#include <gconfmm.h>
+#include <glibmm.h>
+#include <gtkmm.h>
+#include <hildonmm.h>
+
+class MyWindow : public Hildon::Window
+{
+public:
+ MyWindow();
+ virtual ~MyWindow();
+ void restore();
+
+protected:
+ void on_save_clicked();
+ void on_menu_quit();
+
+ Gtk::Menu m_main;
+ Gtk::MenuItem m_item_exit;
+ Gtk::VBox vbox;
+ Gtk::HBox hbox1;
+ Gtk::HBox hbox2;
+ Gtk::HBox hbox3;
+ Gtk::CheckButton m_checkbutton;
+ Gtk::Label m_label;
+ Gtk::Entry m_entry;
+ Gtk::Button m_save;
+
+ Glib::RefPtr<Gnome::Conf::Client> gconf;
+ std::auto_ptr<Glib::Error> error;
+
+ Glib::ustring gconf_textentry;
+ Glib::ustring gconf_checkbox;
+};
+
+#endif /* MYWINDOW_H */
Added: trunk/org.indt.esbox.ui/templates/CppGconfExample/template.properties
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppGconfExample/template.properties (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppGconfExample/template.properties 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,10 @@
+#Template Default Values
+CppGconfExample.Ctemplate.label=Maemo Gconf Example Project
+CppGconfExample.Ctemplate.description=A Maemo Gconf Example Project
+CppGconfExample.basics.label=Basic Settings
+CppGconfExample.basics.description=Basic properties of a project
+CppGconfExample.author.label=Author
+CppGconfExample.author.description=Name of the author
+CppGconfExample.copyright.label=Copyright notice
+CppGconfExample.copyright.description=Your copyright notice
+CppGconfExample.copyright.default=Your copyright notice
Added: trunk/org.indt.esbox.ui/templates/CppGconfExample/template.xml
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppGconfExample/template.xml (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppGconfExample/template.xml 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<template type="ProjTempl" version="1.0" supplier="Eclipse.org" revision="1.0" author="Intel Corporation"
+ copyright="Copyright (c) 2007 Intel Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html"
+ id="CppGconfExampleProject" label="%CppGconfExample.Ctemplate.label" description="%CppGconfExample.Ctemplate.description"
+ help="help.html">
+
+ <property-group id="basics" label="%CppGconfExample.basics.label" description="%CppGconfExample.basics.description" type="PAGES-ONLY" help="help.html">
+ <property id="author"
+ label="%CppGconfExample.author.label"
+ description="%CppGconfExample.author.description"
+ type="input"
+ pattern=".*"
+ default=""
+ hidden="false"
+ persist="true"/>
+ <property id="copyright"
+ label="%CppGconfExample.copyright.label"
+ description="%CppGconfExample.copyright.description"
+ type="input"
+ pattern=".*"
+ default="%CppGconfExample.copyright.default"
+ hidden="false"
+ persist="true"/>
+ </property-group>
+
+ <process type="org.eclipse.cdt.core.CreateSourceFolder">
+ <simple name="projectName" value="$(projectName)"/>
+ <simple name="path" value="src"/>
+ </process>
+
+ <process type="org.eclipse.cdt.core.AddFiles">
+ <simple name="projectName" value="$(projectName)"/>
+ <complex-array name="files">
+ <element>
+ <simple name="source" value="configure.ac"/>
+ <simple name="target" value="configure.ac"/>
+ <simple name="replaceable" value="false"/>
+ </element>
+ <element>
+ <simple name="source" value="Makefile.am"/>
+ <simple name="target" value="Makefile.am"/>
+ <simple name="replaceable" value="false"/>
+ </element>
+ <element>
+ <simple name="source" value="src/main.cc"/>
+ <simple name="target" value="src/main.cc"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/main.cpp"/>
+ <simple name="target" value="src/main.cpp"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/mywindow.cc"/>
+ <simple name="target" value="src/mywindow.cc"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/mywindow.cpp"/>
+ <simple name="target" value="src/mywindow.cpp"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/mywindow.h"/>
+ <simple name="target" value="src/mywindow.h"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/Makefile.am"/>
+ <simple name="target" value="src/Makefile.am"/>
+ <simple name="replaceable" value="false"/>
+ </element>
+ </complex-array>
+ </process>
+
+</template>
+
Added: trunk/org.indt.esbox.ui/templates/CppHelloWorld/Makefile.am
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppHelloWorld/Makefile.am (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppHelloWorld/Makefile.am 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,3 @@
+AUTOMAKE_OPTIONS = foreign
+
+SUBDIRS = src
Added: trunk/org.indt.esbox.ui/templates/CppHelloWorld/configure.ac
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppHelloWorld/configure.ac (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppHelloWorld/configure.ac 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,22 @@
+AC_INIT(helloworld, 0.1)
+AC_PREREQ(2.59)
+
+AM_INIT_AUTOMAKE([1.7.9])
+AC_CONFIG_HEADERS([config.h])
+
+AC_GNU_SOURCE
+AC_CANONICAL_HOST
+AM_MAINTAINER_MODE
+
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+AC_PROG_CXX
+
+AC_CONFIG_FILES([Makefile
+ src/Makefile])
+
+PKG_CHECK_MODULES(LIBHILDONMM, hildonmm >= 0.9.6)
+AC_SUBST(LIBHILDONMM_CFLAGS)
+AC_SUBST(LIBHILDONMM_LIBS)
+
+AC_OUTPUT
Added: trunk/org.indt.esbox.ui/templates/CppHelloWorld/src/Makefile.am
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppHelloWorld/src/Makefile.am (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppHelloWorld/src/Makefile.am 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,9 @@
+AUTOMAKE_OPTIONS = foreign
+
+bin_PROGRAMS = helloworld
+helloworld_SOURCES = main.cpp \
+ mywindow.cpp \
+ mywindow.h
+
+helloworld_LDADD = $(LIBHILDONMM_LIBS)
+helloworld_CXXFLAGS = $(LIBHILDONMM_CFLAGS)
Added: trunk/org.indt.esbox.ui/templates/CppHelloWorld/src/main.cc
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppHelloWorld/src/main.cc (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppHelloWorld/src/main.cc 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,43 @@
+/*
+ ============================================================================
+ Name : main.c
+ Author : $(author)
+ Version :
+ Copyright : $(copyright)
+ Description : Cpp Hello World
+ ============================================================================
+ */
+
+#include <hildonmm.h>
+#include <iostream>
+
+#include "mywindow.h"
+
+int main(int argc, char *argv[])
+{
+ /* Initialize gtkmm and checks the arguments passed to your application */
+ Gtk::Main main_loop(&argc, &argv);
+
+ /* Initialize the hildomm libraries */
+ Hildon::init();
+
+ /* Initialize libosso environment */
+ osso_context_t* osso_context = osso_initialize("helloworld", "1.0.0", TRUE, 0);
+ if(!osso_context)
+ std::cerr << "osso_initialize() failed." << std::endl;
+
+ /* Set the application name */
+ Glib::set_application_name("$(message)");
+
+ /* Create an object for the main Window and attach it to the program */
+ MyWindow window;
+ Hildon::Program::get_instance()->add_window(window);
+
+ /* Begin the main application */
+ main_loop.run(window);
+
+ /* Clean the libosso environment */
+ osso_deinitialize(osso_context);
+
+ return 0;
+}
Added: trunk/org.indt.esbox.ui/templates/CppHelloWorld/src/main.cpp
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppHelloWorld/src/main.cpp (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppHelloWorld/src/main.cpp 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,43 @@
+/*
+ ============================================================================
+ Name : main.c
+ Author : $(author)
+ Version :
+ Copyright : $(copyright)
+ Description : Cpp Hello World
+ ============================================================================
+ */
+
+#include <hildonmm.h>
+#include <iostream>
+
+#include "mywindow.h"
+
+int main(int argc, char *argv[])
+{
+ /* Initialize gtkmm and checks the arguments passed to your application */
+ Gtk::Main main_loop(&argc, &argv);
+
+ /* Initialize the hildomm libraries */
+ Hildon::init();
+
+ /* Initialize libosso environment */
+ osso_context_t* osso_context = osso_initialize("helloworld", "1.0.0", TRUE, 0);
+ if(!osso_context)
+ std::cerr << "osso_initialize() failed." << std::endl;
+
+ /* Set the application name */
+ Glib::set_application_name("$(message)");
+
+ /* Create an object for the main Window and attach it to the program */
+ MyWindow window;
+ Hildon::Program::get_instance()->add_window(window);
+
+ /* Begin the main application */
+ main_loop.run(window);
+
+ /* Clean the libosso environment */
+ osso_deinitialize(osso_context);
+
+ return 0;
+}
Added: trunk/org.indt.esbox.ui/templates/CppHelloWorld/src/mywindow.cc
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppHelloWorld/src/mywindow.cc (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppHelloWorld/src/mywindow.cc 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,54 @@
+/*
+ ============================================================================
+ Name : main.c
+ Author : $(author)
+ Version :
+ Copyright : $(copyright)
+ Description : Cpp Hello World
+ ============================================================================
+ */
+
+#include <gtkmm.h>
+#include <hildonmm.h>
+
+#include "mywindow.h"
+
+/* Class constructor */
+MyWindow::MyWindow() :
+ m_item_exit("Exit"),
+ m_item_helloworld("Say Hello")
+{
+ /* Add items to the menu */
+ m_main.append(m_item_helloworld);
+ m_main.append(m_item_exit);
+ m_main.show_all();
+
+ /* Attach the menu object to the application */
+ set_menu(m_main);
+
+ /* Attach the callback function to signal handler */
+ m_item_exit.signal_activate().connect(sigc::mem_fun(*this, &MyWindow::on_menu_quit));
+ m_item_helloworld.signal_activate().connect(sigc::mem_fun(*this, &MyWindow::on_menu_helloworld));
+
+ /* Make all menu widgets visible */
+ show_all();
+}
+
+/* Class destructor */
+MyWindow::~MyWindow()
+{
+}
+
+/* Callback function for menu exit */
+void MyWindow::on_menu_quit()
+{
+ /* Close the window */
+ hide();
+}
+
+void MyWindow::on_menu_helloworld()
+{
+ /* Create and show a "Hello World" dialog */
+ Hildon::Note helloworld_note(Hildon::NOTE_TYPE_INFORMATION, "$(message)");
+ helloworld_note.run();
+}
Added: trunk/org.indt.esbox.ui/templates/CppHelloWorld/src/mywindow.cpp
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppHelloWorld/src/mywindow.cpp (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppHelloWorld/src/mywindow.cpp 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,54 @@
+/*
+ ============================================================================
+ Name : main.c
+ Author : $(author)
+ Version :
+ Copyright : $(copyright)
+ Description : Cpp Hello World
+ ============================================================================
+ */
+
+#include <gtkmm.h>
+#include <hildonmm.h>
+
+#include "mywindow.h"
+
+/* Class constructor */
+MyWindow::MyWindow() :
+ m_item_exit("Exit"),
+ m_item_helloworld("Say Hello")
+{
+ /* Add items to the menu */
+ m_main.append(m_item_helloworld);
+ m_main.append(m_item_exit);
+ m_main.show_all();
+
+ /* Attach the menu object to the application */
+ set_menu(m_main);
+
+ /* Attach the callback function to signal handler */
+ m_item_exit.signal_activate().connect(sigc::mem_fun(*this, &MyWindow::on_menu_quit));
+ m_item_helloworld.signal_activate().connect(sigc::mem_fun(*this, &MyWindow::on_menu_helloworld));
+
+ /* Make all menu widgets visible */
+ show_all();
+}
+
+/* Class destructor */
+MyWindow::~MyWindow()
+{
+}
+
+/* Callback function for menu exit */
+void MyWindow::on_menu_quit()
+{
+ /* Close the window */
+ hide();
+}
+
+void MyWindow::on_menu_helloworld()
+{
+ /* Create and show a "Hello World" dialog */
+ Hildon::Note helloworld_note(Hildon::NOTE_TYPE_INFORMATION, "$(message)");
+ helloworld_note.run();
+}
Added: trunk/org.indt.esbox.ui/templates/CppHelloWorld/src/mywindow.h
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppHelloWorld/src/mywindow.h (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppHelloWorld/src/mywindow.h 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,36 @@
+/*
+ ============================================================================
+ Name : main.c
+ Author : $(author)
+ Version :
+ Copyright : $(copyright)
+ Description : Cpp Hello World
+ ============================================================================
+ */
+
+#ifndef MYWINDOW_H
+#define MYWINDOW_H
+
+#include <gtkmm.h>
+#include <hildonmm.h>
+
+class MyWindow : public Hildon::Window
+{
+public:
+ MyWindow();
+ virtual ~MyWindow();
+
+protected:
+ /* Signal handlers */
+ void on_menu_quit();
+ void on_menu_helloworld();
+
+ /* Menu object */
+ Gtk::Menu m_main;
+
+ /* The menu items */
+ Gtk::MenuItem m_item_exit;
+ Gtk::MenuItem m_item_helloworld;
+};
+
+#endif /* MYWINDOW_H */
Added: trunk/org.indt.esbox.ui/templates/CppHelloWorld/template.properties
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppHelloWorld/template.properties (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppHelloWorld/template.properties 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,13 @@
+#Template Default Values
+CppHelloWorld.Ctemplate.label=Maemo Hello World Cpp Project
+CppHelloWorld.Ctemplate.description=A Hello World Cpp Project
+CppHelloWorld.basics.label=Basic Settings
+CppHelloWorld.basics.description=Basic properties of a project
+CppHelloWorld.author.label=Author
+CppHelloWorld.author.description=Name of the author
+CppHelloWorld.copyright.label=Copyright notice
+CppHelloWorld.copyright.description=Your copyright notice
+CppHelloWorld.copyright.default=Your copyright notice
+CppHelloWorld.message.default=Hello World!!!
+CppHelloWorld.message.description=Your hello world greeting message
+CppHelloWorld.message.label=Hello world greeting
\ No newline at end of file
Added: trunk/org.indt.esbox.ui/templates/CppHelloWorld/template.xml
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppHelloWorld/template.xml (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppHelloWorld/template.xml 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<template type="ProjTempl" version="1.0" supplier="Eclipse.org" revision="1.0" author="Intel Corporation"
+ copyright="Copyright (c) 2007 Intel Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html"
+ id="CppHelloWorldProject" label="%CppHelloWorld.Ctemplate.label" description="%CppHelloWorld.Ctemplate.description"
+ help="help.html">
+
+ <property-group id="basics" label="%CppHelloWorld.basics.label" description="%CppHelloWorld.basics.description" type="PAGES-ONLY" help="help.html">
+ <property id="author"
+ label="%CppHelloWorld.author.label"
+ description="%CppHelloWorld.author.description"
+ type="input"
+ pattern=".*"
+ default=""
+ hidden="false"
+ persist="true"/>
+ <property id="copyright"
+ label="%CppHelloWorld.copyright.label"
+ description="%CppHelloWorld.copyright.description"
+ type="input"
+ pattern=".*"
+ default="%CppHelloWorld.copyright.default"
+ hidden="false"
+ persist="true"/>
+ <property id="message"
+ label="%CppHelloWorld.message.label"
+ description="%CppHelloWorld.message.description"
+ type="input"
+ pattern=".*"
+ default="%CppHelloWorld.message.default"
+ hidden="false"
+ persist="true"/>
+ </property-group>
+
+ <process type="org.eclipse.cdt.core.CreateSourceFolder">
+ <simple name="projectName" value="$(projectName)"/>
+ <simple name="path" value="src"/>
+ </process>
+
+ <process type="org.eclipse.cdt.core.AddFiles">
+ <simple name="projectName" value="$(projectName)"/>
+ <complex-array name="files">
+ <element>
+ <simple name="source" value="configure.ac"/>
+ <simple name="target" value="configure.ac"/>
+ <simple name="replaceable" value="false"/>
+ </element>
+ <element>
+ <simple name="source" value="Makefile.am"/>
+ <simple name="target" value="Makefile.am"/>
+ <simple name="replaceable" value="false"/>
+ </element>
+ <element>
+ <simple name="source" value="src/main.cc"/>
+ <simple name="target" value="src/main.cc"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/main.cpp"/>
+ <simple name="target" value="src/main.cpp"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/mywindow.cc"/>
+ <simple name="target" value="src/mywindow.cc"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/mywindow.cpp"/>
+ <simple name="target" value="src/mywindow.cpp"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/mywindow.h"/>
+ <simple name="target" value="src/mywindow.h"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/Makefile.am"/>
+ <simple name="target" value="src/Makefile.am"/>
+ <simple name="replaceable" value="false"/>
+ </element>
+ </complex-array>
+ </process>
+
+</template>
+
Added: trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/Makefile.am
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/Makefile.am (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/Makefile.am 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,9 @@
+AUTOMAKE_OPTIONS = foreign
+
+SUBDIRS = src po
+
+INTLTOOL_FILES = intltool-extract.in \
+ intltool-merge.in \
+ intltool-update.in
+
+EXTRA_DIST = $(INTLTOOL_FILES)
Added: trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/configure.ac
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/configure.ac (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/configure.ac 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,33 @@
+AC_INIT(helloworld-i18n, 0.1)
+AC_PREREQ(2.59)
+
+AM_INIT_AUTOMAKE([1.7.9])
+AC_CONFIG_HEADERS([config.h])
+
+AC_GNU_SOURCE
+AC_CANONICAL_HOST
+AM_MAINTAINER_MODE
+
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+AC_PROG_CXX
+
+IT_PROG_INTLTOOL([0.35.0])
+GETTEXT_PACKAGE="$PACKAGE_NAME"
+AC_SUBST(GETTEXT_PACKAGE)
+AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"],
+ [The domain to use with gettext])
+AM_GLIB_GNU_GETTEXT
+
+HELLOWORLD_LOCALEDIR=[${datadir}/locale]
+AC_SUBST(HELLOWORLD_LOCALEDIR)
+
+AC_CONFIG_FILES([Makefile
+ src/Makefile
+ po/Makefile.in])
+
+PKG_CHECK_MODULES(LIBHILDONMM, hildonmm >= 0.9.6)
+AC_SUBST(LIBHILDONMM_CFLAGS)
+AC_SUBST(LIBHILDONMM_LIBS)
+
+AC_OUTPUT
Added: trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/po/LINGUAS.htm
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/po/LINGUAS.htm (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/po/LINGUAS.htm 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,3 @@
+en_GB
+pt_BR
+
Added: trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/po/POTFILES.in
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/po/POTFILES.in (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/po/POTFILES.in 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,2 @@
+src/main.cpp
+src/mywindow.cpp
Added: trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/po/en_GB.po
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/po/en_GB.po (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/po/en_GB.po 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,33 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: helloworld_i18n\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-10-10 12:18-0400\n"
+"PO-Revision-Date: 2007-10-05 16:14-0300\n"
+"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ../src/main.cpp:25
+msgid "osso_initialize() failed."
+msgstr ""
+
+#: ../src/mywindow.cpp:9
+msgid "Exit"
+msgstr ""
+
+#: ../src/mywindow.cpp:10
+msgid "Say Hello"
+msgstr ""
+
+#. Create and show a "Hello World" dialog
+#: ../src/mywindow.cpp:43
+msgid "Hello World!"
+msgstr ""
Added: trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/po/pt_BR.po
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/po/pt_BR.po (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/po/pt_BR.po 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,33 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: helloworld_i18n\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-10-10 12:18-0400\n"
+"PO-Revision-Date: 2007-10-05 16:14-0300\n"
+"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ../src/main.cpp:25
+msgid "osso_initialize() failed."
+msgstr "osso_initialize() falhou"
+
+#: ../src/mywindow.cpp:9
+msgid "Exit"
+msgstr "Sair"
+
+#: ../src/mywindow.cpp:10
+msgid "Say Hello"
+msgstr "Diga Alô"
+
+#. Create and show a "Hello World" dialog
+#: ../src/mywindow.cpp:43
+msgid "Hello World!"
+msgstr "Alô Mundo!"
Added: trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/src/Makefile.am
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/src/Makefile.am (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/src/Makefile.am 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,9 @@
+AUTOMAKE_OPTIONS = foreign
+
+bin_PROGRAMS = helloworld-i18n
+helloworld_i18n_SOURCES = main.cpp \
+ mywindow.cpp \
+ mywindow.h
+
+helloworld_i18n_LDADD = $(LIBHILDONMM_LIBS)
+helloworld_i18n_CXXFLAGS = $(LIBHILDONMM_CFLAGS) -DHELLOWORLD_LOCALEDIR=\"${HELLOWORLD_LOCALEDIR}\"
Added: trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/src/helloworld.htm
===================================================================
(Binary files differ)
Property changes on: trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/src/helloworld.htm
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/src/main.cc
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/src/main.cc (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/src/main.cc 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,51 @@
+/*
+ ============================================================================
+ Name : main.c
+ Author : $(author)
+ Version :
+ Copyright : $(copyright)
+ Description : Cpp Hello World I18n
+ ============================================================================
+ */
+
+#include "config.h"
+
+#include <hildonmm.h>
+#include <iostream>
+#include <glibmm/i18n.h> /* Must be after <iostream> */
+
+#include "mywindow.h"
+
+int main(int argc, char *argv[])
+{
+ /* i18n initialization */
+ bindtextdomain(GETTEXT_PACKAGE, HELLOWORLD_LOCALEDIR);
+ bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
+ textdomain(GETTEXT_PACKAGE);
+
+ /* Initialize gtkmm and checks the arguments passed to your application */
+ Gtk::Main main_loop(&argc, &argv);
+
+ /* Initialize the hildomm libraries */
+ Hildon::init();
+
+ /* Initialize libosso environment */
+ osso_context_t* osso_context = osso_initialize(PACKAGE_NAME, PACKAGE_VERSION, TRUE, 0);
+ if(!osso_context)
+ std::cerr << _("osso_initialize() failed.") << std::endl;
+
+ /* Set the application name */
+ Glib::set_application_name(PACKAGE_STRING);
+
+ /* Create an object for the main Window and attach it to the program */
+ MyWindow window;
+ Hildon::Program::get_instance()->add_window(window);
+
+ /* Begin the main application */
+ main_loop.run(window);
+
+ /* Clean the libosso environment */
+ osso_deinitialize(osso_context);
+
+ return 0;
+}
Added: trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/src/main.cpp
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/src/main.cpp (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/src/main.cpp 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,51 @@
+/*
+ ============================================================================
+ Name : main.c
+ Author : $(author)
+ Version :
+ Copyright : $(copyright)
+ Description : Cpp Hello World I18n
+ ============================================================================
+ */
+
+#include "config.h"
+
+#include <hildonmm.h>
+#include <iostream>
+#include <glibmm/i18n.h> /* Must be after <iostream> */
+
+#include "mywindow.h"
+
+int main(int argc, char *argv[])
+{
+ /* i18n initialization */
+ bindtextdomain(GETTEXT_PACKAGE, HELLOWORLD_LOCALEDIR);
+ bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
+ textdomain(GETTEXT_PACKAGE);
+
+ /* Initialize gtkmm and checks the arguments passed to your application */
+ Gtk::Main main_loop(&argc, &argv);
+
+ /* Initialize the hildomm libraries */
+ Hildon::init();
+
+ /* Initialize libosso environment */
+ osso_context_t* osso_context = osso_initialize(PACKAGE_NAME, PACKAGE_VERSION, TRUE, 0);
+ if(!osso_context)
+ std::cerr << _("osso_initialize() failed.") << std::endl;
+
+ /* Set the application name */
+ Glib::set_application_name(PACKAGE_STRING);
+
+ /* Create an object for the main Window and attach it to the program */
+ MyWindow window;
+ Hildon::Program::get_instance()->add_window(window);
+
+ /* Begin the main application */
+ main_loop.run(window);
+
+ /* Clean the libosso environment */
+ osso_deinitialize(osso_context);
+
+ return 0;
+}
Added: trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/src/mywindow.cc
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/src/mywindow.cc (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/src/mywindow.cc 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,55 @@
+/*
+ ============================================================================
+ Name : main.c
+ Author : $(author)
+ Version :
+ Copyright : $(copyright)
+ Description : Cpp Hello World I18n
+ ============================================================================
+ */
+
+#include <glibmm/i18n.h>
+#include <gtkmm.h>
+#include <hildonmm.h>
+
+#include "mywindow.h"
+
+/* Class constructor */
+MyWindow::MyWindow() :
+ m_item_exit(_("Exit")),
+ m_item_helloworld(_("Say Hello"))
+{
+ /* Add items to the menu */
+ m_main.append(m_item_helloworld);
+ m_main.append(m_item_exit);
+ m_main.show_all();
+
+ /* Attach the menu object to the application */
+ set_menu(m_main);
+
+ /* Attach the callback function to signal handler */
+ m_item_exit.signal_activate().connect(sigc::mem_fun(*this, &MyWindow::on_menu_quit));
+ m_item_helloworld.signal_activate().connect(sigc::mem_fun(*this, &MyWindow::on_menu_helloworld));
+
+ /* Make all menu widgets visible */
+ show_all();
+}
+
+/* Class destructor */
+MyWindow::~MyWindow()
+{
+}
+
+/* Callback function for menu exit */
+void MyWindow::on_menu_quit()
+{
+ /* Close the window */
+ hide();
+}
+
+void MyWindow::on_menu_helloworld()
+{
+ /* Create and show a "Hello World" dialog */
+ Hildon::Note helloworld_note(Hildon::NOTE_TYPE_INFORMATION, _("$(message)"));
+ helloworld_note.run();
+}
Added: trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/src/mywindow.cpp
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/src/mywindow.cpp (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/src/mywindow.cpp 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,55 @@
+/*
+ ============================================================================
+ Name : main.c
+ Author : $(author)
+ Version :
+ Copyright : $(copyright)
+ Description : Cpp Hello World I18n
+ ============================================================================
+ */
+
+#include <glibmm/i18n.h>
+#include <gtkmm.h>
+#include <hildonmm.h>
+
+#include "mywindow.h"
+
+/* Class constructor */
+MyWindow::MyWindow() :
+ m_item_exit(_("Exit")),
+ m_item_helloworld(_("Say Hello"))
+{
+ /* Add items to the menu */
+ m_main.append(m_item_helloworld);
+ m_main.append(m_item_exit);
+ m_main.show_all();
+
+ /* Attach the menu object to the application */
+ set_menu(m_main);
+
+ /* Attach the callback function to signal handler */
+ m_item_exit.signal_activate().connect(sigc::mem_fun(*this, &MyWindow::on_menu_quit));
+ m_item_helloworld.signal_activate().connect(sigc::mem_fun(*this, &MyWindow::on_menu_helloworld));
+
+ /* Make all menu widgets visible */
+ show_all();
+}
+
+/* Class destructor */
+MyWindow::~MyWindow()
+{
+}
+
+/* Callback function for menu exit */
+void MyWindow::on_menu_quit()
+{
+ /* Close the window */
+ hide();
+}
+
+void MyWindow::on_menu_helloworld()
+{
+ /* Create and show a "Hello World" dialog */
+ Hildon::Note helloworld_note(Hildon::NOTE_TYPE_INFORMATION, _("$(message)"));
+ helloworld_note.run();
+}
Added: trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/src/mywindow.h
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/src/mywindow.h (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/src/mywindow.h 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,36 @@
+/*
+ ============================================================================
+ Name : main.c
+ Author : $(author)
+ Version :
+ Copyright : $(copyright)
+ Description : Cpp Hello World I18n
+ ============================================================================
+ */
+
+#ifndef MYWINDOW_H
+#define MYWINDOW_H
+
+#include <gtkmm.h>
+#include <hildonmm.h>
+
+class MyWindow : public Hildon::Window
+{
+public:
+ MyWindow();
+ virtual ~MyWindow();
+
+protected:
+ /* Signal handlers */
+ void on_menu_quit();
+ void on_menu_helloworld();
+
+ /* Menu object */
+ Gtk::Menu m_main;
+
+ /* The menu items */
+ Gtk::MenuItem m_item_exit;
+ Gtk::MenuItem m_item_helloworld;
+};
+
+#endif /* MYWINDOW_H */
Added: trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/template.properties
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/template.properties (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/template.properties 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,13 @@
+#Template Default Values
+CppHelloworldI18n.Ctemplate.label=Maemo Hello World I18n Cpp Project
+CppHelloworldI18n.Ctemplate.description=A Hello World I18n Cpp Project
+CppHelloworldI18n.basics.label=Basic Settings
+CppHelloworldI18n.basics.description=Basic properties of a project
+CppHelloworldI18n.author.label=Author
+CppHelloworldI18n.author.description=Name of the author
+CppHelloworldI18n.copyright.label=Copyright notice
+CppHelloworldI18n.copyright.description=Your copyright notice
+CppHelloworldI18n.copyright.default=Your copyright notice
+CppHelloworldI18n.message.default=Hello World!!!
+CppHelloworldI18n.message.description=Your hello world greeting message
+CppHelloworldI18n.message.label=Hello world greeting
\ No newline at end of file
Added: trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/template.xml
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/template.xml (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppHelloworldI18n/template.xml 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<template type="ProjTempl" version="1.0" supplier="Eclipse.org" revision="1.0" author="Intel Corporation"
+ copyright="Copyright (c) 2007 Intel Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html"
+ id="CppHelloworldI18nProject" label="%CppHelloworldI18n.Ctemplate.label" description="%CppHelloworldI18n.Ctemplate.description"
+ help="help.html">
+
+ <property-group id="basics" label="%CppHelloworldI18n.basics.label" description="%CppHelloworldI18n.basics.description" type="PAGES-ONLY" help="help.html">
+ <property id="author"
+ label="%CppHelloworldI18n.author.label"
+ description="%CppHelloworldI18n.author.description"
+ type="input"
+ pattern=".*"
+ default=""
+ hidden="false"
+ persist="true"/>
+ <property id="copyright"
+ label="%CppHelloworldI18n.copyright.label"
+ description="%CppHelloworldI18n.copyright.description"
+ type="input"
+ pattern=".*"
+ default="%CppHelloworldI18n.copyright.default"
+ hidden="false"
+ persist="true"/>
+ <property id="message"
+ label="%CppHelloworldI18n.message.label"
+ description="%CppHelloworldI18n.message.description"
+ type="input"
+ pattern=".*"
+ default="%CppHelloworldI18n.message.default"
+ hidden="false"
+ persist="true"/>
+ </property-group>
+
+ <process type="org.eclipse.cdt.core.CreateSourceFolder">
+ <simple name="projectName" value="$(projectName)"/>
+ <simple name="path" value="src"/>
+ </process>
+
+ <process type="org.eclipse.cdt.core.AddFiles">
+ <simple name="projectName" value="$(projectName)"/>
+ <complex-array name="files">
+ <element>
+ <simple name="source" value="configure.ac"/>
+ <simple name="target" value="configure.ac"/>
+ <simple name="replaceable" value="false"/>
+ </element>
+ <element>
+ <simple name="source" value="Makefile.am"/>
+ <simple name="target" value="Makefile.am"/>
+ <simple name="replaceable" value="false"/>
+ </element>
+ <element>
+ <simple name="source" value="src/main.cc"/>
+ <simple name="target" value="src/main.cc"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/main.cpp"/>
+ <simple name="target" value="src/main.cpp"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/mywindow.cc"/>
+ <simple name="target" value="src/mywindow.cc"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/mywindow.cpp"/>
+ <simple name="target" value="src/mywindow.cpp"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/mywindow.h"/>
+ <simple name="target" value="src/mywindow.h"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/Makefile.am"/>
+ <simple name="target" value="src/Makefile.am"/>
+ <simple name="replaceable" value="false"/>
+ </element>
+ <element>
+ <simple name="source" value="src/helloworld.htm"/>
+ <simple name="target" value="src/helloworld.htm"/>
+ <simple name="replaceable" value="false"/>
+ </element>
+ </complex-array>
+ </process>
+
+</template>
+
Added: trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/Makefile.am
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/Makefile.am (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/Makefile.am 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,3 @@
+AUTOMAKE_OPTIONS = foreign
+
+SUBDIRS = src
Added: trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/configure.ac
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/configure.ac (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/configure.ac 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,26 @@
+AC_INIT(new_helloworld, 0.1)
+AC_PREREQ(2.59)
+
+AM_INIT_AUTOMAKE([1.7.9])
+AC_CONFIG_HEADERS([config.h])
+
+AC_GNU_SOURCE
+AC_CANONICAL_HOST
+AM_MAINTAINER_MODE
+
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+AC_PROG_CXX
+
+AC_CONFIG_FILES([Makefile
+ src/Makefile])
+
+PKG_CHECK_MODULES(LIBHILDONMM, hildonmm >= 0.9.6)
+AC_SUBST(LIBHILDONMM_CFLAGS)
+AC_SUBST(LIBHILDONMM_LIBS)
+
+PKG_CHECK_MODULES(LIBHILDONFMMM, hildon-fmmm >= 0.9.6)
+AC_SUBST(LIBHILDONFMMM_CFLAGS)
+AC_SUBST(LIBHILDONFMMM_LIBS)
+
+AC_OUTPUT
Added: trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/src/Makefile.am
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/src/Makefile.am (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/src/Makefile.am 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,9 @@
+AUTOMAKE_OPTIONS = foreign
+
+bin_PROGRAMS = new_helloworld
+new_helloworld_SOURCES = main.cpp \
+ mywindow.cpp \
+ mywindow.h
+
+new_helloworld_LDADD = $(LIBHILDONMM_LIBS) $(LIBHILDONFMMM_LIBS)
+new_helloworld_CXXFLAGS = $(LIBHILDONMM_CFLAGS) $(LIBHILDONFMMM_CFLAGS)
Added: trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/src/main.cc
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/src/main.cc (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/src/main.cc 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,45 @@
+/*
+ ============================================================================
+ Name : main.c
+ Author : $(author)
+ Version :
+ Copyright : $(copyright)
+ Description : New Cpp Hello World
+ ============================================================================
+ */
+
+#include "config.h"
+
+#include <hildonmm.h>
+#include <iostream>
+
+#include "mywindow.h"
+
+int main(int argc, char *argv[])
+{
+ /* Initialize gtkmm and checks the arguments passed to your application */
+ Gtk::Main main_loop(&argc, &argv);
+
+ /* Initialize the hildomm libraries */
+ Hildon::init();
+
+ /* Initialize libosso environment */
+ osso_context_t* osso_context = osso_initialize(PACKAGE_NAME, PACKAGE_VERSION, TRUE, 0);
+ if(!osso_context)
+ std::cerr << "osso_initialize() failed." << std::endl;
+
+ /* Set the application name */
+ Glib::set_application_name(PACKAGE_STRING);
+
+ /* Create an object for the main Window and attach it to the program */
+ MyWindow window;
+ Hildon::Program::get_instance()->add_window(window);
+
+ /* Begin the main application */
+ main_loop.run(window);
+
+ /* Clean the libosso environment */
+ osso_deinitialize(osso_context);
+
+ return 0;
+}
Added: trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/src/main.cpp
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/src/main.cpp (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/src/main.cpp 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,45 @@
+/*
+ ============================================================================
+ Name : main.c
+ Author : $(author)
+ Version :
+ Copyright : $(copyright)
+ Description : New Cpp Hello World
+ ============================================================================
+ */
+
+#include "config.h"
+
+#include <hildonmm.h>
+#include <iostream>
+
+#include "mywindow.h"
+
+int main(int argc, char *argv[])
+{
+ /* Initialize gtkmm and checks the arguments passed to your application */
+ Gtk::Main main_loop(&argc, &argv);
+
+ /* Initialize the hildomm libraries */
+ Hildon::init();
+
+ /* Initialize libosso environment */
+ osso_context_t* osso_context = osso_initialize(PACKAGE_NAME, PACKAGE_VERSION, TRUE, 0);
+ if(!osso_context)
+ std::cerr << "osso_initialize() failed." << std::endl;
+
+ /* Set the application name */
+ Glib::set_application_name(PACKAGE_STRING);
+
+ /* Create an object for the main Window and attach it to the program */
+ MyWindow window;
+ Hildon::Program::get_instance()->add_window(window);
+
+ /* Begin the main application */
+ main_loop.run(window);
+
+ /* Clean the libosso environment */
+ osso_deinitialize(osso_context);
+
+ return 0;
+}
Added: trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/src/mywindow.cc
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/src/mywindow.cc (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/src/mywindow.cc 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,186 @@
+/*
+ ============================================================================
+ Name : main.c
+ Author : $(author)
+ Version :
+ Copyright : $(copyright)
+ Description : New Cpp Hello World
+ ============================================================================
+ */
+
+#include <fstream>
+#include <gtkmm.h>
+#include <hildon-fmmm.h>
+#include <hildonmm.h>
+#include <iostream>
+
+#include "mywindow.h"
+
+using namespace std;
+
+/* Class constructor */
+MyWindow::MyWindow() :
+ m_item_exit("Exit"),
+ m_item_helloworld("Say \"Hello\""),
+ m_item_helloworld_entry("Say \"Hello\" From Text Box"),
+ m_item_helloworld_file("Say \"Hello\" From File"),
+ m_label("Type some text"),
+ m_button("Quit"),
+ m_tool_open(Gtk::Stock::OPEN),
+ m_tool_save(Gtk::Stock::SAVE),
+ m_image(Gtk::Stock::HELP, Gtk::ICON_SIZE_DIALOG),
+ m_note(Hildon::NOTE_TYPE_CONFIRMATION_BUTTON, "Quit application?")
+{
+ m_tool_entry.add(tb_entry);
+ m_tool_entry.set_expand();
+
+ /* Add Tollbar items to Toolbar */
+ m_toolbar.append(m_tool_open);
+ m_toolbar.append(m_tool_save);
+ m_toolbar.append(m_tool_separator);
+ m_toolbar.append(m_tool_entry);
+
+ /* Add ToolBar */
+ add_toolbar(m_toolbar);
+ m_toolbar.show_all();
+
+ /* Add items to the menu */
+ m_main.append(m_item_helloworld);
+ m_main.append(m_item_helloworld_entry);
+ m_main.append(m_item_helloworld_file);
+ m_main.append(m_item_exit);
+ m_main.show_all();
+
+ /* Add dialog box buttons */
+ m_note.add_button(Gtk::Stock::YES, Gtk::RESPONSE_YES);
+ m_note.add_button(Gtk::Stock::NO, Gtk::RESPONSE_NO);
+
+ /* Attach the menu object to the application */
+ set_menu(m_main);
+
+ /* Attach the callback function to signal handler signal */
+ m_item_exit.signal_activate().connect(sigc::mem_fun(*this, &MyWindow::on_menu_quit));
+ m_item_helloworld.signal_activate().connect(sigc::mem_fun(*this, &MyWindow::on_menu_helloworld));
+ m_item_helloworld_entry.signal_activate().connect(sigc::mem_fun(*this, &MyWindow::on_menu_helloworld_entry));
+ m_button.signal_clicked().connect(sigc::mem_fun(*this, &MyWindow::on_menu_quit));
+ m_item_helloworld_file.signal_activate().connect(sigc::mem_fun(*this, &MyWindow::on_menu_helloworld_file));
+ m_tool_open.signal_clicked().connect(sigc::mem_fun(*this, &MyWindow::on_open_click));
+ m_tool_save.signal_clicked().connect(sigc::mem_fun(*this, &MyWindow::on_save_click));
+ m_note.signal_response().connect(sigc::mem_fun(*this, &MyWindow::on_note_response));
+
+ /* Attach the frame_box to window application */
+ add(frame_box);
+
+ /* Sets the "text" property to the value of entry. */
+ m_entry.set_text("My \"Hello World!\"");
+
+ /* Adjust the boxes' borders */
+ b_box.set_border_width(50);
+ e_box.set_border_width(50);
+
+ /* Adding the widgets to boxes */
+ b_box.pack_start(m_button);
+ e_box.pack_start(m_label);
+ e_box.pack_start(m_entry);
+ e_box.pack_start(m_image);
+ frame_box.pack_start(e_box);
+ frame_box.pack_start(b_box);
+
+ /* Make all menu widgets visible */
+ show_all();
+}
+
+/* Class destructor */
+MyWindow::~MyWindow()
+{
+}
+
+/* Callback function, which will be called to close the application */
+void MyWindow::on_menu_quit()
+{
+ m_note.run();
+}
+
+/* Note response handler */
+void MyWindow::on_note_response(int response_id)
+{
+ if (response_id == Gtk::RESPONSE_YES) {
+ /* Close the window */
+ this->hide();
+ } else {
+ /* Close the dialog box */
+ m_note.hide();
+ }
+}
+
+/* Callback function, which will be called when the "Say Hello" menu is activated */
+void MyWindow::on_menu_helloworld()
+{
+ /* Create and show a "Hello World" dialog */
+ Hildon::Note helloworld_note(Hildon::NOTE_TYPE_INFORMATION, "$(message)");
+ helloworld_note.run();
+}
+
+/* Callback function, which will be called when the "Say Hello from text box" menu is activated */
+void MyWindow::on_menu_helloworld_entry()
+{
+ Hildon::Note helloworld_note(Hildon::NOTE_TYPE_INFORMATION_THEME, m_entry.get_text());
+ helloworld_note.run();
+}
+
+/* Callback function, which will be called when the "Say Hello from file" menu is activated */
+void MyWindow::on_menu_helloworld_file()
+{
+ std::string line="";
+ fstream file;
+
+ file.open(tb_entry.get_text().c_str());
+
+ if (!file) {
+ cerr << "File cannot be opened!" << endl;
+ Gtk::MessageDialog dialog(*this, "File cannot be open!", false, Gtk::MESSAGE_ERROR);
+ dialog.set_title("Error");
+ dialog.run();
+ } else {
+ std::getline (file,line);
+ Hildon::Note helloworld_note(Hildon::NOTE_TYPE_INFORMATION_THEME, line);
+ helloworld_note.run();
+ }
+
+ file.close();
+}
+
+void MyWindow::on_open_click()
+{
+ Hildon::FileChooserDialog dialog(*this, Gtk::FILE_CHOOSER_ACTION_OPEN);
+
+ /* Show the dialog and wait for a user response: */
+ int response = dialog.run();
+
+ if (response == Gtk::RESPONSE_OK) {
+ std::string filename = dialog.get_filename();
+ tb_entry.set_text(filename.c_str());
+ }
+}
+
+void MyWindow::on_save_click()
+{
+ ofstream file;
+
+ file.open(tb_entry.get_text().c_str());
+ if (!file) {
+ Gtk::MessageDialog dialog(*this, "File cannot be saved!", false, Gtk::MESSAGE_ERROR);
+ dialog.set_title("Error");
+ dialog.run();
+ } else {
+ file.close();
+ std::remove(tb_entry.get_text().c_str());
+ file.open(tb_entry.get_text().c_str(), ios::trunc);
+ file << m_entry.get_text().c_str();
+ Gtk::MessageDialog dialog(*this, "File saved!");
+ dialog.set_title("Info");
+ dialog.run();
+ }
+
+ file.close();
+}
Added: trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/src/mywindow.cpp
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/src/mywindow.cpp (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/src/mywindow.cpp 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,193 @@
+/*
+ ============================================================================
+ Name : main.c
+ Author : $(author)
+ Version :
+ Copyright : $(copyright)
+ Description : New Cpp Hello World
+ ============================================================================
+ */
+
+#include <fstream>
+#include <gtkmm.h>
+#include <hildon-fmmm.h>
+#include <hildonmm.h>
+#include <iostream>
+
+#include "mywindow.h"
+
+/* Class constructor */
+MyWindow::MyWindow() :
+ m_item_exit("Exit"),
+ m_item_helloworld("Say \"Hello\""),
+ m_item_helloworld_entry("Say \"Hello\" From Text Box"),
+ m_item_helloworld_file("Say \"Hello\" From File"),
+ m_label("Type some text"),
+ m_button("Quit"),
+ m_tool_open(Gtk::Stock::OPEN),
+ m_tool_save(Gtk::Stock::SAVE),
+ m_image(Gtk::Stock::HELP, Gtk::ICON_SIZE_DIALOG),
+ m_note(Hildon::NOTE_TYPE_CONFIRMATION_BUTTON, "Quit application?")
+{
+ m_tool_entry.add(m_tb_entry);
+ m_tool_entry.set_expand();
+
+ /* Add Tollbar items to Toolbar */
+ m_toolbar.append(m_tool_open);
+ m_toolbar.append(m_tool_save);
+ m_toolbar.append(m_tool_separator);
+ m_toolbar.append(m_tool_entry);
+
+ /* Add ToolBar */
+ add_toolbar(m_toolbar);
+ m_toolbar.show_all();
+
+ /* Add items to the menu */
+ m_main.append(m_item_helloworld);
+ m_main.append(m_item_helloworld_entry);
+ m_main.append(m_item_helloworld_file);
+ m_main.append(m_item_exit);
+ m_main.show_all();
+
+ /* Add dialog box buttons */
+ m_note.add_button(Gtk::Stock::YES, Gtk::RESPONSE_YES);
+ m_note.add_button(Gtk::Stock::NO, Gtk::RESPONSE_NO);
+
+ /* Attach the menu object to the application */
+ set_menu(m_main);
+
+ /* Attach the callback function to signal handler signal */
+ m_item_exit.signal_activate().connect(sigc::mem_fun(*this, &MyWindow::on_menu_quit));
+ m_item_helloworld.signal_activate().connect(sigc::mem_fun(*this, &MyWindow::on_menu_helloworld));
+ m_item_helloworld_entry.signal_activate().connect(sigc::mem_fun(*this, &MyWindow::on_menu_helloworld_entry));
+ m_button.signal_clicked().connect(sigc::mem_fun(*this, &MyWindow::on_menu_quit));
+ m_item_helloworld_file.signal_activate().connect(sigc::mem_fun(*this, &MyWindow::on_menu_helloworld_file));
+ m_tool_open.signal_clicked().connect(sigc::mem_fun(*this, &MyWindow::on_open_click));
+ m_tool_save.signal_clicked().connect(sigc::mem_fun(*this, &MyWindow::on_save_click));
+ m_note.signal_response().connect(sigc::mem_fun(*this, &MyWindow::on_note_response));
+
+ /* Handle click on X button in the title bar */
+ this->signal_delete_event().connect(sigc::mem_fun(*this, &MyWindow::on_delete_event));
+
+ /* Attach the frame_box to window application */
+ add(m_frame_box);
+
+ /* Sets the "text" property to the value of entry. */
+ m_entry.set_text("My \"Hello World!\"");
+
+ /* All widgets should use the same amount of space */
+ m_hbox_button.set_homogeneous(true);
+ m_frame_box.set_homogeneous(true);
+
+ /* Adding the widgets to boxes */
+ m_hbox_button.pack_start(m_button, Gtk::PACK_SHRINK);
+ m_hbox_textbox.pack_start(m_label);
+ m_hbox_textbox.pack_start(m_entry);
+ m_hbox_textbox.pack_start(m_image);
+ m_frame_box.pack_start(m_hbox_textbox);
+ m_frame_box.pack_start(m_hbox_button, Gtk::PACK_SHRINK);
+
+ /* Make all menu widgets visible */
+ show_all();
+}
+
+/* Class destructor */
+MyWindow::~MyWindow()
+{
+}
+
+/* Callback function, which will be called to close the application */
+void MyWindow::on_menu_quit()
+{
+ m_note.run();
+}
+
+bool MyWindow::on_delete_event(GdkEventAny *event)
+{
+ m_note.run();
+ return true;
+}
+
+/* Note response handler */
+void MyWindow::on_note_response(int response_id)
+{
+ if (response_id == Gtk::RESPONSE_YES) {
+ /* Close the window */
+ this->hide();
+ } else {
+ /* Close the dialog box */
+ m_note.hide();
+ }
+}
+
+/* Callback function, which will be called when the "Say Hello" menu is activated */
+void MyWindow::on_menu_helloworld()
+{
+ /* Create and show a "Hello World" dialog */
+ Hildon::Note helloworld_note(Hildon::NOTE_TYPE_INFORMATION, "$(message)");
+ helloworld_note.run();
+}
+
+/* Callback function, which will be called when the "Say Hello from text box" menu is activated */
+void MyWindow::on_menu_helloworld_entry()
+{
+ Hildon::Note helloworld_note(Hildon::NOTE_TYPE_INFORMATION_THEME, m_entry.get_text());
+ helloworld_note.run();
+}
+
+/* Callback function, which will be called when the "Say Hello from file" menu is activated */
+void MyWindow::on_menu_helloworld_file()
+{
+ std::string line="";
+ std::fstream file;
+
+ file.open(m_tb_entry.get_text().c_str());
+
+ if (!file) {
+ std::cerr << "File cannot be opened!" << std::endl;
+ Gtk::MessageDialog dialog(*this, "File cannot be open!", false, Gtk::MESSAGE_ERROR);
+ dialog.set_title("Error");
+ dialog.run();
+ } else {
+ std::getline (file,line);
+ Hildon::Note helloworld_note(Hildon::NOTE_TYPE_INFORMATION_THEME, line);
+ helloworld_note.run();
+ }
+
+ file.close();
+}
+
+void MyWindow::on_open_click()
+{
+ Hildon::FileChooserDialog dialog(*this, Gtk::FILE_CHOOSER_ACTION_OPEN);
+
+ /* Show the dialog and wait for a user response: */
+ int response = dialog.run();
+
+ if (response == Gtk::RESPONSE_OK) {
+ std::string filename = dialog.get_filename();
+ m_tb_entry.set_text(filename.c_str());
+ }
+}
+
+void MyWindow::on_save_click()
+{
+ std::ofstream file;
+
+ file.open(m_tb_entry.get_text().c_str());
+ if (!file) {
+ Gtk::MessageDialog dialog(*this, "File cannot be saved!", false, Gtk::MESSAGE_ERROR);
+ dialog.set_title("Error");
+ dialog.run();
+ } else {
+ file.close();
+ std::remove(m_tb_entry.get_text().c_str());
+ file.open(m_tb_entry.get_text().c_str(), std::ios::trunc);
+ file << m_entry.get_text().c_str();
+ Gtk::MessageDialog dialog(*this, "File saved!");
+ dialog.set_title("Info");
+ dialog.run();
+ }
+
+ file.close();
+}
Added: trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/src/mywindow.h
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/src/mywindow.h (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/src/mywindow.h 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,65 @@
+/*
+ ============================================================================
+ Name : main.c
+ Author : $(author)
+ Version :
+ Copyright : $(copyright)
+ Description : New Cpp Hello World
+ ============================================================================
+ */
+
+#ifndef MYWINDOW_H
+#define MYWINDOW_H
+
+#include <gtkmm.h>
+#include <hildonmm.h>
+
+class MyWindow : public Hildon::Window
+{
+public:
+ MyWindow();
+ virtual ~MyWindow();
+
+protected:
+ /* Signal handlers */
+ void on_menu_quit();
+ bool on_delete_event(GdkEventAny *);
+ void on_menu_helloworld();
+ void on_menu_helloworld_entry();
+ void on_menu_helloworld_file();
+ void on_note_response(int);
+ void on_open_click();
+ void on_save_click();
+
+ /* Menu object */
+ Gtk::Menu m_main;
+
+ /* The menu items */
+ Gtk::MenuItem m_item_exit;
+ Gtk::MenuItem m_item_helloworld;
+ Gtk::MenuItem m_item_helloworld_entry;
+ Gtk::MenuItem m_item_helloworld_file;
+
+ /* Widgets */
+ Gtk::VBox m_frame_box;
+ Gtk::HBox m_hbox_textbox;
+ Gtk::HBox m_hbox_button;
+ Gtk::Label m_label;
+ Gtk::Entry m_entry;
+ Gtk::Entry m_tb_entry;
+ Gtk::Button m_button;
+ Gtk::Image m_image;
+
+ /* Toolbar */
+ Gtk::Toolbar m_toolbar;
+ Gtk::ToolButton m_tool_open;
+ Gtk::ToolButton m_tool_save;
+ Gtk::SeparatorToolItem m_tool_separator;
+ Gtk::ToolItem m_tool_entry;
+
+ /* Quit confimation dialog box */
+ Hildon::Note m_note;
+};
+
+#endif /* MYWINDOW_H */
+
Added: trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/template.properties
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/template.properties (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/template.properties 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,13 @@
+#Template Default Values
+CppNewHelloWorld.Ctemplate.label=Maemo New Hello World Cpp Project
+CppNewHelloWorld.Ctemplate.description=A New Hello World Cpp Project
+CppNewHelloWorld.basics.label=Basic Settings
+CppNewHelloWorld.basics.description=Basic properties of a project
+CppNewHelloWorld.author.label=Author
+CppNewHelloWorld.author.description=Name of the author
+CppNewHelloWorld.copyright.label=Copyright notice
+CppNewHelloWorld.copyright.description=Your copyright notice
+CppNewHelloWorld.copyright.default=Your copyright notice
+CppNewHelloWorld.message.default=Hello World!!!
+CppNewHelloWorld.message.description=Your hello world greeting message
+CppNewHelloWorld.message.label=Hello world greeting
\ No newline at end of file
Added: trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/template.xml
===================================================================
--- trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/template.xml (rev 0)
+++ trunk/org.indt.esbox.ui/templates/CppNewHelloWorld/template.xml 2007-10-21 20:13:35 UTC (rev 162)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<template type="ProjTempl" version="1.0" supplier="Eclipse.org" revision="1.0" author="Intel Corporation"
+ copyright="Copyright (c) 2007 Intel Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html"
+ id="CppNewHelloWorldProject" label="%CppNewHelloWorld.Ctemplate.label" description="%CppNewHelloWorld.Ctemplate.description"
+ help="help.html">
+
+ <property-group id="basics" label="%CppNewHelloWorld.basics.label" description="%CppNewHelloWorld.basics.description" type="PAGES-ONLY" help="help.html">
+ <property id="author"
+ label="%CppNewHelloWorld.author.label"
+ description="%CppNewHelloWorld.author.description"
+ type="input"
+ pattern=".*"
+ default=""
+ hidden="false"
+ persist="true"/>
+ <property id="copyright"
+ label="%CppNewHelloWorld.copyright.label"
+ description="%CppNewHelloWorld.copyright.description"
+ type="input"
+ pattern=".*"
+ default="%CppNewHelloWorld.copyright.default"
+ hidden="false"
+ persist="true"/>
+ <property id="message"
+ label="%CppNewHelloWorld.message.label"
+ description="%CppNewHelloWorld.message.description"
+ type="input"
+ pattern=".*"
+ default="%CppNewHelloWorld.message.default"
+ hidden="false"
+ persist="true"/>
+ </property-group>
+
+ <process type="org.eclipse.cdt.core.CreateSourceFolder">
+ <simple name="projectName" value="$(projectName)"/>
+ <simple name="path" value="src"/>
+ </process>
+
+ <process type="org.eclipse.cdt.core.AddFiles">
+ <simple name="projectName" value="$(projectName)"/>
+ <complex-array name="files">
+ <element>
+ <simple name="source" value="configure.ac"/>
+ <simple name="target" value="configure.ac"/>
+ <simple name="replaceable" value="false"/>
+ </element>
+ <element>
+ <simple name="source" value="Makefile.am"/>
+ <simple name="target" value="Makefile.am"/>
+ <simple name="replaceable" value="false"/>
+ </element>
+ <element>
+ <simple name="source" value="src/main.cc"/>
+ <simple name="target" value="src/main.cc"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/main.cpp"/>
+ <simple name="target" value="src/main.cpp"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/mywindow.cc"/>
+ <simple name="target" value="src/mywindow.cc"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/mywindow.cpp"/>
+ <simple name="target" value="src/mywindow.cpp"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/mywindow.h"/>
+ <simple name="target" value="src/mywindow.h"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/Makefile.am"/>
+ <simple name="target" value="src/Makefile.am"/>
+ <simple name="replaceable" value="false"/>
+ </element>
+ </complex-array>
+ </process>
+
+</template>
+
More information about the Esbox-commits
mailing list