Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
2008-08-06 Mike Kestner <mkestner@novell.com>
Browse files Browse the repository at this point in the history
	* *: Update to GNOME 2.23.5 API.  Add gnome-print-sharp.dll
	and gnome-panel-sharp.dll assemblies, along with .pcs to detect
	their availability.

svn path=/trunk/gnome-desktop-sharp/; revision=109795
  • Loading branch information
mkestner committed Aug 6, 2008
1 parent 62f20d1 commit d38c694
Show file tree
Hide file tree
Showing 42 changed files with 4,080 additions and 151 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
@@ -1,3 +1,9 @@
2008-08-06 Mike Kestner <mkestner@novell.com>

* *: Update to GNOME 2.23.5 API. Add gnome-print-sharp.dll
and gnome-panel-sharp.dll assemblies, along with .pcs to detect
their availability.

2008-03-10 Mike Kestner <mkestner@novell.com>

* configure.in: bump version and tag 2.20.1.
Expand Down
2 changes: 1 addition & 1 deletion Makefile.am
@@ -1,4 +1,4 @@
SUBDIRS = sources gnomedesktop gtkhtml gtksourceview nautilusburn rsvg vte wnck #sample
SUBDIRS = sources gnomedesktop gnomepanel gnomeprint gtkhtml gtksourceview nautilusburn rsvg vte wnck #sample

EXTRA_DIST = \
gtk-sharp.snk \
Expand Down
7 changes: 3 additions & 4 deletions Makefile.include
Expand Up @@ -25,13 +25,12 @@ $(API): $(METADATA) $(RAW_API)
build_customs = $(addprefix $(srcdir)/, $(customs))
api_includes = $(GTKSHARP_CFLAGS) $(addprefix -I:, $(INCLUDE_API))


generated-stamp: $(API) $(INCLUDE_API) $(build_customs)
rm -f generated/* && \
$(GAPI_CODEGEN) --generate $(API) \
$(api_includes) \
$(api_includes) $(glue_args) \
--outdir=generated --customdir=$(srcdir) --assembly-name=$(ASSEMBLY_NAME) \
--gluelib-name=$(pkg)sharpglue-2 --glue-filename=glue/generated.c \
--glue-includes=$(glue_includes) \
&& touch generated-stamp

$(SNK): $(top_srcdir)/$(SNK)
Expand All @@ -41,7 +40,7 @@ AssemblyInfo.cs: $(top_srcdir)/AssemblyInfo.cs.in
sed -e "s/@API_VERSION@/$(API_VERSION)/" $(top_srcdir)/AssemblyInfo.cs.in > AssemblyInfo.cs

build_sources = $(addprefix $(srcdir)/, $(sources)) AssemblyInfo.cs
build_references = $(MONO_CAIRO_LIBS) $(GTKSHARP_LIBS) $(addprefix /r:, $(references))
build_references = $(MONO_CAIRO_LIBS) $(GNOMESHARP_LIBS) $(addprefix /r:, $(references))

if PLATFORM_WIN32
GAPI_CDECL_INSERT=$(top_srcdir)/gapi-cdecl-insert --keyfile=$(SNK) $(ASSEMBLY)
Expand Down
43 changes: 35 additions & 8 deletions configure.in
@@ -1,7 +1,7 @@
AC_INIT(README)
AC_CANONICAL_SYSTEM
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(gnome-desktop-sharp, 2.20.1)
AM_INIT_AUTOMAKE(gnome-desktop-sharp, 2.23.90)
AM_MAINTAINER_MODE

case "$host" in
Expand Down Expand Up @@ -156,8 +156,8 @@ AC_PATH_PROG(GAPI_FIXUP, gapi2-fixup, no)
AC_SUBST(GAPI_FIXUP)

## Versions of dependencies
GNOME_REQUIRED_VERSION=2.20.0
GNOME_SHARP_REQUIRED_VERSION=2.20.0
GNOME_REQUIRED_VERSION=2.23.0
GNOME_SHARP_REQUIRED_VERSION=2.23.0

PKG_CHECK_MODULES(GNOMESHARP, gnome-sharp-2.0 >= $GNOME_SHARP_REQUIRED_VERSION, enable_gnome=yes, enable_gnome=no)
AC_SUBST(GNOMESHARP_CFLAGS)
Expand All @@ -166,29 +166,41 @@ AC_SUBST(GNOMESHARP_LIBS)
AM_CONDITIONAL(ENABLE_GNOME, test "x$enable_gnome" = "xyes")
AC_SUBST(CFLAGS)

PKG_CHECK_MODULES(NAUTILUSBURN, libnautilus-burn >= $GNOME_REQUIRED_VERSION, enable_nautilusburn=yes, enable_nautilusburn=no)
NAUTILUSBURN_REQUIRED_VERSION=2.22.1

PKG_CHECK_MODULES(NAUTILUSBURN, libnautilus-burn >= $NAUTILUSBURN_REQUIRED_VERSION, enable_nautilusburn=yes, enable_nautilusburn=no)
AC_SUBST(NAUTILUSBURN_CFLAGS)
AC_SUBST(NAUTILUSBURN_LIBS)

RSVG_REQUIRED_VERSION=2.18.2
RSVG_REQUIRED_VERSION=2.22.2

PKG_CHECK_MODULES(RSVG, librsvg-2.0 >= $RSVG_REQUIRED_VERSION, enable_rsvg=yes, enable_rsvg=no)
AC_SUBST(RSVG_CFLAGS)
AC_SUBST(RSVG_LIBS)

GTKHTML_REQUIRED_VERSION=3.16.0
PKG_CHECK_MODULES(GNOME_PANEL, libpanelapplet-2.0 >= $GNOME_REQUIRED_VERSION, enable_gnome_panel=yes, enable_gnome_panel=no)
AC_SUBST(GNOME_PANEL_CFLAGS)
AC_SUBST(GNOME_PANEL_LIBS)

GNOME_PRINT_REQUIRED_VERSION=2.18.0

PKG_CHECK_MODULES(GNOME_PRINT, libgnomeprint-2.2 >= $GNOME_PRINT_REQUIRED_VERSION libgnomeprintui-2.2 >= $GNOME_PRINT_REQUIRED_VERSION, enable_gnome_print=yes, enable_gnome_print=no)
AC_SUBST(GNOME_PRINT_CFLAGS)
AC_SUBST(GNOME_PRINT_LIBS)

GTKHTML_REQUIRED_VERSION=3.23.5

PKG_CHECK_MODULES(GTKHTML, libgtkhtml-3.14 >= $GTKHTML_REQUIRED_VERSION, enable_gtkhtml=yes, enable_gtkhtml=no)
AC_SUBST(GTKHTML_CFLAGS)
AC_SUBST(GTKHTML_LIBS)

GTKSOURCEVIEW_REQUIRED_VERSION=2.0.0
GTKSOURCEVIEW_REQUIRED_VERSION=2.2.2

PKG_CHECK_MODULES(GTKSOURCEVIEW, gtksourceview-2.0 >= $GTKSOURCEVIEW_REQUIRED_VERSION, enable_gtksourceview=yes, enable_gtksourceview=no)
AC_SUBST(GTKSOURCEVIEW_CFLAGS)
AC_SUBST(GTKSOURCEVIEW_LIBS)

VTE_REQUIRED_VERSION=0.16.9
VTE_REQUIRED_VERSION=0.16.14

PKG_CHECK_MODULES(VTE, vte >= $VTE_REQUIRED_VERSION, enable_vte=yes, enable_vte=no)
AC_SUBST(VTE_CFLAGS)
Expand All @@ -199,6 +211,8 @@ AC_SUBST(WNCK_CFLAGS)
AC_SUBST(WNCK_LIBS)

AM_CONDITIONAL(ENABLE_GTKHTML, test "x$enable_gtkhtml" = "xyes")
AM_CONDITIONAL(ENABLE_GNOME_PANEL, test "x$enable_gnome_panel" = "xyes")
AM_CONDITIONAL(ENABLE_GNOME_PRINT, test "x$enable_gnome_print" = "xyes")
AM_CONDITIONAL(ENABLE_GTKSOURCEVIEW, test "x$enable_gtksourceview" = "xyes")
AM_CONDITIONAL(ENABLE_NAUTILUSBURN, test "x$enable_nautilusburn" = "xyes")
AM_CONDITIONAL(ENABLE_RSVG, test "x$enable_rsvg" = "xyes")
Expand All @@ -213,23 +227,34 @@ sources/Makefile
gnomedesktop/Makefile
gnomedesktop/gnomedesktop-sharp.dll.config
gnomedesktop/gnome-desktop-sharp-2.0.pc
gnomepanel/Makefile
gnomepanel/glue/Makefile
gnomepanel/gnome-panel-sharp.dll.config
gnomepanel/gnome-panel-sharp-2.24.pc
gnomeprint/Makefile
gnomeprint/gnome-print-sharp.dll.config
gnomeprint/gnome-print-sharp-2.18.pc
nautilusburn/Makefile
nautilusburn/glue/Makefile
nautilusburn/nautilusburn-sharp.dll.config
nautilusburn/nautilusburn-sharp.pc
rsvg/Makefile
rsvg/rsvg2-sharp.dll.config
rsvg/rsvg2-sharp-2.0.pc
gtkhtml/Makefile
gtkhtml/glue/Makefile
gtkhtml/gtkhtml-sharp.dll.config
gtkhtml/gtkhtml-sharp-3.14.pc
gtksourceview/Makefile
gtksourceview/glue/Makefile
gtksourceview/gtksourceview2-sharp.dll.config
gtksourceview/gtksourceview2-sharp.pc
vte/Makefile
vte/vte-sharp.dll.config
vte/vte-sharp-0.16.pc
vte/glue/Makefile
wnck/Makefile
wnck/glue/Makefile
wnck/wnck-sharp.dll.config
wnck/wnck-sharp-1.0.pc
])
Expand All @@ -245,6 +270,8 @@ echo " * $CS compiler: $CSC $CSFLAGS"
echo ""
echo " Optional assemblies included in the build:"
echo ""
echo " * gnome-panel-sharp.dll: $enable_gnome_panel"
echo " * gnome-print-sharp.dll: $enable_gnome_print"
echo " * gtkhtml-sharp.dll: $enable_gtkhtml"
echo " * gtksourceview2-sharp.dll: $enable_gtksourceview"
echo " * nautilusburn-sharp.dll: $enable_nautilusburn"
Expand Down
28 changes: 28 additions & 0 deletions gnomepanel/Makefile.am
@@ -0,0 +1,28 @@
SUBDIRS = . glue

if ENABLE_GNOME_PANEL
pkg = gnome-panel
pkgversion = 2.24
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = gnome-panel-sharp-2.24.pc
else
pkg =
pkgversion =
endif

API_VERSION=2.24.0.0
INCLUDE_API =
METADATA = metadata
references =
glue_args = --glue-includes=panel-applet.h --gluelib-name=gnomepanelsharpglue-2 --glue-filename=glue/generated.c

sources = \
PanelAppletFactory.cs

customs = \
PanelApplet.custom

add_dist = gnome-panel-sharp-2.24.pc.in gnome-panel-sharp.dll.config.in

include ../Makefile.include

23 changes: 23 additions & 0 deletions gnomepanel/PanelApplet.custom
@@ -0,0 +1,23 @@
[DllImport ("panel-applet-2")]
static extern void panel_applet_setup_menu (IntPtr handle, IntPtr xml, BonoboUIVerb[] items, IntPtr user_data);

public void SetupMenu (string xml, BonoboUIVerb[] items)
{
BonoboUIVerb[] nulled_items = new BonoboUIVerb[items.Length + 1];
Array.Copy (items, nulled_items, items.Length);
nulled_items[items.Length] = new BonoboUIVerb (null, null);
IntPtr native = GLib.Marshaller.StringToPtrGStrdup (xml);
panel_applet_setup_menu (Handle, native, nulled_items, IntPtr.Zero);
GLib.Marshaller.Free (native);
PersistentData ["setup_menu_verbs"] = items;
}

public abstract void Creation ();

public abstract string IID {
get;
}

public abstract string FactoryIID {
get;
}
60 changes: 60 additions & 0 deletions gnomepanel/PanelAppletFactory.cs
@@ -0,0 +1,60 @@
// Gnome.PanelAppletFactory.cs - PanelAppletFactory class impl
//
// Copyright (c) 2004-2005 Novell, Inc.
//
// This code is inserted after the automatically generated code.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the Lesser GNU General
// Public License as published by the Free Software Foundation.
//
// 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
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser 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.



using System;
using System.Reflection;
using System.Runtime.InteropServices;

namespace Gnome
{
public class PanelAppletFactory
{
private PanelAppletFactory () {}

private static string _IID;
private static string _factoryIID;
private static GnomeSharp.PanelAppletFactoryCallbackWrapper cb_wrapper;

public static void Register (Type applet_type)
{
PanelApplet applet = (PanelApplet) Activator.CreateInstance (applet_type, BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance | BindingFlags.CreateInstance, null, new object[] {IntPtr.Zero}, null);

cb_wrapper = new GnomeSharp.PanelAppletFactoryCallbackWrapper (new PanelAppletFactoryCallback (Creation));
_IID = applet.IID;
_factoryIID = applet.FactoryIID;
IntPtr native_iid = GLib.Marshaller.StringToPtrGStrdup (_factoryIID);
panel_applet_factory_main (native_iid, ((GLib.GType) applet_type).Val, cb_wrapper.NativeDelegate, IntPtr.Zero);
GLib.Marshaller.Free (native_iid);
}

private static bool Creation (PanelApplet applet, string iid)
{
if (_IID != iid)
return false;
applet.Creation ();
return true;
}

[DllImport("panel-applet-2")]
static extern int panel_applet_factory_main(IntPtr iid, IntPtr applet_type, GnomeSharp.PanelAppletFactoryCallbackNative cb, IntPtr data);
}
}
23 changes: 23 additions & 0 deletions gnomepanel/glue/Makefile.am
@@ -0,0 +1,23 @@
lib_LTLIBRARIES = $(TARGET)

if ENABLE_GNOME_PANEL
TARGET = libgnomepanelsharpglue-2.la
else
TARGET =
endif

libgnomepanelsharpglue_2_la_SOURCES = panelapplet.c

nodist_libgnomepanelsharpglue_2_la_SOURCES = generated.c

libgnomepanelsharpglue_2_la_LDFLAGS = -module -avoid-version -no-undefined

libgnomepanelsharpglue_2_la_LIBADD = $(GNOME_PANEL_LIBS)

INCLUDES = $(GNOME_PANEL_CFLAGS) -I$(top_srcdir)

libgnomepanelsharpglue.dll: $(libgnomepanelsharpglue_2_la_OBJECTS) libgnomepanelsharpglue.rc libgnomepanelsharpglue.def
./build-dll libgnomepanelsharpglue-2 $(VERSION)

CLEANFILES = lib*.a lib*.dll

29 changes: 29 additions & 0 deletions gnomepanel/glue/panelapplet.c
@@ -0,0 +1,29 @@
#include <panel-applet.h>

typedef struct _ContextMenuItem
{
const gchar *verb;
gpointer callback;
} ContextMenuItem;

void panelapplet_setup_menu (PanelApplet *applet, const gchar *xml, ContextMenuItem *menuitems, gint cnt);

void
panelapplet_setup_menu (PanelApplet *applet, const gchar *xml, ContextMenuItem *menuitems, gint cnt)
{
int i;
BonoboUIVerb *menu_verbs = NULL;

menu_verbs = g_new0 (BonoboUIVerb, cnt + 1);

for (i = 0; i < cnt; i++) {
menu_verbs[i].cname = menuitems[i].verb;
menu_verbs[i].cb = menuitems[i].callback;
menu_verbs[i].user_data = NULL;
}
menu_verbs[cnt].cname = NULL;
menu_verbs[cnt].cb = NULL;
menu_verbs[cnt].user_data = NULL;
panel_applet_setup_menu (applet, xml, menu_verbs, NULL);
g_free (menu_verbs);
}

0 comments on commit d38c694

Please sign in to comment.