Commit a7601d6b authored by Vladislav's avatar Vladislav

update yad to 14.0

parent 5caa59f0
Version 14.0
- add --workdir option for changing current working directory
- add --window-type option
- add zooming in html dialog
- updates in man page
- add --disable-deprecated configure option for exlude obsoletted features in compile-time
- possible build against webkit2gtk-4.1 or webkit2gtk-4.0
- code cleanup
Version 13.0
- extend --in-place behavior in text-info dialog
- improve labels look&feel
......
AC_INIT([YAD], [13.0], [https://github.com/v1cont/yad/issues/], yad, [https://github.com/v1cont/yad/])
AC_INIT([YAD], [14.0], [https://github.com/v1cont/yad/issues/], yad, [https://github.com/v1cont/yad/])
AC_CONFIG_AUX_DIR([build])
AM_INIT_AUTOMAKE([1.11 foreign dist-xz no-dist-gzip])
......@@ -34,7 +34,10 @@ AC_ARG_ENABLE([html],
[Build YAD with HTML widget])],
[build_html=$enableval], [build_html=yes])
if test x$build_html = xyes; then
PKG_CHECK_MODULES([HTML], [webkit2gtk-4.0], [have_html=yes], [have_html=no])
PKG_CHECK_MODULES([HTML], [webkit2gtk-4.1], [have_html=yes], [have_html=no])
if test x$have_html=no; then
PKG_CHECK_MODULES([HTML], [webkit2gtk-4.0], [have_html=yes], [have_html=no])
fi
else
have_html=no
fi
......@@ -102,6 +105,16 @@ if test x$build_sa = xyes; then
AC_DEFINE([STANDALONE], [1], [Define this if you need standalone YAD binary])
fi
dnl deprecated options
AC_ARG_ENABLE([deprecated],
[AS_HELP_STRING([--enable-deprecated],
[Build YAD with deprecated options])],
[build_depr=$enableval], [build_depr=yes])
if test x$build_depr = xyes; then
AC_DEFINE([DEPRECATED], [1], [Define this if you need to build YAD with deprecated options])
fi
dnl tools
AC_ARG_ENABLE([tools],
[AS_HELP_STRING([--enable-tools],
......@@ -170,6 +183,7 @@ echo " GtkSourceView - $have_sourceview"
echo " Spell checking - $have_spell"
echo " Path to rgb.txt - $with_rgb"
echo " Standalone build - $build_sa"
echo " Deprecated options - $build_depr"
echo " Tools - $build_tools"
echo " Icon browser - $build_ib"
echo
.TH YAD 1 "October 2023" "yad" "User Commands"
.TH YAD 1 "June 2024" "yad" "User Commands"
.SH NAME
yad \- display GTK+ dialogs from shell scripts or command-line
......@@ -177,7 +177,7 @@ Don't close dialog if \fIEscape\fP was pressed.
Print result for any of the return codes. This option doesn't work if timeout was reached or \fIEscape\fP was pressed.
.TP
.B \-\-use-interp=\fI[INTERP]\fP
All commands runs unter specified interpreter. Default is \fIbash -c "%s"\fP. This option can reduse quoting in commands. If \fI%s\fP is specified, it will be replaced by the command.
All commands runs under specified interpreter. Default is \fIbash -c "%s"\fP. This option can reduse quoting in commands. If \fI%s\fP is specified, it will be replaced by the command.
Otherwise command will be appended to the end of command line.
.TP
.B \-\-uri-handler=\fICMD\fP
......@@ -186,6 +186,9 @@ Use \fICMD\fP as uri handler. By default yad uses \fIopen-command\fP parameter f
.B \-\-f1-action=\fICMD\fP
Set the command running when F1 was pressed.
.TP
.B \-\-workdir=\fiPATH\fP
Set current working directory to \fIPATH\fP.
.TP
.B \-\-borders=\fINUM\fP
Set dialog window borders.
.TP
......@@ -216,18 +219,18 @@ Run dialog window maximized.
.B \-\-fullscreen
Run dialog in fullscreen mode. This option may not work on all window managers.
.TP
.B \-\-splash (DEPRECATED)
.B \-\-splash (Deprecated)
Open window with "splashscreen" window hints. For details see description of \fI_NET_WM_WINDOW_TYPE_SPLASH\fP
in EWMH specification. The behavior of dialog with this option is HIGHLY DEPENDS on settings of your window manager.
This option is deprecated. Use \fB--window-type=splash\fP instead.
This option is deprecated. Use \fB--window-type\fP instead.
.TP
.B \-\-window-type=\fITYPE\fP
Create a window with the specified window type. Can be one of "normal", "dialog" or "splash".
The behavior of each window type depends on your window manager.
Create a window with the specified window type. \fITYPE\fPCan be one of \fInormal\fP, \fIdialog\fP, \fIutility\fP,
\fIdock\fP, \fIdesktop\fP, \fItooltip\fP, \fInotification\fP or \fIsplash\fP.
The behavior of each window type depends on your window manager. See EWMH specification for details.
Tiling window managers will often float a "dialog" window but tile a "normal" window.
The behavior of splash windows HIGHLY DEPENDS on settings of your window manager.
\fINOTE:\fP Tiling window managers will often float a "dialog" window but tile a "normal" window.
.TP
.B \-\-no-focus
Dialog window never take focus.
......@@ -251,7 +254,7 @@ Set default exit code to \fINUMBER\fP instead of \fI0\fP.
.B \-\-css=\fISTRING\fP
Read and parse additional GTK+ CSS styles from given data. If \fISTRING\fP is filename, the content of file is loaded. If not \fISTRING\fP treats like CSS data.
.TP
.B \-\-gtkrc=\fIFILENAME\fP (DEPRECATED)
.B \-\-gtkrc=\fIFILENAME\fP (Deprecated)
Read and parse additional GTK+ CSS styles from given file. This option is deprecated. Use \fB--css\fP instead.
.TP
.B \-\-hscroll-policy=\fITYPE\fP
......@@ -643,7 +646,7 @@ Print clicked links to standard output. By default clicked links opens with \fIx
.B \-\-mime=\fIMIME\fP
Set mime type of data passed to standard input to \fIMIME\fP. Default is \fItext/html\fP.
.TP
.B \-\-encodintg=\fIENCODING\fP
.B \-\-encoding=\fIENCODING\fP
Set encoding of data passed to standard input to \fIENCODING\fP. Default is \fIUTF-8\fP.
.TP
.B \-\-uri-handler=\fICMD\fP
......
......@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with YAD. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2008-2023, Victor Ananjevsky <victor@sanana.kiev.ua>
* Copyright (C) 2008-2024, Victor Ananjevsky <victor@sanana.kiev.ua>
*/
#include "yad.h"
......@@ -143,7 +143,7 @@ yad_about (void)
g_object_set (G_OBJECT (dialog),
"name", PACKAGE_NAME,
"version", PACKAGE_VERSION,
"copyright", "Copyright \xc2\xa9 2008-2023, Victor Ananjevsky <victor@sanana.kiev.ua>",
"copyright", "Copyright \xc2\xa9 2008-2024, Victor Ananjevsky <victor@sanana.kiev.ua>",
"comments", comments,
"authors", authors,
"website", PACKAGE_URL,
......
......@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with YAD. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2008-2023, Victor Ananjevsky <victor@sanana.kiev.ua>
* Copyright (C) 2008-2024, Victor Ananjevsky <victor@sanana.kiev.ua>
*/
#include "yad.h"
......
......@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with YAD. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2010-2023, Victor Ananjevsky <victor@sanana.kiev.ua>
* Copyright (C) 2010-2024, Victor Ananjevsky <victor@sanana.kiev.ua>
*/
#include <config.h>
......
......@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with YAD. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2008-2023, Victor Ananjevsky <victor@sanana.kiev.ua>
* Copyright (C) 2008-2024, Victor Ananjevsky <victor@sanana.kiev.ua>
*/
#include <errno.h>
......
......@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with YAD. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2008-2023, Victor Ananjevsky <victor@sanana.kiev.ua>
* Copyright (C) 2008-2024, Victor Ananjevsky <victor@sanana.kiev.ua>
*/
#include <errno.h>
......
......@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with YAD. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2020-2023, Victor Ananjevsky <victor@sanana.kiev.ua>
* Copyright (C) 2020-2024, Victor Ananjevsky <victor@sanana.kiev.ua>
*/
/* This code getted from deprecated GtkColorSelection widget (gtk+-3.24.33) */
......
......@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with YAD. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2008-2023, Victor Ananjevsky <victor@sanana.kiev.ua>
* Copyright (C) 2008-2024, Victor Ananjevsky <victor@sanana.kiev.ua>
*/
#include "yad.h"
......
......@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with YAD. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2008-2023, Victor Ananjevsky <victor@sanana.kiev.ua>
* Copyright (C) 2008-2024, Victor Ananjevsky <victor@sanana.kiev.ua>
*/
#include "yad.h"
......
......@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with YAD. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2008-2023, Victor Ananjevsky <victor@sanana.kiev.ua>
* Copyright (C) 2008-2024, Victor Ananjevsky <victor@sanana.kiev.ua>
*/
#include "yad.h"
......
......@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with YAD. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2008-2023, Victor Ananjevsky <victor@sanana.kiev.ua>
* Copyright (C) 2008-2024, Victor Ananjevsky <victor@sanana.kiev.ua>
*/
#include "yad.h"
......
......@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with YAD. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2008-2023, Victor Ananjevsky <victor@sanana.kiev.ua>
* Copyright (C) 2008-2024, Victor Ananjevsky <victor@sanana.kiev.ua>
*/
#include <limits.h>
......@@ -30,9 +30,25 @@ static YadSearchBar *search_bar = NULL;
static GString *inbuf;
static gboolean is_loaded = FALSE;
static volatile gboolean is_loaded = FALSE;
static gboolean uri_cmd = FALSE;
/* get from devhelp */
static const gdouble zoom_levels[] = {
0.5, /* 50% */
0.8408964152, /* 75% */
1.0, /* 100% */
1.1892071149, /* 125% */
1.4142135623, /* 150% */
1.6817928304, /* 175% */
2.0, /* 200% */
2.8284271247, /* 300% */
4.0 /* 400% */
};
static const guint n_zoom_levels = G_N_ELEMENTS (zoom_levels);
static guint current_zoom = 2;
#ifndef PATH_MAX
#define PATH_MAX 4096
#endif
......@@ -290,6 +306,33 @@ quit_cb (GSimpleAction *act, GVariant *param, gpointer d)
}
static gboolean
scroll_cb (GtkWidget *w, GdkEventScroll *ev, gpointer d)
{
if ((ev->state & GDK_CONTROL_MASK) != 0)
{
switch (ev->direction)
{
case GDK_SCROLL_UP:
if (current_zoom < n_zoom_levels)
current_zoom++;
webkit_web_view_set_zoom_level (view, zoom_levels[current_zoom]);
return GDK_EVENT_STOP;
case GDK_SCROLL_DOWN:
if (current_zoom > 0)
current_zoom--;
webkit_web_view_set_zoom_level (view, zoom_levels[current_zoom]);
return GDK_EVENT_STOP;
default:
break;
}
}
return GDK_EVENT_PROPAGATE;
}
static gboolean
menu_cb (WebKitWebView *view, WebKitContextMenu *menu, GdkEvent *ev, WebKitHitTestResult *hit, gpointer d)
{
WebKitContextMenuItem *mi;
......@@ -322,24 +365,44 @@ menu_cb (WebKitWebView *view, WebKitContextMenu *menu, GdkEvent *ev, WebKitHitTe
static gboolean
key_press_cb (GtkWidget *w, GdkEventKey *key, gpointer d)
{
if ((key->state & GDK_CONTROL_MASK) && (key->keyval == GDK_KEY_O || key->keyval == GDK_KEY_o))
{
open_cb (NULL, NULL, d);
return TRUE;
}
else if ((key->state & GDK_CONTROL_MASK) && (key->keyval == GDK_KEY_Q || key->keyval == GDK_KEY_q))
if (key->state & GDK_CONTROL_MASK)
{
yad_exit (options.data.def_resp);
return TRUE;
}
else if ((key->state & GDK_CONTROL_MASK) && (key->keyval == GDK_KEY_F || key->keyval == GDK_KEY_f))
{
if (search_bar == NULL)
return FALSE;
if (key->keyval == GDK_KEY_plus)
{
if (current_zoom < n_zoom_levels)
current_zoom++;
webkit_web_view_set_zoom_level (view, zoom_levels[current_zoom]);
}
else if (key->keyval == GDK_KEY_minus)
{
if (current_zoom > 0)
current_zoom--;
webkit_web_view_set_zoom_level (view, zoom_levels[current_zoom]);
}
else if (key->keyval == GDK_KEY_0)
{
current_zoom = 2;
webkit_web_view_set_zoom_level (view, zoom_levels[current_zoom]);
}
if (key->keyval == GDK_KEY_O || key->keyval == GDK_KEY_o)
{
open_cb (NULL, NULL, d);
return TRUE;
}
else if (key->keyval == GDK_KEY_Q || key->keyval == GDK_KEY_q)
{
yad_exit (options.data.def_resp);
return TRUE;
}
else if (key->keyval == GDK_KEY_F || key->keyval == GDK_KEY_f)
{
if (search_bar == NULL)
return FALSE;
ignore_esc = TRUE;
gtk_search_bar_set_search_mode (GTK_SEARCH_BAR (search_bar->bar), TRUE);
return gtk_search_bar_handle_event (GTK_SEARCH_BAR (search_bar->bar), (GdkEvent *) key);
ignore_esc = TRUE;
gtk_search_bar_set_search_mode (GTK_SEARCH_BAR (search_bar->bar), TRUE);
return gtk_search_bar_handle_event (GTK_SEARCH_BAR (search_bar->bar), (GdkEvent *) key);
}
}
return FALSE;
......@@ -479,6 +542,8 @@ html_create_widget (GtkWidget * dlg)
g_signal_connect (view, "decide-policy", G_CALLBACK (policy_cb), NULL);
g_signal_connect (view, "load-changed", G_CALLBACK (loaded_cb), NULL);
g_signal_connect (view, "scroll-event", G_CALLBACK (scroll_cb), NULL);
wk_settings = webkit_settings_new ();
g_object_set (G_OBJECT (wk_settings),
......
......@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with YAD. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2008-2023, Victor Ananjevsky <victor@sanana.kiev.ua>
* Copyright (C) 2008-2024, Victor Ananjevsky <victor@sanana.kiev.ua>
*/
#include "yad.h"
......
......@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with YAD. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2008-2023, Victor Ananjevsky <victor@sanana.kiev.ua>
* Copyright (C) 2008-2024, Victor Ananjevsky <victor@sanana.kiev.ua>
*/
#include <string.h>
......
......@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with YAD. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2008-2023, Victor Ananjevsky <victor@sanana.kiev.ua>
* Copyright (C) 2008-2024, Victor Ananjevsky <victor@sanana.kiev.ua>
*/
#include <sys/types.h>
......@@ -482,19 +482,12 @@ create_dialog (void)
/* create dialog window */
dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL);
switch (options.data.window_type)
{
case YAD_WINDOW_UNSET:
case YAD_WINDOW_NORMAL:
gtk_window_set_type_hint (GTK_WINDOW (dlg), GDK_WINDOW_TYPE_HINT_NORMAL);
break;
case YAD_WINDOW_DIALOG:
gtk_window_set_type_hint (GTK_WINDOW (dlg), GDK_WINDOW_TYPE_HINT_DIALOG);
break;
case YAD_WINDOW_SPLASH:
gtk_window_set_type_hint (GTK_WINDOW (dlg), GDK_WINDOW_TYPE_HINT_SPLASHSCREEN);
break;
}
#ifdef DEPRECATED
if (options.data.splash)
options.data.window_type = GDK_WINDOW_TYPE_HINT_SPLASHSCREEN;
#endif
gtk_window_set_type_hint (GTK_WINDOW (dlg), options.data.window_type);
gtk_window_set_title (GTK_WINDOW (dlg), options.data.dialog_title);
gtk_widget_set_name (dlg, "yad-dialog-window");
......@@ -869,17 +862,24 @@ main (gint argc, gchar ** argv)
return -1;
}
#ifdef DEPRECATED
if (options.data.splash)
{
g_warning(_("Use of deprecated option --splash, use --window-type=splash instead"));
if (options.data.window_type == YAD_WINDOW_UNSET)
options.data.window_type = YAD_WINDOW_SPLASH;
else
g_warning(_("Both --splash and --window-type are specified, ignoring --splash"));
if (options.debug)
g_printerr(_("WARNING: Using splash option is deprecated, please use --window-type instead"));
}
#endif
yad_set_mode ();
/* set working directory */
if (options.data.workdir)
{
if (g_chdir (options.data.workdir) != 0)
g_printerr (_("Unable to change directory to %s: %s\n"),
options.data.workdir, strerror (errno));
}
/* check for current GDK backend */
#ifdef GDK_WINDOWING_X11
if (GDK_IS_X11_DISPLAY (gdk_display_get_default ()))
......@@ -899,6 +899,7 @@ main (gint argc, gchar ** argv)
GTK_STYLE_PROVIDER_PRIORITY_USER);
g_object_unref (css);
}
#ifdef DEPRECATED
else if (options.gtkrc_file)
{
GtkCssProvider *css = gtk_css_provider_new ();
......@@ -911,6 +912,7 @@ main (gint argc, gchar ** argv)
GTK_STYLE_PROVIDER_PRIORITY_USER);
g_object_unref (css);
}
#endif
/* set default icons and icon theme */
if (options.data.icon_theme)
......
......@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with YAD. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2008-2023, Victor Ananjevsky <victor@sanana.kiev.ua>
* Copyright (C) 2008-2024, Victor Ananjevsky <victor@sanana.kiev.ua>
*/
#include <sys/types.h>
......
......@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with YAD. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2008-2023, Victor Ananjevsky <victor@sanana.kiev.ua>
* Copyright (C) 2008-2024, Victor Ananjevsky <victor@sanana.kiev.ua>
*/
#include <sys/stat.h>
......
......@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with YAD. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2008-2023, Victor Ananjevsky <victor@sanana.kiev.ua>
* Copyright (C) 2008-2024, Victor Ananjevsky <victor@sanana.kiev.ua>
*/
#include <stdlib.h>
......@@ -164,6 +164,8 @@ static GOptionEntry general_options[] = {
N_("Set URI handler"), N_("CMD") },
{ "f1-action", 0, 0, G_OPTION_ARG_STRING, &options.data.f1_action,
N_("Set command running when F1 was pressed"), N_("CMD") },
{ "workdir", 0, 0, G_OPTION_ARG_STRING, &options.data.workdir,
N_("Set working directory"), N_("PATH") },
/* window settings */
{ "sticky", 0, 0, G_OPTION_ARG_NONE, &options.data.sticky,
N_("Set window sticky"), NULL },
......@@ -187,10 +189,12 @@ static GOptionEntry general_options[] = {
N_("Don't focus dialog window"), NULL },
{ "close-on-unfocus", 0, 0, G_OPTION_ARG_NONE, &options.data.close_on_unfocus,
N_("Close window when it sets unfocused"), NULL },
#ifdef DEPRECATED
{ "splash", 0, 0, G_OPTION_ARG_NONE, &options.data.splash,
N_("Open window as a splashscreen (DEPRECATED: use --window-type=splash instead)"), NULL },
N_("Open window as a splashscreen (Deprecated, see man page for details)"), NULL },
#endif
{ "window-type", 0, 0, G_OPTION_ARG_CALLBACK, set_window_type,
N_("Specify the window type for the dialog"), N_("normal|dialog|splash") },
N_("Specify the window type for the dialog"), N_("TYPE") },
{ "gui-type", 0, 0, G_OPTION_ARG_CALLBACK, set_gui_type,
N_("Specify the gui type"), N_("start|start-old|settings-{paned,noteboke,shortcut,base}") },
{ "image-halign", 0, 0, G_OPTION_ARG_CALLBACK, set_image_halign,
......@@ -791,8 +795,10 @@ static GOptionEntry misc_options[] = {
N_("Print version"), NULL },
{ "css", 0, 0, G_OPTION_ARG_STRING, &options.css,
N_("Load additional CSS settings from file or string"), N_("STRING") },
#ifdef DEPRECATED
{ "gtkrc", 0, 0, G_OPTION_ARG_FILENAME, &options.gtkrc_file,
N_("Load additional CSS settings from file"), N_("FILENAME") },
#endif
{ "hscroll-policy", 0, 0, G_OPTION_ARG_CALLBACK, set_scroll_policy,
N_("Set policy for horizontal scrollbars (auto, always, never)"), N_("TYPE") },
{ "vscroll-policy", 0, 0, G_OPTION_ARG_CALLBACK, set_scroll_policy,
......@@ -1087,12 +1093,12 @@ add_file_filter (const gchar * option_name, const gchar * value, gpointer data,
for (i = 0; value[i] != '\0'; i++)
{
if (value[i] == '|')
break;
{
name = g_strstrip (g_strndup (value, i));
break;
}
}
if (value[i] == '|')
name = g_strstrip (g_strndup (value, i));
if (name)
{
gtk_file_filter_set_name (filter, name);
......@@ -1444,21 +1450,6 @@ set_interp (const gchar * option_name, const gchar * value, gpointer data, GErro
}
static gboolean
set_window_type (const gchar * option_name, const gchar * value, gpointer data, GError ** err)
{
if (strcasecmp (value, "normal") == 0)
options.data.window_type = YAD_WINDOW_NORMAL;
else if (strcasecmp (value, "dialog") == 0)
options.data.window_type = YAD_WINDOW_DIALOG;
else if (strcasecmp (value, "splash") == 0)
options.data.window_type = YAD_WINDOW_SPLASH;
else
g_printerr (_("Unknown window type: %s\n"), value);
return TRUE;
}
static gboolean
set_gui_type (const gchar * option_name, const gchar * value, gpointer data, GError ** err)
{
if (strcasecmp (value, "start") == 0)
......@@ -1517,6 +1508,31 @@ set_image_valign (const gchar * option_name, const gchar * value, gpointer data,
return TRUE;
}
static gboolean
set_window_type (const gchar * option_name, const gchar * value, gpointer data, GError ** err)
{
if (strcasecmp (value, "normal") == 0)
options.data.window_type = GDK_WINDOW_TYPE_HINT_NORMAL;
else if (strcasecmp (value, "dialog") == 0)
options.data.window_type = GDK_WINDOW_TYPE_HINT_DIALOG;
else if (strcasecmp (value, "utility") == 0)
options.data.window_type = GDK_WINDOW_TYPE_HINT_UTILITY;
else if (strcasecmp (value, "dock") == 0)
options.data.window_type = GDK_WINDOW_TYPE_HINT_DOCK;
else if (strcasecmp (value, "desktop") == 0)
options.data.window_type = GDK_WINDOW_TYPE_HINT_DESKTOP;
else if (strcasecmp (value, "tooltip") == 0)
options.data.window_type = GDK_WINDOW_TYPE_HINT_TOOLTIP;
else if (strcasecmp (value, "notification") == 0)
options.data.window_type = GDK_WINDOW_TYPE_HINT_NOTIFICATION;
else if (strcasecmp (value, "splash") == 0)
options.data.window_type = GDK_WINDOW_TYPE_HINT_SPLASHSCREEN;
else
g_printerr (_("Unknown window type: %s\n"), value);
return TRUE;
}
#if HAVE_SOURCEVIEW
static gboolean
set_right_margin (const gchar * option_name, const gchar * value, gpointer data, GError ** err)
......@@ -1716,7 +1732,9 @@ yad_options_init (void)
options.rest_file = NULL;
options.extra_data = NULL;
options.css = NULL;
#ifdef DEPRECATED
options.gtkrc_file = NULL;
#endif
#ifndef G_OS_WIN32
options.kill_parent = 0;
options.print_xid = FALSE;
......@@ -1791,6 +1809,7 @@ yad_options_init (void)
options.data.uri_handler = OPEN_CMD;
#endif
options.data.f1_action = NULL;
options.data.workdir = NULL;
/* Initialize window options */
options.data.sticky = FALSE;
......@@ -1802,8 +1821,10 @@ yad_options_init (void)
options.data.skip_taskbar = FALSE;
options.data.maximized = FALSE;
options.data.fullscreen = FALSE;
#ifdef DEPRECATED
options.data.splash = FALSE;
options.data.window_type = YAD_WINDOW_UNSET;
#endif
options.data.window_type = GDK_WINDOW_TYPE_HINT_NORMAL;
options.data.gui_type = YAD_GUI_UNSET;
options.data.image_halign = GTK_ALIGN_CENTER;
options.data.image_valign = GTK_ALIGN_CENTER;
......
......@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with YAD. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2008-2023, Victor Ananjevsky <victor@sanana.kiev.ua>
* Copyright (C) 2008-2024, Victor Ananjevsky <victor@sanana.kiev.ua>
*/
#include <sys/types.h>
......
......@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with YAD. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2008-2023, Victor Ananjevsky <victor@sanana.kiev.ua>
* Copyright (C) 2008-2024, Victor Ananjevsky <victor@sanana.kiev.ua>
*/
#include "yad.h"
......
......@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with YAD. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2008-2023, Victor Ananjevsky <victor@sanana.kiev.ua>
* Copyright (C) 2008-2024, Victor Ananjevsky <victor@sanana.kiev.ua>
*/
#include <sys/types.h>
......
......@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with YAD. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2008-2023, Victor Ananjevsky <victor@sanana.kiev.ua>
* Copyright (C) 2008-2024, Victor Ananjevsky <victor@sanana.kiev.ua>
*/
#include <stdio.h>
......
......@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with YAD. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2008-2023, Victor Ananjevsky <victor@sanana.kiev.ua>
* Copyright (C) 2008-2024, Victor Ananjevsky <victor@sanana.kiev.ua>
*/
#include "yad.h"
......
......@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with YAD. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2008-2023, Victor Ananjevsky <victor@sanana.kiev.ua>
* Copyright (C) 2008-2024, Victor Ananjevsky <victor@sanana.kiev.ua>
*/
#include <pango/pango.h>
......
......@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with YAD. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2019-2023, Victor Ananjevsky <victor@sanana.kiev.ua>
* Copyright (C) 2019-2024, Victor Ananjevsky <victor@sanana.kiev.ua>
*/
#include <config.h>
......
......@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with YAD. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2008-2023, Victor Ananjevsky <victor@sanana.kiev.ua>
* Copyright (C) 2008-2024, Victor Ananjevsky <victor@sanana.kiev.ua>
*/
#ifndef _GNU_SOURCE
......@@ -56,7 +56,7 @@ const YadStock yad_stock_items[] = {
};
gboolean
stock_lookup (gchar *key, YadStock *it)
stock_lookup (const gchar *key, YadStock *it)
{
gint i;
gboolean found = FALSE;
......@@ -859,7 +859,9 @@ create_search_bar ()
{
YadSearchBar *sb;
GtkWidget *b;
#ifndef STANDALONE
gint e_width = -1;
#endif
sb = g_new0 (YadSearchBar, 1);
sb->new_search = TRUE;
......@@ -876,9 +878,9 @@ create_search_bar ()
#ifndef STANDALONE
e_width = g_settings_get_int (settings, "search-width");
#endif
if (e_width > 0)
gtk_widget_set_size_request (sb->entry, e_width, -1);
#endif
sb->next = gtk_button_new_from_icon_name ("go-down", GTK_ICON_SIZE_BUTTON);
gtk_widget_set_focus_on_click (sb->next, FALSE);
......
......@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License along with
# YAD. If not, see <https://www.gnu.org/licenses/>.
#
# Copyright (C) 2021-2023, Victor Ananjevsky <victor@sanana.kiev.ua>
# Copyright (C) 2021-2024, Victor Ananjevsky <victor@sanana.kiev.ua>
#
TEXTDOMAIN=@GETTEXT_PACKAGE@
......
......@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with YAD. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2008-2023, Victor Ananjevsky <victor@sanana.kiev.ua>
* Copyright (C) 2008-2024, Victor Ananjevsky <victor@sanana.kiev.ua>
*/
#ifndef _YAD_H_
......@@ -26,6 +26,7 @@
#include <sys/stat.h>
#include <sys/ipc.h>
#include <fcntl.h>
#include <errno.h>
#include <gdk/gdkx.h>
......@@ -196,13 +197,6 @@ typedef enum {
} YadBoolFormat;
typedef enum {
YAD_WINDOW_UNSET = 0,
YAD_WINDOW_NORMAL,
YAD_WINDOW_DIALOG,
YAD_WINDOW_SPLASH,
} YadWindowType;
typedef enum {
YAD_GUI_UNSET = 0,
YAD_GUI_START,
YAD_GUI_START_OLD,
......@@ -287,6 +281,7 @@ typedef struct {
gchar *interp;
gchar *uri_handler;
gchar *f1_action;
gchar *workdir;
/* window settings */
gboolean sticky;
gboolean fixed;
......@@ -297,8 +292,10 @@ typedef struct {
gboolean skip_taskbar;
gboolean maximized;
gboolean fullscreen;
#ifdef DEPRECATED
gboolean splash;
YadWindowType window_type;
#endif
GdkWindowTypeHint window_type;
YadGuiType gui_type;
GtkAlign image_halign;
GtkAlign image_valign;
......@@ -621,7 +618,9 @@ typedef struct {
#endif
gchar *css;
#ifdef DEPRECATED
gchar *gtkrc_file;
#endif
GtkPolicyType hscroll_policy;
GtkPolicyType vscroll_policy;
......@@ -760,7 +759,7 @@ gchar **split_arg (const gchar *str);
YadNTabs *get_tabs (key_t key, gboolean create);
gboolean stock_lookup (gchar *key, YadStock *it);
gboolean stock_lookup (const gchar *key, YadStock *it);
GtkWidget *get_label (gchar *str, guint border, GtkWidget *w);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment