[gtkmm] Application: Document that ID may now be empty.



commit 17b77354d43f058a5ab5fc1566071f409505c6ea
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon May 28 14:55:43 2012 +0200

    Application: Document that ID may now be empty.
    
    * gtk/src/application.hg: Constructors/create(): Document that the
    application ID may now be empty (thanks to the change in
    glib bug #671249) and generally document these.
    
    * demos/gtk-demo/main.cc:
    * demos/pixbuf-demo.cc:
    * tests/child_widget/main.cc:
    * tests/child_widget2/main.cc:
    * tests/child_widget_managed/main.cc:
    * tests/delete_cpp_child/main.cc:
    * tests/dialog/main.cc:
    * tests/dialog_deletethis/main.cc:
    * tests/main_with_options/main.cc:
    * tests/menu_destruction/main.cc:
    * tests/property_notification/main.cc:
    * tests/refcount_dialog/main.cc:
    * tests/scrolledwindow/main.cc:
    * tests/wrap_existing/main.cc: Remove the useless application IDs.

 ChangeLog                           |   23 +++++++++
 demos/gtk-demo/main.cc              |    2 +-
 demos/pixbuf-demo.cc                |    2 +-
 gtk/src/application.hg              |   93 +++++++++++++++++++++++++++++-----
 tests/child_widget/main.cc          |    3 +-
 tests/child_widget2/main.cc         |    3 +-
 tests/child_widget_managed/main.cc  |    3 +-
 tests/delete_cpp_child/main.cc      |    3 +-
 tests/dialog/main.cc                |    3 +-
 tests/dialog_deletethis/main.cc     |    3 +-
 tests/main_with_options/main.cc     |    3 +-
 tests/menu_destruction/main.cc      |    3 +-
 tests/property_notification/main.cc |    3 +-
 tests/refcount_dialog/main.cc       |    3 +-
 tests/scrolledwindow/main.cc        |    3 +-
 tests/wrap_existing/main.cc         |    3 +-
 16 files changed, 116 insertions(+), 40 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 2ce9145..7878fb6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2012-05-28  Murray Cumming  <murrayc murrayc com>
+
+	Application: Document that ID may now be empty.
+
+	* gtk/src/application.hg: Constructors/create(): Document that the 
+	application ID may now be empty (thanks to the change in 
+	glib bug #671249) and generally document these.
+
+	* demos/gtk-demo/main.cc:
+	* demos/pixbuf-demo.cc:
+	* tests/child_widget/main.cc:
+	* tests/child_widget2/main.cc:
+	* tests/child_widget_managed/main.cc:
+	* tests/delete_cpp_child/main.cc:
+	* tests/dialog/main.cc:
+	* tests/dialog_deletethis/main.cc:
+	* tests/main_with_options/main.cc:
+	* tests/menu_destruction/main.cc:
+	* tests/property_notification/main.cc:
+	* tests/refcount_dialog/main.cc:
+	* tests/scrolledwindow/main.cc:
+	* tests/wrap_existing/main.cc: Remove the useless application IDs.
+
 2012-04-21  Kalev Lember  <kalevlember gmail com>
 
 	UIManager: Wrap the GResource convenience API.
diff --git a/demos/gtk-demo/main.cc b/demos/gtk-demo/main.cc
index c70a568..e54c059 100644
--- a/demos/gtk-demo/main.cc
+++ b/demos/gtk-demo/main.cc
@@ -25,7 +25,7 @@
 int main (int argc, char *argv[])
 {
   Glib::RefPtr<Gtk::Application> app =
-    Gtk::Application::create(argc, argv, "org.gtkmm.demos.demo");
+    Gtk::Application::create(argc, argv);
 
   DemoWindow window;
 
diff --git a/demos/pixbuf-demo.cc b/demos/pixbuf-demo.cc
index 804b4ac..15f76ae 100644
--- a/demos/pixbuf-demo.cc
+++ b/demos/pixbuf-demo.cc
@@ -193,7 +193,7 @@ int main(int argc, char** argv)
   try
   {
     Glib::RefPtr<Gtk::Application> app =
-      Gtk::Application::create(argc, argv, "org.gtkmm.demos.pixbuf-demo");
+      Gtk::Application::create(argc, argv);
 
     Gtk::Window window;
     window.add(*Gtk::manage(new DemoRenderArea()));
diff --git a/gtk/src/application.hg b/gtk/src/application.hg
index 3f3a47b..c3053ec 100644
--- a/gtk/src/application.hg
+++ b/gtk/src/application.hg
@@ -34,6 +34,8 @@ _WRAP_ENUM(ApplicationInhibitFlags, GtkApplicationInhibitFlags)
 
 class Window;
 
+//TODO: Add overview documentation discussing the techniques show in the examples in gtkmm-docmentation.
+
 /** TODO
  *
  * @newin{3,4}
@@ -47,16 +49,22 @@ protected:
 protected:
 
   /** Creates a new Application instance.
-   * This constructor calls g_type_init() for you.
-   * You should call run() with your main() function's argc and argv parameters
-   * to initialize gtkmm too.
    *
-   * @param application_id A valid application id
-   * @param flags The application flags
+   * This initializes gtkmm (and the GObject type system) for you.
+   *
+   * If non-empty, the application ID must be valid.  See
+   * g_application_id_is_valid().
+   *
+   * If no application ID is given then some features (most notably application 
+   * uniqueness) will be disabled. A null application ID is only allowed with 
+   * gtkmm 3.6 or later.
+   *
+   * @param application_id A valid application ID.
+   * @param flags The application flags.
    *
    * @newin{3,4}
    */
-  explicit Application(const Glib::ustring& application_id, Gio::ApplicationFlags flags = Gio::APPLICATION_FLAGS_NONE);
+  explicit Application(const Glib::ustring& application_id = Glib::ustring(), Gio::ApplicationFlags flags = Gio::APPLICATION_FLAGS_NONE);
   _IGNORE(gtk_application_new)
   _IGNORE(gtk_application_window_new)
 
@@ -64,23 +72,80 @@ protected:
   //We added it so we can choose to always initialize gtkmm as early as possible.
   //See https://bugzilla.gnome.org/show_bug.cgi?id=639925
   /** Creates a new Application instance.
-   * This constructor initializes gtkmm for you, so you should call run() 
-   * without specifying the the argc and argv parameters again. 
-   * 
+   *
+   * This initializes gtkmm (and the GObject type system) for you, parsing the
+   * standard GTK+ command line arguments.
+   *
+   * You could instead use the constuctor that takes no command line arguements 
+   * and later supply the command line arguments to run().
+   *
+   * Note that all GTK+ functionality that is available via command line arguments
+   * can instead be achieved by setting suitable environment variables
+   * such as G_DEBUG.
+   *
+   * If non-empty, the application ID must be valid.  See
+   * g_application_id_is_valid().
+   *
+   * If no application ID is given then some features (most notably application 
+   * uniqueness) will be disabled. A null application ID is only allowed with 
+   * gtkmm 3.6 or later.
+   *
    * @param argc The parameter received by your main() function.
    * @param argv The parameter received by your main() function.
-   * @param application_id A valid application id
-   * @param flags The application flags
+   * @param application_id A valid application ID.
+   * @param flags The application flags.
    *
    * @newin{3,4}
    */
-  explicit Application(int& argc, char**& argv, const Glib::ustring& application_id, Gio::ApplicationFlags flags = Gio::APPLICATION_FLAGS_NONE);
+  explicit Application(int& argc, char**& argv, const Glib::ustring& application_id = Glib::ustring(), Gio::ApplicationFlags flags = Gio::APPLICATION_FLAGS_NONE);
   
 public:
 
-  static Glib::RefPtr<Application> create(const Glib::ustring& application_id, Gio::ApplicationFlags flags = Gio::APPLICATION_FLAGS_NONE);
+  /** Creates a new Application instance.
+   *
+   * This initializes gtkmm (and the GObject type system) for you.
+   *
+   * If non-empty, the application ID must be valid.  See
+   * g_application_id_is_valid().
+   *
+   * If no application ID is given then some features (most notably application 
+   * uniqueness) will be disabled. A null application ID is only allowed with 
+   * gtkmm 3.6 or later.
+   *
+   * @param application_id A valid application ID.
+   * @param flags The application flags.
+   *
+   * @newin{3,4}
+   */
+  static Glib::RefPtr<Application> create(const Glib::ustring& application_id = Glib::ustring(), Gio::ApplicationFlags flags = Gio::APPLICATION_FLAGS_NONE);
   
-  static Glib::RefPtr<Application> create(int& argc, char**& argv, const Glib::ustring& application_id, Gio::ApplicationFlags flags = Gio::APPLICATION_FLAGS_NONE);
+  /** Creates a new Application instance.
+   *
+   * This initializes gtkmm (and the GObject type system) for you, parsing the
+   * standard GTK+ command line arguments.
+   *
+   * You could instead use the constuctor that takes no command line arguements 
+   * and later supply the command line arguments to run().
+   *
+   * Note that all GTK+ functionality that is available via command line arguments
+   * can instead be achieved by setting suitable environment variables
+   * such as G_DEBUG.
+   *
+   * If non-empty, the application ID must be valid.  See
+   * g_application_id_is_valid().
+   *
+   * If no application ID is given then some features (most notably application 
+   * uniqueness) will be disabled. A null application ID is only allowed with 
+   * gtkmm 3.6 or later.
+   *
+   * @param argc The parameter received by your main() function.
+   * @param argv The parameter received by your main() function.
+   * @param application_id A valid application ID.
+   *
+   * @param flags The application flags.
+   * @newin{3,4}
+   */
+  static Glib::RefPtr<Application> create(int& argc, char**& argv, const Glib::ustring& application_id = Glib::ustring(), Gio::ApplicationFlags flags = Gio::APPLICATION_FLAGS_NONE);
 
 #m4 _CONVERSION(`GList*',`std::vector<Window*>',`Glib::ListHandler<Window*>::list_to_vector($3, Glib::OWNERSHIP_NONE)')
   _WRAP_METHOD(std::vector<Window*> get_windows(), gtk_application_get_windows)
diff --git a/tests/child_widget/main.cc b/tests/child_widget/main.cc
index 2ee60a2..c36de4e 100644
--- a/tests/child_widget/main.cc
+++ b/tests/child_widget/main.cc
@@ -22,8 +22,7 @@
 int main(int argc, char *argv[])
 {
   Glib::RefPtr<Gtk::Application> app =
-    Gtk::Application::create(argc, argv,
-      "org.gtkmm.test");
+    Gtk::Application::create(argc, argv);
 
   TestWindow testWindow;
   return app->run(testWindow); //Shows the window and returns when it is closed.
diff --git a/tests/child_widget2/main.cc b/tests/child_widget2/main.cc
index 8d402e7..e92951f 100644
--- a/tests/child_widget2/main.cc
+++ b/tests/child_widget2/main.cc
@@ -21,8 +21,7 @@ MyWindow::MyWindow() :
 int main (int argc, char *argv[])
 {
   Glib::RefPtr<Gtk::Application> app =
-    Gtk::Application::create(argc, argv,
-      "org.gtkmm.test");
+    Gtk::Application::create(argc, argv);
 
   MyWindow window;
   return app->run(window);
diff --git a/tests/child_widget_managed/main.cc b/tests/child_widget_managed/main.cc
index b0c3255..c750e40 100644
--- a/tests/child_widget_managed/main.cc
+++ b/tests/child_widget_managed/main.cc
@@ -46,8 +46,7 @@ ExampleWindow::~ExampleWindow()
 int main(int argc, char* argv[])
 {
    Glib::RefPtr<Gtk::Application> app =
-    Gtk::Application::create(argc, argv,
-      "org.gtkmm.test");
+    Gtk::Application::create(argc, argv);
 
   ExampleWindow window;
   return app->run(window);
diff --git a/tests/delete_cpp_child/main.cc b/tests/delete_cpp_child/main.cc
index 40a5b5f..6966349 100644
--- a/tests/delete_cpp_child/main.cc
+++ b/tests/delete_cpp_child/main.cc
@@ -51,8 +51,7 @@ void AppWindow::on_button_clicked()
 int main(int argc, char *argv[])
 {
   Glib::RefPtr<Gtk::Application> app =
-    Gtk::Application::create(argc, argv,
-      "org.gtkmm.test");
+    Gtk::Application::create(argc, argv);
   AppWindow window;
   return app->run(window);
 }
diff --git a/tests/dialog/main.cc b/tests/dialog/main.cc
index d719aeb..890d43b 100644
--- a/tests/dialog/main.cc
+++ b/tests/dialog/main.cc
@@ -51,8 +51,7 @@ void AppWindow::on_button_clicked()
 int main(int argc, char *argv[])
 {
   Glib::RefPtr<Gtk::Application> app =
-    Gtk::Application::create(argc, argv,
-      "org.gtkmm.test");
+    Gtk::Application::create(argc, argv);
   AppWindow window;
   return app->run(window);
 }
diff --git a/tests/dialog_deletethis/main.cc b/tests/dialog_deletethis/main.cc
index 8c6c894..6cd92e9 100644
--- a/tests/dialog_deletethis/main.cc
+++ b/tests/dialog_deletethis/main.cc
@@ -45,8 +45,7 @@ class Dlg : public sigc::trackable
 
 int main (int argc, char **argv)
 {
-  app = Gtk::Application::create(argc, argv,
-    "org.gtkmm.test");
+  app = Gtk::Application::create(argc, argv);
 
   new Dlg(); //Not a Gtk::Dialog - it creates one in its constructor.
 
diff --git a/tests/main_with_options/main.cc b/tests/main_with_options/main.cc
index 03e5573..81d4cc0 100644
--- a/tests/main_with_options/main.cc
+++ b/tests/main_with_options/main.cc
@@ -104,8 +104,7 @@ int main(int argc, char *argv[])
   try
   {
     Glib::RefPtr<Gtk::Application> app =
-      Gtk::Application::create(argc, argv,
-        "org.gtkmm.test");
+      Gtk::Application::create(argc, argv);
   
     //Here we can see the parsed values of our custom command-line arguments:
 
diff --git a/tests/menu_destruction/main.cc b/tests/menu_destruction/main.cc
index 878bc8c..fb21fcc 100644
--- a/tests/menu_destruction/main.cc
+++ b/tests/menu_destruction/main.cc
@@ -77,8 +77,7 @@ test_window::test_window()
 int main(int argc, char *argv[])
 {
   Glib::RefPtr<Gtk::Application> app =
-    Gtk::Application::create(argc, argv,
-      "org.gtkmm.test");
+    Gtk::Application::create(argc, argv);
   test_window foo;
   return app->run(foo);
 }
diff --git a/tests/property_notification/main.cc b/tests/property_notification/main.cc
index 97f792a..8190d67 100644
--- a/tests/property_notification/main.cc
+++ b/tests/property_notification/main.cc
@@ -20,8 +20,7 @@ void on_property_name_changed()
 int main (int argc, char **argv)
 {
   Glib::RefPtr<Gtk::Application> app =
-    Gtk::Application::create(argc, argv,
-      "org.gtkmm.test");
+    Gtk::Application::create(argc, argv);
 
   Gtk::Window window;
 
diff --git a/tests/refcount_dialog/main.cc b/tests/refcount_dialog/main.cc
index bca6ac9..49a37ef 100644
--- a/tests/refcount_dialog/main.cc
+++ b/tests/refcount_dialog/main.cc
@@ -55,8 +55,7 @@ void MyWindow::on_button_clicked()
 int main(int argc, char* argv[])
 {
   Glib::RefPtr<Gtk::Application> app =
-    Gtk::Application::create(argc, argv,
-      "org.gtkmm.test");
+    Gtk::Application::create(argc, argv);
 
   MyWindow win;
   return app->run(win);
diff --git a/tests/scrolledwindow/main.cc b/tests/scrolledwindow/main.cc
index 16b0a35..aa9d702 100644
--- a/tests/scrolledwindow/main.cc
+++ b/tests/scrolledwindow/main.cc
@@ -58,8 +58,7 @@ protected:
 int main ( int argc, char *argv[] ) {
   
   Glib::RefPtr<Gtk::Application> app =
-    Gtk::Application::create(argc, argv,
-      "org.gtkmm.test");
+    Gtk::Application::create(argc, argv);
 
   Instance instance;
 }
diff --git a/tests/wrap_existing/main.cc b/tests/wrap_existing/main.cc
index 95e4941..31c66c0 100644
--- a/tests/wrap_existing/main.cc
+++ b/tests/wrap_existing/main.cc
@@ -21,8 +21,7 @@ void on_object_qdata_destroyed(gpointer data)
 int main(int argc, char**argv)
 {
   Glib::RefPtr<Gtk::Application> app =
-    Gtk::Application::create(argc, argv,
-      "org.gtkmm.test");
+    Gtk::Application::create(argc, argv);
 
   Gtk::Dialog* pDialog = new Gtk::Dialog();
   Gtk::Box* pBox = pDialog->get_content_area();



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