Commit b3d4a271 authored by Jannis Pohlmann's avatar Jannis Pohlmann

Add ThunarDesktop class skeleton. Include new Thunarx headers.

parent 206468dd
......@@ -70,6 +70,8 @@ Thunar_SOURCES = \
thunar-debug.c \
thunar-deep-count-job.h \
thunar-deep-count-job.c \
thunar-desktop.h \
thunar-desktop.c \
thunar-details-view-ui.h \
thunar-details-view.c \
thunar-details-view.h \
......
/* $Id$ */
/* vi:set et ai sw=2 sts=2 ts=2: */
/*-
* Copyright (c) 2005-2011 os-cillation e.K.
* written by Benedikt Meurer <benny@xfce.org>
* Copyright (c) 2011 Jannis Pohlmann <jannis@xfce.org>
*
* Written by Benedikt Meurer <benny@xfce.org>.
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
* This program 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 General Public License for more details.
*
* This program 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 General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple
* Place, Suite 330, Boston, MA 02111-1307 USA
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
......@@ -40,6 +41,7 @@
#include <thunar/thunar-application.h>
#include <thunar/thunar-dbus-client.h>
#include <thunar/thunar-dbus-service.h>
#include <thunar/thunar-desktop.h>
#include <thunar/thunar-gobject-extensions.h>
#include <thunar/thunar-private.h>
#include <thunar/thunar-session-client.h>
......@@ -116,6 +118,7 @@ main (int argc, char **argv)
ThunarDBusService *dbus_service = NULL;
#endif
ThunarApplication *application;
ThunarDesktop *desktop = NULL;
GError *error = NULL;
gchar *working_directory;
gchar **filenames = NULL;
......@@ -275,6 +278,10 @@ error0:
/* check if the application should run as a daemon */
if (thunar_application_get_daemon (application))
{
/* start the desktop subsystem that will take over the desktop if
* desired so by the user */
desktop = g_object_new (THUNAR_TYPE_DESKTOP, NULL);
#ifdef HAVE_DBUS
/* attach the D-Bus service */
dbus_service = g_object_new (THUNAR_TYPE_DBUS_SERVICE, NULL);
......@@ -293,6 +300,10 @@ error0:
/* enter the main loop */
gtk_main ();
/* shut down the desktop subsystem */
if (desktop != NULL)
g_object_unref (desktop);
#ifdef HAVE_DBUS
if (dbus_service != NULL)
g_object_unref (G_OBJECT (dbus_service));
......
/* vi:set et ai sw=2 sts=2 ts=2: */
/*-
* Copyright (c) 2011 Jannis Pohlmann <jannis@xfce.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <glib.h>
#include <glib-object.h>
#include <thunarx/thunarx.h>
#include <thunar/thunar-desktop.h>
/* property identifiers */
enum
{
PROP_0,
};
static void thunar_desktop_constructed (GObject *object);
static void thunar_desktop_dispose (GObject *object);
static void thunar_desktop_finalize (GObject *object);
static void thunar_desktop_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
static void thunar_desktop_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec);
struct _ThunarDesktopClass
{
GObjectClass __parent__;
};
struct _ThunarDesktop
{
GObject __parent__;
};
G_DEFINE_TYPE (ThunarDesktop, thunar_desktop, G_TYPE_OBJECT)
static void
thunar_desktop_class_init (ThunarDesktopClass *klass)
{
GObjectClass *gobject_class;
/* Determine the parent type class */
thunar_desktop_parent_class = g_type_class_peek_parent (klass);
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->constructed = thunar_desktop_constructed;
gobject_class->dispose = thunar_desktop_dispose;
gobject_class->finalize = thunar_desktop_finalize;
gobject_class->get_property = thunar_desktop_get_property;
gobject_class->set_property = thunar_desktop_set_property;
}
static void
thunar_desktop_init (ThunarDesktop *desktop)
{
ThunarxProviderFactory *provider_factory;
GList *lp;
GList *providers;
GList *view_infos = NULL;
/* determine the list of available views (using the desktop view provider) */
provider_factory = thunarx_provider_factory_get_default ();
providers = thunarx_provider_factory_list_providers (provider_factory,
THUNARX_TYPE_DESKTOP_VIEW_PROVIDER);
for (lp = providers; lp != NULL; lp = lp->next)
{
/* determine the view infos for this provider */
view_infos =
g_list_concat (view_infos,
thunarx_desktop_view_provider_get_view_infos (lp->data));
/* release the provider */
g_object_unref (lp->data);
}
g_list_free (providers);
g_object_unref (provider_factory);
g_debug ("view infos:");
for (lp = view_infos; lp != NULL; lp = lp->next)
{
g_debug (" %p", lp->data);
}
}
static void
thunar_desktop_constructed (GObject *object)
{
#if 0
ThunarDesktop *desktop = THUNAR_DESKTOP (object);
#endif
}
static void
thunar_desktop_dispose (GObject *object)
{
#if 0
ThunarDesktop *desktop = THUNAR_DESKTOP (object);
#endif
(*G_OBJECT_CLASS (thunar_desktop_parent_class)->dispose) (object);
}
static void
thunar_desktop_finalize (GObject *object)
{
#if 0
ThunarDesktop *desktop = THUNAR_DESKTOP (object);
#endif
(*G_OBJECT_CLASS (thunar_desktop_parent_class)->finalize) (object);
}
static void
thunar_desktop_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
#if 0
ThunarDesktop *desktop = THUNAR_DESKTOP (object);
#endif
switch (prop_id)
{
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
thunar_desktop_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
#if 0
ThunarDesktop *desktop = THUNAR_DESKTOP (object);
#endif
switch (prop_id)
{
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
/* vi:set et ai sw=2 sts=2 ts=2: */
/*-
* Copyright (c) 2011 Jannis Pohlmann <jannis@xfce.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __THUNAR_DESKTOP_H__
#define __THUNAR_DESKTOP_H__
#include <glib-object.h>
G_BEGIN_DECLS
#define THUNAR_TYPE_DESKTOP (thunar_desktop_get_type ())
#define THUNAR_DESKTOP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THUNAR_TYPE_DESKTOP, ThunarDesktop))
#define THUNAR_DESKTOP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), THUNAR_TYPE_DESKTOP, ThunarDesktopClass))
#define THUNAR_IS_DESKTOP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THUNAR_TYPE_DESKTOP))
#define THUNAR_IS_DESKTOP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), THUNAR_TYPE_DESKTOP)
#define THUNAR_DESKTOP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THUNAR_TYPE_DESKTOP, ThunarDesktopClass))
typedef struct _ThunarDesktopClass ThunarDesktopClass;
typedef struct _ThunarDesktop ThunarDesktop;
GType thunar_desktop_get_type (void) G_GNUC_CONST;
G_END_DECLS
#endif /* !__THUNAR_DESKTOP_H__ */
......@@ -24,6 +24,8 @@
#define THUNARX_INSIDE_THUNARX_H
#include <thunarx/thunarx-config.h>
#include <thunarx/thunarx-desktop-view-provider.h>
#include <thunarx/thunarx-desktop-view.h>
#include <thunarx/thunarx-file-info.h>
#include <thunarx/thunarx-menu-provider.h>
#include <thunarx/thunarx-preferences-provider.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment