[nautilus/wip/oholy/gnome-42: 26/41] Revert "eel: Drop gtk extensions"




commit 7aeec8a3e46d28cb43e1c74d7f7bb2dd17bc00d7
Author: Ondrej Holy <oholy redhat com>
Date:   Fri Feb 11 14:31:43 2022 +0100

    Revert "eel: Drop gtk extensions"
    
    This reverts commit 23cb15d8eeec9f60e9baab80fff3aad9f9122af1.

 eel/eel-gtk-extensions.c          | 66 +++++++++++++++++++++++++++++++++++++++
 eel/eel-gtk-extensions.h          | 34 ++++++++++++++++++++
 eel/eel-stock-dialogs.c           |  1 +
 eel/eel.h                         |  3 +-
 eel/meson.build                   |  2 ++
 po/POTFILES.in                    |  1 +
 src/nautilus-application.c        |  1 +
 src/nautilus-dnd.c                |  1 +
 src/nautilus-file.c               |  1 +
 src/nautilus-files-view.c         |  1 +
 src/nautilus-global-preferences.c |  1 +
 src/nautilus-properties-window.c  |  1 +
 src/nautilus-window.c             |  1 +
 13 files changed, 113 insertions(+), 1 deletion(-)
---
diff --git a/eel/eel-gtk-extensions.c b/eel/eel-gtk-extensions.c
new file mode 100644
index 000000000..2c3d8ac6d
--- /dev/null
+++ b/eel/eel-gtk-extensions.c
@@ -0,0 +1,66 @@
+/* eel-gtk-extensions.c - implementation of new functions that operate on
+ *                         gtk classes. Perhaps some of these should be
+ *                         rolled into gtk someday.
+ *
+ *  Copyright (C) 1999, 2000, 2001 Eazel, Inc.
+ *
+ *  The Gnome Library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Library General Public License as
+ *  published by the Free Software Foundation; either version 2 of the
+ *  License, or (at your option) any later version.
+ *
+ *  The Gnome Library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public
+ *  License along with the Gnome Library; see the file COPYING.LIB.  If not,
+ *  see <http://www.gnu.org/licenses/>.
+ *
+ *  Authors: John Sullivan <sullivan eazel com>
+ *           Ramiro Estrugo <ramiro eazel com>
+ *           Darin Adler <darin eazel com>
+ */
+
+#include <config.h>
+#include "eel-gtk-extensions.h"
+
+#include "eel-glib-extensions.h"
+#include "eel-string.h"
+
+#include <gdk/gdk.h>
+#include <gtk/gtk.h>
+#include <glib/gi18n-lib.h>
+#include <math.h>
+
+/* This number is fairly arbitrary. Long enough to show a pretty long
+ * menu title, but not so long to make a menu grotesquely wide.
+ */
+#define MAXIMUM_MENU_TITLE_LENGTH       48
+
+/* Used for window position & size sanity-checking. The sizes are big enough to prevent
+ * at least normal-sized gnome panels from obscuring the window at the screen edges.
+ */
+#define MINIMUM_ON_SCREEN_WIDTH         100
+#define MINIMUM_ON_SCREEN_HEIGHT        100
+
+
+GtkMenuItem *
+eel_gtk_menu_append_separator (GtkMenu *menu)
+{
+    return eel_gtk_menu_insert_separator (menu, -1);
+}
+
+GtkMenuItem *
+eel_gtk_menu_insert_separator (GtkMenu *menu,
+                               int      index)
+{
+    GtkWidget *menu_item;
+
+    menu_item = gtk_separator_menu_item_new ();
+    gtk_widget_show (menu_item);
+    gtk_menu_shell_insert (GTK_MENU_SHELL (menu), menu_item, index);
+
+    return GTK_MENU_ITEM (menu_item);
+}
diff --git a/eel/eel-gtk-extensions.h b/eel/eel-gtk-extensions.h
new file mode 100644
index 000000000..afbd19631
--- /dev/null
+++ b/eel/eel-gtk-extensions.h
@@ -0,0 +1,34 @@
+
+/* eel-gtk-extensions.h - interface for new functions that operate on
+                              gtk classes. Perhaps some of these should be
+                              rolled into gtk someday.
+
+   Copyright (C) 1999, 2000, 2001 Eazel, Inc.
+
+   The Gnome Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The Gnome Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the Gnome Library; see the file COPYING.LIB.  If not,
+   see <http://www.gnu.org/licenses/>.
+
+   Authors: John Sullivan <sullivan eazel com>
+            Ramiro Estrugo <ramiro eazel com>
+*/
+
+#pragma once
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gtk/gtk.h>
+
+/* GtkMenu and GtkMenuItem */
+GtkMenuItem *         eel_gtk_menu_append_separator                   (GtkMenu              *menu);
+GtkMenuItem *         eel_gtk_menu_insert_separator                   (GtkMenu              *menu,
+                                                                      int                   index);
diff --git a/eel/eel-stock-dialogs.c b/eel/eel-stock-dialogs.c
index 9e10eb28a..8cf2efbcd 100644
--- a/eel/eel-stock-dialogs.c
+++ b/eel/eel-stock-dialogs.c
@@ -23,6 +23,7 @@
 #include "eel-stock-dialogs.h"
 
 #include "eel-glib-extensions.h"
+#include "eel-gtk-extensions.h"
 
 #include <glib/gi18n-lib.h>
 #include <gtk/gtk.h>
diff --git a/eel/eel.h b/eel/eel.h
index 855339411..cf3cddac5 100644
--- a/eel/eel.h
+++ b/eel/eel.h
@@ -25,7 +25,8 @@
 #include <eel/eel-art-extensions.h>
 #include <eel/eel-glib-extensions.h>
 #include <eel/eel-graphic-effects.h>
+#include <eel/eel-gtk-extensions.h>
 #include <eel/eel-self-checks.h>
 #include <eel/eel-stock-dialogs.h>
 #include <eel/eel-string.h>
-#include <eel/eel-vfs-extensions.h>
+#include <eel/eel-vfs-extensions.h>
\ No newline at end of file
diff --git a/eel/meson.build b/eel/meson.build
index adf7547e1..8f88a9bad 100644
--- a/eel/meson.build
+++ b/eel/meson.build
@@ -6,6 +6,7 @@ libeel_2_sources = [
   'eel-glib-extensions.h',
   'eel-graphic-effects.h',
   'eel-graphic-effects.c',
+  'eel-gtk-extensions.h',
   'eel-self-checks.h',
   'eel-self-checks.c',
   'eel-stock-dialogs.h',
@@ -15,6 +16,7 @@ libeel_2_sources = [
   'eel-vfs-extensions.h',
   'eel-vfs-extensions.c',
   'eel.h',
+  'eel-gtk-extensions.c',
   'eel-lib-self-check-functions.h',
   'eel-lib-self-check-functions.c',
 ]
diff --git a/po/POTFILES.in b/po/POTFILES.in
index cea948da6..20c36be67 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -4,6 +4,7 @@ data/nautilus-autorun-software.desktop.in
 data/org.gnome.Nautilus.appdata.xml.in.in
 data/org.gnome.Nautilus.desktop.in.in
 data/org.gnome.nautilus.gschema.xml
+eel/eel-gtk-extensions.c
 eel/eel-stock-dialogs.c
 eel/eel-vfs-extensions.c
 extensions/audio-video-properties/bacon-video-widget-properties.c
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index e254c6513..76ac83fea 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -26,6 +26,7 @@
 
 #include "nautilus-application.h"
 
+#include <eel/eel-gtk-extensions.h>
 #include <eel/eel-stock-dialogs.h>
 #include <fcntl.h>
 #include <gdk/gdk.h>
diff --git a/src/nautilus-dnd.c b/src/nautilus-dnd.c
index 769f224ef..578ad1dd0 100644
--- a/src/nautilus-dnd.c
+++ b/src/nautilus-dnd.c
@@ -27,6 +27,7 @@
 #include "nautilus-program-choosing.h"
 #include "nautilus-gtk4-helpers.h"
 #include <eel/eel-glib-extensions.h>
+#include <eel/eel-gtk-extensions.h>
 #include <eel/eel-string.h>
 #include <eel/eel-vfs-extensions.h>
 #include <gtk/gtk.h>
diff --git a/src/nautilus-file.c b/src/nautilus-file.c
index 4253642da..2f10da27f 100644
--- a/src/nautilus-file.c
+++ b/src/nautilus-file.c
@@ -28,6 +28,7 @@
 
 #include <eel/eel-debug.h>
 #include <eel/eel-glib-extensions.h>
+#include <eel/eel-gtk-extensions.h>
 #include <eel/eel-string.h>
 #include <eel/eel-vfs-extensions.h>
 #include <gdesktop-enums.h>
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index b62089cd0..e70d940c2 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -26,6 +26,7 @@
 #include "nautilus-files-view.h"
 
 #include <eel/eel-glib-extensions.h>
+#include <eel/eel-gtk-extensions.h>
 #include <eel/eel-stock-dialogs.h>
 #include <eel/eel-string.h>
 #include <eel/eel-vfs-extensions.h>
diff --git a/src/nautilus-global-preferences.c b/src/nautilus-global-preferences.c
index 6b3a82bf1..d24db28c3 100644
--- a/src/nautilus-global-preferences.c
+++ b/src/nautilus-global-preferences.c
@@ -27,6 +27,7 @@
 #include "nautilus-file.h"
 #include "src/nautilus-files-view.h"
 #include <eel/eel-glib-extensions.h>
+#include <eel/eel-gtk-extensions.h>
 #include <eel/eel-stock-dialogs.h>
 #include <eel/eel-string.h>
 #include <glib/gi18n.h>
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index 804a993bb..6a233370f 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -22,6 +22,7 @@
 #include "nautilus-properties-window.h"
 
 #include <cairo.h>
+#include <eel/eel-gtk-extensions.h>
 #include <eel/eel-stock-dialogs.h>
 #include <eel/eel-string.h>
 #include <eel/eel-vfs-extensions.h>
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 17f8e827f..af695ad0a 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -27,6 +27,7 @@
 #include "nautilus-window.h"
 
 #include <eel/eel-debug.h>
+#include <eel/eel-gtk-extensions.h>
 #include <eel/eel-vfs-extensions.h>
 #include <gdk-pixbuf/gdk-pixbuf.h>
 #include <gdk/gdkkeysyms.h>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]