[Xfce4-commits] <thunarx-python:master> Removed old files that shouldn't be there
Adam Plumb
noreply at xfce.org
Thu May 27 18:10:16 CEST 2010
Updating branch refs/heads/master
to ed171186775eac7faeb1e058ae5ffb4a9c5c01b6 (commit)
from 1e958dc160c64d6b72e62a930e065484f6fba1b1 (commit)
commit ed171186775eac7faeb1e058ae5ffb4a9c5c01b6
Author: Adam Plumb <adamplumb at gmail.com>
Date: Wed Dec 9 09:27:20 2009 -0500
Removed old files that shouldn't be there
configure.ac | 62 -----------
src/thunarx-python-object.c | 236 -------------------------------------------
src/thunarx-python-object.h | 50 ---------
src/thunarx-python.h | 61 -----------
src/thunarx.defs | 100 ------------------
src/thunarxmodule.c | 56 ----------
6 files changed, 0 insertions(+), 565 deletions(-)
diff --git a/configure.ac b/configure.ac
deleted file mode 100644
index bd709e5..0000000
--- a/configure.ac
+++ /dev/null
@@ -1,62 +0,0 @@
-# -*- Autoconf -*-
-# Process this file with autoconf to produce a configure script.
-
-AC_PREREQ([2.61])
-AC_INIT(thunarx-python, 0.0.1)
-AM_INIT_AUTOMAKE
-AC_CONFIG_SRCDIR([src/thunarx-python.h])
-AC_CONFIG_HEADERS([config.h])
-
-# Checks for programs.
-AC_PROG_CC
-AC_PROG_INSTALL
-AC_PROG_LIBTOOL
-
-# Check for programs
-PKG_CHECK_MODULES([THUNARX], [thunarx-1 >= 0.4.0])
-PKG_CHECK_MODULES([PYGTK], [pygtk-2.0 >= 2.8.0])
-PKG_CHECK_MODULES([GNOME], [
- gobject-2.0 >= 2.6.0
- gnome-vfs-2.0
- gtk+-2.0 >= 2.6.0
- glib-2.0 >= 2.6.0
- gnome-python-2.0
-])
-
-PACKAGE_CFLAGS="-g -Wall $THUNARX_CFLAGS $PYGTK_CFLAGS $GNOME_CFLAGS `python-config --includes`"
-PACKAGE_LIBS="-g $THUNARX_LIBS $PYGTK_LIBS $GNOME_LIBS `python-config --ldflags`"
-PACKAGE_LDFLAGS="$THUNARX_LDFLAGS $PYGTK_LDFLAGS $GNOME_LDFLAGS"
-PACKAGE_CPPFLAGS="$THUNARX_CPPFLAGS $PYGTK_CPPFLAGS $GNOME_CPPFLAGS"
-
-# Make dependency CFLAGS and LIBS available
-AC_SUBST(PACKAGE_CFLAGS)
-AC_SUBST(PACKAGE_LIBS)
-AC_SUBST(PACKAGE_LDFLAGS)
-AC_SUBST(PACKAGE_CPPFLAGS)
-
-AC_MSG_CHECKING(for pygtk defs)
-PYGTK_DEFSDIR=`pkg-config --variable=defsdir pygtk-2.0`
-AC_SUBST(PYGTK_DEFSDIR)
-AC_MSG_RESULT($PYGTK_DEFSDIR)
-
-AC_MSG_CHECKING(for pygtk codegen)
-PYGTK_CODEGEN="/usr/bin/python `pkg-config --variable=codegendir pygtk-2.0`/codegen.py"
-AC_SUBST(PYGTK_CODEGEN)
-AC_MSG_RESULT($PYGTK_CODEGEN)
-
-# Checks for header files.
-AC_HEADER_STDC
-AC_CHECK_HEADERS([string.h])
-
-# Checks for typedefs, structures, and compiler characteristics.
-AC_C_CONST
-AC_C_INLINE
-
-# Checks for library functions.
-AC_CHECK_FUNCS([setenv])
-
-AC_CONFIG_FILES([
-Makefile
-src/Makefile
-])
-AC_OUTPUT
diff --git a/src/thunarx-python-object.c b/src/thunarx-python-object.c
deleted file mode 100644
index cb6762c..0000000
--- a/src/thunarx-python-object.c
+++ /dev/null
@@ -1,236 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
-/*
- * Copyright (C) 2004 Novell, Inc.
- *
- * This library 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 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * Author: Dave Camp <dave at ximian.com>
- *
- */
-
-#include <config.h>
-
-#include "thunarx-python-object.h"
-#include "thunarx-python.h"
-
-#include <thunarx/thunarx-extension-types.h>
-
-#include <pygobject.h>
-
-/* Thunarx extension headers */
-#include <thunarx/thunarx-menu-item.h>
-#include <thunarx/thunarx-menu-provider.h>
-
-#include <string.h>
-
-#define METHOD_PREFIX ""
-
-static GObjectClass *parent_class;
-
-/* These macros assumes the following things:
- * a METHOD_NAME is defined with is a string
- * a goto label called beach
- * the return value is called ret
- */
-
-#define CHECK_METHOD_NAME(self) \
- if (!PyObject_HasAttrString(self, METHOD_NAME)) \
- goto beach;
-
-#define CONVERT_LIST(py_files, files) \
- { \
- GList *l; \
- py_files = PyList_New(0); \
- for (l = files; l; l = l->next) { \
- PyObject *obj = pygobject_new((GObject*)l->data); \
- PyList_Append(py_files, obj); \
- Py_DECREF(obj); \
- } \
- }
-
-#define HANDLE_RETVAL(py_ret) \
- if (!py_ret) { \
- PyErr_Print(); \
- goto beach; \
- } else if (py_ret == Py_None) { \
- goto beach; \
- }
-
-#define HANDLE_LIST(py_ret, type, type_name) \
- { \
- Py_ssize_t i = 0; \
- if (!PySequence_Check(py_ret) || PyString_Check(py_ret)) { \
- PyErr_SetString(PyExc_TypeError, \
- METHOD_NAME " must return a sequence"); \
- goto beach; \
- } \
- for (i = 0; i < PySequence_Size (py_ret); i++) { \
- PyGObject *py_item; \
- py_item = (PyGObject*)PySequence_GetItem (py_ret, i); \
- if (!pygobject_check(py_item, &Py##type##_Type)) { \
- PyErr_SetString(PyExc_TypeError, \
- METHOD_NAME \
- " must return a sequence of " \
- type_name); \
- goto beach; \
- } \
- ret = g_list_append (ret, (type*) g_object_ref(py_item->obj)); \
- Py_DECREF(py_item); \
- } \
- }
-
-#define METHOD_NAME "get_file_actions"
-static GList *
-thunarx_python_object_get_file_actions (ThunarxMenuProvider *provider,
- GtkWidget *window,
- GList *files)
-{
- ThunarxPythonObject *object = (ThunarxPythonObject*)provider;
- GList *ret = NULL;
- PyObject *py_ret = NULL, *py_files;
- PyGILState_STATE state = pyg_gil_state_ensure();
-
- debug_enter();
-
- CHECK_METHOD_NAME(object->instance);
-
- CONVERT_LIST(py_files, files);
-
- py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME,
- "(NN)", pygobject_new((GObject *)window), py_files);
- HANDLE_RETVAL(py_ret);
-
- HANDLE_LIST(py_ret, ThunarxMenuItem, "thunarx.MenuItem");
-
- beach:
- Py_XDECREF(py_ret);
- pyg_gil_state_release(state);
- return ret;
-}
-#undef METHOD_NAME
-
-#define METHOD_NAME "get_folder_actions"
-static GList *
-thunarx_python_object_get_folder_actions (ThunarxMenuProvider *provider,
- GtkWidget *window,
- ThunarxFileInfo *file)
-{
- ThunarxPythonObject *object = (ThunarxPythonObject*)provider;
- GList *ret = NULL;
- PyObject *py_ret = NULL;
- PyGILState_STATE state = pyg_gil_state_ensure(); \
-
- debug_enter();
-
- CHECK_METHOD_NAME(object->instance);
-
- py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME,
- "(NN)",
- pygobject_new((GObject *)window),
- pygobject_new((GObject *)file));
-
- HANDLE_RETVAL(py_ret);
-
- HANDLE_LIST(py_ret, ThunarxMenuItem, "thunarx.MenuItem");
-
- beach:
- Py_XDECREF(py_ret);
- pyg_gil_state_release(state);
- return ret;
-}
-#undef METHOD_NAME
-
-static void
-thunarx_python_object_menu_provider_iface_init (ThunarxMenuProviderIface *iface)
-{
- iface->get_folder_actions = thunarx_python_object_get_folder_actions;
- iface->get_file_actions = thunarx_python_object_get_file_actions;
-}
-
-static void
-thunarx_python_object_instance_init (ThunarxPythonObject *object)
-{
- ThunarxPythonObjectClass *class;
- debug_enter();
-
- class = (ThunarxPythonObjectClass*)(((GTypeInstance*)object)->g_class);
-
- object->instance = PyObject_CallObject(class->type, NULL);
- if (object->instance == NULL)
- PyErr_Print();
-}
-
-static void
-thunarx_python_object_finalize (GObject *object)
-{
- debug_enter();
-
- Py_DECREF(((ThunarxPythonObject *)object)->instance);
-}
-
-static void
-thunarx_python_object_class_init (ThunarxPythonObjectClass *class,
- gpointer class_data)
-{
- debug_enter();
-
- parent_class = g_type_class_peek_parent (class);
-
- class->type = (PyObject*)class_data;
-
- G_OBJECT_CLASS (class)->finalize = thunarx_python_object_finalize;
-}
-
-GType
-thunarx_python_object_get_type (GTypeModule *module,
- PyObject *type)
-{
- GTypeInfo *info;
- const char *type_name;
- GType gtype;
-
- static const GInterfaceInfo menu_provider_iface_info = {
- (GInterfaceInitFunc) thunarx_python_object_menu_provider_iface_init,
- NULL,
- NULL
- };
-
- debug_enter_args("type=%s", PyString_AsString(PyObject_GetAttrString(type, "__name__")));
- info = g_new0 (GTypeInfo, 1);
-
- info->class_size = sizeof (ThunarxPythonObjectClass);
- info->class_init = (GClassInitFunc)thunarx_python_object_class_init;
- info->instance_size = sizeof (ThunarxPythonObject);
- info->instance_init = (GInstanceInitFunc)thunarx_python_object_instance_init;
-
- info->class_data = type;
- Py_INCREF(type);
-
- type_name = g_strdup_printf("%s+ThunarxPython",
- PyString_AsString(PyObject_GetAttrString(type, "__name__")));
-
- gtype = g_type_module_register_type (module,
- G_TYPE_OBJECT,
- type_name,
- info, 0);
-
- if (PyObject_IsSubclass(type, (PyObject*)&PyThunarxMenuProvider_Type)) {
- g_type_module_add_interface (module, gtype,
- THUNARX_TYPE_MENU_PROVIDER,
- &menu_provider_iface_info);
- }
-
- return gtype;
-}
diff --git a/src/thunarx-python-object.h b/src/thunarx-python-object.h
deleted file mode 100644
index 1c5c7a2..0000000
--- a/src/thunarx-python-object.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * thunarx-python-object.h - Generation of wrapper objects for thunarx
- * extension objects in python.
- *
- * Copyright (C) 2003 Novell, Inc.
- *
- * This library 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 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * Author: Dave Camp <dave at ximian.com>
- *
- */
-
-#ifndef THUNARX_PYTHON_OBJECT_H
-#define THUNARX_PYTHON_OBJECT_H
-
-#include <Python.h>
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-typedef struct _ThunarxPythonObject ThunarxPythonObject;
-typedef struct _ThunarxPythonObjectClass ThunarxPythonObjectClass;
-
-struct _ThunarxPythonObject {
- GObject parent_slot;
- PyObject *instance;
-};
-
-struct _ThunarxPythonObjectClass {
- GObjectClass parent_slot;
- PyObject *type;
-};
-
-GType thunarx_python_object_get_type (GTypeModule *module, PyObject *type);
-
-G_END_DECLS
-
-#endif
diff --git a/src/thunarx-python.h b/src/thunarx-python.h
deleted file mode 100644
index 7d7d61e..0000000
--- a/src/thunarx-python.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * thunarx-python.c - Thunarx Python extension
- *
- * Copyright (C) 2004 Johan Dahlin
- *
- * This library 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 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef THUNARX_PYTHON_H
-#define THUNARX_PYTHON_H
-
-#include <glib-object.h>
-#include <glib/gprintf.h>
-#include <Python.h>
-
-#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
-typedef int Py_ssize_t;
-#define PY_SSIZE_T_MAX INT_MAX
-#define PY_SSIZE_T_MIN INT_MIN
-#endif
-
-typedef enum {
- THUNARX_PYTHON_DEBUG_MISC = 1 << 0,
-} ThunarxPythonDebug;
-
-extern ThunarxPythonDebug thunarx_python_debug;
-
-#define debug(x) { if (thunarx_python_debug & THUNARX_PYTHON_DEBUG_MISC) \
- g_printf( "thunarx-python:" x "\n"); }
-#define debug_enter() { if (thunarx_python_debug & THUNARX_PYTHON_DEBUG_MISC) \
- g_printf("%s: entered\n", __FUNCTION__); }
-#define debug_enter_args(x, y) { if (thunarx_python_debug & THUNARX_PYTHON_DEBUG_MISC) \
- g_printf("%s: entered " x "\n", __FUNCTION__, y); }
-
-
-PyTypeObject *_PyGtkWidget_Type;
-#define PyGtkWidget_Type (*_PyGtkWidget_Type)
-
-PyTypeObject *_PyThunarxMenu_Type;
-#define PyThunarxMenu_Type (*_PyThunarxMenu_Type)
-
-PyTypeObject *_PyThunarxMenuItem_Type;
-#define PyThunarxMenuItem_Type (*_PyThunarxMenuItem_Type)
-
-PyTypeObject *_PyThunarxMenuProvider_Type;
-#define PyThunarxMenuProvider_Type (*_PyThunarxMenuProvider_Type)
-
-#endif /* THUNARX_PYTHON_H */
diff --git a/src/thunarx.defs b/src/thunarx.defs
deleted file mode 100644
index a6431d3..0000000
--- a/src/thunarx.defs
+++ /dev/null
@@ -1,100 +0,0 @@
-;; -*- scheme -*-
-; object definitions ...
-
-(define-object Menu
- (in-module "Thunarx")
- (parent "GObject")
- (c-name "ThunarxMenu")
- (gtype-id "THUNARX_TYPE_MENU")
-)
-
-(define-object MenuItem
- (in-module "Thunarx")
- (parent "GObject")
- (c-name "ThunarxMenuItem")
- (gtype-id "THUNARX_TYPE_MENU_ITEM")
-)
-
-(define-interface MenuProvider
- (in-module "Thunarx")
- (c-name "ThunarxMenuProvider")
- (gtype-id "THUNARX_TYPE_MENU_PROVIDER")
-)
-
-;; Enumerations and flags ...
-
-(define-enum OperationResult
- (in-module "Thunarx")
- (c-name "ThunarxOperationResult")
- (gtype-id "THUNARX_TYPE_OPERATION_RESULT")
- (values
- '("complete" "THUNARX_OPERATION_COMPLETE")
- '("failed" "THUNARX_OPERATION_FAILED")
- '("in-progress" "THUNARX_OPERATION_IN_PROGRESS")
- )
-)
-
-
-;; From /usr/include/thunarx-1/libthunarx-extension/thunarx-extension-types.h
-
-(define-function thunarx_operation_result_get_type
- (c-name "thunarx_operation_result_get_type")
- (return-type "GType")
-)
-
-;; From /usr/include/thunarx-1/libthunarx-extension/thunarx-menu-item.h
-
-(define-function thunarx_menu_item_get_type
- (c-name "thunarx_menu_item_get_type")
- (return-type "GType")
-)
-
-(define-function thunarx_menu_new
- (c-name "thunarx_menu_new")
- (is-constructor-of "ThunarxMenu")
- (return-type "ThunarxMenu*")
-)
-
-(define-method append_item
- (of-object "ThunarxMenu")
- (c-name "thunarx_menu_append_item")
- (return-type "none")
- (parameters
- '("ThunarxMenuItem*" "item")
- )
-)
-
-(define-function thunarx_menu_item_list_free
- (c-name "thunarx_menu_item_list_free")
- (return-type "none")
- (parameters
- '("GList*", "item_list")
- )
-)
-
-(define-function thunarx_menu_item_new
- (c-name "thunarx_menu_item_new")
- (is-constructor-of "ThunarxMenuItem")
- (return-type "ThunarxMenuItem*")
- (parameters
- '("const-char*" "name")
- '("const-char*" "label")
- '("const-char*" "tip")
- '("const-char*" "icon" (null-ok) (default "NULL"))
- )
-)
-
-(define-method set_submenu
- (of-object "ThunarxMenuItem")
- (c-name "thunarx_menu_item_set_submenu")
- (return-type "none")
- (parameters
- '("ThunarxMenu*" "menu")
- )
-)
-
-(define-method activate
- (of-object "ThunarxMenuItem")
- (c-name "thunarx_menu_item_activate")
- (return-type "none")
-)
diff --git a/src/thunarxmodule.c b/src/thunarxmodule.c
deleted file mode 100644
index 9d356ac..0000000
--- a/src/thunarxmodule.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- Mode: C; c-basic-offset: 4 -*-
- * Copyright (C) 2004 Johan Dahlin
- *
- * thunarx.override: overrides for the thunarx extension library
- *
- * 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; either
- * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- */
-
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-/* include this first, before NO_IMPORT_PYGOBJECT is defined */
-#include <pygobject.h>
-#include <pygtk/pygtk.h>
-#include "pygnomevfs.h"
-
-void pythunarx_register_classes (PyObject *d);
-void pythunarx_add_constants(PyObject *module, const gchar *strip_prefix);
-
-extern PyMethodDef pythunarx_functions[];
-
-DL_EXPORT(void)
-initthunarx(void)
-{
- PyObject *m, *d;
-
- if (!g_getenv("INSIDE_THUNARX_PYTHON")) {
- Py_FatalError("This module can only be used from thunarx");
- return;
- }
-
- init_pygobject ();
- init_pygtk ();
- init_pygnomevfs();
-
- m = Py_InitModule ("thunarx", pythunarx_functions);
- d = PyModule_GetDict (m);
-
- pythunarx_register_classes (d);
- pythunarx_add_constants(m, "THUNARX_");
-}
More information about the Xfce4-commits
mailing list