[Xfce4-commits] [panel-plugins/xfce4-notes-plugin] 01/01: gtk3: Drop support for GTK+-2.0
noreply at xfce.org
noreply at xfce.org
Sun Oct 2 16:58:44 CEST 2016
This is an automated email from the git hooks/post-receive script.
mmassonnet pushed a commit to branch mmassonnet/gtk3-only
in repository panel-plugins/xfce4-notes-plugin.
commit 7b534aed55e806b2c0896c2856271c59d00560d9
Author: Mike Massonnet <m8t at gandi.net>
Date: Sun Oct 2 14:00:08 2016 +0200
gtk3: Drop support for GTK+-2.0
- remove gtk-2.0 theme
- remove specific gtk-2.0 source code
- remove conditionals #if ENABLE_GTK3
- update requirements to match Xfce 4.12
- include .gitignore file to hide compiled files
---
.gitignore | 34 ++
configure.ac.in | 65 ++--
data/Makefile.am | 2 +-
data/gtk-2.0/Makefile.am | 5 -
data/gtk-2.0/gradient.png | Bin 671 -> 0 bytes
data/gtk-2.0/notes.gtkrc | 375 ---------------------
data/gtk-2.0/scrollbars/Makefile.am | 16 -
data/gtk-2.0/scrollbars/slider-horiz-active.png | Bin 348 -> 0 bytes
data/gtk-2.0/scrollbars/slider-horiz.png | Bin 262 -> 0 bytes
data/gtk-2.0/scrollbars/slider-vert-active.png | Bin 358 -> 0 bytes
data/gtk-2.0/scrollbars/slider-vert.png | Bin 263 -> 0 bytes
data/gtk-2.0/scrollbars/stepper-down-active.png | Bin 2865 -> 0 bytes
data/gtk-2.0/scrollbars/stepper-down.png | Bin 2839 -> 0 bytes
data/gtk-2.0/scrollbars/stepper-left-active.png | Bin 2870 -> 0 bytes
data/gtk-2.0/scrollbars/stepper-left.png | Bin 2837 -> 0 bytes
data/gtk-2.0/scrollbars/stepper-right-active.png | Bin 2871 -> 0 bytes
data/gtk-2.0/scrollbars/stepper-right.png | Bin 2838 -> 0 bytes
data/gtk-2.0/scrollbars/stepper-up-active.png | Bin 2863 -> 0 bytes
data/gtk-2.0/scrollbars/stepper-up.png | Bin 2832 -> 0 bytes
data/gtk-2.0/scrollbars/trough-scrollbar-horiz.png | Bin 2792 -> 0 bytes
data/gtk-2.0/scrollbars/trough-scrollbar-vert.png | Bin 2793 -> 0 bytes
data/gtk-2.0/tabs/Makefile.am | 11 -
data/gtk-2.0/tabs/notebook.png | Bin 2769 -> 0 bytes
data/gtk-2.0/tabs/tab-bottom-active.png | Bin 294 -> 0 bytes
data/gtk-2.0/tabs/tab-bottom.png | Bin 207 -> 0 bytes
data/gtk-2.0/tabs/tab-left-active.png | Bin 172 -> 0 bytes
data/gtk-2.0/tabs/tab-left.png | Bin 212 -> 0 bytes
data/gtk-2.0/tabs/tab-right-active.png | Bin 244 -> 0 bytes
data/gtk-2.0/tabs/tab-right.png | Bin 213 -> 0 bytes
data/gtk-2.0/tabs/tab-top-active.png | Bin 241 -> 0 bytes
data/gtk-2.0/tabs/tab-top.png | Bin 216 -> 0 bytes
data/gtk-3.0/Makefile.am | 3 +
lib/Makefile.am | 34 +-
lib/application.vala | 35 --
lib/ext-gdk.c | 80 -----
lib/ext-gdk.h | 29 --
lib/ext-gdk.vapi | 5 -
lib/icon-button.vala | 36 --
lib/note.vala | 6 +-
lib/popup.c | 58 ----
lib/popup.h | 32 --
lib/popup.vapi | 7 -
lib/theme-gtkcss.vala | 2 -
lib/theme-gtkrc.c | 102 ------
lib/theme-gtkrc.h | 29 --
lib/theme-gtkrc.vapi | 7 -
lib/theme.vala | 5 -
lib/window.vala | 47 +--
src/Makefile.am | 140 +++-----
src/main-panel-plugin.vala | 24 --
src/main-status-icon.vala | 35 +-
src/xfce4-popup-notes.c | 104 ------
52 files changed, 126 insertions(+), 1202 deletions(-)
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..e085ad0
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,34 @@
+*.lo
+*.o
+*.gmo
+*.stamp
+INSTALL
+Makefile
+Makefile.in
+.deps
+.libs
+aclocal.m4
+autom4te.cache
+compile
+config.guess
+config.h
+config.h.in
+config.log
+config.status
+config.sub
+configure
+configure.ac
+depcomp
+install-sh
+ltmain.sh
+libtool
+mkinstalldirs
+missing
+stamp-h1
+intltool-extract.in
+intltool-merge.in
+intltool-update.in
+po/.intltool-merge-cache
+po/Makefile.in.in
+po/POTFILES
+po/stamp-it
diff --git a/configure.ac.in b/configure.ac.in
index a24cd45..b9cb495 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -2,12 +2,12 @@ dnl
dnl xfce4-notes-plugin - Notes plugin for the Xfce4 panel
dnl
dnl 2003 Jakob Henriksson <b0kaj+dev at lysator.liu.se>
-dnl 2006-2012 Mike Massonnet <mmassonnet at gmail.com>
+dnl 2006-2016 Mike Massonnet <mmassonnet at xfce.org>
dnl
m4_define([xfce4_notes_plugin_version_major], [1])
-m4_define([xfce4_notes_plugin_version_minor], [8])
-m4_define([xfce4_notes_plugin_version_micro], [2])
+m4_define([xfce4_notes_plugin_version_minor], [9])
+m4_define([xfce4_notes_plugin_version_micro], [0])
m4_define([xfce4_notes_plugin_version_nano], [])
m4_define([xfce4_notes_plugin_version_build], [@REVISION@])
m4_define([xfce4_notes_plugin_version_tag], [git]) # Leave empty for releases
@@ -41,39 +41,24 @@ AC_SUBST([MATH_LIBS], [" -lm"])
dnl Check for required packages
XDT_CHECK_LIBX11_REQUIRE()
-XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.24.0])
-XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.10.0])
-XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.10.0])
-
-dnl Check for GTK
-AC_ARG_ENABLE([gtk3],
- [AC_HELP_STRING([--enable-gtk3], [Build with GTK3])],
- [enable_gtk3=$enableval], [enable_gtk3=no])
-if test "x$enable_gtk3" = "xyes"; then
- dnl GIO 2.28 for GApplication
- XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.28.0])
- XDT_CHECK_PACKAGE([GTK], [gtk+-3.0], [3.2.0])
- XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-2], [4.10.0])
- AC_DEFINE([ENABLE_GTK3], [1], [Defined if build with GTK3 is enabled])
-else
- XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.24.0])
- XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.20.0])
- XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-1], [4.10.0])
- XDT_CHECK_PACKAGE([UNIQUE], [unique-1.0], [1.0.0])
-fi
-AM_CONDITIONAL([ENABLE_GTK3], [test "x$enable_gtk3" = "xyes"])
+XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.30.0])
+XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.30.0])
+XDT_CHECK_PACKAGE([GTK], [gtk+-3.0], [3.14.0])
+XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.12.0])
+XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-2], [4.12.0])
+XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.12.0])
dnl Check for Xfce Panel
-if test "x$enable_gtk3" = "xno" ; then
-XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.10.0])
-fi
+# TODO port plugin to gtk3
+#XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.10.0])
dnl Check for valac
if test "x$USE_MAINTAINER_MODE" = "xyes" ; then
- AM_PROG_VALAC([0.16.0])
+ AM_PROG_VALAC([0.26.0])
if test "x$VALAC" = "x" ; then
AC_MSG_ERROR([Cannot find the "valac" compiler in your PATH])
fi
+ # TODO look forward for an xfce4-vala 4.12 release
XDT_CHECK_PACKAGE([XFCE4VALA], [xfce4-vala], [4.10])
fi
@@ -87,9 +72,7 @@ XDT_FEATURE_DEBUG()
AC_OUTPUT([
Makefile
data/Makefile
-data/gtk-2.0/Makefile
-data/gtk-2.0/tabs/Makefile
-data/gtk-2.0/scrollbars/Makefile
+data/gtk-3.0/Makefile
data/icons/Makefile
data/icons/16x16/Makefile
data/icons/22x22/Makefile
@@ -112,21 +95,17 @@ echo "* Maintainer Mode: $USE_MAINTAINER_MODE"
if test "x$USE_MAINTAINER_MODE" = "xyes" ; then
echo
echo " * Vala: $VALAC $am__vala_version"
-if test "x$enable_gtk3" = "xno" ; then
-echo " * Xfce4-vala: $XFCE4VALA_VERSION"
-fi
+# TODO needed for panel plugin
+#if test "x$enable_gtk3" = "xno" ; then
+#echo " * Xfce4-vala: $XFCE4VALA_VERSION"
+#fi
echo
fi
echo "* GTK+: $GTK_VERSION"
-if test "x$enable_gtk3" = "xyes" ; then
-echo "* W"
-echo "* W GTK3 support is only experimental, don't use for production."
-echo "* W"
-echo
-fi
-if test "x$enable_gtk3" = "xno" ; then
-echo "* Xfce Panel: $LIBXFCE4PANEL_VERSION"
-fi
+# TODO needed for panel plugin, no code yet for gtk3
+#if test "x$enable_gtk3" = "xno" ; then
+#echo "* Xfce Panel: $LIBXFCE4PANEL_VERSION"
+#fi
echo "* Debug Support: $enable_debug"
echo
diff --git a/data/Makefile.am b/data/Makefile.am
index c081716..e01936e 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,5 +1,5 @@
SUBDIRS = \
- gtk-2.0 \
+ gtk-3.0 \
icons \
pixmaps
diff --git a/data/gtk-2.0/Makefile.am b/data/gtk-2.0/Makefile.am
deleted file mode 100644
index 234aa91..0000000
--- a/data/gtk-2.0/Makefile.am
+++ /dev/null
@@ -1,5 +0,0 @@
-SUBDIRS = scrollbars tabs
-notesgtkrcdir = $(pkgdatadir)/gtk-2.0
-dist_notesgtkrc_DATA = \
- gradient.png \
- notes.gtkrc
diff --git a/data/gtk-2.0/gradient.png b/data/gtk-2.0/gradient.png
deleted file mode 100644
index 8d5441c..0000000
Binary files a/data/gtk-2.0/gradient.png and /dev/null differ
diff --git a/data/gtk-2.0/notes.gtkrc b/data/gtk-2.0/notes.gtkrc
deleted file mode 100644
index 01b4428..0000000
--- a/data/gtk-2.0/notes.gtkrc
+++ /dev/null
@@ -1,375 +0,0 @@
-style "notes-default" {
-xthickness = 1
-ythickness = 1
-fg[NORMAL] = @notes_fg_color
-fg[ACTIVE] = @notes_fg_color
-fg[PRELIGHT] = @notes_fg_color
-fg[SELECTED] = @notes_selected_fg_color
-fg[INSENSITIVE] = shade(0.78, at notes_fg_color)
-bg[NORMAL] = @notes_bg_color
-bg[ACTIVE] = @notes_bg_color
-bg[PRELIGHT] = mix(0.90,shade(1.1, at notes_bg_color), at notes_selected_bg_color)
-bg[SELECTED] = @notes_selected_bg_color
-bg[INSENSITIVE] = shade(1.03, at notes_bg_color)
-base[NORMAL] = @notes_base_color
-base[ACTIVE] = shade(0.65, at notes_base_color)
-base[PRELIGHT] = @notes_base_color
-base[SELECTED] = @notes_selected_bg_color
-base[INSENSITIVE] = shade(1.025, at notes_bg_color)
-text[NORMAL] = @notes_text_color
-text[ACTIVE] = shade(0.95, at notes_base_color)
-text[PRELIGHT] = @notes_text_color
-text[SELECTED] = @notes_selected_fg_color
-text[INSENSITIVE] = mix(0.675,shade(0.95, at notes_bg_color), at notes_fg_color)
-}
-
-style "notes-window" = "notes-default" {
- engine "pixmap" {
- image {
- function = FLAT_BOX
- file = "gradient.png"
- border = {0, 0, 40, 0}
- }
- }
-}
-
-style "notes-tooltips" {
-xthickness = 4
-ythickness = 4
-bg[NORMAL] = @notes_fg_color
-fg[NORMAL] = @notes_bg_color
-}
-
-style "notes-notebook" = "notes-default" {
-xthickness = 0
-ythickness = 1
-
-bg[NORMAL] = @notes_fg_color
-fg[NORMAL] = @notes_fg_color
-fg[ACTIVE] = shade(0.77, at notes_fg_color)
-
- engine "pixmap" {
- image {
- function = EXTENSION
- state = ACTIVE
- file = "tabs/tab-bottom.png"
- border = { 3,3,3,3 }
- stretch = TRUE
- gap_side = TOP
- }
- image {
- function = EXTENSION
- state = ACTIVE
- file = "tabs/tab-top.png"
- border = { 3,3,3,3 }
- stretch = TRUE
- gap_side = BOTTOM
- }
- image {
- function = EXTENSION
- state = ACTIVE
- file = "tabs/tab-left.png"
- border = { 3,3,3,3 }
- stretch = TRUE
- gap_side = RIGHT
- }
- image {
- function = EXTENSION
- state = ACTIVE
- file = "tabs/tab-right.png"
- border = { 3,3,3,3 }
- stretch = TRUE
- gap_side = LEFT
- }
-
- image {
- function = EXTENSION
- state = NORMAL
- file = "tabs/tab-bottom-active.png"
- border = { 3,3,3,3 }
- stretch = TRUE
- gap_side = TOP
- }
- image {
- function = EXTENSION
- state = NORMAL
- file = "tabs/tab-top-active.png"
- border = { 3,3,3,3 }
- stretch = TRUE
- gap_side = BOTTOM
- }
- image {
- function = EXTENSION
- state = NORMAL
- file = "tabs/tab-left-active.png"
- border = { 3,3,3,3 }
- stretch = TRUE
- gap_side = RIGHT
- }
- image {
- function = EXTENSION
- state = NORMAL
- file = "tabs/tab-right-active.png"
- border = { 3,3,3,3 }
- stretch = TRUE
- gap_side = LEFT
- }
-
- image {
- function = BOX_GAP
- file = "tabs/notebook.png"
- border = { 4, 4, 4, 4 }
- stretch = TRUE
- }
- image {
- function = BOX
- file = "tabs/notebook.png"
- border = { 4, 4, 4, 4 }
- stretch = TRUE
- }
- }
-}
-
-style "notes-scrollbar" = "notes-default" {
-GtkRange::trough_border = 0
-GtkRange::slider_width = 15
-GtkRange::stepper_size = 14
-GtkScrollbar::has-backward-stepper = 1
-GtkScrollbar::has-forward-stepper = 1
-GtkScrollbar::trough-border = 1
-GtkScrollbar::min_slider_length = 30
-
- engine "pixmap" {
- # Horizontal slider background
- image {
- function = BOX
- detail = "trough"
- file = "scrollbars/trough-scrollbar-horiz.png"
- border = { 30, 30, 0, 0 }
- stretch = TRUE
- orientation = HORIZONTAL
- }
- # Vertical slider background
- image {
- function = BOX
- detail = "trough"
- file = "scrollbars/trough-scrollbar-vert.png"
- border = { 0, 0, 30, 30 }
- stretch = TRUE
- orientation = VERTICAL
- }
-
- # Horizontal slider (normal)
- image {
- function = SLIDER
- state = NORMAL
- file = "scrollbars/slider-horiz.png"
- border = { 15, 15, 6, 6 }
- stretch = TRUE
- orientation = HORIZONTAL
- }
- # Horizontal slider (active)
- image {
- function = SLIDER
- state = ACTIVE
- file = "scrollbars/slider-horiz-active.png"
- border = { 15, 15, 6, 6 }
- stretch = TRUE
- orientation = HORIZONTAL
- }
- # Horizontal slider (prelight)
- image {
- function = SLIDER
- state = PRELIGHT
- file = "scrollbars/slider-horiz-active.png"
- border = { 15, 15, 6, 6 }
- stretch = TRUE
- orientation = HORIZONTAL
- }
- # Horizontal slider (insensitive)
- image {
- function = SLIDER
- state = INSENSITIVE
- file = "scrollbars/slider-horiz.png"
- border = { 15, 15, 6, 6 }
- stretch = TRUE
- orientation = HORIZONTAL
- }
-
- # Vertical slider (normal)
- image {
- function = SLIDER
- state = NORMAL
- file = "scrollbars/slider-vert.png"
- border = { 6, 6, 15, 15 }
- stretch = TRUE
- orientation = VERTICAL
- }
- # Vertical slider (active)
- image {
- function = SLIDER
- state = ACTIVE
- file = "scrollbars/slider-vert-active.png"
- border = { 6, 6, 15, 15 }
- stretch = TRUE
- orientation = VERTICAL
- }
- # Vertical slider (prelight)
- image {
- function = SLIDER
- state = PRELIGHT
- file = "scrollbars/slider-vert-active.png"
- border = { 6, 6, 15, 15 }
- stretch = TRUE
- orientation = VERTICAL
- }
- # Vertical slider (insensitive)
- image {
- function = SLIDER
- state = INSENSITIVE
- file = "scrollbars/slider-vert.png"
- border = { 6, 6, 15, 15 }
- stretch = TRUE
- orientation = VERTICAL
- }
-
- # Scrollbar stepper up (normal)
- image {
- function = STEPPER
- state = NORMAL
- file = "scrollbars/stepper-up.png"
- stretch = TRUE
- arrow_direction = UP
- }
- # Scrollbar stepper up (active)
- image {
- function = STEPPER
- state = ACTIVE
- file = "scrollbars/stepper-up-active.png"
- stretch = TRUE
- arrow_direction = UP
- }
- # Scrollbar stepper up (prelight)
- image {
- function = STEPPER
- state = PRELIGHT
- file = "scrollbars/stepper-up-active.png"
- stretch = TRUE
- arrow_direction = UP
- }
- # Scrollbar stepper up (insensitive)
- image {
- function = STEPPER
- state = INSENSITIVE
- file = "scrollbars/stepper-up.png"
- stretch = TRUE
- arrow_direction = UP
- }
-
- # Scrollbar stepper down (normal)
- image {
- function = STEPPER
- state = NORMAL
- file = "scrollbars/stepper-down.png"
- stretch = TRUE
- arrow_direction = DOWN
- }
- # Scrollbar stepper down (active)
- image {
- function = STEPPER
- state = ACTIVE
- file = "scrollbars/stepper-down-active.png"
- stretch = TRUE
- arrow_direction = DOWN
- }
- # Scrollbar stepper down (prelight)
- image {
- function = STEPPER
- state = PRELIGHT
- file = "scrollbars/stepper-down-active.png"
- stretch = TRUE
- arrow_direction = DOWN
- }
- # Scrollbar stepper down (insensitive)
- image {
- function = STEPPER
- state = INSENSITIVE
- file = "scrollbars/stepper-down.png"
- stretch = TRUE
- arrow_direction = DOWN
- }
-
- # Scrollbar stepper left (normal)
- image {
- function = STEPPER
- state = NORMAL
- file = "scrollbars/stepper-left.png"
- stretch = TRUE
- arrow_direction = LEFT
- }
- # Scrollbar stepper left (active)
- image {
- function = STEPPER
- state = ACTIVE
- file = "scrollbars/stepper-left-active.png"
- stretch = TRUE
- arrow_direction = LEFT
- }
- # Scrollbar stepper left (prelight)
- image {
- function = STEPPER
- state = PRELIGHT
- file = "scrollbars/stepper-left-active.png"
- stretch = TRUE
- arrow_direction = LEFT
- }
- # Scrollbar stepper left (insensitive)
- image {
- function = STEPPER
- state = INSENSITIVE
- file = "scrollbars/stepper-left.png"
- stretch = TRUE
- arrow_direction = LEFT
- }
-
- # Scrollbar stepper right (normal)
- image {
- function = STEPPER
- state = NORMAL
- file = "scrollbars/stepper-right.png"
- stretch = TRUE
- arrow_direction = RIGHT
- }
- # Scrollbar stepper right (active)
- image {
- function = STEPPER
- state = ACTIVE
- file = "scrollbars/stepper-right-active.png"
- stretch = TRUE
- arrow_direction = RIGHT
- }
- # Scrollbar stepper right (prelight)
- image {
- function = STEPPER
- state = PRELIGHT
- file = "scrollbars/stepper-right-active.png"
- stretch = TRUE
- arrow_direction = RIGHT
- }
- # Scrollbar stepper right (insensitive)
- image {
- function = STEPPER
- state = INSENSITIVE
- file = "scrollbars/stepper-right.png"
- stretch = TRUE
- arrow_direction = RIGHT
- }
- }
-}
-
-widget "notes-window*" style "notes-default"
-widget "notes-window" style "notes-window"
-widget "gtk-tooltip*" style "notes-tooltips"
-widget "*notes-notebook*" style "notes-notebook"
-widget_class "*<GtkScrolledWindow>*" style "notes-scrollbar"
-
diff --git a/data/gtk-2.0/scrollbars/Makefile.am b/data/gtk-2.0/scrollbars/Makefile.am
deleted file mode 100644
index 13c0b37..0000000
--- a/data/gtk-2.0/scrollbars/Makefile.am
+++ /dev/null
@@ -1,16 +0,0 @@
-scrollbarsdir = $(pkgdatadir)/gtk-2.0/scrollbars
-dist_scrollbars_DATA = \
- slider-horiz-active.png \
- slider-horiz.png \
- slider-vert-active.png \
- slider-vert.png \
- stepper-down-active.png \
- stepper-down.png \
- stepper-left-active.png \
- stepper-left.png \
- stepper-right-active.png \
- stepper-right.png \
- stepper-up-active.png \
- stepper-up.png \
- trough-scrollbar-horiz.png \
- trough-scrollbar-vert.png
diff --git a/data/gtk-2.0/scrollbars/slider-horiz-active.png b/data/gtk-2.0/scrollbars/slider-horiz-active.png
deleted file mode 100644
index 716a728..0000000
Binary files a/data/gtk-2.0/scrollbars/slider-horiz-active.png and /dev/null differ
diff --git a/data/gtk-2.0/scrollbars/slider-horiz.png b/data/gtk-2.0/scrollbars/slider-horiz.png
deleted file mode 100644
index a619d60..0000000
Binary files a/data/gtk-2.0/scrollbars/slider-horiz.png and /dev/null differ
diff --git a/data/gtk-2.0/scrollbars/slider-vert-active.png b/data/gtk-2.0/scrollbars/slider-vert-active.png
deleted file mode 100644
index 5050c72..0000000
Binary files a/data/gtk-2.0/scrollbars/slider-vert-active.png and /dev/null differ
diff --git a/data/gtk-2.0/scrollbars/slider-vert.png b/data/gtk-2.0/scrollbars/slider-vert.png
deleted file mode 100644
index d2da00b..0000000
Binary files a/data/gtk-2.0/scrollbars/slider-vert.png and /dev/null differ
diff --git a/data/gtk-2.0/scrollbars/stepper-down-active.png b/data/gtk-2.0/scrollbars/stepper-down-active.png
deleted file mode 100644
index 52ff742..0000000
Binary files a/data/gtk-2.0/scrollbars/stepper-down-active.png and /dev/null differ
diff --git a/data/gtk-2.0/scrollbars/stepper-down.png b/data/gtk-2.0/scrollbars/stepper-down.png
deleted file mode 100644
index 0e84d87..0000000
Binary files a/data/gtk-2.0/scrollbars/stepper-down.png and /dev/null differ
diff --git a/data/gtk-2.0/scrollbars/stepper-left-active.png b/data/gtk-2.0/scrollbars/stepper-left-active.png
deleted file mode 100644
index 6590cca..0000000
Binary files a/data/gtk-2.0/scrollbars/stepper-left-active.png and /dev/null differ
diff --git a/data/gtk-2.0/scrollbars/stepper-left.png b/data/gtk-2.0/scrollbars/stepper-left.png
deleted file mode 100644
index 3d903a9..0000000
Binary files a/data/gtk-2.0/scrollbars/stepper-left.png and /dev/null differ
diff --git a/data/gtk-2.0/scrollbars/stepper-right-active.png b/data/gtk-2.0/scrollbars/stepper-right-active.png
deleted file mode 100644
index 376a95b..0000000
Binary files a/data/gtk-2.0/scrollbars/stepper-right-active.png and /dev/null differ
diff --git a/data/gtk-2.0/scrollbars/stepper-right.png b/data/gtk-2.0/scrollbars/stepper-right.png
deleted file mode 100644
index 723db3a..0000000
Binary files a/data/gtk-2.0/scrollbars/stepper-right.png and /dev/null differ
diff --git a/data/gtk-2.0/scrollbars/stepper-up-active.png b/data/gtk-2.0/scrollbars/stepper-up-active.png
deleted file mode 100644
index d2e6955..0000000
Binary files a/data/gtk-2.0/scrollbars/stepper-up-active.png and /dev/null differ
diff --git a/data/gtk-2.0/scrollbars/stepper-up.png b/data/gtk-2.0/scrollbars/stepper-up.png
deleted file mode 100644
index 1bd9133..0000000
Binary files a/data/gtk-2.0/scrollbars/stepper-up.png and /dev/null differ
diff --git a/data/gtk-2.0/scrollbars/trough-scrollbar-horiz.png b/data/gtk-2.0/scrollbars/trough-scrollbar-horiz.png
deleted file mode 100644
index 5e08328..0000000
Binary files a/data/gtk-2.0/scrollbars/trough-scrollbar-horiz.png and /dev/null differ
diff --git a/data/gtk-2.0/scrollbars/trough-scrollbar-vert.png b/data/gtk-2.0/scrollbars/trough-scrollbar-vert.png
deleted file mode 100644
index 26ee2c1..0000000
Binary files a/data/gtk-2.0/scrollbars/trough-scrollbar-vert.png and /dev/null differ
diff --git a/data/gtk-2.0/tabs/Makefile.am b/data/gtk-2.0/tabs/Makefile.am
deleted file mode 100644
index e0aa284..0000000
--- a/data/gtk-2.0/tabs/Makefile.am
+++ /dev/null
@@ -1,11 +0,0 @@
-tabsdir = $(pkgdatadir)/gtk-2.0/tabs
-dist_tabs_DATA = \
- notebook.png \
- tab-bottom-active.png \
- tab-bottom.png \
- tab-left-active.png \
- tab-left.png \
- tab-right-active.png \
- tab-right.png \
- tab-top-active.png \
- tab-top.png
diff --git a/data/gtk-2.0/tabs/notebook.png b/data/gtk-2.0/tabs/notebook.png
deleted file mode 100644
index 8f6ff08..0000000
Binary files a/data/gtk-2.0/tabs/notebook.png and /dev/null differ
diff --git a/data/gtk-2.0/tabs/tab-bottom-active.png b/data/gtk-2.0/tabs/tab-bottom-active.png
deleted file mode 100644
index 7f8990f..0000000
Binary files a/data/gtk-2.0/tabs/tab-bottom-active.png and /dev/null differ
diff --git a/data/gtk-2.0/tabs/tab-bottom.png b/data/gtk-2.0/tabs/tab-bottom.png
deleted file mode 100644
index 93f4965..0000000
Binary files a/data/gtk-2.0/tabs/tab-bottom.png and /dev/null differ
diff --git a/data/gtk-2.0/tabs/tab-left-active.png b/data/gtk-2.0/tabs/tab-left-active.png
deleted file mode 100644
index f14e4c9..0000000
Binary files a/data/gtk-2.0/tabs/tab-left-active.png and /dev/null differ
diff --git a/data/gtk-2.0/tabs/tab-left.png b/data/gtk-2.0/tabs/tab-left.png
deleted file mode 100644
index a0a7398..0000000
Binary files a/data/gtk-2.0/tabs/tab-left.png and /dev/null differ
diff --git a/data/gtk-2.0/tabs/tab-right-active.png b/data/gtk-2.0/tabs/tab-right-active.png
deleted file mode 100644
index 79ea381..0000000
Binary files a/data/gtk-2.0/tabs/tab-right-active.png and /dev/null differ
diff --git a/data/gtk-2.0/tabs/tab-right.png b/data/gtk-2.0/tabs/tab-right.png
deleted file mode 100644
index 567f069..0000000
Binary files a/data/gtk-2.0/tabs/tab-right.png and /dev/null differ
diff --git a/data/gtk-2.0/tabs/tab-top-active.png b/data/gtk-2.0/tabs/tab-top-active.png
deleted file mode 100644
index b4e3fe1..0000000
Binary files a/data/gtk-2.0/tabs/tab-top-active.png and /dev/null differ
diff --git a/data/gtk-2.0/tabs/tab-top.png b/data/gtk-2.0/tabs/tab-top.png
deleted file mode 100644
index a8712aa..0000000
Binary files a/data/gtk-2.0/tabs/tab-top.png and /dev/null differ
diff --git a/data/gtk-3.0/Makefile.am b/data/gtk-3.0/Makefile.am
new file mode 100644
index 0000000..a6a4c3a
--- /dev/null
+++ b/data/gtk-3.0/Makefile.am
@@ -0,0 +1,3 @@
+notesgtkcssdir = $(pkgdatadir)/gtk-3.0
+dist_notesgtkcss_DATA = \
+ gtk-main.css
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 118582a..c971e9c 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -6,18 +6,8 @@ libnotes_la_VALAFLAGS = \
--vapidir=$(srcdir) \
--pkg=config \
--pkg=libxfconf-0 \
- --pkg=libxfce4util-1.0
-
-if ENABLE_GTK3
-libnotes_la_VALAFLAGS += \
- -D ENABLE_GTK3 \
+ --pkg=libxfce4util-1.0 \
--pkg=gtk+-3.0
-else
-libnotes_la_VALAFLAGS += \
- --pkg=ext-gdk \
- --pkg=theme-gtkrc \
- --pkg=gtk+-2.0
-endif
libnotes_la_SOURCES = \
icon-button.vala \
@@ -26,17 +16,8 @@ libnotes_la_SOURCES = \
hypertextview.vala \
note.vala \
window.vala \
- theme.vala
-
-if ENABLE_GTK3
-libnotes_la_SOURCES += \
+ theme.vala \
theme-gtkcss.vala
-else
-libnotes_la_SOURCES += \
- popup.c \
- ext-gdk.c \
- theme-gtkrc.c
-endif
libnotes_la_CFLAGS = \
-DPKGDATADIR=\""$(pkgdatadir)"\" \
@@ -56,17 +37,6 @@ libnotes_la_LIBADD = \
@XFCONF_LIBS@
EXTRA_DIST = \
- ext-gdk.h \
- theme-gtkrc.h \
- popup.h \
libnotes.vapi \
libnotes.h
-if ENABLE_GTK3
-EXTRA_DIST += \
- ext-gdk.c \
- theme-gtkrc.c \
- popup.c
-else
-endif
-
diff --git a/lib/application.vala b/lib/application.vala
index 243f80e..9f0370a 100644
--- a/lib/application.vala
+++ b/lib/application.vala
@@ -31,11 +31,6 @@ namespace Xnp {
private Xfconf.Channel xfconf_channel;
construct {
-#if !ENABLE_GTK3
- var notesgtkrc = "%s/xfce4/xfce4-notes.gtkrc".printf (GLib.Environment.get_user_config_dir ());
- Gtk.rc_parse (notesgtkrc);
-#endif
-
try {
Xfce.PosixSignalHandler.init ();
Xfce.PosixSignalHandler.set_handler(ProcessSignal.TERM, quit);
@@ -145,13 +140,8 @@ namespace Xnp {
private void update_color () {
string color = xfconf_channel.get_string ("/global/background-color", "#F7EB96");
if (color == "GTK+") {
-#if ENABLE_GTK3
// TODO: Read from StyleContext with default CssProvider
return;
-#else
- var style_widget = new Gtk.Invisible ();
- color = style_widget.get_style ().bg[Gtk.StateType.NORMAL].to_string ();
-#endif
}
Xnp.Theme.set_background_color (color);
}
@@ -433,20 +423,13 @@ namespace Xnp {
*/
private void rename_window (Xnp.Window window) {
var dialog = new Gtk.Dialog.with_buttons (_("Rename group"), window,
-#if ENABLE_GTK3
Gtk.DialogFlags.DESTROY_WITH_PARENT,
-#else
- Gtk.DialogFlags.DESTROY_WITH_PARENT|Gtk.DialogFlags.NO_SEPARATOR,
-#endif
Gtk.Stock.CANCEL, Gtk.ResponseType.CANCEL, Gtk.Stock.OK, Gtk.ResponseType.OK);
Gtk.Box content_area = (Gtk.Box)dialog.get_content_area ();
dialog.set_default_response (Gtk.ResponseType.OK);
dialog.resizable = false;
dialog.icon_name = Gtk.Stock.EDIT;
dialog.border_width = 4;
-#if !ENABLE_GTK3
- content_area.border_width = 6;
-#endif
var entry = new Gtk.Entry ();
entry.text = window.name;
@@ -730,24 +713,6 @@ namespace Xnp {
* Open the about dialog.
*/
public void open_about_dialog () {
-#if !ENABLE_GTK3
- Gtk.AboutDialog.set_url_hook ((dialog, uri) => {
- string command;
- try {
- command = "exo-open %s".printf (uri);
- GLib.Process.spawn_command_line_async (command);
- return;
- } catch (GLib.Error e) {
- }
- try {
- command = "firefox %s".printf (uri);
- GLib.Process.spawn_command_line_async (command);
- return;
- } catch (GLib.Error e) {
- }
- });
-#endif
-
string[] authors = {
"(c) 2006-2010 Mike Massonnet",
"(c) 2003 Jakob Henriksson",
diff --git a/lib/ext-gdk.c b/lib/ext-gdk.c
deleted file mode 100644
index c1deec4..0000000
--- a/lib/ext-gdk.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Notes - panel plugin for Xfce Desktop Environment
- * Copyright (C) 2006-2013 Mike Massonnet <mmassonnet at xfce.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
-
-#include <glib.h>
-#include <gdk/gdk.h>
-
-#include "ext-gdk.h"
-
-void
-__gdk_color_contrast (GdkColor *color,
- gdouble contrast)
-{
- /* cf. http://accessibility.kde.org/hsl-adjusted.php */
- gdouble N_r, N_g, N_b;
- gdouble f_r = 0.2125, f_g = 0.7154, f_b = 0.0721;
- gdouble L, L_, m, D, D_;
- gdouble N__1, N_0, N_1;
- gdouble N_r_, N_g_, N_b_;
-
- g_return_if_fail (G_LIKELY (contrast >= 1 && contrast <= 21));
-
- /* Calculate luminosity */
- N_r = pow ((gdouble)color->red / G_MAXUINT16, 2.2);
- N_g = pow ((gdouble)color->green / G_MAXUINT16, 2.2);
- N_b = pow ((gdouble)color->blue / G_MAXUINT16, 2.2);
-
- L = f_r * N_r + f_g * N_g + f_b * N_b;
-
- /* Change luminosity */
- L_ = (L + 0.05) / contrast - 0.05;
-
- N__1 = MIN (N_r, MIN (N_g, N_b));
- N_1 = MAX (N_r, MAX (N_g, N_b));
- if (N_r > N__1 && N_r < N_1)
- N_0 = N_r;
- else if (N_g > N__1 && N_g < N_1)
- N_0 = N_g;
- else if (N_b > N__1 && N_b < N_1)
- N_0 = N_b;
- else
- N_0 = N_1;
-
- m = f_g + f_r * (N_0 - N__1) / (N_1 - N__1);
- D = MIN (L / m, (1 - L) / (1 - m));
- D_ = MIN (L_ / m, (1 - L_) / (1 - m));
-
- N_r_ = L_ + (N_r - L) * D_ / D;
- N_g_ = L_ + (N_g - L) * D_ / D;
- N_b_ = L_ + (N_b - L) * D_ / D;
-
- /* Conversion to RGB */
- color->red = G_MAXUINT16 * pow (N_r_, 1 / 2.2);
- color->green = G_MAXUINT16 * pow (N_g_, 1 / 2.2);
- color->blue = G_MAXUINT16 * pow (N_b_, 1 / 2.2);
-}
-
diff --git a/lib/ext-gdk.h b/lib/ext-gdk.h
deleted file mode 100644
index f6aaedd..0000000
--- a/lib/ext-gdk.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Notes - panel plugin for Xfce Desktop Environment
- * Copyright (C) 2006-2013 Mike Massonnet <mmassonnet at xfce.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#ifndef EXT_GDK_H
-#define EXT_GDK_H
-
-#include <glib.h>
-#include <gdk/gdk.h>
-
-void __gdk_color_contrast (GdkColor *color,
- gdouble contrast);
-#endif
-
diff --git a/lib/ext-gdk.vapi b/lib/ext-gdk.vapi
deleted file mode 100644
index 3afac96..0000000
--- a/lib/ext-gdk.vapi
+++ /dev/null
@@ -1,5 +0,0 @@
-[CCode (cprefix = "", lower_case_prefix = "", cheader_filename = "ext-gdk.h")]
-namespace ExtGdk {
- [CCode (cname = "__gdk_color_constrast")]
- public static void color_contrast (Gdk.Color color, double contrast);
-}
diff --git a/lib/icon-button.vala b/lib/icon-button.vala
index 07b6b14..8f0925a 100644
--- a/lib/icon-button.vala
+++ b/lib/icon-button.vala
@@ -31,9 +31,6 @@ namespace Xnp {
set_visible_window (false);
set_above_child (true);
set_size_request (22, 22);
-#if !ENABLE_GTK3
- set_border_width (2);
-#endif
enter_notify_event.connect (on_enter_notify_event);
leave_notify_event.connect (on_leave_notify_event);
@@ -43,7 +40,6 @@ namespace Xnp {
protected abstract void draw_icon (Cairo.Context cr, int width, int height);
protected void set_widget_source_color (Cairo.Context cr) {
-#if ENABLE_GTK3
var style_context = get_style_context ();
if (sensitive && active) {
@@ -53,21 +49,12 @@ namespace Xnp {
Gdk.cairo_set_source_rgba (cr, style_context.get_color (Gtk.StateFlags.NORMAL));
else if (!sensitive)
Gdk.cairo_set_source_rgba (cr, style_context.get_color (Gtk.StateFlags.INSENSITIVE));
-#else
- if (sensitive && active)
- Gdk.cairo_set_source_color (cr, style.base[Gtk.StateType.NORMAL]);
- else if (sensitive && !active)
- Gdk.cairo_set_source_color (cr, style.fg[Gtk.StateType.INSENSITIVE]);
- else if (!sensitive)
- Gdk.cairo_set_source_color (cr, style.text[Gtk.StateType.INSENSITIVE]);
-#endif
}
public override void add (Gtk.Widget widget) {
warning ("This object doesn't allow packing child widgets.");
}
-#if ENABLE_GTK3
public override bool draw (Cairo.Context cr) {
int width = get_allocated_width ();
int height = get_allocated_height ();
@@ -86,29 +73,6 @@ namespace Xnp {
return false;
}
-#else
- public override bool expose_event (Gdk.EventExpose event) {
- Gtk.Allocation allocation;
- get_allocation (out allocation);
-
- int width = allocation.width - (int)border_width * 2;
- int height = allocation.height - (int)border_width * 2;
- int x = allocation.width / 2 - width / 2 + allocation.x;
- int y = allocation.height / 2 - height / 2 + allocation.y;
-
- var cr = Gdk.cairo_create (get_window ());
- cr.rectangle (x, y, width, height);
- cr.clip ();
-
- var surface = new Cairo.ImageSurface (Cairo.Format.ARGB32, width, height);
- var cr_ = new Cairo.Context (surface);
- draw_icon (cr_, width, height);
- cr.set_source_surface (surface, x, y);
- cr.paint ();
-
- return false;
- }
-#endif
private bool on_enter_notify_event (Gdk.EventCrossing event) {
active = true;
diff --git a/lib/note.vala b/lib/note.vala
index 3d4266e..148d470 100644
--- a/lib/note.vala
+++ b/lib/note.vala
@@ -104,7 +104,8 @@ namespace Xnp {
}
-/*public class GtkSample : Window {
+#if DEBUG_XNP_NOTE
+public class GtkSample : Window {
public GtkSample () {
this.title = "Sample Window";
@@ -122,5 +123,6 @@ namespace Xnp {
return 0;
}
-}*/
+}
+#endif
diff --git a/lib/popup.c b/lib/popup.c
deleted file mode 100644
index 76b8f33..0000000
--- a/lib/popup.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Notes - panel plugin for Xfce Desktop Environment
- * Copyright (C) 2002-2006 Olivier Fourdan
- * Copyright (C) 2009-2010 Mike Massonnet <mmassonnet at xfce.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include <X11/Xlib.h>
-#include <gdk/gdkx.h>
-#include <gtk/gtk.h>
-
-#include "popup.h"
-
-gboolean popup_set_x_selection (GtkWidget *widget) {
- GdkScreen *screen;
- gchar *selection_name;
- Atom selection_atom;
- Window id;
- Display *display;
-
- gtk_widget_realize (widget);
- id = GDK_WINDOW_XID (widget->window);
-
- display = GDK_DISPLAY ();
- screen = gtk_widget_get_screen (widget);
- selection_name = g_strdup_printf (XFCE_NOTES_SELECTION"%d", gdk_screen_get_number (screen));
- selection_atom = XInternAtom (display, selection_name, FALSE);
-
- if (XGetSelectionOwner (display, selection_atom)) {
- return FALSE;
- }
-
- XSelectInput (display, id, PropertyChangeMask);
- XSetSelectionOwner (display, selection_atom, id, GDK_CURRENT_TIME);
-
- return TRUE;
-}
-
-const gchar* popup_get_message_from_event (GdkEventClient *event) {
- if (G_LIKELY (event->data_format == 8 && *(event->data.b) != '\0')) {
- return event->data.b;
- }
- return NULL;
-}
-
diff --git a/lib/popup.h b/lib/popup.h
deleted file mode 100644
index e984505..0000000
--- a/lib/popup.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Notes - panel plugin for Xfce Desktop Environment
- * Copyright (C) 2002-2006 Olivier Fourdan
- * Copyright (C) 2009-2010 Mike Massonnet <mmassonnet at xfce.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#ifndef __POPUP_H__
-#define __POPUP_H__
-
-#include <gtk/gtk.h>
-
-#define XFCE_NOTES_SELECTION "XFCE_NOTES_SELECTION"
-#define NOTES_MSG_SHOW_HIDE "SHOW_HIDE"
-
-gboolean popup_set_x_selection (GtkWidget *widget);
-const gchar* popup_get_message_from_event (GdkEventClient *event);
-
-#endif
diff --git a/lib/popup.vapi b/lib/popup.vapi
deleted file mode 100644
index c330de2..0000000
--- a/lib/popup.vapi
+++ /dev/null
@@ -1,7 +0,0 @@
-[CCode (cheader_filename = "popup.h")]
-namespace Xnp.Popup {
- [CCode (cname = "popup_set_x_selection")]
- public static bool set_x_selection (Gtk.Widget widget);
- [CCode (cname = "popup_get_message_from_event")]
- public static unowned string? get_message_from_event (Gdk.EventClient event);
-}
diff --git a/lib/theme-gtkcss.vala b/lib/theme-gtkcss.vala
index becd371..05d1b59 100644
--- a/lib/theme-gtkcss.vala
+++ b/lib/theme-gtkcss.vala
@@ -17,7 +17,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#if ENABLE_GTK3
namespace Xnp {
public class ThemeGtkcss : GLib.Object {
@@ -49,5 +48,4 @@ namespace Xnp {
}
}
-#endif
diff --git a/lib/theme-gtkrc.c b/lib/theme-gtkrc.c
deleted file mode 100644
index c7aef8f..0000000
--- a/lib/theme-gtkrc.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Notes - panel plugin for Xfce Desktop Environment
- * Copyright (c) 2006-2013 Mike Massonnet <mmassonnet at xfce.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-#include <glib.h>
-#include <gdk/gdk.h>
-
-#include "ext-gdk.h"
-
-
-
-#define RC_STYLE \
- "gtk_color_scheme = \"notes_fg_color:#xxxxxxxxxxxx\\nnotes_bg_color:#xxxxxxxxxxxx\\n" \
- "notes_base_color:#xxxxxxxxxxxx\\nnotes_text_color:#xxxxxxxxxxxx\\n" \
- "notes_selected_bg_color:#xxxxxxxxxxxx\\nnotes_selected_fg_color:#xxxxxxxxxxxx\"\n" \
- "include \"" PKGDATADIR "/gtk-2.0/notes.gtkrc\""
-
-
-
-void
-update_gtkrc (const GdkColor *color)
-{
- GdkColor *color2;
- gchar *notesrc_file;
- gchar *bg;
- gchar *text;
- gchar *selected;
- gchar rc_style[] = RC_STYLE;
- gchar *offset;
-
- /* bg */
- bg = gdk_color_to_string (color);
-
- /* text */
- color2 = gdk_color_copy (color);
- __gdk_color_contrast (color2, 5.);
- text = gdk_color_to_string (color2);
- gdk_color_free (color2);
-
- /* selected */
- color2 = gdk_color_copy (color);
- __gdk_color_contrast (color2, 3.2);
- selected = gdk_color_to_string (color2);
- gdk_color_free (color2);
-
- /* notes_fg_color */
- offset = rc_style + 35;
- memcpy (offset, bg, 13);
-
- /* notes_bg_color */
- offset += 30;
- memcpy (offset, text, 13);
-
- /* notes_base_color */
- offset += 32;
- memcpy (offset, bg, 13);
-
- /* notes_text_color */
- offset += 32;
- memcpy (offset, text, 13);
-
- /* notes_selected_bg_color */
- offset += 39;
- memcpy (offset, selected, 13);
-
- /* notes_selected_fg_color */
- offset += 39;
- memcpy (offset, bg, 13);
-
- /* set the rc style */
- notesrc_file = g_strdup_printf ("%s/xfce4/xfce4-notes.gtkrc", g_get_user_config_dir ());
- g_file_set_contents (notesrc_file, rc_style, -1, NULL);
-
- g_free (notesrc_file);
- g_free (bg);
- g_free (text);
- g_free (selected);
-}
-
diff --git a/lib/theme-gtkrc.h b/lib/theme-gtkrc.h
deleted file mode 100644
index bd82cf6..0000000
--- a/lib/theme-gtkrc.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Notes - panel plugin for Xfce Desktop Environment
- * Copyright (c) 2006-2013 Mike Massonnet <mmassonnet at xfce.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#ifndef THEME_GTKRC_H
-#define THEME_GTKRC_H
-
-#include <glib.h>
-#include <gdk/gdk.h>
-
-void xnp_theme_update_gtkrc (const GdkColor color);
-
-#endif
-
diff --git a/lib/theme-gtkrc.vapi b/lib/theme-gtkrc.vapi
deleted file mode 100644
index 5405c17..0000000
--- a/lib/theme-gtkrc.vapi
+++ /dev/null
@@ -1,7 +0,0 @@
-namespace Xnp {
- public class ThemeGtkrc {
- [CCode (cname = "update_gtkrc", cheader_filename = "theme-gtkrc.h")]
- public static void update_gtkrc (Gdk.Color color);
- }
-}
-
diff --git a/lib/theme.vala b/lib/theme.vala
index d6b50ef..e0c821d 100644
--- a/lib/theme.vala
+++ b/lib/theme.vala
@@ -28,13 +28,8 @@ namespace Xnp {
return;
}
-#if ENABLE_GTK3
Xnp.ThemeGtkcss.update_css (gdkcolor);
Xnp.ThemeGtkcss.update_style_context ();
-#else
- Xnp.ThemeGtkrc.update_gtkrc (gdkcolor);
- Gtk.rc_reparse_all ();
-#endif
}
}
diff --git a/lib/window.vala b/lib/window.vala
index a930327..64dfe82 100644
--- a/lib/window.vala
+++ b/lib/window.vala
@@ -40,11 +40,7 @@ namespace Xnp {
private Xnp.TitleBarButton left_arrow_button;
private Xnp.TitleBarButton right_arrow_button;
private Xnp.TitleBarButton close_button;
-#if ENABLE_GTK3
private Gtk.Box content_box;
-#else
- private Gtk.VBox content_box;
-#endif
private Gtk.Notebook notebook;
private Gtk.UIManager ui;
@@ -219,22 +215,14 @@ namespace Xnp {
frame.modify_style (style);
frame.show ();
add (frame);
-#if ENABLE_GTK3
var vbox_frame = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
-#else
- var vbox_frame = new Gtk.VBox (false, 0);
-#endif
vbox_frame.spacing = 1;
vbox_frame.show ();
frame.add (vbox_frame);
/* Build title bar */
-#if ENABLE_GTK3
var title_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
-#else
- var title_box = new Gtk.HBox (false, 0);
-#endif
var menu_evbox = new Gtk.EventBox ();
menu_evbox.tooltip_text = _("Menu");
menu_evbox.set_visible_window (false);
@@ -284,11 +272,7 @@ namespace Xnp {
vbox_frame.pack_start (title_box, false, false, 0);
/* Build content box */
-#if ENABLE_GTK3
this.content_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
-#else
- this.content_box = new Gtk.VBox (false, 0);
-#endif
this.content_box.show ();
vbox_frame.pack_start (this.content_box, true, true, 0);
@@ -298,9 +282,6 @@ namespace Xnp {
this.notebook.show_border = true;
this.notebook.show_tabs = false;
this.notebook.tab_pos = Gtk.PositionType.TOP;
-#if !ENABLE_GTK3
- this.notebook.tab_border = 4;
-#endif
this.notebook.scrollable = true;
this.notebook.show ();
this.content_box.pack_start (this.notebook, true, true, 0);
@@ -645,13 +626,8 @@ namespace Xnp {
Gtk.Requisition requisition;
Gtk.Allocation allocation;
-#if ENABLE_GTK3
get_window ().get_geometry (out winx, out winy, out width, out height);
menu.get_preferred_size (out requisition, null);
-#else
- get_window ().get_geometry (out winx, out winy, out width, out height, null);
- menu.size_request (out requisition);
-#endif
get_window ().get_origin (out x, out y);
push_in = false;
@@ -667,13 +643,9 @@ namespace Xnp {
}
if (x + requisition.width > Gdk.Screen.width ()) {
/* Adjust menu left */
-#if ENABLE_GTK3
int menu_width;
menu.get_preferred_width (out menu_width, null);
x = x - menu_width + allocation.y;
-#else
- x = x - menu.requisition.width + content_box.allocation.y;
-#endif
}
}
@@ -1057,11 +1029,7 @@ namespace Xnp {
var note = (Xnp.Note)(this.notebook.get_nth_page (page));
var dialog = new Gtk.Dialog.with_buttons (_("Rename note"), (Gtk.Window)get_toplevel (),
-#if ENABLE_GTK3
Gtk.DialogFlags.MODAL|Gtk.DialogFlags.DESTROY_WITH_PARENT,
-#else
- Gtk.DialogFlags.MODAL|Gtk.DialogFlags.DESTROY_WITH_PARENT|Gtk.DialogFlags.NO_SEPARATOR,
-#endif
Gtk.Stock.CANCEL, Gtk.ResponseType.CANCEL, Gtk.Stock.OK, Gtk.ResponseType.OK);
Gtk.Box content_area = (Gtk.Box)dialog.get_content_area ();
dialog.set_default_response (Gtk.ResponseType.OK);
@@ -1106,21 +1074,12 @@ namespace Xnp {
return;
var note = (Xnp.Note)(this.notebook.get_nth_page (page));
-#if ENABLE_GTK3
var dialog = new Gtk.FontChooserDialog ("Choose current note font", this);
dialog.set_font (note.text_view.font);
-#else
- var dialog = new Gtk.FontSelectionDialog ("Choose current note font");
- dialog.set_font_name (note.text_view.font);
-#endif
int res = dialog.run ();
dialog.hide ();
if (res == Gtk.ResponseType.OK) {
-#if ENABLE_GTK3
note.text_view.font = dialog.get_font ();
-#else
- note.text_view.font = dialog.get_font_name ();
-#endif
}
dialog.destroy ();
}
@@ -1179,7 +1138,8 @@ namespace Xnp {
}
}
-/* valac -X '-I..' -X '-DGETTEXT_PACKAGE="xfce4-notes-plugin"' -X '-DPKGDATADIR="../data"' -D ENABLE_GTK3 --pkg=gtk+-3.0 --pkg=libxfce4util-1.0 --pkg=libxfconf-0 --pkg=color --pkg=config --vapidir=.. --vapidir=. window.vala note.vala hypertextview.vala icon-button.vala
+/* valac -X '-I..' -X '-DGETTEXT_PACKAGE="xfce4-notes-plugin"' -X '-DPKGDATADIR="../data"' -D DEBUG_XNP_WINDOW --pkg=gtk+-3.0 --pkg=libxfce4util-1.0 --pkg=libxfconf-0 --pkg=color --pkg=config --vapidir=.. --vapidir=. window.vala note.vala hypertextview.vala icon-button.vala */
+#if DEBUG_XNP_WINDOW
static int main (string[] args) {
Gtk.init (ref args);
var sample = new Xnp.Window ();
@@ -1187,8 +1147,7 @@ namespace Xnp {
Gtk.main ();
return 0;
}
-// */
-
+#endif
}
}
diff --git a/src/Makefile.am b/src/Makefile.am
index 9ce0ebf..ab7278b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -13,7 +13,6 @@ AM_CPPFLAGS = \
bin_PROGRAMS = xfce4-popup-notes
-if ENABLE_GTK3
if MAINTAINER_MODE
xfce4_popup_notes_VALAFLAGS = \
--pkg=gtk+-3.0
@@ -31,19 +30,6 @@ xfce4_popup_notes_CFLAGS = \
xfce4_popup_notes_LDADD = \
@GTK_LIBS@
-else
-xfce4_popup_notes_SOURCES = \
- $(top_srcdir)/lib/popup.h \
- xfce4-popup-notes.c
-
-xfce4_popup_notes_CFLAGS = \
- @LIBX11_CFLAGS@ \
- @GTK_CFLAGS@
-
-xfce4_popup_notes_LDADD = \
- @LIBX11_LIBS@ \
- @GTK_LIBS@
-endif
#
# Settings dialog
@@ -74,60 +60,61 @@ xfce4_notes_settings_LDADD = \
# Panel plugin
#
-if !ENABLE_GTK3
-# REM Xfce Panel is not yet built with GTK3 support
-# hence it's impossible to build a panel plugin yet
-
-if MAINTAINER_MODE
-notes_VALAFLAGS = \
- --vapidir=$(top_srcdir)/lib \
- --pkg=libnotes \
- --pkg=config \
- --pkg=libxfce4panel-1.0 \
- --pkg=libxfconf-0 \
- --pkg=libxfce4util-1.0
-
-if ENABLE_GTK3
-notes_VALAFLAGS += \
- -D ENABLE_GTK3 \
- --pkg=gtk+-3.0
-else
-notes_VALAFLAGS += \
- --pkg=popup \
- --pkg=gtk+-2.0
-endif
-
-BUILT_SOURCES += main-panel-plugin.c
-main-panel-plugin.c: main-panel-plugin.vala
- $(AM_V_GEN) $(VALAC) $(notes_VALAFLAGS) $< -C
-endif
-
-plugindir = $(libdir)/xfce4/panel/plugins
-plugin_LTLIBRARIES = libnotes.la
-
-libnotes_la_SOURCES = \
- main-panel-plugin.c
-
-libnotes_la_CFLAGS = \
- @LIBX11_CFLAGS@ \
- @LIBXFCE4PANEL_CFLAGS@ \
- @LIBXFCE4UTIL_CFLAGS@ \
- @XFCONF_CFLAGS@
-
-libnotes_la_LIBADD = \
- $(top_builddir)/lib/libnotes.la \
- @LIBX11_LIBS@ \
- @LIBXFCE4PANEL_LIBS@ \
- @LIBXFCE4UTIL_LIBS@ \
- @XFCONF_LIBS@
-
-libnotes_la_LDFLAGS = \
- -avoid-version \
- -module \
- -no-undefined \
- -export-symbols-regex '^xfce_panel_module_(preinit|init|construct)' \
- $(PLATFORM_LDFLAGS)
-endif
+# TODO port plugin to gtk3
+#if !ENABLE_GTK3
+## REM Xfce Panel is not yet built with GTK3 support
+## hence it's impossible to build a panel plugin yet
+#
+#if MAINTAINER_MODE
+#notes_VALAFLAGS = \
+# --vapidir=$(top_srcdir)/lib \
+# --pkg=libnotes \
+# --pkg=config \
+# --pkg=libxfce4panel-1.0 \
+# --pkg=libxfconf-0 \
+# --pkg=libxfce4util-1.0
+#
+#if ENABLE_GTK3
+#notes_VALAFLAGS += \
+# -D ENABLE_GTK3 \
+# --pkg=gtk+-3.0
+#else
+#notes_VALAFLAGS += \
+# --pkg=popup \
+# --pkg=gtk+-2.0
+#endif
+#
+#BUILT_SOURCES += main-panel-plugin.c
+#main-panel-plugin.c: main-panel-plugin.vala
+# $(AM_V_GEN) $(VALAC) $(notes_VALAFLAGS) $< -C
+#endif
+#
+#plugindir = $(libdir)/xfce4/panel/plugins
+#plugin_LTLIBRARIES = libnotes.la
+#
+#libnotes_la_SOURCES = \
+# main-panel-plugin.c
+#
+#libnotes_la_CFLAGS = \
+# @LIBX11_CFLAGS@ \
+# @LIBXFCE4PANEL_CFLAGS@ \
+# @LIBXFCE4UTIL_CFLAGS@ \
+# @XFCONF_CFLAGS@
+#
+#libnotes_la_LIBADD = \
+# $(top_builddir)/lib/libnotes.la \
+# @LIBX11_LIBS@ \
+# @LIBXFCE4PANEL_LIBS@ \
+# @LIBXFCE4UTIL_LIBS@ \
+# @XFCONF_LIBS@
+#
+#libnotes_la_LDFLAGS = \
+# -avoid-version \
+# -module \
+# -no-undefined \
+# -export-symbols-regex '^xfce_panel_module_(preinit|init|construct)' \
+# $(PLATFORM_LDFLAGS)
+#endif
#
# Status icon
@@ -143,18 +130,8 @@ xfce4_notes_VALAFLAGS = \
--vapidir=. \
--pkg=xfce-autostart \
--pkg=libxfconf-0 \
- --pkg=libxfce4util-1.0
-
-if ENABLE_GTK3
-xfce4_notes_VALAFLAGS += \
- -D ENABLE_GTK3 \
+ --pkg=libxfce4util-1.0 \
--pkg=gtk+-3.0
-else
-xfce4_notes_VALAFLAGS += \
- --pkg=popup \
- --pkg=unique-1.0 \
- --pkg=gtk+-2.0
-endif
BUILT_SOURCES += main-status-icon.c
main-status-icon.c: main-status-icon.vala
@@ -219,11 +196,6 @@ EXTRA_DIST = \
$(applications_in_files) \
$(autostart_in_files)
-if ENABLE_GTK3
-EXTRA_DIST += \
- xfce4-popup-notes.c
-endif
-
DISTCLEANFILES = \
$(desktop_DATA) \
$(applications_DATA) \
diff --git a/src/main-panel-plugin.vala b/src/main-panel-plugin.vala
index 9b09c0b..86c18f6 100644
--- a/src/main-panel-plugin.vala
+++ b/src/main-panel-plugin.vala
@@ -54,8 +54,6 @@ public class NotesPlugin : Xfce.PanelPlugin {
mi.show_all ();
menu_insert_item (mi);
- set_x_selection ();
-
size_changed.connect ((p, size) => {
size = size / (int)nrows;
button.set_size_request (size, size);
@@ -71,28 +69,6 @@ public class NotesPlugin : Xfce.PanelPlugin {
destroy.connect (() => { Gtk.main_quit (); });
}
- /**
- * set_x_selection:
- *
- * Set an X selection to listen to for the popup command.
- */
- private bool set_x_selection () {
-#if !ENABLE_GTK3
- invisible = new Gtk.Invisible ();
- if (!Xnp.Popup.set_x_selection (invisible)) {
- return false;
- }
- invisible.client_event.connect ((w, event) => {
- if (Xnp.Popup.get_message_from_event (event) == "SHOW_HIDE") {
- application.show_hide_notes ();
- return true;
- }
- return false;
- });
-#endif
- return true;
- }
-
}
[ModuleInit]
diff --git a/src/main-status-icon.vala b/src/main-status-icon.vala
index 429b6d8..8a5c602 100644
--- a/src/main-status-icon.vala
+++ b/src/main-status-icon.vala
@@ -44,7 +44,6 @@ static void build_plugin () {
status_icon.popup_menu.connect (() => {
context_menu.popup (null, null, status_icon.position_menu, 0, Gtk.get_current_event_time ());
});
- set_x_selection ();
}
static Gtk.Menu build_context_menu () {
@@ -82,26 +81,8 @@ static Gtk.Menu build_context_menu () {
return menu;
}
-static bool set_x_selection () {
-#if !ENABLE_GTK3
- invisible = new Gtk.Invisible ();
- if (!Xnp.Popup.set_x_selection (invisible)) {
- return false;
- }
- invisible.client_event.connect ((w, event) => {
- if (Xnp.Popup.get_message_from_event (event) == "SHOW_HIDE") {
- application.show_hide_notes ();
- return true;
- }
- return false;
- });
-#endif
- return true;
-}
-
static int main (string[] args) {
Gtk.init (ref args);
-#if ENABLE_GTK3
Gtk.Application app = new Gtk.Application ("org.xfce.Notes", 0);
try {
@@ -118,21 +99,7 @@ static int main (string[] args) {
app.activate.connect (() => {
application.show_hide_notes ();
});
-#else
- Unique.App app = new Unique.App ("org.xfce.Notes", null);
- if (app.is_running) {
- if (app.send_message (Unique.Command.ACTIVATE, null) == Unique.Response.OK) {
- app = null;
- return 0;
- }
- }
- app.message_received.connect ((command, message_data, time_) => {
- if (command != Unique.Command.ACTIVATE) {
- return Unique.Response.PASSTHROUGH;
- }
- return Unique.Response.OK;
- });
-#endif
+
GLib.Environment.set_application_name (_("Notes"));
build_plugin ();
Xfce.Autostart. at set ("xfce4-notes-autostart", "xfce4-notes", false);
diff --git a/src/xfce4-popup-notes.c b/src/xfce4-popup-notes.c
deleted file mode 100644
index da28d42..0000000
--- a/src/xfce4-popup-notes.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/* $Id$
- *
- * Notes - panel plugin for Xfce Desktop Environment
- * popup command to show the notes
- * Copyright (C) 2002-2006 Olivier Fourdan
- * 2006 Mike Massonnet <mmassonnet at gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <gtk/gtk.h>
-#include <gdk/gdkx.h>
-#include <X11/Xlib.h>
-
-#include "popup.h"
-
-
-
-static gboolean
-notes_plugin_check_is_running (GtkWidget *widget,
- Window *xid)
-{
- GdkScreen *gscreen;
- gchar *selection_name;
- Atom selection_atom;
-
- gscreen = gtk_widget_get_screen (widget);
- selection_name = g_strdup_printf (XFCE_NOTES_SELECTION"%d",
- gdk_screen_get_number (gscreen));
- selection_atom = XInternAtom (GDK_DISPLAY (), selection_name, FALSE);
-
- if ((*xid = XGetSelectionOwner (GDK_DISPLAY (), selection_atom)))
- return TRUE;
-
- return FALSE;
-}
-
-gint
-main (gint argc, gchar *argv[])
-{
- GdkEventClient gev;
- GtkWidget *win;
- Window id;
-
- gboolean opt_show_hide = FALSE;
- GError *opt_error = NULL;
-
- GOptionContext *context =
- g_option_context_new ("- command the Xfce 4 notes plugin");
- GOptionEntry entries[] =
- {
- { "show-hide", 0, 0, G_OPTION_ARG_NONE, &opt_show_hide,
- "Default action that show/hide all the windows", NULL },
- { NULL }
- };
-
- g_option_context_set_summary (context, "The default action is to show/hide all windows");
- g_option_context_add_main_entries (context, entries, NULL);
- if (G_LIKELY (! g_option_context_parse (context, &argc, &argv, &opt_error)))
- {
- g_printerr ("%s\n", opt_error->message);
- g_error_free (opt_error);
- return -1;
- }
-
- gtk_init (&argc, &argv);
-
- win = gtk_invisible_new ();
- gtk_widget_realize (win);
-
- gev.type = GDK_CLIENT_EVENT;
- gev.window = win->window;
- gev.send_event = TRUE;
- gev.message_type = gdk_atom_intern ("STRING", FALSE);
- gev.data_format = 8;
- g_snprintf (gev.data.b, sizeof (gev.data.b), NOTES_MSG_SHOW_HIDE);
-
- if (notes_plugin_check_is_running (win, &id))
- gdk_event_send_client_message ((GdkEvent *)&gev, (GdkNativeWindow)id);
- else
- g_warning ("Can't find the xfce4-notes-plugin.\n");
- gdk_flush ();
-
- gtk_widget_destroy (win);
-
- return FALSE;
-}
-
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list