diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 310f590..0000000 --- a/Makefile.am +++ /dev/null @@ -1,70 +0,0 @@ -## Process this file with automake to produce Makefile.in -ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} - -SUBDIRS = xed pixmaps po data plugins docs help - -distuninstallcheck_listfiles = find . -type f -print - -EXTRA_DIST = \ - autogen.sh \ - ChangeLog \ - HACKING \ - NEWS \ - NEWS.GNOME \ - README \ - xmldocs.make \ - omf.make \ - intltool-extract.in \ - intltool-merge.in \ - intltool-update.in - -DISTCLEANFILES = \ - intltool-extract \ - intltool-merge \ - intltool-update - -MAINTAINERCLEANFILES = \ - aclocal.m4 \ - config.guess \ - config.h.in \ - config.sub \ - depcomp \ - intltool-extract.in \ - intltool-merge.in \ - intltool-update.in \ - configure \ - INSTALL \ - gtk-doc.make \ - install-sh \ - ltmain.sh \ - missing \ - mkinstalldirs \ - omf.make \ - py-compile \ - xmldocs.make \ - m4/gtk-doc.m4 \ - m4/intltool.m4 \ - m4/libtool.m4 \ - m4/ltoptions.m4 \ - m4/ltsugar.m4 \ - m4/ltversion.m4 \ - m4/lt~obsolete.m4 \ - `find "$(srcdir)" -type f -name Makefile.in -print` - -DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc - -dist-hook: - @if test -d "$(srcdir)/.git"; \ - then \ - echo Creating ChangeLog && \ - (GIT_DIR=$(top_srcdir)/.git \ - ./missing --run git log --stat -M -C --name-status --date=short --no-color) | \ - fmt --split-only > ChangeLog.tmp \ - && mv -f ChangeLog.tmp $(top_distdir)/ChangeLog \ - || ( rm -f ChangeLog.tmp ; \ - echo Failed to generate ChangeLog >&2 ); \ - else \ - echo A git clone is required to generate a ChangeLog >&2; \ - fi - --include $(top_srcdir)/git.mk diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index 56ea79f..0000000 --- a/autogen.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# Run this to generate all the initial makefiles, etc. - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -PKG_NAME="xed" - -(test -f $srcdir/configure.ac) || { - echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" - echo " top-level $PKG_NAME directory" - exit 1 -} - -which gnome-autogen.sh || { - echo "You need to install gnome-common" - exit 1 -} - - -which yelp-build || { - echo "You need to install yelp-tools" - exit 1 -} - -REQUIRED_AUTOMAKE_VERSION=1.9 -GNOME_DATADIR="$gnome_datadir" -USE_COMMON_DOC_BUILD=yes - -. gnome-autogen.sh - diff --git a/configure.ac b/configure.ac deleted file mode 100644 index dad12f5..0000000 --- a/configure.ac +++ /dev/null @@ -1,239 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. - -AC_PREREQ(2.63.2) - -m4_define(xed_major_version, 1) -m4_define(xed_minor_version, 8) -m4_define(xed_micro_version, 3) -m4_define(xed_version, xed_major_version.xed_minor_version.xed_micro_version) - -AC_INIT([xed], [xed_version], - [https://github.com/linuxmint/xed/issues], - [xed], [http://github.com/linuxmint/xed]) - -AC_CONFIG_HEADERS(config.h) -AC_CONFIG_SRCDIR(xed/xed.c) -AC_CONFIG_MACRO_DIR([m4]) - -AC_DEFINE(XED_MAJOR_VERSION, xed_major_version, [Xed major version]) -AC_SUBST(XED_MAJOR_VERSION, xed_major_version) -AC_DEFINE(XED_MINOR_VERSION, xed_minor_version, [Xed minor version]) -AC_SUBST(XED_MINOR_VERSION, xed_minor_version) -AC_DEFINE(XED_MICRO_VERSION, xed_micro_version, [Xed micro version]) -AC_SUBST(XED_MICRO_VERSION, xed_micro_version) - -AM_INIT_AUTOMAKE([1.10 dist-xz no-dist-gzip -Wno-portability check-news]) -AM_MAINTAINER_MODE -m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) - -# Checks for programs -AC_PROG_CC -AC_PROG_INSTALL -AC_PROG_MAKE_SET -AC_SYS_LARGEFILE -PKG_PROG_PKG_CONFIG - -# Initialize libtool -LT_PREREQ([2.2.6]) -LT_INIT(disable-static) - -GTK_DOC_CHECK([1.0],[--flavour=no-tmpl]) - -AC_CHECK_FUNC(sigaction) -AC_CHECK_LIB(m, floor) - -dnl make sure we keep ACLOCAL_FLAGS around for maintainer builds to work -AC_SUBST(ACLOCAL_AMFLAGS, "$ACLOCAL_FLAGS -I m4") - -dnl toolbar style for GSettings schemas -TOOLBAR_STYLE="XED_TOOLBAR_SYSTEM" -AC_SUBST(TOOLBAR_STYLE) - -dnl =============================================================== -dnl Expanded dirs -dnl =============================================================== - -# This macro expands DIR and assigns it to RET. -# If DIR is NONE, then it's replaced by DEFAULT. -# Based on AC_DEFINE_DIR -AC_DEFUN([XED_FULLPATH], [ - test "x$prefix" = xNONE && prefix="$ac_default_prefix" - test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - ac_expand=[$]$1 - test "x$ac_expand" = xNONE && ac_expand="[$]$2" - ac_expand=`eval echo [$]ac_expand` - $3=`eval echo [$]ac_expand` -]) - -dnl ================================================================ -dnl Gettext stuff. -dnl ================================================================ - -IT_PROG_INTLTOOL([0.50.1]) -GETTEXT_PACKAGE=xed -AC_SUBST([GETTEXT_PACKAGE]) -AM_GLIB_GNU_GETTEXT -AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Define to the Gettext package name]) - -dnl ================================================================ -dnl Use gvfs metadata or the old xml file store. -dnl ================================================================ - -AC_ARG_ENABLE([gvfs-metadata], - AS_HELP_STRING([--enable-gvfs-metadata], [Enable using gvfs to store metadata]), - [enable_gvfs_metadata=$enableval], - [enable_gvfs_metadata=yes]) - -AM_CONDITIONAL(ENABLE_GVFS_METADATA, test "x$enable_gvfs_metadata" != "xno") - -if test "x$enable_gvfs_metadata" != "xno"; then - AC_DEFINE([ENABLE_GVFS_METADATA], [1], [Define to enable using gvfs metadata]) -fi - -dnl ================================================================ -dnl spell plugins checks: enchant and iso-codes -dnl ================================================================ - -GSPELL_REQUIRED=0.2.5 - -AC_ARG_ENABLE([spell], - AS_HELP_STRING([--disable-spell],[Disable spell plugin (default: enabled)]), - [enable_spell=$enableval], - [enable_spell=yes]) - -if test "x$enable_spell" = "xyes" ; then - - PKG_CHECK_MODULES(GSPELL, gspell-1 >= $GSPELL_REQUIRED, \ - have_gspell=yes, have_gspell=no) - - if test "x$have_gspell" = "xno"; then - enable_spell=no - AC_MSG_ERROR([gspell library not found or too old. Use --disable-spell to build without spell plugin.]) - fi -fi - -AM_CONDITIONAL(ENABLE_SPELL, test x"$enable_spell" = "xyes") - -dnl ================================================================ -dnl Start of pkg-config checks -dnl ================================================================ - -PKG_CHECK_MODULES(GMODULE,gmodule-2.0,[GMODULE_ADD="gmodule-2.0"],[GMODULE_ADD=""]) -PKG_CHECK_MODULES(XED, [ - libxml-2.0 >= 2.5.0 - glib-2.0 >= 2.40.0 - $GMODULE_ADD - gthread-2.0 >= 2.13.0 - gio-2.0 >= 2.40.0 - gtk+-3.0 >= 3.19.3 - gtksourceview-3.0 >= 3.19.0 - libpeas-1.0 >= 1.12.0 - libpeas-gtk-1.0 >= 1.12.0 - xapp -]) - -PKG_CHECK_MODULES(X11, [x11]) - -XED_CFLAGS="$XED_CFLAGS $X11_CFLAGS" -XED_LIBS="$XED_LIBS $X11_LIBS" - -AC_SUBST(XED_CFLAGS) -AC_SUBST(XED_LIBS) - -# Introspection -GOBJECT_INTROSPECTION_CHECK([0.9.3]) - -if test "$found_introspection" = "yes"; then - enable_introspection=yes - AC_DEFINE([ENABLE_INTROSPECTION], [1], [Define to enable GObject Introspection]) -else - enable_introspection=no -fi - -AM_PATH_PYTHON([3.4]) - -dnl ================================================================ -dnl GSettings related settings -dnl ================================================================ - -GLIB_GSETTINGS - -dnl ================================================================ -dnl Misc -dnl ================================================================ -AC_PATH_PROG(GLIB_COMPILE_RESOURCES, glib-compile-resources) -AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal) -AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums) - -GNOME_COMPILE_WARNINGS(yes) - -AC_ARG_ENABLE(deprecations, - [AS_HELP_STRING([--enable-deprecations], - [warn about deprecated usages [default=no]])],, - [enable_deprecations=no]) - -if test "x$enable_deprecations" = "xyes"; then - DISABLE_DEPRECATED_CFLAGS="\ --DG_DISABLE_DEPRECATED \ --DGDK_DISABLE_DEPRECATED \ --DGTK_DISABLE_DEPRECATED \ --DGDK_PIXBUF_DISABLE_DEPRECATED \ --DGNOME_DISABLE_DEPRECATED" - AC_SUBST(DISABLE_DEPRECATED_CFLAGS) -fi - -PLUGIN_LIBTOOL_FLAGS="-module -avoid-version" - -AC_SUBST(PLUGIN_LIBTOOL_FLAGS) - -XED_PLUGINS_DATA_DIR="$datadir/xed/plugins" -AC_SUBST(XED_PLUGINS_DATA_DIR) - -XED_PLUGINS_LIBS_DIR="$libdir/xed/plugins" -AC_SUBST(XED_PLUGINS_LIBS_DIR) - -YELP_HELP_INIT - -AC_CONFIG_FILES([ -Makefile -data/xed.desktop.in -data/xed-bugreport.sh -data/xed.pc -data/org.x.editor.gschema.xml -data/Makefile -docs/Makefile -docs/reference/Makefile -xed/Makefile -help/Makefile -pixmaps/Makefile -plugins/Makefile -plugins/docinfo/Makefile -plugins/filebrowser/Makefile -plugins/filebrowser/org.x.editor.plugins.filebrowser.gschema.xml -plugins/modelines/Makefile -plugins/sort/Makefile -plugins/spell/Makefile -plugins/spell/org.x.editor.plugins.spell.gschema.xml -plugins/taglist/Makefile -plugins/textsize/Makefile -plugins/textsize/textsize/Makefile -plugins/time/Makefile -plugins/time/org.x.editor.plugins.time.gschema.xml -plugins/trailsave/Makefile -plugins/wordcompletion/Makefile -plugins/wordcompletion/org.x.editor.plugins.wordcompletion.gschema.xml -po/Makefile.in -]) - -AC_OUTPUT - -echo " - -Configuration: - - Source code location: ${srcdir} - Compiler: ${CC} - Spell Plugin enabled: $enable_spell - Gvfs metadata enabled: $enable_gvfs_metadata - GObject Introspection: ${enable_introspection} -" diff --git a/data/Makefile.am b/data/Makefile.am deleted file mode 100644 index c234c15..0000000 --- a/data/Makefile.am +++ /dev/null @@ -1,49 +0,0 @@ -desktopdir = $(datadir)/applications -desktop_in_files = xed.desktop.in -desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) -@INTLTOOL_DESKTOP_RULE@ - -@INTLTOOL_XML_RULE@ - -appdatadir = $(datadir)/appdata -appdata_in_files = xed.appdata.xml.in -appdata_DATA = $(appdata_in_files:.xml.in=.xml) - -gsettings_SCHEMAS = org.x.editor.gschema.xml - -@GSETTINGS_RULES@ - -servicedir = $(datadir)/dbus-1/services -service_in_files = org.x.editor.service.in -service_DATA = $(service_in_files:.service.in=.service) - -$(service_DATA): $(service_in_files) Makefile - @sed -e "s|\@bindir\@|$(bindir)|" $<> $@ - -man_MANS = xed.1 - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = xed.pc - -bugreportdir = $(libexecdir)/xed -bugreport_SCRIPTS = xed-bugreport.sh - -EXTRA_DIST = \ - $(appdata_in_files) \ - $(desktop_in_files) \ - $(service_in_files) \ - $(man_MANS) \ - xed.pc.in \ - xed-bugreport.sh.in - -CLEANFILES = \ - $(desktop_DATA) \ - $(service_DATA) \ - $(gsettings_SCHEMAS) \ - $(pkgconfig_DATA) \ - $(appdata_DATA) - - - - --include $(top_srcdir)/git.mk diff --git a/data/meson.build b/data/meson.build new file mode 100644 index 0000000..264c6ce --- /dev/null +++ b/data/meson.build @@ -0,0 +1,42 @@ +desktop = custom_target( + 'desktop', + input: 'xed.desktop.in.in', + output: 'xed.desktop', + command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'], + install: true, + install_dir: desktopdir, +) + +appdata = custom_target( + 'appdata', + input: 'xed.appdata.xml.in', + output: 'xed.appdata.xml', + command: [intltool_merge, '-x', '-u', po_dir, '@INPUT@', '@OUTPUT@'], + install: true, + install_dir: join_paths(datadir, 'metainfo'), +) + +schema_conf = configuration_data() +schema_conf.set('GETTEXT_PACKAGE', 'xed') + +schema_file = configure_file( + input: 'org.x.editor.gschema.xml.in', + output: 'org.x.editor.gschema.xml', + configuration: schema_conf, + install_dir: join_paths(datadir, 'glib-2.0', 'schemas') +) + +service_conf = configuration_data() +service_conf.set('bindir', join_paths(prefix, bindir)) + +configure_file( + input: 'org.x.editor.service.in', + output: 'org.x.editor.service', + configuration: service_conf, + install_dir: join_paths(datadir, 'dbus-1', 'services') +) + +install_data( + 'xed.1', + install_dir : join_paths(get_option('prefix'), get_option('mandir'), 'man1') +) diff --git a/data/xed-bugreport.sh.in b/data/xed-bugreport.sh.in deleted file mode 100644 index 6d6bf0c..0000000 --- a/data/xed-bugreport.sh.in +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/sh - -PKG_CONFIG_MODULES="glib-2.0 gtk+-3.0 gtksourceview-3.0 enchant iso-codes" - -echo_padded () -{ - echo -n " - $1 " - N=$(echo -n $1 | wc -m) - while test $N -le 20 - do - echo -n " " - N=`expr $N + 1` - done -} - -if (which gsettings >/dev/null) -then - echo "GSettings configuration dump:" - gsettings list-recursively org.x.editor - echo -fi - -echo "Active plugins:" -gsettings get org.x.editor active-plugins \ - | sed -r -e 's/^\[(.*)\]$/\1/' -e 's/, /\n/g' \ - | sed -e 's/^.*$/ - \0/' -echo - -# Manually installed plugins (in $HOME) -if [ -d $HOME/.config/xed/plugins ] -then - echo "Plugins in \$HOME:" - ls $HOME/.config/xed/plugins/*.xed-plugin \ - | sed -r -e 's#.*/([^/]*)\.xed-plugin$# - \1#' -else - echo "No plugin installed in \$HOME." -fi -echo - -echo "Module versions:" -if (which pkg-config > /dev/null) -then - for i in $PKG_CONFIG_MODULES - do - echo_padded "`echo -n $i | sed -r -e 's/^(.*)-[0-9]\.[0-9]$/\1/'`" - pkg-config --modversion $i 2>/dev/null || echo - done -else - echo " pkg-config unavailable" -fi -echo diff --git a/data/xed.desktop.in.in b/data/xed.desktop.in.in index 1955875..cf59626 100644 --- a/data/xed.desktop.in.in +++ b/data/xed.desktop.in.in @@ -1,6 +1,6 @@ [Desktop Entry] -_Name=Text Editor -_Comment=Edit text files +Name=Text Editor +Comment=Edit text files Exec=xed %U Terminal=false Type=Application diff --git a/data/xed.pc.in b/data/xed.pc.in deleted file mode 100644 index 68685d0..0000000 --- a/data/xed.pc.in +++ /dev/null @@ -1,12 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ -pluginsdir=@libdir@/xed/plugins - -Name: xed -Description: xed -Requires: gtksourceview-3.0 libpeas-1.0 libpeas-gtk-1.0 -Version: @VERSION@ -Cflags: -I${includedir}/xed -Libs: -L${libdir} diff --git a/debian/clean b/debian/clean new file mode 100644 index 0000000..75167fa --- /dev/null +++ b/debian/clean @@ -0,0 +1 @@ +debian/build/ diff --git a/debian/control b/debian/control index 8d7e25e..0b795cc 100644 --- a/debian/control +++ b/debian/control @@ -2,8 +2,7 @@ Source: xed Section: x11 Priority: optional Maintainer: Linux Mint -Build-Depends: autotools-dev, - debhelper (>= 9), +Build-Depends: debhelper (>= 9), gobject-introspection, gtk-doc-tools, intltool, @@ -21,6 +20,7 @@ Build-Depends: autotools-dev, python3, python3-gi, yelp-tools, + meson Standards-Version: 3.9.6 Package: xed diff --git a/debian/rules b/debian/rules index 529c008..98d6475 100755 --- a/debian/rules +++ b/debian/rules @@ -5,27 +5,28 @@ DHFLAGS=--parallel %: dh $@ $(DHFLAGS) --with gir -override_dh_install: - rm -rfv debian/tmp/usr/lib/*/xed/plugins/*.la - rm -rfv debian/tmp/usr/lib/*/xed/*.la - dh_install --fail-missing - override_dh_auto_configure: - # upstream tarball is without configure. autogen.sh will create it - NOCONFIGURE=1 ./autogen.sh - dh_auto_configure $(DHFLAGS) -- \ - --enable-silent-rules \ - --libexecdir=/usr/lib/ \ - --enable-gtk-doc + meson debian/build \ + --prefix=/usr \ + --buildtype=plain \ + -D docs=true \ + -D deprecated_warnings=false override_dh_installchangelogs: dh_installchangelogs NEWS override_dh_auto_test: - DEB_BUILD_OPTIONS=nocheck dh_auto_test + ninja -C debian/build test override_dh_strip: dh_strip --dbg-package=xed-dbg get-orig-source: uscan --noconf --force-download --rename --download-current-version --destdir=.. + +override_dh_auto_install: + DESTDIR=${CURDIR}/debian/tmp \ + ninja -C debian/build install + +override_dh_auto_build: + ninja -C debian/build diff --git a/debian/xed-common.install b/debian/xed-common.install index 75d4ae1..5c5107c 100644 --- a/debian/xed-common.install +++ b/debian/xed-common.install @@ -1,4 +1,4 @@ -usr/share/appdata +usr/share/metainfo usr/share/xed/plugins usr/share/glib-2.0 usr/share/help diff --git a/debian/xed.install b/debian/xed.install index 5871df7..57beab3 100644 --- a/debian/xed.install +++ b/debian/xed.install @@ -1,6 +1,5 @@ usr/bin/xed usr/lib/*/xed/girepository-1.0/ -usr/lib/xed/xed-bugreport.sh usr/lib/*/xed/plugins/ usr/lib/*/xed/*.so usr/share/applications/xed.desktop diff --git a/docs/Makefile.am b/docs/Makefile.am deleted file mode 100644 index ffdce49..0000000 --- a/docs/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -SUBDIRS = reference - -EXTRA_DIST = class-diagram.dia - --include $(top_srcdir)/git.mk diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am deleted file mode 100644 index 8f9e1e9..0000000 --- a/docs/reference/Makefile.am +++ /dev/null @@ -1,74 +0,0 @@ -## Process this file with automake to produce Makefile.in - -# see /gtk-doc/examples/Makefile.am - -# We require automake 1.6 at least. -AUTOMAKE_OPTIONS = 1.6 - -# The name of the module, e.g. 'glib'. -DOC_MODULE = xed - -# The top-level XML file (SGML in the past). -DOC_MAIN_SGML_FILE = xed-docs.xml - -# The directory containing the source code. Relative to $(srcdir). -DOC_SOURCE_DIR = ../../xed - -# Extra options to supply to gtkdoc-scan. -# e.g. SCAN_OPTIONS = --deprecated-guards="GTK_DISABLE_DEPRECATED" -SCAN_OPTIONS = --rebuild-types - -# Extra options to supply to gtkdoc-mkdb. -MKDB_OPTIONS = --xml-mode --output-format=xml - -# Used for dependencies. The docs will be rebuilt if any of these change. -HFILE_GLOB = $(top_srcdir)/xed/*.h -CFILE_GLOB = $(top_srcdir)/xed/*.c - -# Header files to ignore when scanning (These are internal to xed). -IGNORE_HFILES= \ - xed-close-confirmation-dialog.h \ - xed-dirs.h \ - xed-commands.h \ - xed-documents-panel.h \ - xed-io-error-info-bar.h \ - xed-languages-manager.h \ - xed-plugins-engine.h \ - xed-session.h \ - xed-ui.h \ - xed-window-private.h \ - xed-output-window.h \ - xed-encodings-dialog.h \ - xed-open-location-dialog.h \ - xed-page-setup-dialog.h \ - xed-preferences-dialog.h \ - xed-search-dialog.h \ - xed-marshal.h \ - xed-enum-types.h - -# Images to copy into HTML directory. -HTML_IMAGES = - -# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). -content_files = - -# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. -# Only needed if you are using gtkdoc-scangobj to dynamically query widget -# signals and properties. -GTKDOC_CFLAGS = \ - -I$(top_srcdir)/xed \ - -I$(top_builddir)/xed \ - -I$(top_srcdir) \ - -I$(top_builddir) \ - $(XED_CFLAGS) - -GTKDOC_LIBS = \ - $(top_builddir)/xed/libxed.la \ - $(XED_LIBS) - -MAINTAINERCLEANFILES = xed.types - -# This includes the standard gtk-doc make rules, copied by gtkdocize. -include $(top_srcdir)/gtk-doc.make - --include $(top_srcdir)/git.mk diff --git a/docs/reference/meson.build b/docs/reference/meson.build new file mode 100644 index 0000000..2042e6c --- /dev/null +++ b/docs/reference/meson.build @@ -0,0 +1,36 @@ +docs_ignore_h = [ + 'xed-close-confirmation-dialog.h', + 'xed-dirs.h', + 'xed-commands.h', + 'xed-documents-panel.h', + 'xed-io-error-info-bar.h', + 'xed-languages-manager.h', + 'xed-plugins-engine.h', + 'xed-session.h', + 'xed-ui.h', + 'xed-window-private.h', + 'xed-output-window.h', + 'xed-encodings-dialog.h', + 'xed-open-location-dialog.h', + 'xed-page-setup-dialog.h', + 'xed-preferences-dialog.h', + 'xed-search-dialog.h', + 'xed-marshal.h', + 'xed-enum-types.h' +] + +gnome.gtkdoc( + 'xed', + mode: 'xml', + install: true, + main_xml: 'xed-docs.xml', + gobject_typesfile: 'xed.types', + src_dir: [ + join_paths(meson.source_root(), 'xed'), + join_paths(meson.build_root(), 'xed'), + ], + ignore_headers: docs_ignore_h, + dependencies: libxed_dep, + scan_args: ['--rebuild-types'], + mkdb_args: ['--xml-mode', '--output-format=xml'], +) diff --git a/help/LINGUAS b/help/LINGUAS new file mode 100644 index 0000000..e4af19a --- /dev/null +++ b/help/LINGUAS @@ -0,0 +1,23 @@ +ar +bg +ca +cs +da +de +el +es +fi +fr +hu +it +ja +ko +oc +pt_BR +ru +sv +th +uk +zh_CN +zh_HK +zh_TW diff --git a/help/Makefile.am b/help/Makefile.am deleted file mode 100644 index 01a4a37..0000000 --- a/help/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -@YELP_HELP_RULES@ - -HELP_ID = xed -HELP_FILES = index.docbook legal.xml -HELP_MEDIA = \ - figures/xed_format_bold.png \ - figures/xed_format_italic.png \ - figures/xed_format_strikethrough.png \ - figures/xed_format_underline.png \ - figures/xed_recent_files_menu_icon.png \ - figures/xed_window.png - -HELP_LINGUAS = ar bg ca cs da de el es fi fr hu it ja ko oc pt_BR ru sv th uk zh_CN zh_HK zh_TW - - --include $(top_srcdir)/git.mk diff --git a/help/meson.build b/help/meson.build new file mode 100644 index 0000000..906b490 --- /dev/null +++ b/help/meson.build @@ -0,0 +1,20 @@ +help_sources = [ + 'index.docbook', + 'legal.xml' +] + +help_media = [ + 'figures/xed_format_bold.png', + 'figures/xed_format_italic.png', + 'figures/xed_format_strikethrough.png', + 'figures/xed_format_underline.png', + 'figures/xed_recent_files_menu_icon.png', + 'figures/xed_window.png' +] + +gnome.yelp( + meson.project_name(), + sources: help_sources, + media: help_media, + symlink_media: false +) diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..d9a7352 --- /dev/null +++ b/meson.build @@ -0,0 +1,103 @@ +project('xed', 'c', version : '1.8.3') + +gnome = import('gnome') +i18n = import('i18n') +pkgconfig = import('pkgconfig') + +version = meson.project_version() + +xed_conf = configuration_data() +xed_conf.set_quoted('VERSION', version) +xed_conf.set_quoted('GETTEXT_PACKAGE', 'xed') + +# directories +prefix = get_option('prefix') +bindir = get_option('bindir') +datadir = get_option('datadir') +libdir = get_option('libdir') +includedir = get_option('includedir') +libexecdir = get_option('libexecdir') +desktopdir = join_paths(datadir, 'applications') +schema_dir = join_paths(datadir, 'glib-2.0', 'schemas') + +po_dir = join_paths(meson.source_root(), 'po') + +# dependencies +libxml = dependency('libxml-2.0', version: '>= 2.5.0') +glib = dependency('glib-2.0', version: '>= 2.40.0') +gthread = dependency('gthread-2.0', version: '>= 2.13.0') +gio = dependency('gio-2.0', version: '>= 2.40.0') +gtk = dependency('gtk+-3.0', version: '>= 3.19.3') +gtksourceview = dependency('gtksourceview-3.0', version: '>= 3.19.0') +libpeas = dependency('libpeas-1.0', version: '>= 1.12.0') +libpeas_gtk = dependency('libpeas-gtk-1.0', version: '>= 1.12.0') +gir_dep = dependency('gobject-introspection-1.0', version: '>= 0.6.7', required: false) +gmodule = dependency('gmodule-2.0') +xapp = dependency('xapp') +X11 = dependency('x11') +pango = dependency('pango') + +if gir_dep.found() + xed_conf.set('ENABLE_INTROSPECTION', 1) +endif + +enable_spell = get_option('enable_spell') +if enable_spell + gspell = dependency('gspell-1', version: '>= 0.2.5') +endif + +if get_option('enable_gvfs_metadata') + xed_conf.set('ENABLE_GVFS_METADATA', true) +endif + +# on some systems we need to find the math lib to make sure it builds +cc = meson.get_compiler('c') +math = cc.find_library('m', required: false) + +intltool_merge = find_program('intltool-merge') + +# generate config.h +config_h_file = configure_file( + output : 'config.h', + configuration : xed_conf +) + +config_h = declare_dependency( + sources: config_h_file +) + +include_dirs = include_directories('.', 'xed') + +# compiler flags +add_global_arguments('-DDATADIR="@0@"'.format(join_paths(prefix, datadir)), language: 'c') +add_global_arguments('-DLIBDIR="@0@"'.format(join_paths(prefix, libdir)), language: 'c') + +# remove this later or add as build option +if not get_option('deprecated_warnings') + add_global_arguments([ + '-Wno-deprecated-declarations', + '-Wno-deprecated', + '-Wno-declaration-after-statement', + ], + language: 'c', + ) +endif + +subdir('xed') +subdir('pixmaps') +subdir('po') +subdir('data') +subdir('plugins') +subdir('help') +if get_option('docs') + subdir('docs/reference') +endif + +message('prefix = @0@'.format(prefix)) +message('bindir = @0@'.format(bindir)) +message('datadir = @0@'.format(datadir)) +message('libdir = @0@'.format(libdir)) +message('includedir = @0@'.format(includedir)) +message('libexecdir = @0@'.format(libexecdir)) +message('desktopdir = @0@'.format(desktopdir)) +message('schema_dir = @0@'.format(schema_dir)) diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..277d628 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,23 @@ +option( + 'enable_spell', + type : 'boolean', + value : true, + description : 'enable gspell' +) +option( + 'enable_gvfs_metadata', + type : 'boolean', + value : true, + description : 'enable gvfs metadata' +) +option('docs', + type: 'boolean', + value: false, + description: 'Build the API references (requires gtk-doc)' +) +option( + 'deprecated_warnings', + type : 'boolean', + value : false, + description: 'Show build warnings for deprecations' +) diff --git a/pixmaps/Makefile.am b/pixmaps/Makefile.am deleted file mode 100644 index 5742ff5..0000000 --- a/pixmaps/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -icondir = $(datadir)/xed/icons -icon_DATA = xed-plugin.png - -EXTRA_DIST = \ - $(icon_DATA) \ - xed.ico - --include $(top_srcdir)/git.mk diff --git a/pixmaps/meson.build b/pixmaps/meson.build new file mode 100644 index 0000000..a0cd95a --- /dev/null +++ b/pixmaps/meson.build @@ -0,0 +1,4 @@ +install_data( + 'xed-plugin.png', + install_dir: join_paths(datadir, 'xed', 'icons') +) diff --git a/plugins/Makefile.am b/plugins/Makefile.am deleted file mode 100644 index 0b4b225..0000000 --- a/plugins/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -DIST_SUBDIRS = \ - docinfo \ - filebrowser \ - modelines \ - sort \ - spell \ - taglist \ - textsize \ - time \ - trailsave \ - wordcompletion - -SUBDIRS = \ - docinfo \ - filebrowser \ - modelines \ - sort \ - taglist \ - textsize \ - time \ - trailsave \ - wordcompletion - -if ENABLE_SPELL -SUBDIRS += spell -endif - --include $(top_srcdir)/git.mk diff --git a/plugins/docinfo/Makefile.am b/plugins/docinfo/Makefile.am deleted file mode 100644 index 015cece..0000000 --- a/plugins/docinfo/Makefile.am +++ /dev/null @@ -1,34 +0,0 @@ -# docinfo plugin -plugindir = $(XED_PLUGINS_LIBS_DIR) - -AM_CPPFLAGS = \ - -I$(top_srcdir) \ - $(XED_CFLAGS) \ - $(WARN_CFLAGS) \ - $(DISABLE_DEPRECATED_CFLAGS) - -plugin_LTLIBRARIES = libdocinfo.la - -libdocinfo_la_SOURCES = \ - xed-docinfo-plugin.h \ - xed-docinfo-plugin.c - -libdocinfo_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS) -libdocinfo_la_LIBADD = $(XED_LIBS) - -uidir = $(XED_PLUGINS_DATA_DIR)/docinfo -ui_DATA = docinfo.ui - -plugin_in_files = docinfo.plugin.desktop.in - -%.plugin: %.plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache - -plugin_DATA = $(plugin_in_files:.plugin.desktop.in=.plugin) - -EXTRA_DIST = $(ui_DATA) $(plugin_in_files) - -CLEANFILES = $(plugin_DATA) -DISTCLEANFILES = $(plugin_DATA) - - --include $(top_srcdir)/git.mk diff --git a/plugins/docinfo/meson.build b/plugins/docinfo/meson.build new file mode 100644 index 0000000..6d8b008 --- /dev/null +++ b/plugins/docinfo/meson.build @@ -0,0 +1,37 @@ +docinfo_sources = [ + 'xed-docinfo-plugin.h', + 'xed-docinfo-plugin.c' +] + +docinfo_deps = [ + config_h, + glib, + gmodule, + gtksourceview, + libpeas, + pango +] + +library('docinfo', + docinfo_sources, + dependencies: docinfo_deps, + include_directories: include_dirs, + link_with: libxed, + install_rpath: join_paths(prefix, libdir, 'xed'), + install: true, + install_dir: join_paths(libdir, 'xed', 'plugins') +) + +install_data( + 'docinfo.ui', + install_dir: join_paths(pluginsdatadir, 'docinfo') +) + +docinfo_desktop = custom_target( + 'docinfo_desktop', + input: 'docinfo.plugin.desktop.in', + output: 'docinfo.plugin', + command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'], + install: true, + install_dir: pluginslibdir, +) diff --git a/plugins/docinfo/xed-docinfo-plugin.c b/plugins/docinfo/xed-docinfo-plugin.c index 0db0a83..dcc6915 100644 --- a/plugins/docinfo/xed-docinfo-plugin.c +++ b/plugins/docinfo/xed-docinfo-plugin.c @@ -19,14 +19,8 @@ * */ -#ifdef HAVE_CONFIG_H #include -#endif - -#include "xed-docinfo-plugin.h" - #include /* For strlen (...) */ - #include #include #include @@ -36,6 +30,8 @@ #include #include +#include "xed-docinfo-plugin.h" + #define MENU_PATH "/MenuBar/ToolsMenu/ToolsOps_2" struct _XedDocInfoPluginPrivate diff --git a/plugins/filebrowser/Makefile.am b/plugins/filebrowser/Makefile.am deleted file mode 100644 index 9613fff..0000000 --- a/plugins/filebrowser/Makefile.am +++ /dev/null @@ -1,94 +0,0 @@ -# filebrowser - -plugindir = $(XED_PLUGINS_LIBS_DIR) - -AM_CPPFLAGS = \ - -I$(top_srcdir) \ - $(XED_CFLAGS) \ - $(WARN_CFLAGS) \ - $(DISABLE_DEPRECATED_CFLAGS) - -BUILT_SOURCES = \ - xed-file-browser-enum-types.h \ - xed-file-browser-enum-types.c \ - xed-file-browser-marshal.h \ - xed-file-browser-marshal.c - -plugin_LTLIBRARIES = libfilebrowser.la - -NOINST_H_FILES = \ - xed-file-bookmarks-store.h \ - xed-file-browser-store.h \ - xed-file-browser-view.h \ - xed-file-browser-widget.h \ - xed-file-browser-error.h \ - xed-file-browser-utils.h \ - xed-file-browser-plugin.h \ - xed-file-browser-messages.h - -libfilebrowser_la_SOURCES = \ - $(BUILT_SOURCES) \ - xed-file-bookmarks-store.c \ - xed-file-browser-store.c \ - xed-file-browser-view.c \ - xed-file-browser-widget.c \ - xed-file-browser-utils.c \ - xed-file-browser-plugin.c \ - xed-file-browser-messages.c \ - $(NOINST_H_FILES) - -libfilebrowser_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS) -libfilebrowser_la_LIBADD = $(XED_LIBS) - -# UI files (if you use ui for your plugin, list those files here) -uidir = $(XED_PLUGINS_DATA_DIR)/filebrowser -ui_DATA = xed-file-browser-widget-ui.xml - -plugin_in_files = filebrowser.plugin.desktop.in - -%.plugin: %.plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache - -xed-file-browser-enum-types.h: xed-file-browser-enum-types.h.template $(NOINST_H_FILES) $(GLIB_MKENUMS) - (cd $(srcdir) && $(GLIB_MKENUMS) --template xed-file-browser-enum-types.h.template $(NOINST_H_FILES)) > $@ - -xed-file-browser-enum-types.c: xed-file-browser-enum-types.c.template xed-file-browser-enum-register.c.template $(NOINST_H_FILES) $(GLIB_MKENUMS) - $(AM_V_GEN) (cd $(srcdir) && \ - $(GLIB_MKENUMS) --template xed-file-browser-enum-types.c.template $(NOINST_H_FILES) && \ - $(GLIB_MKENUMS) --template xed-file-browser-enum-register.c.template $(NOINST_H_FILES)) > $@ - -xed-file-browser-marshal.h: xed-file-browser-marshal.list $(GLIB_GENMARSHAL) - $(AM_V_GEN) $(GLIB_GENMARSHAL) $< --header --prefix=xed_file_browser_marshal > $@ - -xed-file-browser-marshal.c: xed-file-browser-marshal.list $(GLIB_GENMARSHAL) - $(AM_V_GEN) echo "#include \"xed-file-browser-marshal.h\"" > $@ && \ - $(GLIB_GENMARSHAL) $< --body --prefix=xed_file_browser_marshal >> $@ - -plugin_DATA = $(plugin_in_files:.plugin.desktop.in=.plugin) - -@INTLTOOL_XML_NOMERGE_RULE@ -filebrowser_gschema_in = org.x.editor.plugins.filebrowser.gschema.xml.in -gsettings_SCHEMAS = $(filebrowser_gschema_in:.xml.in=.xml) -@GSETTINGS_RULES@ - -EXTRA_DIST = \ - $(ui_DATA) \ - $(plugin_in_files) \ - $(filebrowser_gschema_in) \ - xed-file-browser-enum-types.h.template \ - xed-file-browser-enum-types.c.template \ - xed-file-browser-enum-register.c.template \ - xed-file-browser-marshal.list - -CLEANFILES = \ - $(plugin_DATA) \ - $(gsettings_SCHEMAS_in) \ - $(gsettings_SCHEMAS) \ - $(BUILT_SOURCES) - -DISTCLEANFILES = \ - $(plugin_DATA) \ - $(gsettings_SCHEMAS_in) \ - $(gsettings_SCHEMAS) \ - $(BUILT_SOURCES) - --include $(top_srcdir)/git.mk diff --git a/plugins/filebrowser/meson.build b/plugins/filebrowser/meson.build new file mode 100644 index 0000000..0c36112 --- /dev/null +++ b/plugins/filebrowser/meson.build @@ -0,0 +1,73 @@ +filebrowser_headers = [ + 'xed-file-bookmarks-store.h', + 'xed-file-browser-store.h', + 'xed-file-browser-view.h', + 'xed-file-browser-widget.h', + 'xed-file-browser-error.h', + 'xed-file-browser-utils.h', + 'xed-file-browser-plugin.h', + 'xed-file-browser-messages.h' +] + +filebrowser_lib_sources = [ + 'xed-file-bookmarks-store.c', + 'xed-file-browser-store.c', + 'xed-file-browser-view.c', + 'xed-file-browser-widget.c', + 'xed-file-browser-utils.c', + 'xed-file-browser-plugin.c', + 'xed-file-browser-messages.c' +] + +filebrowser_enums = gnome.mkenums_simple( + 'xed-file-browser-enum-types', + sources : filebrowser_headers, + identifier_prefix : 'XedFileBrowser', + symbol_prefix : 'xed_file_browser' +) + +filebrowser_marshal = gnome.genmarshal( + 'xed-file-browser-marshal', + sources: 'xed-file-browser-marshal.list', + prefix: 'xed_file_browser_marshal' +) + +filebrowser_deps = [ + config_h, + gio, + glib, + gmodule, + gtk, + gtksourceview, + libpeas +] + +library( + 'filebrowser', + filebrowser_headers + filebrowser_lib_sources + filebrowser_enums + filebrowser_marshal, + link_with: libxed, + dependencies: filebrowser_deps, + include_directories: include_dirs, + install_rpath: join_paths(prefix, libdir, 'xed'), + install: true, + install_dir: join_paths(libdir, 'xed', 'plugins') +) + +install_data( + 'xed-file-browser-widget-ui.xml', + install_dir: join_paths(pluginsdatadir, 'filebrowser') +) + +filebrowser_desktop = custom_target( + 'filebrowser_desktop', + input: 'filebrowser.plugin.desktop.in', + output: 'filebrowser.plugin', + command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'], + install: true, + install_dir: pluginslibdir, +) + +install_data( + 'org.x.editor.plugins.filebrowser.gschema.xml', + install_dir: schema_dir +) diff --git a/plugins/filebrowser/org.x.editor.plugins.filebrowser.gschema.xml.in b/plugins/filebrowser/org.x.editor.plugins.filebrowser.gschema.xml similarity index 100% rename from plugins/filebrowser/org.x.editor.plugins.filebrowser.gschema.xml.in rename to plugins/filebrowser/org.x.editor.plugins.filebrowser.gschema.xml diff --git a/plugins/filebrowser/xed-file-bookmarks-store.c b/plugins/filebrowser/xed-file-bookmarks-store.c index 320c8e6..c88c4b0 100644 --- a/plugins/filebrowser/xed-file-bookmarks-store.c +++ b/plugins/filebrowser/xed-file-bookmarks-store.c @@ -911,7 +911,7 @@ xed_file_bookmarks_store_get_location (XedFileBookmarksStore *model, } else if (!isfs) { - file = g_object_ref (obj); + file = G_FILE (g_object_ref (obj)); } g_object_unref (obj); diff --git a/plugins/filebrowser/xed-file-browser-enum-register.c.template b/plugins/filebrowser/xed-file-browser-enum-register.c.template deleted file mode 100644 index 0f12c21..0000000 --- a/plugins/filebrowser/xed-file-browser-enum-register.c.template +++ /dev/null @@ -1,20 +0,0 @@ -/*** BEGIN file-header ***/ -void -xed_file_browser_enum_and_flag_register_type (GTypeModule * module) -{ -/*** END file-header ***/ - -/*** BEGIN file-production ***/ - /* Enumerations from "@filename@" */ - -/*** END file-production ***/ - -/*** BEGIN enumeration-production ***/ - register_@enum_name@ (module); - -/*** END enumeration-production ***/ - -/*** BEGIN file-tail ***/ -} - -/*** END file-tail ***/ diff --git a/plugins/filebrowser/xed-file-browser-enum-types.c.template b/plugins/filebrowser/xed-file-browser-enum-types.c.template deleted file mode 100644 index 0dd98b9..0000000 --- a/plugins/filebrowser/xed-file-browser-enum-types.c.template +++ /dev/null @@ -1,45 +0,0 @@ -/*** BEGIN file-header ***/ -#include "xed-file-browser-enum-types.h" - -/*** END file-header ***/ - -/*** BEGIN file-production ***/ -/* enumerations from "@filename@" */ -#include "@filename@" - -/*** END file-production ***/ - -/*** BEGIN value-header ***/ -static GType @enum_name@_type = 0; - -static GType -register_@enum_name@ (GTypeModule *module) -{ - static const G@Type@Value values[] = { -/*** END value-header ***/ - -/*** BEGIN value-production ***/ - { @VALUENAME@, - "@VALUENAME@", - "@valuenick@" }, -/*** END value-production ***/ - -/*** BEGIN value-tail ***/ - { 0, NULL, NULL } - }; - - @enum_name@_type = - g_type_module_register_@type@ (module, - "@EnumName@", - values); - - return @enum_name@_type; -} - -GType -@enum_name@_get_type (void) -{ - return @enum_name@_type; -} - -/*** END value-tail ***/ diff --git a/plugins/filebrowser/xed-file-browser-enum-types.h.template b/plugins/filebrowser/xed-file-browser-enum-types.h.template deleted file mode 100644 index 314482b..0000000 --- a/plugins/filebrowser/xed-file-browser-enum-types.h.template +++ /dev/null @@ -1,29 +0,0 @@ -/*** BEGIN file-header ***/ -#ifndef __XED_FILE_BROWSER_ENUM_TYPES_H__ -#define __XED_FILE_BROWSER_ENUM_TYPES_H__ - -#include - -G_BEGIN_DECLS - -/*** END file-header ***/ - -/*** BEGIN file-production ***/ -/* Enumerations from "@filename@" */ - -/*** END file-production ***/ - -/*** BEGIN enumeration-production ***/ -#define XED_TYPE_@ENUMSHORT@ (@enum_name@_get_type()) -GType @enum_name@_get_type (void) G_GNUC_CONST; - -/*** END enumeration-production ***/ - -/*** BEGIN file-tail ***/ -void xed_file_browser_enum_and_flag_register_type (GTypeModule * module); - -G_END_DECLS - -#endif /* __XED_FILE_BROWSER_ENUM_TYPES_H__ */ -/*** END file-tail ***/ - diff --git a/plugins/filebrowser/xed-file-browser-marshal.list b/plugins/filebrowser/xed-file-browser-marshal.list index 9b24776..eb2b8f3 100644 --- a/plugins/filebrowser/xed-file-browser-marshal.list +++ b/plugins/filebrowser/xed-file-browser-marshal.list @@ -1,5 +1,5 @@ VOID:UINT,STRING VOID:OBJECT,OBJECT -BOOL:OBJECT,POINTER -BOOL:POINTER -BOOL:VOID +BOOLEAN:OBJECT,POINTER +BOOLEAN:POINTER +BOOLEAN:VOID diff --git a/plugins/filebrowser/xed-file-browser-plugin.c b/plugins/filebrowser/xed-file-browser-plugin.c index ec7f86e..be70b45 100644 --- a/plugins/filebrowser/xed-file-browser-plugin.c +++ b/plugins/filebrowser/xed-file-browser-plugin.c @@ -20,10 +20,7 @@ */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include @@ -111,7 +108,6 @@ G_DEFINE_DYNAMIC_TYPE_EXTENDED (XedFileBrowserPlugin, G_IMPLEMENT_INTERFACE_DYNAMIC (XED_TYPE_WINDOW_ACTIVATABLE, xed_window_activatable_iface_init) \ \ - xed_file_browser_enum_and_flag_register_type (type_module); \ _xed_file_browser_store_register_type (type_module); \ _xed_file_bookmarks_store_register_type (type_module); \ _xed_file_browser_view_register_type (type_module); \ diff --git a/plugins/filebrowser/xed-file-browser-store.c b/plugins/filebrowser/xed-file-browser-store.c index 48d1afc..f6f1361 100644 --- a/plugins/filebrowser/xed-file-browser-store.c +++ b/plugins/filebrowser/xed-file-browser-store.c @@ -19,10 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include @@ -350,7 +347,7 @@ xed_file_browser_store_class_init (XedFileBrowserStoreClass * klass) g_param_spec_flags ("filter-mode", "Filter Mode", "The filter mode", - XED_TYPE_FILE_BROWSER_STORE_FILTER_MODE, + XED_FILE_BROWSER_TYPE_STORE_FILTER_MODE, xed_file_browser_store_filter_mode_get_default (), G_PARAM_READWRITE)); @@ -384,7 +381,7 @@ xed_file_browser_store_class_init (XedFileBrowserStoreClass * klass) G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (XedFileBrowserStoreClass, no_trash), g_signal_accumulator_true_handled, NULL, - xed_file_browser_marshal_BOOL__POINTER, + xed_file_browser_marshal_BOOLEAN__POINTER, G_TYPE_BOOLEAN, 1, G_TYPE_POINTER); model_signals[RENAME] = g_signal_new ("rename", diff --git a/plugins/filebrowser/xed-file-browser-utils.c b/plugins/filebrowser/xed-file-browser-utils.c index 9c55f6b..39eb91f 100644 --- a/plugins/filebrowser/xed-file-browser-utils.c +++ b/plugins/filebrowser/xed-file-browser-utils.c @@ -19,10 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include diff --git a/plugins/filebrowser/xed-file-browser-view.c b/plugins/filebrowser/xed-file-browser-view.c index 20dac58..2d0784c 100644 --- a/plugins/filebrowser/xed-file-browser-view.c +++ b/plugins/filebrowser/xed-file-browser-view.c @@ -947,7 +947,7 @@ xed_file_browser_view_class_init (XedFileBrowserViewClass *klass) g_param_spec_enum ("click-policy", "Click Policy", "The click policy", - XED_TYPE_FILE_BROWSER_VIEW_CLICK_POLICY, + XED_FILE_BROWSER_TYPE_VIEW_CLICK_POLICY, XED_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); diff --git a/plugins/filebrowser/xed-file-browser-widget.c b/plugins/filebrowser/xed-file-browser-widget.c index f9376c2..ba046fa 100644 --- a/plugins/filebrowser/xed-file-browser-widget.c +++ b/plugins/filebrowser/xed-file-browser-widget.c @@ -19,10 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include @@ -30,7 +27,6 @@ #include #include #include - #include #include "xed-file-browser-utils.h" @@ -470,7 +466,7 @@ xed_file_browser_widget_class_init (XedFileBrowserWidgetClass *klass) confirm_delete), g_signal_accumulator_true_handled, NULL, - xed_file_browser_marshal_BOOL__OBJECT_POINTER, + xed_file_browser_marshal_BOOLEAN__OBJECT_POINTER, G_TYPE_BOOLEAN, 2, G_TYPE_OBJECT, @@ -483,7 +479,7 @@ xed_file_browser_widget_class_init (XedFileBrowserWidgetClass *klass) confirm_no_trash), g_signal_accumulator_true_handled, NULL, - xed_file_browser_marshal_BOOL__POINTER, + xed_file_browser_marshal_BOOLEAN__POINTER, G_TYPE_BOOLEAN, 1, G_TYPE_POINTER); diff --git a/plugins/meson.build b/plugins/meson.build new file mode 100644 index 0000000..35570f2 --- /dev/null +++ b/plugins/meson.build @@ -0,0 +1,16 @@ +pluginsdatadir = join_paths(datadir, 'xed', 'plugins') +pluginslibdir = join_paths(libdir, 'xed', 'plugins') + +subdir('docinfo') +subdir('filebrowser') +subdir('modelines') +subdir('sort') +subdir('taglist') +subdir('textsize') +subdir('time') +subdir('trailsave') +subdir('wordcompletion') + +if enable_spell + subdir('spell') +endif diff --git a/plugins/modelines/Makefile.am b/plugins/modelines/Makefile.am deleted file mode 100644 index e3cdc0b..0000000 --- a/plugins/modelines/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -# Modelines Plugin -plugindir = $(XED_PLUGINS_LIBS_DIR) - -AM_CPPFLAGS = \ - -I$(top_srcdir) \ - $(XED_CFLAGS) \ - $(WARN_CFLAGS) \ - $(DISABLE_DEPRECATED_CFLAGS) - -modelinesdir = $(XED_PLUGINS_DATA_DIR)/modelines -modelines_DATA = \ - language-mappings - -plugin_LTLIBRARIES = libmodelines.la - -libmodelines_la_SOURCES = \ - xed-modeline-plugin.h \ - xed-modeline-plugin.c \ - modeline-parser.h \ - modeline-parser.c - -libmodelines_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS) -libmodelines_la_LIBADD = $(XED_LIBS) - -plugin_in_files = modelines.plugin.desktop.in -%.plugin: %.plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache - -plugin_DATA = $(plugin_in_files:.plugin.desktop.in=.plugin) - -EXTRA_DIST = \ - $(plugin_in_files) \ - $(modelines_DATA) - -CLEANFILES = $(plugin_DATA) -DISTCLEANFILES = $(plugin_DATA) - - --include $(top_srcdir)/git.mk diff --git a/plugins/modelines/meson.build b/plugins/modelines/meson.build new file mode 100644 index 0000000..d1da146 --- /dev/null +++ b/plugins/modelines/meson.build @@ -0,0 +1,40 @@ +modelines_sources = [ + 'xed-modeline-plugin.h', + 'xed-modeline-plugin.c', + 'modeline-parser.h', + 'modeline-parser.c' +] + +modelines_deps = [ + config_h, + glib, + gmodule, + gtk, + gtksourceview, + libpeas +] + +library( + 'modelines', + modelines_sources, + link_with: libxed, + dependencies: modelines_deps, + include_directories: include_dirs, + install_rpath: join_paths(prefix, libdir, 'xed'), + install: true, + install_dir: join_paths(libdir, 'xed', 'plugins') +) + +install_data( + 'language-mappings', + install_dir: join_paths(pluginsdatadir, 'modelines') +) + +modelines_desktop = custom_target( + 'modelines_desktop', + input: 'modelines.plugin.desktop.in', + output: 'modelines.plugin', + command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'], + install: true, + install_dir: pluginslibdir, +) diff --git a/plugins/modelines/xed-modeline-plugin.c b/plugins/modelines/xed-modeline-plugin.c index b75ab3f..03db3d9 100644 --- a/plugins/modelines/xed-modeline-plugin.c +++ b/plugins/modelines/xed-modeline-plugin.c @@ -19,19 +19,16 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifdef HAVE_CONFIG_H -# include -#endif - +#include #include #include -#include "xed-modeline-plugin.h" -#include "modeline-parser.h" - #include #include #include +#include "xed-modeline-plugin.h" +#include "modeline-parser.h" + struct _XedModelinePluginPrivate { XedView *view; diff --git a/plugins/sort/Makefile.am b/plugins/sort/Makefile.am deleted file mode 100644 index 075c56e..0000000 --- a/plugins/sort/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ -# sort plugin -plugindir = $(XED_PLUGINS_LIBS_DIR) - -AM_CPPFLAGS = \ - -I$(top_srcdir) \ - $(XED_CFLAGS) \ - $(WARN_CFLAGS) \ - $(DISABLE_DEPRECATED_CFLAGS) - -plugin_LTLIBRARIES = libsort.la - -libsort_la_SOURCES = \ - xed-sort-plugin.h \ - xed-sort-plugin.c - -libsort_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS) -libsort_la_LIBADD = $(XED_LIBS) - -plugin_in_files = sort.plugin.desktop.in - -%.plugin: %.plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache - -plugin_DATA = $(plugin_in_files:.plugin.desktop.in=.plugin) - -EXTRA_DIST = $(plugin_in_files) - -CLEANFILES = $(plugin_DATA) -DISTCLEANFILES = $(plugin_DATA) - - --include $(top_srcdir)/git.mk diff --git a/plugins/sort/meson.build b/plugins/sort/meson.build new file mode 100644 index 0000000..6faf12e --- /dev/null +++ b/plugins/sort/meson.build @@ -0,0 +1,31 @@ +sort_sources = [ + 'xed-sort-plugin.h', + 'xed-sort-plugin.c' +] + +sort_deps = [ + config_h, + glib, + gtksourceview, + libpeas +] + +library( + 'sort', + sort_sources, + link_with: libxed, + dependencies: sort_deps, + include_directories: include_dirs, + install_rpath: join_paths(prefix, libdir, 'xed'), + install: true, + install_dir: join_paths(libdir, 'xed', 'plugins'), +) + +sort_desktop = custom_target( + 'sort_desktop', + input: 'sort.plugin.desktop.in', + output: 'sort.plugin', + command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'], + install: true, + install_dir: pluginslibdir, +) diff --git a/plugins/sort/xed-sort-plugin.c b/plugins/sort/xed-sort-plugin.c index 6de63ea..aec8c6a 100644 --- a/plugins/sort/xed-sort-plugin.c +++ b/plugins/sort/xed-sort-plugin.c @@ -21,22 +21,18 @@ * $Id$ */ -#ifdef HAVE_CONFIG_H #include -#endif - -#include "xed-sort-plugin.h" - #include #include #include - #include #include #include #include #include +#include "xed-sort-plugin.h" + #define XED_SORT_PLUGIN_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), XED_TYPE_SORT_PLUGIN, XedSortPluginPrivate)) #define MENU_PATH "/MenuBar/EditMenu/EditOps_6" diff --git a/plugins/spell/Makefile.am b/plugins/spell/Makefile.am deleted file mode 100644 index 504a4f0..0000000 --- a/plugins/spell/Makefile.am +++ /dev/null @@ -1,58 +0,0 @@ -# Spell checker plugin -plugindir = $(XED_PLUGINS_LIBS_DIR) - -AM_CPPFLAGS = \ - -I$(top_srcdir) \ - $(XED_CFLAGS) \ - $(GSPELL_CFLAGS) \ - $(WARN_CFLAGS) \ - $(DISABLE_DEPRECATED_CFLAGS) - -BUILT_SOURCES = \ - xed-spell-marshal.c \ - xed-spell-marshal.h - -plugin_LTLIBRARIES = libspell.la - -libspell_la_SOURCES = \ - xed-spell-plugin.c \ - xed-spell-plugin.h \ - $(BUILT_SOURCES) - -libspell_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS) -libspell_la_LIBADD = $(XED_LIBS) $(GSPELL_LIBS) - -uidir = $(XED_PLUGINS_DATA_DIR)/spell -ui_DATA = xed-spell-setup-dialog.ui - -xed-spell-marshal.h: xed-spell-marshal.list $(GLIB_GENMARSHAL) - $(AM_V_GEN) $(GLIB_GENMARSHAL) $< --header --prefix=xed_marshal > $@ - -xed-spell-marshal.c: xed-spell-marshal.list $(GLIB_GENMARSHAL) - $(AM_V_GEN) echo "#include \"xed-spell-marshal.h\"" > $@ && \ - $(GLIB_GENMARSHAL) $< --body --prefix=xed_marshal >> $@ - -plugin_in_files = spell.plugin.desktop.in - -%.plugin: %.plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache - -plugin_DATA = $(plugin_in_files:.plugin.desktop.in=.plugin) - -@INTLTOOL_XML_NOMERGE_RULE@ -spell_gschema_in = org.x.editor.plugins.spell.gschema.xml.in -gsettings_SCHEMAS = $(spell_gschema_in:.xml.in=.xml) -@GSETTINGS_RULES@ - - -EXTRA_DIST = \ - $(ui_DATA) \ - $(plugin_in_files) \ - xed-spell-marshal.list \ - $(spell_gschema_in) - -CLEANFILES = $(BUILT_SOURCES) $(plugin_DATA) $(gsettings_SCHEMAS) - -dist-hook: - cd $(distdir); rm -f $(BUILT_SOURCES) - --include $(top_srcdir)/git.mk diff --git a/plugins/spell/meson.build b/plugins/spell/meson.build new file mode 100644 index 0000000..c49d37b --- /dev/null +++ b/plugins/spell/meson.build @@ -0,0 +1,57 @@ +spell_sources = [ + 'xed-spell-plugin.c', + 'xed-spell-plugin.h' +] + +spell_marshal = gnome.genmarshal( + 'xed-spell-marshal', + sources: 'xed-spell-marshal.list', + prefix: 'xed_spell_marshal' +) + +spell_deps = [ + config_h, + glib, + gspell, + gtksourceview, + libpeas, + libpeas_gtk +] + +library( + 'spell', + spell_sources + spell_marshal, + link_with: libxed, + dependencies: spell_deps, + include_directories: include_dirs, + install_rpath: join_paths(prefix, libdir, 'xed'), + install: true, + install_dir: join_paths(libdir, 'xed', 'plugins') +) + +install_data( + 'xed-spell-setup-dialog.ui', + install_dir: join_paths(pluginsdatadir, 'spell') +) + +spell_desktop = custom_target( + 'spell_desktop', + input: 'spell.plugin.desktop.in', + output: 'spell.plugin', + command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'], + install: true, + install_dir: pluginslibdir, +) + + +spell_schema_file = configure_file( + input: 'org.x.editor.plugins.spell.gschema.xml.in', + output: 'org.x.editor.plugins.spell.gschema.xml', + configuration: schema_conf, + install_dir: join_paths(datadir, 'glib-2.0', 'schemas') +) + +install_data( + spell_schema_file, + install_dir: schema_dir +) diff --git a/plugins/spell/xed-spell-plugin.c b/plugins/spell/xed-spell-plugin.c index 6e1aac1..e0340c9 100644 --- a/plugins/spell/xed-spell-plugin.c +++ b/plugins/spell/xed-spell-plugin.c @@ -19,14 +19,9 @@ */ #include - -#include "xed-spell-plugin.h" - #include /* For strlen */ - #include #include - #include #include #include @@ -34,6 +29,8 @@ #include #include +#include "xed-spell-plugin.h" + #define XED_METADATA_ATTRIBUTE_SPELL_LANGUAGE "metadata::xed-spell-language" #define XED_METADATA_ATTRIBUTE_SPELL_ENABLED "metadata::xed-spell-enabled" diff --git a/plugins/taglist/Makefile.am b/plugins/taglist/Makefile.am deleted file mode 100644 index 124d427..0000000 --- a/plugins/taglist/Makefile.am +++ /dev/null @@ -1,60 +0,0 @@ -# Tag list plugin -plugindir = $(XED_PLUGINS_LIBS_DIR) - -taglistdir = $(XED_PLUGINS_DATA_DIR)/taglist - -taglist_in_files = \ - HTML.tags.xml.in \ - Latex.tags.xml.in \ - XSLT.tags.xml.in \ - XUL.tags.xml.in - -taglist_DATA = $(taglist_in_files:.tags.xml.in=.tags.gz) - -AM_CPPFLAGS = \ - -I$(top_srcdir) \ - $(XED_CFLAGS) \ - $(WARN_CFLAGS) \ - $(DISABLE_DEPRECATED_CFLAGS) - -plugin_LTLIBRARIES = libtaglist.la - -libtaglist_la_SOURCES = \ - xed-taglist-plugin-parser.c \ - xed-taglist-plugin-parser.h \ - xed-taglist-plugin-panel.c \ - xed-taglist-plugin-panel.h \ - xed-taglist-plugin.c \ - xed-taglist-plugin.h - -libtaglist_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS) -libtaglist_la_LIBADD = $(XED_LIBS) - -plugin_in_files = taglist.plugin.desktop.in - -%.plugin: %.plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) - $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache - -GZIP_ENV = -9 - -%.tags.gz: %.tags.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) - LC_ALL=C $(INTLTOOL_MERGE) $(top_srcdir)/po $< $(@:.gz=) -x -u -c $(top_builddir)/po/.intltool-merge-cache - GZIP=$(GZIP_ENV) gzip -n -f $(@:.gz=) - -plugin_DATA = $(plugin_in_files:.plugin.desktop.in=.plugin) - -EXTRA_DIST = \ - $(taglist_in_files) $(taglist_DATA) \ - $(plugin_in_files) $(plugin_DATA) - -CLEANFILES = \ - $(taglist_DATA) \ - $(plugin_DATA) -DISTCLEANFILES = \ - $(taglist_DATA) \ - $(plugin_DATA) - - - - --include $(top_srcdir)/git.mk diff --git a/plugins/taglist/meson.build b/plugins/taglist/meson.build new file mode 100644 index 0000000..bc7d382 --- /dev/null +++ b/plugins/taglist/meson.build @@ -0,0 +1,63 @@ +taglist_sources = [ + 'xed-taglist-plugin-parser.c', + 'xed-taglist-plugin-parser.h', + 'xed-taglist-plugin-panel.c', + 'xed-taglist-plugin-panel.h', + 'xed-taglist-plugin.c', + 'xed-taglist-plugin.h' +] + +taglist_in_files = [ + 'C.tags@0@', + 'HTML.tags@0@', + 'Latex.tags@0@', + 'XSLT.tags@0@', + 'XUL.tags@0@' +] + +taglist_deps = [ + config_h, + glib, + gtk, + gtksourceview, + libpeas, + libxml +] + +library( + 'taglist', + taglist_sources, + link_with: libxed, + dependencies: taglist_deps, + include_directories: include_dirs, + install_rpath: join_paths(prefix, libdir, 'xed'), + install: true, + install_dir: join_paths(libdir, 'xed', 'plugins') +) + +taglist_desktop = custom_target( + 'taglist_desktop', + input: 'taglist.plugin.desktop.in', + output: 'taglist.plugin', + command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'], + install: true, + install_dir: pluginslibdir, +) + +foreach tagtype : taglist_in_files + taglist_xml = custom_target( + '@0@xmltags'.format(tagtype.format('')), + input: tagtype.format('.xml.in'), + output: tagtype.format(''), + command: [intltool_merge, '-x', '-u', po_dir, '@INPUT@', '@OUTPUT@'], + ) + + taglist_gz = custom_target( + '@0@gztags'.format(tagtype.format('')), + input: taglist_xml, + output: tagtype.format('.gz'), + command: ['gzip', '-9', '-n', '-f', '@INPUT@'], + install: true, + install_dir: join_paths(pluginsdatadir, 'taglist') + ) +endforeach diff --git a/plugins/taglist/xed-taglist-plugin-panel.c b/plugins/taglist/xed-taglist-plugin-panel.c index 17d52fe..3d578ff 100644 --- a/plugins/taglist/xed-taglist-plugin-panel.c +++ b/plugins/taglist/xed-taglist-plugin-panel.c @@ -28,22 +28,17 @@ * $Id$ */ -#ifdef HAVE_CONFIG_H #include -#endif - #include - -#include "xed-taglist-plugin-panel.h" -#include "xed-taglist-plugin-parser.h" - #include #include - #include #include #include +#include "xed-taglist-plugin-panel.h" +#include "xed-taglist-plugin-parser.h" + #define XED_TAGLIST_PLUGIN_PANEL_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \ XED_TYPE_TAGLIST_PLUGIN_PANEL, \ XedTaglistPluginPanelPrivate)) diff --git a/plugins/taglist/xed-taglist-plugin-parser.c b/plugins/taglist/xed-taglist-plugin-parser.c index bb0bdc1..66666cf 100644 --- a/plugins/taglist/xed-taglist-plugin-parser.c +++ b/plugins/taglist/xed-taglist-plugin-parser.c @@ -30,15 +30,11 @@ /* FIXME: we should rewrite the parser to avoid using DOM */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include #include - #include #include "xed-taglist-plugin-parser.h" diff --git a/plugins/taglist/xed-taglist-plugin.c b/plugins/taglist/xed-taglist-plugin.c index ea23652..4424f84 100644 --- a/plugins/taglist/xed-taglist-plugin.c +++ b/plugins/taglist/xed-taglist-plugin.c @@ -27,20 +27,16 @@ * $Id$ */ -#ifdef HAVE_CONFIG_H #include -#endif +#include +#include +#include +#include #include "xed-taglist-plugin.h" #include "xed-taglist-plugin-panel.h" #include "xed-taglist-plugin-parser.h" -#include - -#include -#include -#include - #define XED_TAGLIST_PLUGIN_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), XED_TYPE_TAGLIST_PLUGIN, XedTaglistPluginPrivate)) struct _XedTaglistPluginPrivate diff --git a/plugins/textsize/Makefile.am b/plugins/textsize/Makefile.am deleted file mode 100644 index 7088890..0000000 --- a/plugins/textsize/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -# Textsize Plugin -SUBDIRS = textsize -plugindir = $(XED_PLUGINS_LIBS_DIR) - -plugin_in_files = textsize.plugin.desktop.in -%.plugin: %.plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache - -plugin_DATA = $(plugin_in_files:.plugin.desktop.in=.plugin) - -EXTRA_DIST = \ - $(plugin_in_files) - -CLEANFILES = $(plugin_DATA) -DISTCLEANFILES = $(plugin_DATA) - --include $(top_srcdir)/git.mk diff --git a/plugins/textsize/meson.build b/plugins/textsize/meson.build new file mode 100644 index 0000000..a3270a3 --- /dev/null +++ b/plugins/textsize/meson.build @@ -0,0 +1,13 @@ +install_subdir( + 'textsize', + install_dir: pluginslibdir +) + +textsize_desktop = custom_target( + 'textsize_desktop', + input: 'textsize.plugin.desktop.in', + output: 'textsize.plugin', + command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'], + install: true, + install_dir: pluginslibdir, +) diff --git a/plugins/textsize/textsize/Makefile.am b/plugins/textsize/textsize/Makefile.am deleted file mode 100644 index 2999d65..0000000 --- a/plugins/textsize/textsize/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -plugindir = $(XED_PLUGINS_LIBS_DIR)/textsize - -plugin_PYTHON = \ - __init__.py \ - signals.py \ - documenthelper.py - -CLEANFILES = -DISTCLEANFILES = - --include $(top_srcdir)/git.mk diff --git a/plugins/time/Makefile.am b/plugins/time/Makefile.am deleted file mode 100644 index 808aef0..0000000 --- a/plugins/time/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -# time plugin -plugindir = $(XED_PLUGINS_LIBS_DIR) - -AM_CPPFLAGS = \ - -I$(top_srcdir) \ - $(XED_CFLAGS) \ - $(WARN_CFLAGS) \ - $(DISABLE_DEPRECATED_CFLAGS) - -plugin_LTLIBRARIES = libtime.la - -libtime_la_SOURCES = \ - xed-time-plugin.h \ - xed-time-plugin.c - -libtime_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS) -libtime_la_LIBADD = $(XED_LIBS) - -uidir = $(XED_PLUGINS_DATA_DIR)/time -ui_DATA = \ - xed-time-dialog.ui \ - xed-time-setup-dialog.ui - -plugin_in_files = time.plugin.desktop.in - -%.plugin: %.plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache - -plugin_DATA = $(plugin_in_files:.plugin.desktop.in=.plugin) - -@INTLTOOL_XML_NOMERGE_RULE@ -time_gschema_in = org.x.editor.plugins.time.gschema.xml.in -gsettings_SCHEMAS = $(time_gschema_in:.xml.in=.xml) -@GSETTINGS_RULES@ - -EXTRA_DIST = $(ui_DATA) $(plugin_in_files) $(time_gschema_in) - -CLEANFILES = $(plugin_DATA) $(gsettings_SCHEMAS_in) $(gsettings_SCHEMASn) -DISTCLEANFILES = $(plugin_DATA) $(gsettings_SCHEMAS_in) $(gsettings_SCHEMAS) - - --include $(top_srcdir)/git.mk diff --git a/plugins/time/meson.build b/plugins/time/meson.build new file mode 100644 index 0000000..68082da --- /dev/null +++ b/plugins/time/meson.build @@ -0,0 +1,55 @@ +time_sources = [ + 'xed-time-plugin.h', + 'xed-time-plugin.c' +] + +time_deps = [ + config_h, + gio, + glib, + gtksourceview, + libpeas, + libpeas_gtk +] + +library( + 'time', + time_sources, + link_with: libxed, + dependencies: time_deps, + include_directories: include_dirs, + install_rpath: join_paths(prefix, libdir, 'xed'), + install: true, + install_dir: join_paths(libdir, 'xed', 'plugins') +) + +time_ui_sources = [ + 'xed-time-dialog.ui', + 'xed-time-setup-dialog.ui' +] + +install_data( + time_ui_sources, + install_dir: join_paths(pluginsdatadir, 'time') +) + +time_desktop = custom_target( + 'time_desktop', + input: 'time.plugin.desktop.in', + output: 'time.plugin', + command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'], + install: true, + install_dir: pluginslibdir, +) + +time_schema_file = configure_file( + input: 'org.x.editor.plugins.time.gschema.xml.in', + output: 'org.x.editor.plugins.time.gschema.xml', + configuration: schema_conf, + install_dir: join_paths(datadir, 'glib-2.0', 'schemas') +) + +install_data( + time_schema_file, + install_dir: schema_dir +) diff --git a/plugins/time/xed-time-plugin.c b/plugins/time/xed-time-plugin.c index 7d2983e..87d58de 100644 --- a/plugins/time/xed-time-plugin.c +++ b/plugins/time/xed-time-plugin.c @@ -24,22 +24,18 @@ * See the ChangeLog files for a list of changes. */ -#ifdef HAVE_CONFIG_H #include -#endif - #include - #include #include #include - #include #include #include #include #include #include + #include "xed-time-plugin.h" #define XED_TIME_PLUGIN_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \ diff --git a/plugins/trailsave/Makefile.am b/plugins/trailsave/Makefile.am deleted file mode 100644 index 5705584..0000000 --- a/plugins/trailsave/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ -# trailsave plugin -plugindir = $(XED_PLUGINS_LIBS_DIR) - -AM_CPPFLAGS = \ - -I$(top_srcdir) \ - $(XED_CFLAGS) \ - $(WARN_CFLAGS) \ - $(DISABLE_DEPRECATED_CFLAGS) - -plugin_LTLIBRARIES = libtrailsave.la - -libtrailsave_la_SOURCES = \ - xed-trail-save-plugin.h \ - xed-trail-save-plugin.c - -libtrailsave_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS) -libtrailsave_la_LIBADD = $(XED_LIBS) - -plugin_in_files = trailsave.plugin.desktop.in - -%.plugin: %.plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache - -plugin_DATA = $(plugin_in_files:.plugin.desktop.in=.plugin) - -EXTRA_DIST = $(plugin_in_files) - -CLEANFILES = $(plugin_DATA) -DISTCLEANFILES = $(plugin_DATA) - - --include $(top_srcdir)/git.mk diff --git a/plugins/trailsave/meson.build b/plugins/trailsave/meson.build new file mode 100644 index 0000000..4d70483 --- /dev/null +++ b/plugins/trailsave/meson.build @@ -0,0 +1,31 @@ +trailsave_sources = [ + 'xed-trail-save-plugin.h', + 'xed-trail-save-plugin.c' +] + +trailsave_deps = [ + config_h, + glib, + gtksourceview, + libpeas +] + +library( + 'trailsave', + trailsave_sources, + link_with: libxed, + dependencies: trailsave_deps, + include_directories: include_dirs, + install_rpath: join_paths(prefix, libdir, 'xed'), + install: true, + install_dir: join_paths(libdir, 'xed', 'plugins') +) + +trailsave_desktop = custom_target( + 'trailsave_desktop', + input: 'trailsave.plugin.desktop.in', + output: 'trailsave.plugin', + command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'], + install: true, + install_dir: pluginslibdir, +) diff --git a/plugins/trailsave/xed-trail-save-plugin.c b/plugins/trailsave/xed-trail-save-plugin.c index 288e5e8..4829fdf 100644 --- a/plugins/trailsave/xed-trail-save-plugin.c +++ b/plugins/trailsave/xed-trail-save-plugin.c @@ -16,18 +16,14 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifdef HAVE_CONFIG_H #include -#endif - #include - -#include "xed-trail-save-plugin.h" - #include #include #include +#include "xed-trail-save-plugin.h" + #define XED_TRAIL_SAVE_PLUGIN_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \ XED_TYPE_TRAIL_SAVE_PLUGIN, \ XedTrailSavePluginPrivate)) diff --git a/plugins/wordcompletion/Makefile.am b/plugins/wordcompletion/Makefile.am deleted file mode 100644 index 6d540e7..0000000 --- a/plugins/wordcompletion/Makefile.am +++ /dev/null @@ -1,49 +0,0 @@ -# Word completion plugin -plugindir = $(XED_PLUGINS_LIBS_DIR) - -AM_CPPFLAGS = \ - -I$(top_srcdir) \ - $(XED_CFLAGS) \ - $(ENCHANT_CFLAGS) \ - $(WARN_CFLAGS) \ - $(DISABLE_DEPRECATED_CFLAGS) - -plugin_LTLIBRARIES = libwordcompletion.la - -libwordcompletion_la_SOURCES = \ - xed-wordcompletion-plugin.h \ - xed-wordcompletion-plugin.c - -libwordcompletion_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS) -libwordcompletion_la_LIBADD = $(XED_LIBS) $(ENCHANT_LIBS) - -plugin_in_files = wordcompletion.plugin.desktop.in - -%.plugin: %.plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache - -plugin_DATA = $(plugin_in_files:.plugin.desktop.in=.plugin) - -uidir = $(XED_PLUGINS_DATA_DIR)/wordcompletion -ui_DATA = xed-wordcompletion-configure.ui - -@INTLTOOL_XML_NOMERGE_RULE@ -wordcompletion_gschema_in = org.x.editor.plugins.wordcompletion.gschema.xml.in -gsettings_SCHEMAS = $(wordcompletion_gschema_in:.xml.in=.xml) -@GSETTINGS_RULES@ - -EXTRA_DIST = \ - $(plugin_in_files) \ - $(wordcompletion_gschema_in) - - -CLEANFILES = \ - $(plugin_DATA) \ - $(gsettings_SCHEMAS) - -DISTCLEANFILES = \ - $(plugin_DATA) - -dist-hook: - cd $(distdir); rm -f $(BUILT_SOURCES) - --include $(top_srcdir)/git.mk diff --git a/plugins/wordcompletion/meson.build b/plugins/wordcompletion/meson.build new file mode 100644 index 0000000..2114984 --- /dev/null +++ b/plugins/wordcompletion/meson.build @@ -0,0 +1,43 @@ +wordcompletion_sources = [ + 'xed-wordcompletion-plugin.h', + 'xed-wordcompletion-plugin.c' +] + +wordcompletion_deps = [ + config_h, + gio, + glib, + gtksourceview, + libpeas, + libpeas_gtk +] + +library( + 'wordcompletion', + wordcompletion_sources, + link_with: libxed, + dependencies: wordcompletion_deps, + include_directories: include_dirs, + install_rpath: join_paths(prefix, libdir, 'xed'), + install: true, + install_dir: join_paths(libdir, 'xed', 'plugins') +) + +wordcompletion_desktop = custom_target( + 'wordcompletion_desktop', + input: 'wordcompletion.plugin.desktop.in', + output: 'wordcompletion.plugin', + command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'], + install: true, + install_dir: pluginslibdir, +) + +install_data( + 'xed-wordcompletion-configure.ui', + install_dir: join_paths(pluginsdatadir, 'wordcompletion') +) + +install_data( + 'org.x.editor.plugins.wordcompletion.gschema.xml', + install_dir: schema_dir +) diff --git a/plugins/wordcompletion/xed-wordcompletion-plugin.c b/plugins/wordcompletion/xed-wordcompletion-plugin.c index e1c58d8..3a49c1d 100644 --- a/plugins/wordcompletion/xed-wordcompletion-plugin.c +++ b/plugins/wordcompletion/xed-wordcompletion-plugin.c @@ -19,16 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifdef HAVE_CONFIG_H #include -#endif - -#include "xed-wordcompletion-plugin.h" - #include #include #include - #include #include #include @@ -39,6 +33,8 @@ #include #include +#include "xed-wordcompletion-plugin.h" + #define WINDOW_PROVIDER "XedWordCompletionPluginProvider" #define WORDCOMPLETION_SETTINGS_BASE "org.x.editor.plugins.wordcompletion" diff --git a/po/POTFILES.in b/po/POTFILES.in index d4965b3..a3c2433 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -65,7 +65,7 @@ plugins/docinfo/docinfo.plugin.desktop.in [type: gettext/glade]plugins/docinfo/docinfo.ui plugins/docinfo/xed-docinfo-plugin.c plugins/filebrowser/filebrowser.plugin.desktop.in -[type: gettext/gsettings]plugins/filebrowser/org.x.editor.plugins.filebrowser.gschema.xml.in +[type: gettext/gsettings]plugins/filebrowser/org.x.editor.plugins.filebrowser.gschema.xml plugins/filebrowser/xed-file-bookmarks-store.c plugins/filebrowser/xed-file-browser-messages.c plugins/filebrowser/xed-file-browser-plugin.c diff --git a/po/meson.build b/po/meson.build new file mode 100644 index 0000000..7e0548c --- /dev/null +++ b/po/meson.build @@ -0,0 +1,3 @@ +i18n.gettext('xed', + preset: 'glib' +) diff --git a/tools/generate-plugin.py b/tools/generate-plugin.py index db6b66c..0cba4c3 100755 --- a/tools/generate-plugin.py +++ b/tools/generate-plugin.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # generate-plugin.py - xed plugin skeletton generator @@ -18,100 +18,46 @@ # # You should have received a copy of the GNU General Public License # along with xed; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, +# Foundation, Inc., 51 Franklin St, Fifth Floor, # Boston, MA 02110-1301 USA import re import os -import sys -import getopt +import argparse from datetime import date import preprocessor -# Default values of command line options -options = { - 'language' : 'c', - 'description' : 'Type here a short description of your plugin', - 'author' : os.getenv('USERNAME'), - 'email' : os.getenv('LOGNAME') + '@email.com', - 'standalone' : False, - 'with-side-pane' : False, - 'with-bottom-pane' : False, - 'with-menu' : False, - 'with-config-dlg' : False -} - -USAGE = """Usage: - %s [OPTIONS...] pluginname -""" % os.path.basename(sys.argv[0]) -HELP = USAGE + """ -generate skeleton source tree for a new xed plugin. - -Options: - --author Set the author name - --email Set the author email - --description Set the description you want for your new plugin - --standalone Is this plugin intended to be distributed as a - standalone package ? (N/A) - --language / -l Set the language (C) [default: %(language)s] - --with-$feature Enable $feature - --without-$feature Disable $feature - --help / -h Show this message and exits - -Features: - config-dlg Plugin configuration dialog - menu Plugin menu entries - side-pane Side pane item (N/A) - bottom-pane Bottom pane item (N/A) -""" % options - -TEMPLATE_DIR = os.path.join(os.path.dirname(sys.argv[0]), "plugin_template") +TEMPLATE_DIR = os.path.join(os.path.dirname(__file__), 'plugin_template') +PLUGIN_DIR = os.path.normpath(os.path.join(os.path.dirname(__file__), '../plugins')) # Parsing command line options -try: - opts, args = getopt.getopt(sys.argv[1:], - 'l:h', - ['language=', - 'description=', - 'author=', - 'email=', - 'standalone', - 'with-menu' , 'without-menu', - 'with-side-pane' , 'without-side-pane', - 'with-bottom-pane' , 'without-bottom-pane', - 'with-config-dlg' , 'without-config-dlg', - 'help']) -except getopt.error, exc: - print >>sys.stderr, '%s: %s' % (sys.argv[0], str(exc)) - print >>sys.stderr, USAGE - sys.exit(1) +parser = argparse.ArgumentParser() +parser.add_argument('-S', '--standalone', dest='standalone', action='store_true', + help='indicates that this plugin is intended to be distributed as a standalone package') +parser.add_argument('-s', '--with-side-pane', dest='side_pane', action='store_true', + help='Indicates that this plugin will use a side pane') +parser.add_argument('-b', '--with-bottom-pane', dest='bottom_pane', action='store_true', + help='Indicates that this plugin will use a bottom pane') +parser.add_argument('-m', '--with-menu', dest='menu', action='store_true', + help='Indicates that this plugin will use menu entries') +parser.add_argument('-c', '--with-config', dest='config', action='store_true', + help='Indicates that this plugin will use a configuration dialog') +parser.add_argument('-d', '--description', dest='description', default='Type here a short description of your plugin', metavar='DESC', + help='Description of the plugin') +parser.add_argument('-a', '--author', dest='author', default=os.getenv('USERNAME'), metavar='AUTH', + help='Author of the plugin') +parser.add_argument('-e', '--email', dest='email', default=os.getenv('LOGNAME') + '@email.com', metavar='EMAIL', + help='Email address of the author') +parser.add_argument('-l', '--language', dest='language', default='c', metavar='LANG', + help='Language of the plugin') +parser.add_argument('-o', '--output-directory', dest='directory', default=None, metavar='LANG', + help='Language of the plugin') +parser.add_argument('name', metavar='PLUGIN_NAME', + help='The name of the plugin') -for opt, arg in opts: - if opt in ('-h', '--help'): - print >>sys.stderr, HELP - sys.exit(0) +args = parser.parse_args() - elif opt in ('--description', '--author', '--email'): - options[opt[2:]] = arg - - elif opt in ('-l', '--language'): - options['language'] = arg.lower() - - elif opt == '--standalone': - options['standalone'] = True - - elif opt[0:7] == '--with-': - options['with-' + opt[7:]] = True - - elif opt[0:10] == '--without-': - options['with-' + opt[10:]] = False - -# What's the new plugin name ? -if len(args) < 1: - print >>sys.stderr, USAGE - sys.exit(1) - -plugin_name = args[0] +plugin_name = args.name plugin_id = re.sub('[^a-z0-9_]', '', plugin_name.lower().replace(' ', '_')) plugin_module = plugin_id.replace('_', '-') @@ -119,64 +65,97 @@ directives = { 'PLUGIN_NAME' : plugin_name, 'PLUGIN_MODULE' : plugin_module, 'PLUGIN_ID' : plugin_id, - 'AUTHOR_FULLNAME' : options['author'], - 'AUTHOR_EMAIL' : options['email'], + 'AUTHOR_FULLNAME' : args.author, + 'AUTHOR_EMAIL' : args.email, 'DATE_YEAR' : date.today().year, - 'DESCRIPTION' : options['description'], + 'DESCRIPTION' : args.description, } # Files to be generated by the preprocessor, in the form "template : outfile" output_files = { - 'Makefile.am': '%s/Makefile.am' % plugin_module, - 'xed-plugin.desktop.in': '%s/%s.xed-plugin.desktop.in' % (plugin_module, plugin_module) + 'meson.build': 'meson.build', + 'xed-plugin.desktop.in': '%s.plugin.desktop.in' % plugin_module } -if options['language'] == 'c': - output_files['xed-plugin.c'] = '%s/%s-plugin.c' % (plugin_module, plugin_module) - output_files['xed-plugin.h'] = '%s/%s-plugin.h' % (plugin_module, plugin_module) -else: - print >>sys.stderr, 'Value of --language should be C' - print >>sys.stderr, USAGE - sys.exit(1) +if args.language == 'c': + directives['HAS_C_FILES'] = True + output_files['xed-plugin.c'] = 'xed-%s-plugin.c' % plugin_module + output_files['xed-plugin.h'] = 'xed-%s-plugin.h' % plugin_module -if options['standalone']: - output_files['configure.ac'] = 'configure.ac' - -if options['with-side-pane']: +if args.side_pane: directives['WITH_SIDE_PANE'] = True -if options['with-bottom-pane']: +if args.bottom_pane: directives['WITH_BOTTOM_PANE'] = True -if options['with-menu']: +if args.menu: directives['WITH_MENU'] = True - -if options['with-config-dlg']: + +if args.config: directives['WITH_CONFIGURE_DIALOG'] = True - + +if args.directory is None: + directory = os.getcwd() if args.standalone else PLUGIN_DIR +elif os.path.isdir(args.directory): + directory = args.directory +else: + print('Unable to create plugin: %s does not exist or is not a directory' % args.directory) + quit(1) + +directory = os.path.join(directory, plugin_module) +if os.path.exists(directory): + print('Unable to create plugin: directory %s already exists' % directory) + quit(1) +else: + os.makedirs(directory) + +if not args.standalone: + with open(os.path.join(PLUGIN_DIR, 'meson.build'), 'r') as f: + contents = f.read() + lines = contents.split('\n') + + start = False + for i in range(len(lines)): + line = lines[i].rstrip() + print(line) + if line.startswith('subdir('): + start = True + elif start: + break + else: + continue + + if line[8:-2] > plugin_module: + break + + lines.insert(i, 'subdir(\'%s\')' % plugin_module) + + with open(os.path.join(PLUGIN_DIR, 'meson.build'), 'w') as f: + f.write('\n'.join(lines)) # Generate the plugin base for infile, outfile in output_files.iteritems(): - print 'Processing %s\n' \ - ' into %s...' % (infile, outfile) + print('Generating file %s from template %s...' % (outfile, infile)) + + file_directives = directives.copy() infile = os.path.join(TEMPLATE_DIR, infile) - outfile = os.path.join(os.getcwd(), outfile) + outfile = os.path.join(directory, outfile) if not os.path.isfile(infile): - print >>sys.stderr, 'Input file does not exist : %s.' % os.path.basename(infile) + print('Input file %s does not exist: skipping' % os.path.basename(infile)) continue - + # Make sure the destination directory exists if not os.path.isdir(os.path.split(outfile)[0]): os.makedirs(os.path.split(outfile)[0]) - + # Variables relative to the generated file - directives['DIRNAME'], directives['FILENAME'] = os.path.split(outfile) + file_directives['DIRNAME'], file_directives['FILENAME'] = os.path.split(outfile) # Generate the file - preprocessor.process(infile, outfile, directives.copy()) + preprocessor.process(infile, outfile, file_directives) -print 'Done.' +print('Done') # ex:ts=4:et: diff --git a/tools/plugin_template/Makefile.am b/tools/plugin_template/Makefile.am deleted file mode 100644 index d6892e4..0000000 --- a/tools/plugin_template/Makefile.am +++ /dev/null @@ -1,37 +0,0 @@ -# ##(PLUGIN_NAME) - -plugindir = $(XED_PLUGINS_LIBS_DIR) - -AM_CPPFLAGS = \ - -I$(top_srcdir) \ - $(XED_CFLAGS) \ - $(WARN_CFLAGS) \ - $(DISABLE_DEPRECATED_CFLAGS) \ - -DXED_LOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\" - -plugin_LTLIBRARIES = lib##(PLUGIN_MODULE).la - -lib##(PLUGIN_MODULE)_la_SOURCES = \ - ##(PLUGIN_MODULE)-plugin.h \ - ##(PLUGIN_MODULE)-plugin.c - -lib##(PLUGIN_MODULE)_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS) -lib##(PLUGIN_MODULE)_la_LIBADD = $(XED_LIBS) - -# UI files (if you use gtkbuilder for your plugin, list those files here) -uidir = $(XED_PLUGINS_DATA_DIR)/##(PLUGIN_MODULE) -ui_DATA = - -plugin_in_files = ##(PLUGIN_MODULE).xed-plugin.desktop.in - -%.xed-plugin: %.xed-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache - -plugin_DATA = $(plugin_in_files:.xed-plugin.desktop.in=.xed-plugin) - -EXTRA_DIST = $(plugin_in_files) - -CLEANFILES = $(plugin_DATA) $(ui_DATA) - -DISTCLEANFILES = $(plugin_DATA) $(ui_DATA) - --include $(top_srcdir)/git.mk diff --git a/tools/plugin_template/meson.build b/tools/plugin_template/meson.build new file mode 100644 index 0000000..0da7009 --- /dev/null +++ b/tools/plugin_template/meson.build @@ -0,0 +1,34 @@ +##ifdef HAS_C_FILES +##(PLUGIN_ID.lower)_sources = [ + xed-##(PLUGIN_MODULE.lower)-plugin.h + xed-##(PLUGIN_MODULE.lower)-plugin.c, +] + +##(PLUGIN_ID.lower)_deps = [ + config_h, + glib, + gtksourceview, + libpeas, + libpeas_gtk +] + +library( + '##(PLUGIN_ID.lower)', + ##(PLUGIN_ID.lower)_sources, + link_with: libxed, + dependencies: ##(PLUGIN_ID.lower)_deps, + include_directories: include_dirs, + install_rpath: join_paths(prefix, libdir, 'xed'), + install: true, + install_dir: join_paths(libdir, 'xed', 'plugins') +) + +##endif +##(PLUGIN_ID.lower)_desktop = custom_target( + '##(PLUGIN_ID)_desktop', + input: '##(PLUGIN_ID).plugin.desktop.in', + output: '##(PLUGIN_ID).plugin', + command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'], + install: true, + install_dir: pluginslibdir, +) diff --git a/tools/plugin_template/xed-plugin.c b/tools/plugin_template/xed-plugin.c index 355ac19..253059a 100644 --- a/tools/plugin_template/xed-plugin.c +++ b/tools/plugin_template/xed-plugin.c @@ -7,7 +7,7 @@ * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, 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 @@ -18,167 +18,185 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifdef HAVE_CONFIG_H #include -#endif - -#include "##(PLUGIN_MODULE)-plugin.h" - #include #include -#define WINDOW_DATA_KEY "##(PLUGIN_ID.camel)PluginWindowData" - -#define ##(PLUGIN_ID.upper)_PLUGIN_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), TYPE_##(PLUGIN_ID.upper)_PLUGIN, ##(PLUGIN_ID.camel)PluginPrivate)) +#include "##(PLUGIN_MODULE)-plugin.h" struct _##(PLUGIN_ID.camel)PluginPrivate { - gpointer dummy; + gpointer dummy; + +##ifdef WITH_MENU + GtkActionGroup *action_group; + guint ui_id; +##endif }; -XED_PLUGIN_REGISTER_TYPE (##(PLUGIN_ID.camel)Plugin, ##(PLUGIN_ID.lower)_plugin) +struct _##(PLUGIN_ID.camel)Plugin +{ + PeasExtensionBase; +}; + +static void peas_activatable_iface_init (PeasActivatableInterface *iface); +static void peas_gtk_configurable_iface_init (PeasGtkConfigurableInterface *iface); + +G_DEFINE_TYPE_WITH_PRIVATE (##(PLUGIN_ID.camel)Plugin, ##(PLUGIN_ID.lower)_plugin, PeasExtensionBase) ##ifdef WITH_MENU /* UI string. See xed-ui.xml for reference */ -static const gchar ui_str = - "" - " " - " " - " " - ""; +static const gchar ui_str = + "" + " " + " " + " " + ""; /* UI actions */ static const GtkActionEntry action_entries[] = - { - /* Put your actions here */ - }; + { + /* Put your actions here */ + }; -typedef struct -{ - GtkActionGroup *action_group; - guint ui_id; -} WindowData; ##endif static void ##(PLUGIN_ID.lower)_plugin_init (##(PLUGIN_ID.camel)Plugin *plugin) { - plugin->priv = ##(PLUGIN_ID.upper)_PLUGIN_GET_PRIVATE (plugin); + plugin->priv = ##(PLUGIN_ID.upper)_PLUGIN_GET_PRIVATE (plugin); - xed_debug_message (DEBUG_PLUGINS, - "##(PLUGIN_ID.camel)Plugin initializing"); + xed_debug_message (DEBUG_PLUGINS, "##(PLUGIN_ID.camel)Plugin initializing"); } static void ##(PLUGIN_ID.lower)_plugin_finalize (GObject *object) { - xed_debug_message (DEBUG_PLUGINS, - "##(PLUGIN_ID.camel)Plugin finalizing"); + xed_debug_message (DEBUG_PLUGINS, "##(PLUGIN_ID.camel)Plugin finalizing"); - G_OBJECT_CLASS (##(PLUGIN_ID.lower)_plugin_parent_class)->finalize (object); + G_OBJECT_CLASS (##(PLUGIN_ID.lower)_plugin_parent_class)->finalize (object); } -##ifdef WITH_MENU static void -free_window_data (WindowData *data) +##(PLUGIN_ID.lower)_plugin_dispose (GObject *object) { - g_return_if_fail (data != NULL); + ##(PLUGIN_ID.camelPlugin *plugin = ##(PLUGIN_ID.upper)_PLUGIN (object); + xed_debug_message (DEBUG_PLUGINS, "##(PLUGIN_ID.camel)Plugin disposing"); + if (plugin->priv->window != NULL) + { + g_object_unref (plugin->priv->window); + plugin->priv->window = NULL; + } + if (plugin->priv->action_group) + { + g_object_unref (plugin->priv->action_group); + plugin->priv->action_group = NULL; + } - g_object_unref (data->action_group); - g_free (data); + G_OBJECT_CLASS (##(PLUGIN_ID.lower)_plugin_parent_class)->dispose (object); } + +static void +##(PLUGIN_ID.lower)_plugin_activate (PeasActivatable *activatable) +{ +##ifdef WITH_MENU + ##(PLUGIN_ID.camel)Plugin *plugin; + ##(PLUGIN_ID.camel)PluginPrivate *data; + XedWindow *window; + GtkUIManager *manager; ##endif -static void -impl_activate (XedPlugin *plugin, - XedWindow *window) -{ -##ifdef WITH_MENU - GtkUIManager *manager; - WindowData *data; -##endif - - xed_debug (DEBUG_PLUGINS); + xed_debug (DEBUG_PLUGINS); ##ifdef WITH_MENU - data = g_new (WindowData, 1); - manager = xed_window_get_ui_manager (window); + plugin = ##(PLUGIN_ID.upper)_PLUGIN (activatable); + data = plugin->priv; + window = XED_WINDOW (data->window); - data->action_group = gtk_action_group_new ("##(PLUGIN_ID.camel)PluginActions"); - gtk_action_group_set_translation_domain (data->action_group, - GETTEXT_PACKAGE); - gtk_action_group_add_actions (data->action_group, - action_entries, - G_N_ELEMENTS (action_entries), - window); + manager = xed_window_get_ui_manager (window); - gtk_ui_manager_insert_action_group (manager, data->action_group, -1); + data->action_group = gtk_action_group_new ("##(PLUGIN_ID.camel)PluginActions"); + gtk_action_group_set_translation_domain (data->action_group, + GETTEXT_PACKAGE); + gtk_action_group_add_actions (data->action_group, + action_entries, + G_N_ELEMENTS (action_entries), + window); - data->ui_id = gtk_ui_manager_add_ui_from_string (manager, ui_str, - -1, NULL); + gtk_ui_manager_insert_action_group (manager, data->action_group, -1); - g_object_set_data_full (G_OBJECT (window), - WINDOW_DATA_KEY, - data, - (GDestroyNotify) free_window_data); -##endif -} - -static void -impl_deactivate (XedPlugin *plugin, - XedWindow *window) -{ -##ifdef WITH_MENU - GtkUIManager *manager; - WindowData *data; -##endif - - xed_debug (DEBUG_PLUGINS); - -##ifdef WITH_MENU - manager = xed_window_get_ui_manager (window); - - data = (WindowData *) g_object_get_data (G_OBJECT (window), - WINDOW_DATA_KEY); - g_return_if_fail (data != NULL); - - gtk_ui_manager_remove_ui (manager, data->ui_id); - gtk_ui_manager_remove_action_group (manager, data->action_group); - - g_object_set_data (G_OBJECT (window), WINDOW_DATA_KEY, NULL); + data->ui_id = gtk_ui_manager_add_ui_from_string (manager, ui_str, + -1, NULL); ##endif } static void -impl_update_ui (XedPlugin *plugin, - XedWindow *window) +##(PLUGIN_ID.lower)_plugin_deactivate (PeasActivatable *activatable) { - xed_debug (DEBUG_PLUGINS); +##ifdef WITH_MENU + ##(PLUGIN_ID.camel)PluginPrivate *data; + XedWindow *window; + GtkUIManager *manager; +##endif + + xed_debug (DEBUG_PLUGINS); + +##ifdef WITH_MENU + data = ##(PLUGIN_ID.upper)_PLUGIN (activatable)->priv; + window = XED_WINDOW (data->window); + + manager = xed_window_get_ui_manager (window); + + data = (WindowData *) g_object_get_data (G_OBJECT (window), + WINDOW_DATA_KEY); + g_return_if_fail (data != NULL); + + gtk_ui_manager_remove_ui (manager, data->ui_id); + gtk_ui_manager_remove_action_group (manager, data->action_group); +##endif +} + +static void +##(PLUGIN_ID.lower)_plugin_update_state (PeasActivatable *activatable) +{ + xed_debug (DEBUG_PLUGINS); +} + +static void +peas_activatable_iface_init (PeasActivatableInterface *iface) +{ + iface->activate = ##(PLUGIN_ID.lower)_plugin_activate; + iface->deactivate = ##(PLUGIN_ID.lower)_plugin_deactivate; + iface->update_state = ##(PLUGIN_ID.lower)_plugin_update_state; } ##ifdef WITH_CONFIGURE_DIALOG -static GtkWidget * -impl_create_configure_dialog (XedPlugin *plugin) +static void +peas_gtk_configurable_iface_init (PeasGtkConfigurableInterface *iface) { - xed_debug (DEBUG_PLUGINS); + iface->create_configure_widget = xed_time_plugin_create_configure_widget; } ##endif static void ##(PLUGIN_ID.lower)_plugin_class_init (##(PLUGIN_ID.camel)PluginClass *klass) { - GObjectClass *object_class = G_OBJECT_CLASS (klass); - XedPluginClass *plugin_class = XED_PLUGIN_CLASS (klass); + GObjectClass *object_class = G_OBJECT_CLASS (klass); + XedPluginClass *plugin_class = XED_PLUGIN_CLASS (klass); - object_class->finalize = ##(PLUGIN_ID.lower)_plugin_finalize; - - plugin_class->activate = impl_activate; - plugin_class->deactivate = impl_deactivate; - plugin_class->update_ui = impl_update_ui; -##ifdef WITH_CONFIGURE_DIALOG - plugin_class->create_configure_dialog = impl_create_configure_dialog; -##endif - - g_type_class_add_private (object_class, - sizeof (##(PLUGIN_ID.camel)PluginPrivate)); + object_class->finalize = ##(PLUGIN_ID.lower)_plugin_finalize; + object_class->dispose = ##(PLUGIN_ID.lower)_plugin_dispose; +} + +G_MODULE_EXPORT void +peas_register_types (PeasObjectModule *module) +{ + ##(PLUGIN_ID.lower)_plugin_register_type (G_TYPE_MODULE (module)); + peas_object_module_register_extension_type (module, + PEAS_TYPE_ACTIVATABLE, + ##(PLUGIN_ID.lower)_TYPE_PLUGIN); + + peas_object_module_register_extension_type (module, + PEAS_GTK_TYPE_CONFIGURABLE, + ##(PLUGIN_ID.lower)_TYPE_PLUGIN); } diff --git a/tools/plugin_template/xed-plugin.h b/tools/plugin_template/xed-plugin.h index 34c6bfd..f3c9d56 100644 --- a/tools/plugin_template/xed-plugin.h +++ b/tools/plugin_template/xed-plugin.h @@ -23,53 +23,16 @@ #include #include -#include +#include +#include G_BEGIN_DECLS -/* - * Type checking and casting macros - */ -#define TYPE_##(PLUGIN_ID.upper)_PLUGIN (##(PLUGIN_ID.lower)_plugin_get_type ()) -#define ##(PLUGIN_ID.upper)_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_##(PLUGIN_ID.upper)_PLUGIN, ##(PLUGIN_ID.camel)Plugin)) -#define ##(PLUGIN_ID.upper)_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), TYPE_##(PLUGIN_ID.upper)_PLUGIN, ##(PLUGIN_ID.camel)PluginClass)) -#define IS_##(PLUGIN_ID.upper)_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_##(PLUGIN_ID.upper)_PLUGIN)) -#define IS_##(PLUGIN_ID.upper)_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_##(PLUGIN_ID.upper)_PLUGIN)) -#define ##(PLUGIN_ID.upper)_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_##(PLUGIN_ID.upper)_PLUGIN, ##(PLUGIN_ID.camel)PluginClass)) - -/* Private structure type */ -typedef struct _##(PLUGIN_ID.camel)PluginPrivate ##(PLUGIN_ID.camel)PluginPrivate; - -/* - * Main object structure - */ -typedef struct _##(PLUGIN_ID.camel)Plugin ##(PLUGIN_ID.camel)Plugin; - -struct _##(PLUGIN_ID.camel)Plugin -{ - XedPlugin parent_instance; - - /*< private >*/ - ##(PLUGIN_ID.camel)PluginPrivate *priv; -}; - -/* - * Class definition - */ -typedef struct _##(PLUGIN_ID.camel)PluginClass ##(PLUGIN_ID.camel)PluginClass; - -struct _##(PLUGIN_ID.camel)PluginClass -{ - XedPluginClass parent_class; -}; - -/* - * Public methods - */ -GType ##(PLUGIN_ID.lower)_plugin_get_type (void) G_GNUC_CONST; +#define ##(PLUGIN_ID.upper)_TYPE_PLUGIN (##(PLUGIN_ID.lower)_plugin_get_type ()) +G_DECLARE_FINAL_TYPE (##(PLUGIN_ID.camel)Plugin, ##(PLUGIN_ID.lower)_plugin, ##(PLUGIN_ID.upper), PLUGIN, PeasExtensionBase) /* All the plugins must implement this function */ -G_MODULE_EXPORT GType register_xed_plugin (GTypeModule *module); +G_MODULE_EXPORT void peas_register_types (PeasObjectModule *module); G_END_DECLS diff --git a/xed/Makefile.am b/xed/Makefile.am deleted file mode 100644 index 763df73..0000000 --- a/xed/Makefile.am +++ /dev/null @@ -1,205 +0,0 @@ -## Process this file with automake to produce Makefile.in - -bin_PROGRAMS = xed - -pkglib_LTLIBRARIES = libxed.la - -AM_CPPFLAGS = \ - -I$(top_srcdir) \ - -I$(srcdir) \ - $(XED_CFLAGS) \ - $(WARN_CFLAGS) \ - $(INTROSPECTION_CFLAGS) \ - $(DISABLE_DEPRECATED_CFLAGS) \ - -DDATADIR=\""$(datadir)"\" \ - -DLIBDIR=\""$(libdir)"\" - -xed_SOURCES = \ - xed.c - -xed_LDADD = \ - libxed.la \ - $(XED_LIBS) \ - $(INTROSPECTION_LIBS) - -xed_LDFLAGS = -export-dynamic -no-undefined -export-symbols-regex "^[[^_]].*" - -libxed_la_LDFLAGS = -avoid-version -export-dynamic -no-undefined -export-symbols-regex "^[^_].*" - -# XED_LIBS must be the last to ensure correct order on some platforms -libxed_la_LIBADD = $(XED_LIBS) - -BUILT_SOURCES = \ - xed-enum-types.c \ - xed-enum-types.h \ - xed-marshal.c \ - xed-marshal.h - - -NOINST_H_FILES = \ - xed-close-button.h \ - xed-close-confirmation-dialog.h \ - xed-dirs.h \ - xed-document-private.h \ - xed-documents-panel.h \ - xed-encodings-dialog.h \ - xed-history-entry.h \ - xed-io-error-info-bar.h \ - xed-metadata-manager.h \ - xed-paned.h \ - xed-plugins-engine.h \ - xed-preferences-dialog.h \ - xed-print-job.h \ - xed-print-preview.h \ - xed-settings.h \ - xed-status-combo-box.h \ - xed-tab-label.h \ - xed-ui.h \ - xed-utils.h \ - xed-view-frame.h \ - xed-view-gutter-renderer.h \ - xed-window-private.h - -INST_H_FILES = \ - xed-app.h \ - xed-app-activatable.h \ - xed-commands.h \ - xed-debug.h \ - xed-document.h \ - xed-encodings-combo-box.h \ - xed-file-chooser-dialog.h \ - xed-message-bus.h \ - xed-message-type.h \ - xed-message.h \ - xed-notebook.h \ - xed-panel.h \ - xed-progress-info-bar.h \ - xed-searchbar.h \ - xed-statusbar.h \ - xed-tab.h \ - xed-view.h \ - xed-view-activatable.h \ - xed-window.h \ - xed-window-activatable.h - -headerdir = $(prefix)/include/xed - -header_DATA = \ - $(INST_H_FILES) - -BUILT_SOURCES_PRIVATE = \ - xed-resources.c - -libxed_c_files = \ - xed-app.c \ - xed-app-activatable.c \ - xed-view-activatable.c \ - xed-window-activatable.c \ - xed-resources.c \ - xed-close-button.c \ - xed-close-confirmation-dialog.c \ - xed-commands-documents.c \ - xed-commands-edit.c \ - xed-commands-file.c \ - xed-commands-file-print.c \ - xed-commands-help.c \ - xed-commands-search.c \ - xed-commands-view.c \ - xed-debug.c \ - xed-dirs.c \ - xed-document.c \ - xed-documents-panel.c \ - xed-encodings-combo-box.c \ - xed-encodings-dialog.c \ - xed-file-chooser-dialog.c \ - xed-history-entry.c \ - xed-io-error-info-bar.c \ - xed-message-bus.c \ - xed-message-type.c \ - xed-message.c \ - xed-metadata-manager.c \ - xed-notebook.c \ - xed-paned.c \ - xed-panel.c \ - xed-plugins-engine.c \ - xed-preferences-dialog.c \ - xed-print-job.c \ - xed-print-preview.c \ - xed-progress-info-bar.c \ - xed-settings.c \ - xed-searchbar.c \ - xed-statusbar.c \ - xed-status-combo-box.c \ - xed-tab.c \ - xed-tab-label.c \ - xed-utils.c \ - xed-view.c \ - xed-view-frame.c \ - xed-view-gutter-renderer.c \ - xed-window.c - -libxed_la_SOURCES = \ - $(BUILT_SOURCES) \ - $(libxed_c_files) \ - $(POSIXIO_FILES) \ - $(NOINST_H_FILES) \ - $(INST_H_FILES) - -xed-enum-types.h: xed-enum-types.h.template $(INST_H_FILES) $(GLIB_MKENUMS) - $(AM_V_GEN) (cd $(srcdir) && $(GLIB_MKENUMS) --template xed-enum-types.h.template $(INST_H_FILES)) > $@ - -xed-enum-types.c: xed-enum-types.c.template $(INST_H_FILES) $(GLIB_MKENUMS) - $(AM_V_GEN) (cd $(srcdir) && $(GLIB_MKENUMS) --template xed-enum-types.c.template $(INST_H_FILES)) > $@ - -xed-marshal.h: xed-marshal.list $(GLIB_GENMARSHAL) - $(AM_V_GEN) $(GLIB_GENMARSHAL) $< --header --prefix=xed_marshal > $@ - -xed-marshal.c: xed-marshal.list $(GLIB_GENMARSHAL) - $(AM_V_GEN) echo "#include \"xed-marshal.h\"" > $@ && \ - $(GLIB_GENMARSHAL) $< --body --prefix=xed_marshal >> $@ - -xed-resources.c: resources/xed.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir)/resources --generate-dependencies $(srcdir)/resources/xed.gresource.xml) - $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir)/resources --generate-source $(srcdir)/resources/xed.gresource.xml - -EXTRA_DIST = \ - xed-enum-types.h.template \ - xed-enum-types.c.template \ - xed-marshal.list \ - xed.rc \ - resources/xed.gresource.xml \ - resources/ui/xed-ui.xml \ - resources/ui/xed-encodings-dialog.ui \ - resources/ui/xed-preferences-dialog.ui \ - resources/ui/xed-print-preferences.ui \ - resources/ui/xed-searchbar.ui \ - resources/ui/xed-view-frame.ui - -CLEANFILES = $(BUILT_SOURCES) $(BUILT_SOURCES_PRIVATE) - -if HAVE_INTROSPECTION --include $(INTROSPECTION_MAKEFILE) -INTROSPECTION_GIRS = Xed-1.0.gir - -Xed-1.0.gir: xed -INTROSPECTION_SCANNER_ARGS = -I$(top_srcdir) --warn-all -Xed_1_0_gir_NAMESPACE = Xed -Xed_1_0_gir_VERSION = 1.0 -Xed_1_0_gir_PROGRAM = $(builddir)/xed -Xed_1_0_gir_FILES = $(INST_H_FILES) $(libxed_c_files) $(BUILT_SOURCES) -Xed_1_0_gir_INCLUDES = Gtk-3.0 GtkSource-3.0 - -girdir = $(datadir)/xed/gir-1.0 -gir_DATA = $(INTROSPECTION_GIRS) - -typelibdir = $(libdir)/xed/girepository-1.0 -typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib) - -CLEANFILES += \ - $(gir_DATA) \ - $(typelib_DATA) -endif - -dist-hook: - cd $(distdir); rm -f $(BUILT_SOURCES) $(BUILT_SOURCES_PRIVATE) - --include $(top_srcdir)/git.mk diff --git a/xed/meson.build b/xed/meson.build new file mode 100644 index 0000000..81b9e46 --- /dev/null +++ b/xed/meson.build @@ -0,0 +1,193 @@ +xed_sources = [ + 'xed.c' +] + +private_headers = [ + 'xed-close-button.h', + 'xed-close-confirmation-dialog.h', + 'xed-dirs.h', + 'xed-document-private.h', + 'xed-documents-panel.h', + 'xed-encodings-dialog.h', + 'xed-history-entry.h', + 'xed-io-error-info-bar.h', + 'xed-metadata-manager.h', + 'xed-paned.h', + 'xed-plugins-engine.h', + 'xed-preferences-dialog.h', + 'xed-print-job.h', + 'xed-print-preview.h', + 'xed-settings.h', + 'xed-status-combo-box.h', + 'xed-tab-label.h', + 'xed-ui.h', + 'xed-utils.h', + 'xed-view-frame.h', + 'xed-view-gutter-renderer.h', + 'xed-window-private.h' +] + +public_headers = [ + 'xed-app.h', + 'xed-app-activatable.h', + 'xed-commands.h', + 'xed-debug.h', + 'xed-document.h', + 'xed-encodings-combo-box.h', + 'xed-file-chooser-dialog.h', + 'xed-message-bus.h', + 'xed-message-type.h', + 'xed-message.h', + 'xed-notebook.h', + 'xed-panel.h', + 'xed-progress-info-bar.h', + 'xed-searchbar.h', + 'xed-statusbar.h', + 'xed-tab.h', + 'xed-view.h', + 'xed-view-activatable.h', + 'xed-window.h', + 'xed-window-activatable.h' +] + +libxed_sources = [ + 'xed-app.c', + 'xed-app-activatable.c', + 'xed-view-activatable.c', + 'xed-window-activatable.c', + 'xed-close-button.c', + 'xed-close-confirmation-dialog.c', + 'xed-commands-documents.c', + 'xed-commands-edit.c', + 'xed-commands-file.c', + 'xed-commands-file-print.c', + 'xed-commands-help.c', + 'xed-commands-search.c', + 'xed-commands-view.c', + 'xed-debug.c', + 'xed-dirs.c', + 'xed-document.c', + 'xed-documents-panel.c', + 'xed-encodings-combo-box.c', + 'xed-encodings-dialog.c', + 'xed-file-chooser-dialog.c', + 'xed-history-entry.c', + 'xed-io-error-info-bar.c', + 'xed-message-bus.c', + 'xed-message-type.c', + 'xed-message.c', + 'xed-metadata-manager.c', + 'xed-notebook.c', + 'xed-paned.c', + 'xed-panel.c', + 'xed-plugins-engine.c', + 'xed-preferences-dialog.c', + 'xed-print-job.c', + 'xed-print-preview.c', + 'xed-progress-info-bar.c', + 'xed-settings.c', + 'xed-searchbar.c', + 'xed-statusbar.c', + 'xed-status-combo-box.c', + 'xed-tab.c', + 'xed-tab-label.c', + 'xed-utils.c', + 'xed-view.c', + 'xed-view-frame.c', + 'xed-view-gutter-renderer.c', + 'xed-window.c' +] + +xed_enums = gnome.mkenums( + 'xed-enum-types', + sources : public_headers, + c_template : 'xed-enum-types.c.template', + h_template : 'xed-enum-types.h.template', + identifier_prefix : 'Xed', + symbol_prefix : 'xed' +) + +xed_marshal = gnome.genmarshal( + 'xed-marshal', + sources: 'xed-marshal.list', + prefix: 'xed_marshal' +) + +xed_resources = gnome.compile_resources( + 'xed-resources', 'resources/xed.gresource.xml', + source_dir: ['resources', 'resources/css', 'resources/ui'], + c_name: 'xed' +) + +xed_deps = [ + config_h, + gio, + glib, + gtk, + gtksourceview, + libpeas, + libpeas_gtk, + libxml, + math, + xapp, + X11 +] + +libxed = library( + 'xed', + libxed_sources + private_headers + public_headers + xed_enums + xed_marshal + xed_resources, + dependencies: xed_deps, + include_directories: include_dirs, + install: true, + install_dir: join_paths(libdir, 'xed') +) + +install_headers( + public_headers, + subdir: 'xed' +) + +libxed_dep = declare_dependency( + dependencies: xed_deps, + link_with: libxed, + link_args: ['-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now'], + include_directories: [include_dirs, include_directories('.')] +) + +executable( + 'xed', + xed_sources, + dependencies: libxed_dep, + install_rpath: join_paths(prefix, libdir, 'xed'), + install: true +) + +gir = gnome.generate_gir( + libxed, + namespace: 'Xed', + nsversion: '1.0', + sources: public_headers + libxed_sources + xed_enums + xed_marshal, + identifier_prefix: 'Xed', + symbol_prefix: 'xed', + includes: ['Gtk-3.0', 'GtkSource-3.0'], + install: true, + install_dir_typelib: join_paths(libdir, 'xed', 'girepository-1.0'), + install_dir_gir: join_paths(datadir, 'xed', 'gir-1.0') +) + +pkgconfig.generate( + name: 'xed', + description: 'xed', + filebase: 'xed', + version: meson.project_version(), + libraries: libxed, + requires: [ + 'gtksourceview-3.0', + 'libpeas-1.0', + 'libpeas-gtk-1.0' + ], + variables: [ + 'exec_prefix=${prefix}', + 'pluginsdir=${prefix}/@0@/xed/plugins'.format(libdir) + ] +) diff --git a/xed/xed-app-activatable.c b/xed/xed-app-activatable.c index 086e0c9..164f30c 100644 --- a/xed/xed-app-activatable.c +++ b/xed/xed-app-activatable.c @@ -20,9 +20,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifdef HAVE_CONFIG_H #include -#endif #include "xed-app-activatable.h" #include "xed-app.h" diff --git a/xed/xed-app.c b/xed/xed-app.c index ef0f169..6d53e26 100644 --- a/xed/xed-app.c +++ b/xed/xed-app.c @@ -28,10 +28,7 @@ * $Id$ */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include diff --git a/xed/xed-close-confirmation-dialog.c b/xed/xed-close-confirmation-dialog.c index deecf0a..e420a65 100755 --- a/xed/xed-close-confirmation-dialog.c +++ b/xed/xed-close-confirmation-dialog.c @@ -28,20 +28,15 @@ * $Id$ */ -#ifdef HAVE_CONFIG_H #include -#endif - -#include "xed-close-confirmation-dialog.h" - #include - #include #include #include #include #include +#include "xed-close-confirmation-dialog.h" /* Properties */ enum diff --git a/xed/xed-commands-documents.c b/xed/xed-commands-documents.c index 51120f1..e6b493c 100644 --- a/xed/xed-commands-documents.c +++ b/xed/xed-commands-documents.c @@ -30,10 +30,7 @@ * $Id$ */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include "xed-commands.h" diff --git a/xed/xed-commands-edit.c b/xed/xed-commands-edit.c index 5509332..e6010d7 100644 --- a/xed/xed-commands-edit.c +++ b/xed/xed-commands-edit.c @@ -30,10 +30,7 @@ * $Id$ */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include "xed-commands.h" diff --git a/xed/xed-commands-file-print.c b/xed/xed-commands-file-print.c index b295143..db72b9c 100644 --- a/xed/xed-commands-file-print.c +++ b/xed/xed-commands-file-print.c @@ -30,10 +30,7 @@ * $Id$ */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include diff --git a/xed/xed-commands-file.c b/xed/xed-commands-file.c index e126006..a07a586 100644 --- a/xed/xed-commands-file.c +++ b/xed/xed-commands-file.c @@ -30,10 +30,7 @@ * $Id$ */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include diff --git a/xed/xed-commands-help.c b/xed/xed-commands-help.c index 769ddc2..fa43d7c 100644 --- a/xed/xed-commands-help.c +++ b/xed/xed-commands-help.c @@ -31,10 +31,7 @@ * $Id$ */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include diff --git a/xed/xed-commands-search.c b/xed/xed-commands-search.c index 7d32444..97f6b5b 100644 --- a/xed/xed-commands-search.c +++ b/xed/xed-commands-search.c @@ -1,7 +1,4 @@ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include diff --git a/xed/xed-commands-view.c b/xed/xed-commands-view.c index f692e55..2a48e43 100644 --- a/xed/xed-commands-view.c +++ b/xed/xed-commands-view.c @@ -30,10 +30,7 @@ * $Id$ */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include "xed-commands.h" diff --git a/xed/xed-debug.c b/xed/xed-debug.c index a2507be..eda0f44 100644 --- a/xed/xed-debug.c +++ b/xed/xed-debug.c @@ -4,7 +4,7 @@ * * Copyright (C) 1998, 1999 Alex Roberts, Evan Lawrence * Copyright (C) 2000, 2001 Chema Celorio, Paolo Maggi - * Copyright (C) 2002 - 2005 Paolo Maggi + * Copyright (C) 2002 - 2005 Paolo Maggi * * 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 @@ -18,23 +18,21 @@ * * 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 St, Fifth Floor, + * Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301, USA. */ - + /* - * Modified by the xed Team, 1998-2005. See the AUTHORS file for a - * list of people on the xed Team. + * Modified by the xed Team, 1998-2005. See the AUTHORS file for a + * list of people on the xed Team. * See the ChangeLog files for a list of changes. * * $Id$ */ -#ifdef HAVE_CONFIG_H #include -#endif - #include + #include "xed-debug.h" #define ENABLE_PROFILING @@ -87,7 +85,7 @@ xed_debug_init (void) if (g_getenv ("XED_DEBUG_SAVER") != NULL) debug = debug | XED_DEBUG_SAVER; -out: +out: #ifdef ENABLE_PROFILING if (debug != XED_NO_DEBUG) @@ -104,7 +102,7 @@ xed_debug_message (XedDebugSection section, const gchar *format, ...) { if (G_UNLIKELY (debug & section)) - { + { #ifdef ENABLE_PROFILING gdouble seconds; g_return_if_fail (timer != NULL); @@ -121,11 +119,11 @@ xed_debug_message (XedDebugSection section, #ifdef ENABLE_PROFILING seconds = g_timer_elapsed (timer, NULL); - g_print ("[%f (%f)] %s:%d (%s) %s\n", + g_print ("[%f (%f)] %s:%d (%s) %s\n", seconds, seconds - last, file, line, function, msg); - last = seconds; + last = seconds; #else - g_print ("%s:%d (%s) %s\n", file, line, function, msg); + g_print ("%s:%d (%s) %s\n", file, line, function, msg); #endif fflush (stdout); @@ -146,13 +144,13 @@ void xed_debug (XedDebugSection section, g_return_if_fail (timer != NULL); - seconds = g_timer_elapsed (timer, NULL); - g_print ("[%f (%f)] %s:%d (%s)\n", + seconds = g_timer_elapsed (timer, NULL); + g_print ("[%f (%f)] %s:%d (%s)\n", seconds, seconds - last, file, line, function); last = seconds; #else g_print ("%s:%d (%s)\n", file, line, function); -#endif +#endif fflush (stdout); } } diff --git a/xed/xed-dirs.c b/xed/xed-dirs.c index e2548a3..5833e55 100644 --- a/xed/xed-dirs.c +++ b/xed/xed-dirs.c @@ -21,9 +21,7 @@ * Boston, MA 02110-1301, USA. */ -#ifdef HAVE_CONFIG_H #include -#endif #include "xed-dirs.h" diff --git a/xed/xed-document.c b/xed/xed-document.c index b8d9bfe..40d7661 100644 --- a/xed/xed-document.c +++ b/xed/xed-document.c @@ -30,13 +30,9 @@ * $Id$ */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include - #include #include @@ -1016,8 +1012,8 @@ xed_document_get_short_name_for_display (XedDocument *doc) /** * xed_document_set_short_name_for_display: - * @doc: - * @short_name: (allow-none): + * @doc: a #XedDocument + * @short_name: (allow-none): the short name to use */ void xed_document_set_short_name_for_display (XedDocument *doc, @@ -1626,7 +1622,7 @@ xed_document_set_search_context (XedDocument *doc, * xed_document_get_search_context: * @doc: a #XedDocument * - * Returns: the current search context of the document, + * Returns: (transfer full): the current search context of the document, * or NULL if there is no search context */ GtkSourceSearchContext * diff --git a/xed/xed-document.h b/xed/xed-document.h index a1fbf6d..8672471 100644 --- a/xed/xed-document.h +++ b/xed/xed-document.h @@ -76,7 +76,7 @@ gchar *xed_document_get_uri_for_display (XedDocument *doc); gchar *xed_document_get_short_name_for_display (XedDocument *doc); void xed_document_set_short_name_for_display (XedDocument *doc, - const gchar *name); + const gchar *short_name); gchar *xed_document_get_content_type (XedDocument *doc); diff --git a/xed/xed-documents-panel.c b/xed/xed-documents-panel.c index dad2282..c7b5150 100644 --- a/xed/xed-documents-panel.c +++ b/xed/xed-documents-panel.c @@ -28,15 +28,13 @@ * $Id$ */ -#ifdef HAVE_CONFIG_H #include -#endif +#include #include "xed-documents-panel.h" #include "xed-utils.h" #include "xed-notebook.h" -#include #define XED_DOCUMENTS_PANEL_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \ XED_TYPE_DOCUMENTS_PANEL, \ diff --git a/xed/xed-encodings-combo-box.c b/xed/xed-encodings-combo-box.c index 11d0bb7..5ce2821 100644 --- a/xed/xed-encodings-combo-box.c +++ b/xed/xed-encodings-combo-box.c @@ -29,15 +29,11 @@ * $Id: xed-encodings-combo-box.c 6112 2008-01-23 08:26:24Z sfre $ */ -#ifdef HAVE_CONFIG_H #include -#endif +#include +#include #include "xed-encodings-combo-box.h" - -#include - -#include #include "xed-settings.h" #include "xed-utils.h" diff --git a/xed/xed-encodings-dialog.c b/xed/xed-encodings-dialog.c index babc2f0..41fb74b 100755 --- a/xed/xed-encodings-dialog.c +++ b/xed/xed-encodings-dialog.c @@ -28,12 +28,8 @@ * $Id$ */ -#ifdef HAVE_CONFIG_H #include -#endif - #include - #include #include diff --git a/xed/xed-file-chooser-dialog.c b/xed/xed-file-chooser-dialog.c index b014d3b..cd53474 100644 --- a/xed/xed-file-chooser-dialog.c +++ b/xed/xed-file-chooser-dialog.c @@ -31,12 +31,8 @@ /* TODO: Override set_extra_widget */ /* TODO: add encoding property */ -#ifdef HAVE_CONFIG_H #include -#endif - #include - #include #include "xed-file-chooser-dialog.h" diff --git a/xed/xed-history-entry.c b/xed/xed-history-entry.c index aad20ab..2d7f510 100644 --- a/xed/xed-history-entry.c +++ b/xed/xed-history-entry.c @@ -28,10 +28,7 @@ * $Id$ */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include diff --git a/xed/xed-io-error-info-bar.c b/xed/xed-io-error-info-bar.c index 682d7a3..6c96072 100644 --- a/xed/xed-io-error-info-bar.c +++ b/xed/xed-io-error-info-bar.c @@ -32,21 +32,17 @@ * Verbose error reporting for file I/O operations (load, save, revert, create) */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include - #include #include +#include #include "xed-settings.h" #include "xed-utils.h" #include "xed-document.h" #include "xed-io-error-info-bar.h" -#include #define MAX_URI_IN_DIALOG_LENGTH 50 diff --git a/xed/xed-marshal.list b/xed/xed-marshal.list index 03d7c9e..2e8712b 100644 --- a/xed/xed-marshal.list +++ b/xed/xed-marshal.list @@ -1,4 +1,4 @@ -BOOLEAN:NONE +BOOLEAN:VOID BOOLEAN:OBJECT VOID:BOOLEAN VOID:BOOLEAN,POINTER diff --git a/xed/xed-message-type.h b/xed/xed-message-type.h index 66841c8..6be649b 100644 --- a/xed/xed-message-type.h +++ b/xed/xed-message-type.h @@ -11,9 +11,9 @@ G_BEGIN_DECLS #define XED_TYPE_MESSAGE_TYPE (xed_message_type_get_type ()) #define XED_MESSAGE_TYPE(x) ((XedMessageType *)(x)) -typedef void (*XedMessageTypeForeach) (const gchar *key, - GType type, - gboolean required, +typedef void (*XedMessageTypeForeach) (const gchar *key, + GType type, + gboolean required, gpointer user_data); typedef struct _XedMessageType XedMessageType; @@ -25,21 +25,21 @@ gchar *xed_message_type_identifier (const gchar *object_path, const gchar *method); gboolean xed_message_type_is_valid_object_path (const gchar *object_path); -XedMessageType *xed_message_type_new (const gchar *object_path, +XedMessageType *xed_message_type_new (const gchar *object_path, const gchar *method, guint num_optional, ...) G_GNUC_NULL_TERMINATED; XedMessageType *xed_message_type_new_valist (const gchar *object_path, const gchar *method, guint num_optional, - va_list va_args); + va_list var_args); void xed_message_type_set (XedMessageType *message_type, guint num_optional, ...) G_GNUC_NULL_TERMINATED; void xed_message_type_set_valist (XedMessageType *message_type, guint num_optional, - va_list va_args); + va_list var_args); XedMessageType *xed_message_type_ref (XedMessageType *message_type); void xed_message_type_unref (XedMessageType *message_type); @@ -55,7 +55,7 @@ const gchar *xed_message_type_get_method (XedMessageType *message_type); GType xed_message_type_lookup (XedMessageType *message_type, const gchar *key); - + void xed_message_type_foreach (XedMessageType *message_type, XedMessageTypeForeach func, gpointer user_data); diff --git a/xed/xed-notebook.c b/xed/xed-notebook.c index 8dceee0..2deb897 100644 --- a/xed/xed-notebook.c +++ b/xed/xed-notebook.c @@ -35,10 +35,7 @@ * */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include @@ -984,6 +981,13 @@ xed_notebook_remove_all_tabs (XedNotebook *nb) gtk_container_foreach (GTK_CONTAINER (nb), (GtkCallback)remove_tab, nb); } +/** + * xed_notebook_get_all_tabs: + * @nb: a #XedNotebook + * + * Gets all #XedTab from @nb. + * Returns: (element-type GtkWidget) (transfer container): #GList of all tabs + */ GList * xed_notebook_get_all_tabs (XedNotebook *nb) { diff --git a/xed/xed-paned.c b/xed/xed-paned.c index 7076f8a..ae947b8 100644 --- a/xed/xed-paned.c +++ b/xed/xed-paned.c @@ -1,6 +1,4 @@ -#ifdef HAVE_CONFIG_H #include -#endif #include "xed-paned.h" diff --git a/xed/xed-plugins-engine.c b/xed/xed-plugins-engine.c index c293c1e..cef6ede 100644 --- a/xed/xed-plugins-engine.c +++ b/xed/xed-plugins-engine.c @@ -28,12 +28,8 @@ * $Id$ */ -#ifdef HAVE_CONFIG_H #include -#endif - #include - #include #include diff --git a/xed/xed-preferences-dialog.c b/xed/xed-preferences-dialog.c index 32faf6f..e85b46d 100755 --- a/xed/xed-preferences-dialog.c +++ b/xed/xed-preferences-dialog.c @@ -29,14 +29,10 @@ * $Id$ */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include - #include #include #include @@ -254,7 +250,7 @@ word_wrap_switch_toggled (GObject *toggle_switch, static void setup_editor_page (XedPreferencesDialog *dlg) { - XedSettings *settings; + GObject *settings; gchar *system_font = NULL; gchar *label_text; GtkWrapMode wrap_mode; @@ -263,7 +259,7 @@ setup_editor_page (XedPreferencesDialog *dlg) /* Fonts */ settings = _xed_app_get_settings (XED_APP (g_application_get_default ())); - system_font = xed_settings_get_system_font (settings); + system_font = xed_settings_get_system_font (XED_SETTINGS (settings)); label_text = g_strdup_printf(_("Use the system fixed width font (%s)"), system_font); gtk_label_set_text (GTK_LABEL (dlg->fixed_width_font_label), label_text); diff --git a/xed/xed-print-job.c b/xed/xed-print-job.c index 59a20de..b685fbc 100644 --- a/xed/xed-print-job.c +++ b/xed/xed-print-job.c @@ -29,10 +29,7 @@ * $Id: xed-print.c 6022 2007-12-09 14:38:57Z pborelli $ */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include diff --git a/xed/xed-print-preview.c b/xed/xed-print-preview.c index 54164d4..bd9ab85 100644 --- a/xed/xed-print-preview.c +++ b/xed/xed-print-preview.c @@ -27,10 +27,7 @@ * $Id: xed-commands-search.c 5931 2007-09-25 20:05:40Z pborelli $ */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include diff --git a/xed/xed-progress-info-bar.c b/xed/xed-progress-info-bar.c index fc3f98d..bca327a 100644 --- a/xed/xed-progress-info-bar.c +++ b/xed/xed-progress-info-bar.c @@ -30,10 +30,7 @@ /* TODO: add properties */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include diff --git a/xed/xed-searchbar.c b/xed/xed-searchbar.c index 9d705a6..fdb77a6 100755 --- a/xed/xed-searchbar.c +++ b/xed/xed-searchbar.c @@ -1,7 +1,4 @@ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include @@ -868,6 +865,14 @@ xed_searchbar_get_replace_text (XedSearchbar *searchbar) return gtk_entry_get_text (GTK_ENTRY (searchbar->priv->replace_text_entry)); } +/** + * xed_searchbar_get_search_settings: + * @searchbar: the #XedSearchbar + * + * Gets the search settings. + * + * Returns: (transfer none): #GtkSourceSearchSettings + */ GtkSourceSearchSettings * xed_searchbar_get_search_settings (XedSearchbar *searchbar) { diff --git a/xed/xed-statusbar.c b/xed/xed-statusbar.c index d27dbc8..19f997b 100644 --- a/xed/xed-statusbar.c +++ b/xed/xed-statusbar.c @@ -28,10 +28,7 @@ * $Id$ */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include diff --git a/xed/xed-tab-label.c b/xed/xed-tab-label.c index 02a1754..3991858 100644 --- a/xed/xed-tab-label.c +++ b/xed/xed-tab-label.c @@ -20,12 +20,10 @@ * Boston, MA 02110-1301, USA. */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include + #include "xed-tab-label.h" #include "xed-close-button.h" diff --git a/xed/xed-tab.c b/xed/xed-tab.c index 7dc4986..596c62f 100644 --- a/xed/xed-tab.c +++ b/xed/xed-tab.c @@ -26,10 +26,7 @@ * See the ChangeLog files for a list of changes. */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include diff --git a/xed/xed-ui.h b/xed/xed-ui.h index 9fbeda6..2aa9a04 100644 --- a/xed/xed-ui.h +++ b/xed/xed-ui.h @@ -31,10 +31,7 @@ #ifndef __XED_UI_H__ #define __XED_UI_H__ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include "xed-commands.h" diff --git a/xed/xed-utils.c b/xed/xed-utils.c index 83e1da0..77429e7 100644 --- a/xed/xed-utils.c +++ b/xed/xed-utils.c @@ -30,24 +30,19 @@ * $Id$ */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include #include #include #include - #include #include #include #include #include "xed-utils.h" - #include "xed-document.h" #include "xed-debug.h" diff --git a/xed/xed-view-activatable.c b/xed/xed-view-activatable.c index ea51699..1b69359 100644 --- a/xed/xed-view-activatable.c +++ b/xed/xed-view-activatable.c @@ -19,9 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifdef HAVE_CONFIG_H #include -#endif #include "xed-view-activatable.h" #include "xed-view.h" diff --git a/xed/xed-view-frame.c b/xed/xed-view-frame.c index 7db49f0..aa0bc62 100644 --- a/xed/xed-view-frame.c +++ b/xed/xed-view-frame.c @@ -20,9 +20,10 @@ * Boston, MA 02110-1301 USA */ -#ifdef HAVE_CONFIG_H #include -#endif +#include +#include +#include #include "xed-view-frame.h" #include "xed-marshal.h" @@ -30,10 +31,6 @@ #include "xed-utils.h" #include "xed-settings.h" -#include -#include -#include - #define XED_VIEW_FRAME_SEARCH_DIALOG_TIMEOUT (30*1000) /* 30 seconds */ #define SEARCH_POPUP_MARGIN 12 diff --git a/xed/xed-view.c b/xed/xed-view.c index 0a60133..83f3b4b 100644 --- a/xed/xed-view.c +++ b/xed/xed-view.c @@ -1,7 +1,4 @@ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include diff --git a/xed/xed-window-activatable.c b/xed/xed-window-activatable.c index e7b373b..089b191 100644 --- a/xed/xed-window-activatable.c +++ b/xed/xed-window-activatable.c @@ -19,9 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifdef HAVE_CONFIG_H #include -#endif #include "xed-window-activatable.h" #include "xed-window.h" diff --git a/xed/xed-window.c b/xed/xed-window.c index 83d4ad6..560670a 100644 --- a/xed/xed-window.c +++ b/xed/xed-window.c @@ -1,7 +1,4 @@ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include @@ -1203,7 +1200,7 @@ create_menu_bar_and_toolbar (XedWindow *window, GtkUIManager *manager; GtkRecentManager *recent_manager; GError *error = NULL; - GtkWidget *tool_item; + GtkToolItem *tool_item; GtkWidget *tool_box; GtkWidget *box; GtkWidget *separator; @@ -1305,8 +1302,8 @@ create_menu_bar_and_toolbar (XedWindow *window, gtk_box_pack_start (GTK_BOX(main_box), window->priv->toolbar, FALSE, FALSE, 0); tool_item = gtk_tool_item_new (); - gtk_tool_item_set_expand (GTK_TOOL_ITEM (tool_item), TRUE); - gtk_toolbar_insert (GTK_TOOLBAR (window->priv->toolbar), GTK_TOOL_ITEM (tool_item), 0); + gtk_tool_item_set_expand ((tool_item), TRUE); + gtk_toolbar_insert (GTK_TOOLBAR (window->priv->toolbar), (tool_item), 0); tool_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); gtk_container_add (GTK_CONTAINER (tool_item), tool_box); @@ -1593,11 +1590,11 @@ set_tab_spaces_label (XedWindow *window, { if (use_spaces) { - xed_status_combo_box_set_label (window->priv->tab_width_combo, _("Spaces")); + xed_status_combo_box_set_label (XED_STATUS_COMBO_BOX (window->priv->tab_width_combo), _("Spaces")); } else { - xed_status_combo_box_set_label (window->priv->tab_width_combo, _("Tabs")); + xed_status_combo_box_set_label (XED_STATUS_COMBO_BOX (window->priv->tab_width_combo), _("Tabs")); } } @@ -2667,7 +2664,7 @@ fullscreen_controls_build (XedWindow *window) GtkAction *action; GtkWidget *box; GtkWidget *toolbar; - GtkWidget *toolitem; + GtkToolItem *toolitem; GtkWidget *toolbox; GtkWidget *fullscreen_btn; GtkWidget *separator; @@ -2684,8 +2681,8 @@ fullscreen_controls_build (XedWindow *window) toolbar = gtk_toolbar_new (); toolitem = gtk_tool_item_new (); - gtk_tool_item_set_expand (GTK_TOOL_ITEM (toolitem), TRUE); - gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (toolitem), 0); + gtk_tool_item_set_expand (toolitem, TRUE); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), toolitem, 0); toolbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_style_context_add_class (gtk_widget_get_style_context (toolbar), "primary-toolbar"); @@ -3763,6 +3760,16 @@ xed_window_create_tab_from_location (XedWindow *window, return process_create_tab (window, XED_TAB (tab), jump_to); } +/** + * xed_window_create_tab_from_stream: + * @window: a #XedWindow + * @stream: the #GInputStream + * @encoding: the encoding to use in the stream + * @line_pos: the position + * @jump_to: whether to jump to the new tab + * + * Returns: (transfer none): the active #XedTab in the @window. + */ XedTab * xed_window_create_tab_from_stream (XedWindow *window, GInputStream *stream, @@ -4272,7 +4279,7 @@ _xed_window_is_fullscreen (XedWindow *window) * * Gets the #XedTab that matches with the given @location. * - * Returns: the #XedTab that matches with the given @location. + * Returns: (transfer none): the #XedTab that matches with the given @location. */ XedTab * xed_window_get_tab_from_location (XedWindow *window, diff --git a/xed/xed.c b/xed/xed.c index 7dc2d6c..5782bed 100644 --- a/xed/xed.c +++ b/xed/xed.c @@ -28,10 +28,7 @@ * $Id$ */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include