[Monodevelop-patches-list] r1074 - in branches/MonoDevelop-playground: . libmonodevelop src src/AddIns/DisplayBindings/SourceEditor src/Plugins/Content src/Plugins/Node src/Util
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Mon Mar 1 16:42:30 EST 2004
Author: jzwart
Date: 2004-03-01 16:42:30 -0500 (Mon, 01 Mar 2004)
New Revision: 1074
Added:
branches/MonoDevelop-playground/libmonodevelop/vfs-utils.c
branches/MonoDevelop-playground/libmonodevelop/vfs-utils.h
branches/MonoDevelop-playground/src/Util/
branches/MonoDevelop-playground/src/Util/Makefile.am
branches/MonoDevelop-playground/src/Util/Mime.cs
Modified:
branches/MonoDevelop-playground/configure.in
branches/MonoDevelop-playground/libmonodevelop/
branches/MonoDevelop-playground/libmonodevelop/Makefile.am
branches/MonoDevelop-playground/src/AddIns/DisplayBindings/SourceEditor/Makefile.am
branches/MonoDevelop-playground/src/Makefile.am
branches/MonoDevelop-playground/src/Plugins/Content/ContentManager.cs
branches/MonoDevelop-playground/src/Plugins/Content/Makefile.am
branches/MonoDevelop-playground/src/Plugins/Node/FileNode.cs
Log:
Cleaned up configure.in and related Makefile.am files. libmonodevelop now
installs in $prefix/lib like any other library. Added gnome-vfs methods and new
MonoDevelop.Util namespace for generic utility stuff. Continuing Node stuff.
Modified: branches/MonoDevelop-playground/configure.in
===================================================================
--- branches/MonoDevelop-playground/configure.in 2004-03-01 21:40:50 UTC (rev 1073)
+++ branches/MonoDevelop-playground/configure.in 2004-03-01 21:42:30 UTC (rev 1074)
@@ -4,64 +4,50 @@
AM_MAINTAINER_MODE
AM_PROG_LIBTOOL
-AC_PATH_PROG(MONO, mono)
-AC_PATH_PROG(MCS, mcs)
-if test "x$MONO" = "x" ; then
- AC_MSG_ERROR([Can't find "mono" in your PATH])
-fi
-if test "x$MCS" = "x" ; then
- AC_MSG_ERROR([Can't find "mcs" in your PATH])
-fi
-AC_SUBST(PATH)
-AC_SUBST(LD_LIBRARY_PATH)
+MONO_REQUIRED=0.30
+GTK_REQUIRED=2.3.4
+GTKSHARP_REQUIRED=0.17
+GTKSOURCEVIEW_REQUIRED=0.7
+GTKSOURCEVIEWSHARP_REQUIRED=0.1
+MOZGTK_REQUIRED=1.2
+GNOMEVFS_REQUIRED=2.0
-dnl Find pkg-config
-AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
-if test "x$PKG_CONFIG" = "xno"; then
- AC_MSG_ERROR([You need to install pkg-config])
-fi
+PKG_CHECK_MODULES(CSHARP,
+ gtk-sharp >= $GTKSHARP_REQUIRED \
+ gtksourceview-sharp >= $GTKSOURCEVIEWSHARP_REQUIRED)
+AC_SUBST(CSHARP_LIBS)
-dnl Find mono
-MONO_REQUIRED_VERSION=0.30
+PKG_CHECK_MODULES(MONODEVELOP,
+ mono >= $MONO_REQUIRED \
+ gtksourceview-1.0 >= $GTKSOURCEVIEW_REQUIRED \
+ mozilla-gtkmozembed >= $MOZGTK_REQUIRED)
-PKG_CHECK_MODULES(BASE_DEPENDENCIES, mono >= $MONO_REQUIRED_VERSION, enable_mono=yes, enable_mono=no)
+PKG_CHECK_MODULES(LIBMONODEVELOP,
+ gnome-vfs-2.0 >= $GNOMEVFS_REQUIRED \
+ gtk+-2.0 >= $GTK_REQUIRED)
+AC_SUBST(LIBMONODEVELOP_CFLAGS)
+AC_SUBST(LIBMONODEVELOP_LIBS)
-dnl Find gtk-sharp
-GTKSHARP_REQUIRED_VERSION=0.17
+dnl Check for Mono
+AC_PATH_PROG(MCS, mcs)
+AC_PATH_PROG(MONO, mono)
-PKG_CHECK_MODULES(BASE_DEPENDENCIES, gtk-sharp >= $GTKSHARP_REQUIRED_VERSION, enable_gtksharp=yes, enable_gtksharp=no)
+MCS_FLAGS=
+MONO_FLAGS=
+if test $USE_MAINTAINER_MODE = yes; then
+ MCS_FLAGS="-g"
+ MONO_FLAGS="--debug"
+fi
+AC_SUBST(MCS_FLAGS)
+AC_SUBST(MONO_FLAGS)
+
gtksharp_prefix=`pkg-config --variable=prefix gtk-sharp`
AC_SUBST(gtksharp_prefix)
-GTKSOURCEVIEW_REQUIRED_VERSION=0.7
-
-PKG_CHECK_MODULES(BASE_DEPENDENCIES, gtksourceview-1.0 >= $GTKSOURCEVIEW_REQUIRED_VERSION, enable_gtksourceview=yes, enable_gtksourceview=no)
-
-GTKSOURCEVIEWSHARP_REQUIRED_VERSION=0.1
-PKG_CHECK_MODULES(BASE_DEPENDENCIES, gtksourceview-sharp >= $GTKSOURCEVIEWSHARP_REQUIRED_VERSION, enable_gtksourceviewsharp=yes, enable_gtksourceviewsharp=no)
-GTKSOURCEVIEW_SHARP="`pkg-config --libs gtksourceview-sharp`"
-echo This is it: _ ${GTKSOURCEVIEW_SHARP} _
-AC_SUBST(GTKSOURCEVIEW_SHARP)
-
-dnl find gnome-vfs
-GNOMEVFS_REQUIRED_VERSION=2.0
-PKG_CHECK_MODULES(BASE_DEPENDENCIES, gnome-vfs-2.0 >= $GNOMEVFS_REQUIRED_VERSION, enable_gnomevfs=yes, enable_gnomevfs=no)
-
-dnl should this be a hard dep?
-dnl ORBIT2_REQUIRED_VERSION=2.8.3
-
-dnl PKG_CHECK_MODULES(BASE_DEPENDENCIES, ORBit-2.0 >= $ORBIT2_REQUIRED_VERSION)
-
-dnl find mozilla-gtkmozembed
-MOZGTK_REQUIRED_VERSION=1.2
-PKG_CHECK_MODULES(BASE_DEPENDENCIES, mozilla-gtkmozembed >= $MOZGTK_REQUIRED_VERSION, enable_gtkmoz=yes, enable_gtkmoz=no)
-
+dnl Get mozilla home
MOZILLA_HOME="`$PKG_CONFIG --variable=libdir mozilla-gtkmozembed`"
AC_SUBST(MOZILLA_HOME)
-gnome_prefix="`$PKG_CONFIG --variable=prefix libgnome-2.0`"
-AC_SUBST(gnome_prefix)
-
dnl Set PREFIX
if test "x${prefix}" = "xNONE"; then
packageprefix=${ac_default_prefix}
@@ -95,6 +81,7 @@
data/resources/Makefile
data/resources/glade/Makefile
src/Makefile
+src/Util/Makefile
src/StartUp/Makefile
src/Plugins/Makefile
src/Plugins/Node/Makefile
@@ -104,24 +91,3 @@
src/Plugins/Content/Makefile
monodevelop
])
-
-echo "---"
-echo "Configuration summary"
-echo ""
-echo " * Installation prefix = $prefix"
-echo " * GNOME prefix = $gnome_prefix"
-echo ""
-echo " * gnomevfs $GNOMEVFS_REQUIRED_VERSION: $enable_gnomevfs"
-echo " * gtk-sharp $GTKSHARP_REQUIRED_VERSION: $enable_gtksharp"
-echo " * gtkmozembed $MOZGTK_REQUIRED_VERSION: $enable_gtkmoz"
-echo " * gtksourceview $GTKSOURCEVIEW_REQUIRED_VERSION: $enable_gtksourceview"
-echo " * gtksourceview-sharp $GTKSOURCEVIEWSHARP_REQUIRED_VERSION: $enable_gtksourceviewsharp"
-echo " * mono $MONO_REQUIRED_VERSION: $enable_mono"
-echo ""
-echo " NOTE: if any of the above say 'no' you may install the"
-echo " corresponding development packages for them, and"
-echo " rerun autogen.sh. If you are sure the proper"
-echo " libraries are installed, use PKG_CONFIG_PATH to"
-echo " point to their .pc files"
-echo ""
-echo "---"
Property changes on: branches/MonoDevelop-playground/libmonodevelop
___________________________________________________________________
Name: svn:ignore
- libmonodevelop.so
*.o
Makefile
Makefile.in
+ libmonodevelop.so
*.o
Makefile
Makefile.in
.libs
.deps
Modified: branches/MonoDevelop-playground/libmonodevelop/Makefile.am
===================================================================
--- branches/MonoDevelop-playground/libmonodevelop/Makefile.am 2004-03-01 21:40:50 UTC (rev 1073)
+++ branches/MonoDevelop-playground/libmonodevelop/Makefile.am 2004-03-01 21:42:30 UTC (rev 1074)
@@ -1,43 +1,16 @@
-srcdir = .
+INCLUDES = \
+ -DG_LOG_DOMAIN=\"libmonodevelop\" \
+ -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED \
+ -DGDK_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED \
+ -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
+ $(LIBMONODEVELOP_CFLAGS)
-CFLAGS = -g -Wall -O2
-LDFLAGS = -g -shared
-
-MDL_REQUIREMENTS = gtk+-2.0
-MDL_DEPENDENCIES_CFLAGS = $(shell pkg-config --cflags $(MDL_REQUIREMENTS))
-MDL_DEPENDENCIES_LIBS = $(shell pkg-config --libs $(MDL_REQUIREMENTS))
-
-INCLUDES = \
- -DG_LOG_DOMAIN=\"LibMonoDevelop\" -I.. -I. \
- $(MDL_DEPENDENCIES_CFLAGS)
-
-libmonodevelop_headers =
-
-libmonodevelop_SOURCE = \
- $(libmonodevelop_headers) \
- lmd-key-propagate.c
-
-libmonodevelop_OBJECTS = $(filter-out %.h,$(patsubst %.c,%.o,$(libmonodevelop_SOURCE)))
-
-all: libmonodevelop.so
-
-$(libmonodevelop_OBJECTS): $(libmonodevelop_headers)
-
-libmonodevelop.so: $(libmonodevelop_OBJECTS)
- $(CC) $(LDFLAGS) -shared -fPIC -o libmonodevelop.so $+ && \
- cp libmonodevelop.so ../build/bin/.
-
-%.o: %.c
- $(CC) $(CFLAGS) $(INCLUDES) -c $<
-
monodeveloplibdir = $(prefix)/lib
-monodeveloplib_DATA = libmonodevelop.so
+monodeveloplib_LTLIBRARIES = libmonodevelop.la
-clean:
- rm -f libmonodevelop.so $(libmonodevelop_OBJECTS)
+libmonodevelop_la_SOURCES = \
+ lmd-key-propagate.c \
+ vfs-utils.h \
+ vfs-utils.c
-CLEANFILES= ../build/bin/libmonodevelop.so libmonodevelop.so
-
-.PHONY: clean
-
-EXTRA_DIST = $(libmonodevelop_SOURCE) $(libmonodevelop_headers)
+libmonodevelop_la_LIBADD = $(LIBMONODEVELOP_LIBS)
Added: branches/MonoDevelop-playground/libmonodevelop/vfs-utils.c
===================================================================
--- branches/MonoDevelop-playground/libmonodevelop/vfs-utils.c 2004-03-01 21:40:50 UTC (rev 1073)
+++ branches/MonoDevelop-playground/libmonodevelop/vfs-utils.c 2004-03-01 21:42:30 UTC (rev 1074)
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2004 Jeroen Zwartepoorte <jeroen at xs4all.nl>
+ *
+ * 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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "vfs-utils.h"
+#include <libgnomevfs/gnome-vfs-mime-handlers.h>
+#include <libgnomevfs/gnome-vfs-mime-utils.h>
+
+const char *
+vfs_get_file_mime_type (const char *uri)
+{
+ return gnome_vfs_get_mime_type (uri);
+}
+
+const char *
+vfs_mime_get_icon (const char *mime_type)
+{
+ return gnome_vfs_mime_get_icon (mime_type);
+}
+
+const char *
+vfs_mime_get_description (const char *mime_type)
+{
+ return gnome_vfs_mime_get_description (mime_type);
+}
Added: branches/MonoDevelop-playground/libmonodevelop/vfs-utils.h
===================================================================
--- branches/MonoDevelop-playground/libmonodevelop/vfs-utils.h 2004-03-01 21:40:50 UTC (rev 1073)
+++ branches/MonoDevelop-playground/libmonodevelop/vfs-utils.h 2004-03-01 21:42:30 UTC (rev 1074)
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2004 Jeroen Zwartepoorte <jeroen at xs4all.nl>
+ *
+ * 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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __VFS_UTILS_H__
+#define __VFS_UTILS_H__
+
+const char *vfs_get_file_mime_type (const char *uri);
+const char *vfs_mime_get_icon (const char *mime_type);
+const char *vfs_mime_get_description (const char *mime_type);
+
+#endif /* __VFS_UTILS_H__ */
Modified: branches/MonoDevelop-playground/src/AddIns/DisplayBindings/SourceEditor/Makefile.am
===================================================================
--- branches/MonoDevelop-playground/src/AddIns/DisplayBindings/SourceEditor/Makefile.am 2004-03-01 21:40:50 UTC (rev 1073)
+++ branches/MonoDevelop-playground/src/AddIns/DisplayBindings/SourceEditor/Makefile.am 2004-03-01 21:42:30 UTC (rev 1074)
@@ -74,7 +74,7 @@
mcs $(FILES) /debug /out:$(DLL) /t:library \
/resource:../../../../data/resources/glade/EditorBindings.glade,EditorBindings.glade \
/resource:../../../../data/resources/glade/texteditoraddin.glade,texteditoraddin.glade \
- /r:gtk-sharp /r:gdk-sharp $(GTKSOURCEVIEW_SHARP) /r:glib-sharp \
+ /r:gtk-sharp /r:gdk-sharp $(CSHARP_LIBS) /r:glib-sharp \
/r:../../../../build/bin/MonoDevelop.Core.dll \
/r:../../../../build/bin/MonoDevelop.Base.dll \
/r:../../../../build/bin/MonoDevelop.Gui.Utils.dll \
Modified: branches/MonoDevelop-playground/src/Makefile.am
===================================================================
--- branches/MonoDevelop-playground/src/Makefile.am 2004-03-01 21:40:50 UTC (rev 1073)
+++ branches/MonoDevelop-playground/src/Makefile.am 2004-03-01 21:42:30 UTC (rev 1074)
@@ -1 +1 @@
-SUBDIRS=StartUp Plugins
+SUBDIRS=Util StartUp Plugins
Modified: branches/MonoDevelop-playground/src/Plugins/Content/ContentManager.cs
===================================================================
--- branches/MonoDevelop-playground/src/Plugins/Content/ContentManager.cs 2004-03-01 21:40:50 UTC (rev 1073)
+++ branches/MonoDevelop-playground/src/Plugins/Content/ContentManager.cs 2004-03-01 21:42:30 UTC (rev 1074)
@@ -15,6 +15,7 @@
using Gtk;
using log4net;
using MonoDevelop.Node;
+using MonoDevelop.Util;
using MonoDevelop.Workbench;
namespace MonoDevelop.Content {
@@ -34,7 +35,7 @@
action = new Action ("FileOpenAction", "_Open...",
"Open a file", Gtk.Stock.Open);
- action.Activated += new EventHandler (OnOpen);
+ action.Activated += new EventHandler (OnFileOpen);
group.Add (action);
Workbench.Workbench.AddActionGroup (group);
@@ -45,7 +46,7 @@
// Event handlers
////////////////////////////////////////////////////////////////////////
- private void OnOpen (object obj, EventArgs args)
+ private void OnFileOpen (object obj, EventArgs args)
{
FileChooserDialog fcd = new FileChooserDialog ("Open File",
(Window)Workbench.Workbench.ActiveWorkbench,
@@ -59,6 +60,9 @@
if (resp != (int)ResponseType.Ok)
return;
+ string mimetype = Mime.GetMimeType (fcd.Filename);
+ Console.WriteLine ("mimetype for {0} is {1}", fcd.Filename, mimetype);
+
Type type = FileNode.FindFileNodeType (fcd.Filename, true);
}
Modified: branches/MonoDevelop-playground/src/Plugins/Content/Makefile.am
===================================================================
--- branches/MonoDevelop-playground/src/Plugins/Content/Makefile.am 2004-03-01 21:40:50 UTC (rev 1073)
+++ branches/MonoDevelop-playground/src/Plugins/Content/Makefile.am 2004-03-01 21:42:30 UTC (rev 1074)
@@ -18,6 +18,7 @@
content_assemblies = \
-r:../../StartUp/monodevelop.exe \
+ -r:../../Util/util.dll \
-r:../Node/node.dll \
-r:../Services/services.dll \
-r:../Workbench/workbench.dll \
Modified: branches/MonoDevelop-playground/src/Plugins/Node/FileNode.cs
===================================================================
--- branches/MonoDevelop-playground/src/Plugins/Node/FileNode.cs 2004-03-01 21:40:50 UTC (rev 1073)
+++ branches/MonoDevelop-playground/src/Plugins/Node/FileNode.cs 2004-03-01 21:42:30 UTC (rev 1074)
@@ -181,6 +181,62 @@
Type type,
Pixbuf icon)
{
+ ArrayList types;
+
+ if (fileNodeTypes.Contains (extension)) {
+ types = fileNodeTypes[extension] as ArrayList;
+ types.Add (new FileNodeEntry (extension,
+ description,
+ type, icon));
+ fileNodeTypes[extension] = types;
+ } else {
+ types = new ArrayList ();
+ types.Add (new FileNodeEntry (extension,
+ description,
+ type, icon));
+ fileNodeTypes.Add (extension, types);
+ }
+
}
}
+
+ class FileNodeEntry {
+ private string extension;
+ private string description;
+ private Type type;
+ private Pixbuf icon;
+
+ public string Extension {
+ get {
+ return extension;
+ }
+ }
+
+ public string Description {
+ get {
+ return description;
+ }
+ }
+
+ public Type Type {
+ get {
+ return type;
+ }
+ }
+
+ public Pixbuf Icon {
+ get {
+ return icon;
+ }
+ }
+
+ public FileNodeEntry (string extension, string description,
+ Type type, Pixbuf icon)
+ {
+ this.extension = extension;
+ this.description = description;
+ this.type = type;
+ this.icon = icon;
+ }
+ }
}
Property changes on: branches/MonoDevelop-playground/src/Util
___________________________________________________________________
Name: svn:ignore
+ Makefile
Makefile.in
util.dll
Added: branches/MonoDevelop-playground/src/Util/Makefile.am
===================================================================
--- branches/MonoDevelop-playground/src/Util/Makefile.am 2004-03-01 21:40:50 UTC (rev 1073)
+++ branches/MonoDevelop-playground/src/Util/Makefile.am 2004-03-01 21:42:30 UTC (rev 1074)
@@ -0,0 +1,17 @@
+utildir = $(libdir)/monodevelop
+utilassembly = $(utildir)/util.dll
+util_DATA = util.dll
+CLEANFILES = util.dll
+CSC = mcs
+
+util_sources = \
+ Mime.cs
+
+util_assemblies = \
+ -r:System.dll
+
+util.dll: $(util_sources)
+ $(CSC) -debug -t:library -out:util.dll $(util_sources) $(util_assemblies)
+
+EXTRA_DIST = \
+ $(util_sources)
Added: branches/MonoDevelop-playground/src/Util/Mime.cs
===================================================================
--- branches/MonoDevelop-playground/src/Util/Mime.cs 2004-03-01 21:40:50 UTC (rev 1073)
+++ branches/MonoDevelop-playground/src/Util/Mime.cs 2004-03-01 21:42:30 UTC (rev 1074)
@@ -0,0 +1,39 @@
+//
+// Mime.cs: Utility class for dealing with mime-types.
+//
+// Author:
+// Jeroen Zwartepoorte <jeroen at xs4all.nl>
+//
+// (C) Copyright Jeroen Zwartepoorte 2004
+//
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace MonoDevelop.Util {
+ public class Mime {
+ [DllImport ("libmonodevelop")]
+ private static extern string vfs_get_file_mime_type (string uri);
+
+ public static string GetMimeType (string uri)
+ {
+ return vfs_get_file_mime_type (uri);
+ }
+
+ [DllImport ("libmonodevelop")]
+ private static extern string vfs_mime_get_icon (string mime_type);
+
+ public static string GetIcon (string mime_type)
+ {
+ return vfs_mime_get_icon (mime_type);
+ }
+
+ [DllImport ("libmonodevelop")]
+ private static extern string vfs_mime_get_description (string mime_type);
+
+ public static string GetDescription (string mime_type)
+ {
+ return vfs_mime_get_description (mime_type);
+ }
+ }
+}
More information about the Monodevelop-patches-list
mailing list