make gnt.h a single include file
Move the ncurses bits to a new gntncurses.h.in setup
Move all the function prototypes from gnt.h to gntmain.h since thats where they should be
Move the KEY_EVENT undef to gntncurses.h as that's where it is needed
create a global header file and don't let the library use it
Add the single include header guards and deal with fall out
Testing Done:
Compile testing and ran all of the manual tests.
Reviewed at https://reviews.imfreedom.org/r/62/
--- a/gnt-skel.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gnt-skel.h Thu Aug 13 18:23:33 2020 -0500
@@ -30,7 +30,6 @@
--- a/gnt.h.in Thu Jul 30 05:15:53 2020 -0500
+++ b/gnt.h.in Thu Aug 13 18:23:33 2020 -0500
@@ -16,206 +16,20 @@
* 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 Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * this program; if not, see <http://www.gnu.org/licenses/>.
- * @section_id: libgnt-gnt
- * @short_description: General API for managing GNT
+#ifndef GNT_GLOBAL_HEADER_INSIDE +# define GNT_GLOBAL_HEADER_INSIDE -#define NCURSES_WIDECHAR @NCURSES_WIDECHAR@
-#include <@NCURSES_HEADER@>
-#include "gntclipboard.h"
- * @config_dir: the path to a configuration directory, may be %NULL.
- * Change directory to store gnt configuration files (default is ~).
- * You have to call this before #gnt_init. You might want to call this
- * with %NULL, to free the resources, but not before a call to #gnt_quit.
-void gnt_set_config_dir(const gchar *config_dir);
- * Start running the mainloop for gnt.
- * Check whether the terminal is capable of UTF8 display.
- * Returns: %FALSE if the terminal is capable of drawing UTF-8, %TRUE otherwise.
-gboolean gnt_ascii_only(void);
- * @window: The window the present.
- * Present a window. If the event was triggered because of user interaction,
- * the window is moved to the foreground. Otherwise, the Urgent hint is set.
-void gnt_window_present(GntWidget *window);
- * gnt_screen_resize_widget:
- * @widget: The widget to resize.
- * @width: The desired width.
- * @height: The desired height.
-void gnt_screen_resize_widget(GntWidget *widget, int width, int height);
- * gnt_screen_move_widget:
- * @widget: The widget to move.
- * @x: The desired x-coordinate.
- * @y: The desired y-coordinate.
-void gnt_screen_move_widget(GntWidget *widget, int x, int y);
- * gnt_screen_rename_widget:
- * @widget: The widget to rename.
- * @text: The new name for the widget.
-void gnt_screen_rename_widget(GntWidget *widget, const char *text);
- * gnt_widget_has_focus:
- * Check whether a widget has focus.
- * Returns: %TRUE if the widget has the current focus, %FALSE otherwise.
-gboolean gnt_widget_has_focus(GntWidget *widget);
- * gnt_widget_set_urgent:
- * @widget: The widget to set the URGENT hint for.
- * Set the URGENT hint for a widget.
-void gnt_widget_set_urgent(GntWidget *widget);
- * @label: The user-visible label for the action.
- * @callback: (scope async): The callback function for the action.
- * Register a global action.
-void gnt_register_action(const gchar *label, GCallback callback);
- * gnt_screen_menu_show:
- * @menu: The menu to display.
- * Returns: %TRUE if the menu is displayed, %FALSE otherwise (e.g., if another menu is currently displayed).
-gboolean gnt_screen_menu_show(gpointer menu);
- * Terminate the mainloop of gnt.
- * Get the global clipboard.
- * Returns: (transfer none): The clipboard.
-GntClipboard * gnt_get_clipboard(void);
- * gnt_get_clipboard_string:
- * Get the string in the clipboard.
- * Returns: A copy of the string in the clipboard. The caller
- * must g_free() the string.
-gchar * gnt_get_clipboard_string(void);
- * gnt_set_clipboard_string:
- * @string: The new content of the new clipboard.
- * Set the contents of the global clipboard.
-void gnt_set_clipboard_string(const gchar *string);
- * @wd: The working directory for the new application.
- * @argv: The argument vector.
- * @envp: The environment, or %NULL.
- * @stin: Location to store the child's stdin, or %NULL.
- * @stout: Location to store the child's stdout, or %NULL.
- * @sterr: Location to store the child's stderr, or %NULL.
- * @callback: The callback to call after the child exits.
- * @data: The data to pass to the callback.
- * Spawn a different application that will consume the console.
- * Returns: %TRUE if the child was successfully spawned, %FALSE otherwise.
-gboolean gnt_giveup_console(const char *wd, char **argv, char **envp,
- gint *stin, gint *stout, gint *sterr,
- void (*callback)(int status, gpointer data), gpointer data);
- * Check whether a child process is in control of the current terminal.
- * Returns: %TRUE if a child process (eg., PAGER) is occupying the current
- * terminal, %FALSE otherwise.
-gboolean gnt_is_refugee(void);
+#undef GNT_GLOBAL_HEADER_INSIDE --- a/gntbindable.c Thu Jul 30 05:15:53 2020 -0500
+++ b/gntbindable.c Thu Aug 13 18:23:33 2020 -0500
@@ -28,7 +28,6 @@
--- a/gntbindable.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gntbindable.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,6 +20,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" --- a/gntbox.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gntbox.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,6 +20,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" @@ -29,7 +33,6 @@
* @short_description: A box for packing widgets in a single row or column
#define GNT_TYPE_BOX gnt_box_get_type()
--- a/gntboxprivate.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gntboxprivate.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,10 +20,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" #ifndef GNT_BOX_PRIVATE_H
#define GNT_BOX_PRIVATE_H
--- a/gntbutton.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gntbutton.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,6 +20,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" @@ -32,7 +36,6 @@
#define GNT_TYPE_BUTTON gnt_button_get_type()
--- a/gntcheckbox.c Thu Jul 30 05:15:53 2020 -0500
+++ b/gntcheckbox.c Thu Aug 13 18:23:33 2020 -0500
@@ -23,6 +23,7 @@
#include "gntwidgetprivate.h"
--- a/gntcheckbox.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gntcheckbox.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,6 +20,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" @@ -30,7 +34,6 @@
--- a/gntclipboard.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gntclipboard.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,6 +20,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" --- a/gntcolors.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gntcolors.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,6 +20,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" --- a/gntcombobox.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gntcombobox.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,6 +20,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" @@ -29,7 +33,6 @@
* @short_description: A widget for selecting between multiple choices
--- a/gntentry.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gntentry.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,6 +20,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" @@ -29,7 +33,6 @@
* @short_description: A widget for entering text
--- a/gntfilesel.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gntfilesel.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,6 +20,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" @@ -29,7 +33,6 @@
* @short_description: A widget for selecting a file or directory
--- a/gntinternal.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gntinternal.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,8 +20,12 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" #define G_LOG_DOMAIN "Gnt"
--- a/gntkeys.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gntkeys.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,6 +20,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" --- a/gntlabel.c Thu Jul 30 05:15:53 2020 -0500
+++ b/gntlabel.c Thu Aug 13 18:23:33 2020 -0500
@@ -26,6 +26,7 @@
#include "gnttextviewprivate.h"
#include "gntwidgetprivate.h"
--- a/gntlabel.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gntlabel.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,6 +20,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" @@ -29,9 +33,9 @@
* @short_description: A widget that displays text
+#include "gnttextview.h" -#include "gnttextview.h"
#define GNT_TYPE_LABEL gnt_label_get_type()
--- a/gntline.c Thu Jul 30 05:15:53 2020 -0500
+++ b/gntline.c Thu Aug 13 18:23:33 2020 -0500
@@ -23,6 +23,7 @@
#include "gntwidgetprivate.h"
--- a/gntline.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gntline.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,6 +20,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" @@ -29,7 +33,6 @@
* @short_description: A widget that draws a horizontal or vertical line
--- a/gntmain.c Thu Jul 30 05:15:53 2020 -0500
+++ b/gntmain.c Thu Aug 13 18:23:33 2020 -0500
@@ -36,7 +36,6 @@
#define GNT_LOG_DOMAIN "Main"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gntmain.h Thu Aug 13 18:23:33 2020 -0500
@@ -0,0 +1,221 @@
+ * GNT - The GLib Ncurses Toolkit + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * This library 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, see <http://www.gnu.org/licenses/>. +#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" + * @section_id: libgnt-gnt + * @short_description: General API for managing GNT +#include <gntclipboard.h> + * Start running the mainloop for gnt. + * Terminate the mainloop of gnt. + * @config_dir: the path to a configuration directory, may be %NULL. + * Change directory to store gnt configuration files (default is ~). + * You have to call this before #gnt_init. You might want to call this + * with %NULL, to free the resources, but not before a call to #gnt_quit. +void gnt_set_config_dir(const gchar *config_dir); + * Check whether the terminal is capable of UTF8 display. + * Returns: %FALSE if the terminal is capable of drawing UTF-8, %TRUE otherwise. +gboolean gnt_ascii_only(void); + * @window: The window the present. + * Present a window. If the event was triggered because of user interaction, + * the window is moved to the foreground. Otherwise, the Urgent hint is set. +void gnt_window_present(GntWidget *window); + * gnt_screen_resize_widget: + * @widget: The widget to resize. + * @width: The desired width. + * @height: The desired height. +void gnt_screen_resize_widget(GntWidget *widget, int width, int height); + * gnt_screen_move_widget: + * @widget: The widget to move. + * @x: The desired x-coordinate. + * @y: The desired y-coordinate. +void gnt_screen_move_widget(GntWidget *widget, int x, int y); + * gnt_screen_rename_widget: + * @widget: The widget to rename. + * @text: The new name for the widget. +void gnt_screen_rename_widget(GntWidget *widget, const char *text); + * gnt_widget_has_focus: + * Check whether a widget has focus. + * Returns: %TRUE if the widget has the current focus, %FALSE otherwise. +gboolean gnt_widget_has_focus(GntWidget *widget); + * gnt_widget_set_urgent: + * @widget: The widget to set the URGENT hint for. + * Set the URGENT hint for a widget. +void gnt_widget_set_urgent(GntWidget *widget); + * @label: The user-visible label for the action. + * @callback: (scope async): The callback function for the action. + * Register a global action. +void gnt_register_action(const gchar *label, GCallback callback); + * gnt_screen_menu_show: + * @menu: The menu to display. + * Returns: %TRUE if the menu is displayed, %FALSE otherwise (e.g., if another menu is currently displayed). +gboolean gnt_screen_menu_show(gpointer menu); + * Get the global clipboard. + * Returns: (transfer none): The clipboard. +GntClipboard * gnt_get_clipboard(void); + * gnt_get_clipboard_string: + * Get the string in the clipboard. + * Returns: A copy of the string in the clipboard. The caller + * must g_free() the string. +gchar * gnt_get_clipboard_string(void); + * gnt_set_clipboard_string: + * @string: The new content of the new clipboard. + * Set the contents of the global clipboard. +void gnt_set_clipboard_string(const gchar *string); + * @wd: The working directory for the new application. + * @argv: The argument vector. + * @envp: The environment, or %NULL. + * @stin: Location to store the child's stdin, or %NULL. + * @stout: Location to store the child's stdout, or %NULL. + * @sterr: Location to store the child's stderr, or %NULL. + * @callback: The callback to call after the child exits. + * @data: The data to pass to the callback. + * Spawn a different application that will consume the console. + * Returns: %TRUE if the child was successfully spawned, %FALSE otherwise. +gboolean gnt_giveup_console(const char *wd, char **argv, char **envp, + gint *stin, gint *stout, gint *sterr, + void (*callback)(int status, gpointer data), gpointer data); + * Check whether a child process is in control of the current terminal. + * Returns: %TRUE if a child process (eg., PAGER) is occupying the current + * terminal, %FALSE otherwise. +gboolean gnt_is_refugee(void); --- a/gntmainprivate.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gntmainprivate.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,11 +20,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" #ifndef GNT_MAIN_PRIVATE_H
#define GNT_MAIN_PRIVATE_H
/* Private access to some internals. Contact us if you need these. */
--- a/gntmenu.c Thu Jul 30 05:15:53 2020 -0500
+++ b/gntmenu.c Thu Aug 13 18:23:33 2020 -0500
@@ -22,9 +22,10 @@
#include "gntmenuitemcheck.h"
#include "gntmenuitemprivate.h"
#include "gntwidgetprivate.h"
--- a/gntmenu.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gntmenu.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,6 +20,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" @@ -30,7 +34,6 @@
* @see_also: #GntMenuItem #GntMenuItemCheck
--- a/gntmenuitem.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gntmenuitem.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,6 +20,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" --- a/gntmenuitemcheck.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gntmenuitemcheck.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,6 +20,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" #ifndef GNT_MENU_ITEM_CHECK_H
#define GNT_MENU_ITEM_CHECK_H
@@ -30,7 +34,6 @@
* @see_also: #GntMenu #GntMenuItem
--- a/gntmenuitemprivate.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gntmenuitemprivate.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,10 +20,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" #ifndef GNT_MENUITEM_PRIVATE_H
#define GNT_MENUITEM_PRIVATE_H
--- a/gntmenuprivate.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gntmenuprivate.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,10 +20,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" #ifndef GNT_MENU_PRIVATE_H
#define GNT_MENU_PRIVATE_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gntncurses.h.in Thu Aug 13 18:23:33 2020 -0500
@@ -0,0 +1,39 @@
+ * GNT - The GLib Ncurses Toolkit + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * This library 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, see <http://www.gnu.org/licenses/>. +#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" +/* ncurses defines KEY_EVENT which conflicts on windows some how, so undefine + * the windows constants. +#define NCURSES_WIDECHAR @NCURSES_WIDECHAR@ +#include <@NCURSES_HEADER@> +#endif /* GNT_NCURSES_H */ --- a/gntprogressbar.c Thu Jul 30 05:15:53 2020 -0500
+++ b/gntprogressbar.c Thu Aug 13 18:23:33 2020 -0500
@@ -22,8 +22,9 @@
#include "gntprogressbar.h"
#include "gntwidgetprivate.h"
--- a/gntprogressbar.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gntprogressbar.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,6 +20,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" #ifndef GNT_PROGRESS_BAR_H
#define GNT_PROGRESS_BAR_H
@@ -29,7 +33,6 @@
* @short_description: A widget that shows progress visually
#define GNT_TYPE_PROGRESS_BAR (gnt_progress_bar_get_type ())
--- a/gntslider.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gntslider.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,6 +20,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" @@ -29,7 +33,6 @@
* @short_description: A widget for selecting from a range of values
--- a/gntstyle.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gntstyle.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,6 +20,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" @@ -29,7 +33,6 @@
* @short_description: Styling from a configuration file
--- a/gntstyleprivate.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gntstyleprivate.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,10 +20,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" #ifndef GNT_STYLE_PRIVATE_H
#define GNT_STYLE_PRIVATE_H
--- a/gnttextview.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gnttextview.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,6 +20,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" @@ -29,7 +33,6 @@
* @short_description: A widget for displaying larger bodies of formatted text
--- a/gnttextviewprivate.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gnttextviewprivate.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,10 +20,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" #ifndef GNT_TEXT_VIEW_PRIVATE_H
#define GNT_TEXT_VIEW_PRIVATE_H
--- a/gnttree.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gnttree.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,6 +20,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" @@ -29,7 +33,6 @@
* @short_description: A widget that shows a tree of items
--- a/gnttreeprivate.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gnttreeprivate.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,10 +20,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" #ifndef GNT_TREE_PRIVATE_H
#define GNT_TREE_PRIVATE_H
--- a/gntutils.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gntutils.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,6 +20,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" @@ -31,7 +35,6 @@
--- a/gntversion.h.in Thu Jul 30 05:15:53 2020 -0500
+++ b/gntversion.h.in Thu Aug 13 18:23:33 2020 -0500
@@ -20,6 +20,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" --- a/gntwidget.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gntwidget.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,6 +20,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" --- a/gntwidgetprivate.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gntwidgetprivate.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,10 +20,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" #ifndef GNT_WIDGET_PRIVATE_H
#define GNT_WIDGET_PRIVATE_H
--- a/gntwindow.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gntwindow.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,6 +20,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" @@ -29,7 +33,6 @@
* @short_description: A toplevel window
--- a/gntwm.c Thu Jul 30 05:15:53 2020 -0500
+++ b/gntwm.c Thu Aug 13 18:23:33 2020 -0500
@@ -48,7 +48,6 @@
--- a/gntwm.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gntwm.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,6 +20,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" @@ -29,7 +33,6 @@
* @short_description: A window manager
--- a/gntwmprivate.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gntwmprivate.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,10 +20,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly"
--- a/gntws.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gntws.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,6 +20,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly" @@ -29,7 +33,6 @@
* @short_description: Workspace API
--- a/gntwsprivate.h Thu Jul 30 05:15:53 2020 -0500
+++ b/gntwsprivate.h Thu Aug 13 18:23:33 2020 -0500
@@ -20,10 +20,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#if !defined(GNT_GLOBAL_HEADER_INSIDE) && !defined(GNT_COMPILATION) +# error "only <gnt.h> may be included directly"
--- a/meson.build Thu Jul 30 05:15:53 2020 -0500
+++ b/meson.build Thu Aug 13 18:23:33 2020 -0500
@@ -146,7 +146,6 @@
gnt_config.set10('NCURSES_WIDECHAR', ncurses_widechar)
@@ -159,6 +158,7 @@
@@ -168,14 +168,13 @@
@@ -188,6 +187,7 @@
@@ -197,10 +197,10 @@
# Check for Python headers
@@ -216,9 +216,19 @@
configuration : gnt_config,
install_dir : get_option('includedir') / 'gnt3')
-# This is temporary until we can hide GObject internals:
+gntncurses_h = configure_file(input : 'gntncurses.h.in', output : 'gntncurses.h', + configuration : gnt_config, + install_dir : get_option('includedir') / 'gnt3') +foreach header : libgnt_headers + ['gntncurses.h', 'gntversion.h'] + GNT_H_INCLUDES += '#include <@0@>'.format(header) +gnt_h_config = configuration_data() +gnt_h_config.set('GNT_H_INCLUDES', '\n'.join(GNT_H_INCLUDES)) gnt_h = configure_file(input : 'gnt.h.in', output : 'gnt.h',
- configuration : gnt_config,
+ configuration : gnt_h_config, install_dir : get_option('includedir') / 'gnt3')
@@ -238,6 +248,10 @@
libgnt_inc = include_directories('.')
+ c_args : ['-DGNT_COMPILATION'], version : '@0@.@1@.@2@'.format(gnt_soversion,
@@ -267,7 +281,7 @@
identifier_prefix : 'Gnt',
nsversion : '@0@.@1@'.format(gnt_major_version, gnt_minor_version),
- extra_args : ['--quiet'])
+ extra_args : ['-DGNT_COMPILATION', '--quiet']) --- a/test.c Thu Jul 30 05:15:53 2020 -0500
+++ b/test.c Thu Aug 13 18:23:33 2020 -0500
@@ -1,5 +1,4 @@
--- a/test/combo.c Thu Jul 30 05:15:53 2020 -0500
+++ b/test/combo.c Thu Aug 13 18:23:33 2020 -0500
@@ -1,12 +1,4 @@
-#include <gntcheckbox.h>
-#include <gntcombobox.h>
button_activated(GntWidget *b, GntComboBox *combo)
--- a/test/file.c Thu Jul 30 05:15:53 2020 -0500
+++ b/test/file.c Thu Aug 13 18:23:33 2020 -0500
@@ -1,4 +1,3 @@
--- a/test/focus.c Thu Jul 30 05:15:53 2020 -0500
+++ b/test/focus.c Thu Aug 13 18:23:33 2020 -0500
@@ -1,10 +1,4 @@
toggled(GntWidget *tree, gpointer key, G_GNUC_UNUSED gpointer unused)
--- a/test/keys.c Thu Jul 30 05:15:53 2020 -0500
+++ b/test/keys.c Thu Aug 13 18:23:33 2020 -0500
@@ -1,8 +1,6 @@
print_keycode(GntEntry *entry, const char *text, G_GNUC_UNUSED gpointer unused)
--- a/test/menu.c Thu Jul 30 05:15:53 2020 -0500
+++ b/test/menu.c Thu Aug 13 18:23:33 2020 -0500
@@ -1,9 +1,4 @@
-#include "gntmenuitem.h"
dothis(G_GNUC_UNUSED GntMenuItem *item, G_GNUC_UNUSED gpointer unused)
--- a/test/multiwin.c Thu Jul 30 05:15:53 2020 -0500
+++ b/test/multiwin.c Thu Aug 13 18:23:33 2020 -0500
@@ -1,10 +1,4 @@
show(G_GNUC_UNUSED GntWidget *w)
--- a/test/parse.c Thu Jul 30 05:15:53 2020 -0500
+++ b/test/parse.c Thu Aug 13 18:23:33 2020 -0500
@@ -1,4 +1,4 @@
--- a/test/tv.c Thu Jul 30 05:15:53 2020 -0500
+++ b/test/tv.c Thu Aug 13 18:23:33 2020 -0500
@@ -1,14 +1,8 @@
-#include "gnttextview.h"
key_pressed(GntWidget *w, const char *key, GntWidget *view)
--- a/test/wm.c Thu Jul 30 05:15:53 2020 -0500
+++ b/test/wm.c Thu Aug 13 18:23:33 2020 -0500
@@ -1,9 +1,6 @@
key_pressed(GntEntry *entry, const char *text, G_GNUC_UNUSED gpointer unused)
--- a/wms/irssi.c Thu Jul 30 05:15:53 2020 -0500
+++ b/wms/irssi.c Thu Aug 13 18:23:33 2020 -0500
@@ -33,15 +33,7 @@
-#include "gntinternal.h"
#define GNT_TYPE_IRSSI_WM gnt_irssi_wm_get_type()
G_DECLARE_FINAL_TYPE(GntIrssiWM, gnt_irssi_wm, GNT, IRSSI_WM, GntWM)
--- a/wms/s.c Thu Jul 30 05:15:53 2020 -0500
+++ b/wms/s.c Thu Aug 13 18:23:33 2020 -0500
@@ -20,18 +20,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#include "gntinternal.h"
#define GNT_TYPE_S_WM gnt_s_wm_get_type()
G_DECLARE_FINAL_TYPE(GntSWM, gnt_s_wm, GNT, S_WM, GntWM)