BUILD: Cleaned unneeded information
[maevies] / src / main.c
index b6604df..8d9f014 100644 (file)
-/*******************************************************************************
- * Copyright (c) 2007-2008 INdT, (c) 2009 Nokia.
+/*
+ * Copyright (C) 2010 Simón Pena
  *
- * This code example is licensed under a MIT-style license,
- * that can be found in the file called "COPYING" in the package
+ * Contact: spenap@gmail.com
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
  *
  */
 
-/*
- ============================================================================
- Name        : main.c
- Author      : Simón Pena
- Version     : 0.1
- Description : Hildon GUI Application in C
- ============================================================================
- */
-/* Includes */
-#include <hildon/hildon-program.h>
-#include <gtk/gtkmain.h>
-#include <gtk/gtkbutton.h>
-#include <libosso.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "localisation.h"
-#include "extra_scenes_provider.h"
-#include "maevies_window.h"
-
-/* Defines to add the application to dbus and keep it running
- * Please do not modify "APP_NAME" (or other defines) to different name
- */
-#define APP_NAME "maevies"
-#define APP_VER "0.1"
-#define APP_SERVICE "com.nokia.maevies"
-#define APP_METHOD "/com/nokia/maevies"
-/* end defines */
-
-typedef struct _AppData AppData;
-
-struct _AppData {
-
-       HildonProgram *program;
-       MaeviesWindow *window;
-
-};
-
-static gint dbus_callback(const gchar *interface, const gchar *method,
-               GArray *arguments, gpointer data, osso_rpc_t *retval);
-
-gint main(gint argc, gchar* argv[]) {
-
-       osso_context_t *osso_cont;
-       osso_return_t ret;
-       AppData *data = g_new0(AppData,1);
-
-       locale_init();
-
-       osso_cont = osso_initialize(APP_NAME, APP_VER, TRUE, NULL);
-       g_assert(osso_cont);
-
-       /* Initialize the GTK. */
-       gtk_init(&argc, &argv);
-
-       /* Initialize thread system */
-       g_thread_init(NULL);
-
-       /* Create the hildon program and setup the title */
-       data->program = HILDON_PROGRAM(hildon_program_get_instance());
-       g_set_application_name("Maevies");
-
-       /* Create HildonWindow and set it to HildonProgram */
-       data->window = maevies_window_new(osso_cont);
-       hildon_program_add_window(data->program, HILDON_WINDOW(data->window));
-
-       ret = osso_rpc_set_cb_f(data->window->osso, APP_SERVICE, APP_METHOD,
-                       APP_SERVICE, dbus_callback, GTK_WIDGET(data->window));
-       if (ret != OSSO_OK) {
-               fprintf(stderr, "osso_rpc_set_cb_f failed: %d.\n", ret);
-               exit(1);
-       }
-
-       /* Begin the main application */
-       gtk_widget_show_all(GTK_WIDGET(data->window));
-
-       /* Quit program when window is closed. */
-       g_signal_connect(G_OBJECT(data->window), "delete_event",
-                       G_CALLBACK(gtk_main_quit), NULL);
-
-       /* Quit program when window is otherwise destroyed. */
-       g_signal_connect(G_OBJECT(data->window), "destroy", G_CALLBACK(gtk_main_quit),
-                       NULL);
-
-       gtk_main();
-
-       /* Clean up: */
-       gtk_widget_destroy(GTK_WIDGET (data->window));
-       g_free(data);
-
-       /* Exit */
-       return 0;
-}
-
-static gint dbus_callback(const gchar *interface, const gchar *method,
-               GArray *arguments, gpointer data, osso_rpc_t *retval) {
-       printf("dbus: %s, %s\n", interface, method);
+#include <stdio.h>
+#include <glib.h>
 
-       if (!strcmp(method, "top_application"))
-               gtk_window_present(GTK_WINDOW(data));
+int
+main (int argc, char **argv)
+{
+        g_print ("Hello maevies!\n");
 
-       return DBUS_TYPE_INVALID;
+        return 0;
 }