summaryrefslogtreecommitdiff
path: root/Build/source/texk/xdvik/gui
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2013-04-08 06:34:46 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2013-04-08 06:34:46 +0000
commit7e0f3484d8cd6eca4abe80d057391d14face5606 (patch)
tree92570fc98a476ecbf696c2ef16d046412d405995 /Build/source/texk/xdvik/gui
parent824f7b0903de8ad7f6ee3d7656005e4c59155e06 (diff)
xdvik 22.86
git-svn-id: svn://tug.org/texlive/trunk@29732 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/xdvik/gui')
-rw-r--r--Build/source/texk/xdvik/gui/Panner.c18
-rw-r--r--Build/source/texk/xdvik/gui/help-window.c19
-rw-r--r--Build/source/texk/xdvik/gui/mag.c12
-rw-r--r--Build/source/texk/xdvik/gui/pagesel.c4
-rw-r--r--Build/source/texk/xdvik/gui/print-dialog.c5
-rw-r--r--Build/source/texk/xdvik/gui/search-dialog.c2
-rw-r--r--Build/source/texk/xdvik/gui/sfSelFile.c18
-rw-r--r--Build/source/texk/xdvik/gui/xm_filesel.c10
8 files changed, 67 insertions, 21 deletions
diff --git a/Build/source/texk/xdvik/gui/Panner.c b/Build/source/texk/xdvik/gui/Panner.c
index 9acca69ac14..8a8577a617d 100644
--- a/Build/source/texk/xdvik/gui/Panner.c
+++ b/Build/source/texk/xdvik/gui/Panner.c
@@ -48,6 +48,14 @@
extern Bool XmuDistinguishablePixels(); /* not defined in any Xmu headers */
+#if HAVE_XKB_BELL_EXT
+# include <X11/XKBlib.h>
+# define panBell(display, window, percent) \
+ XkbBell(display, window, percent, (Atom) None)
+#else
+# define panBell(display, window, percent) XBell(display, percent)
+#endif
+
/*
======================================================================
begin copy from Simple.c
@@ -1020,7 +1028,7 @@ static void ActionStart (Widget gw, XEvent *event, String *params, Cardinal *num
UNUSED(num_params);
if (!get_event_xy (pw, event, &x, &y)) {
- XBell (XtDisplay(gw), 0); /* should do error message */
+ panBell(XtDisplay(gw), XtWindow(gw), 0); /* should do error message */
return;
}
@@ -1085,7 +1093,7 @@ static void ActionMove (Widget gw, XEvent *event, String *params, Cardinal *num_
if (!pw->panner.tmp.doing) return;
if (!get_event_xy (pw, event, &x, &y)) {
- XBell (XtDisplay(gw), 0); /* should do error message */
+ panBell(XtDisplay(gw), XtWindow(gw), 0); /* should do error message */
return;
}
@@ -1116,7 +1124,7 @@ static void ActionPage (Widget gw, XEvent *event, String *params, Cardinal *num_
UNUSED(num_params);
if (*num_params != 2) {
- XBell (XtDisplay(gw), 0);
+ panBell (XtDisplay(gw), XtWindow(gw), 0);
return;
}
@@ -1205,7 +1213,7 @@ static void ActionSet (Widget gw, XEvent *event, String *params, Cardinal *num_p
if (*num_params < 2 ||
XmuCompareISOLatin1 (params[0], "rubberband") != 0) {
- XBell (XtDisplay(gw), 0);
+ panBell (XtDisplay(gw), XtWindow(gw), 0);
return;
}
@@ -1216,7 +1224,7 @@ static void ActionSet (Widget gw, XEvent *event, String *params, Cardinal *num_p
} else if (XmuCompareISOLatin1 (params[1], "toggle") == 0) {
rb = !pw->panner.rubber_band;
} else {
- XBell (XtDisplay(gw), 0);
+ panBell (XtDisplay(gw), XtWindow(gw), 0);
return;
}
diff --git a/Build/source/texk/xdvik/gui/help-window.c b/Build/source/texk/xdvik/gui/help-window.c
index 4386d21a8ae..1f0124d7fe6 100644
--- a/Build/source/texk/xdvik/gui/help-window.c
+++ b/Build/source/texk/xdvik/gui/help-window.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004 the xdvik development team
+ * Copyright (c) 2004-2013 the xdvik development team
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@@ -56,6 +56,14 @@
#include "topic-window.h"
#include "help-window.h"
+#if HAVE_XKB_BELL_EXT
+# include <X11/XKBlib.h>
+# define XdviBell(display, window, percent) \
+ XkbBell(display, window, percent, (Atom) None)
+#else
+# define XdviBell(display, window, percent) XBell(display, percent)
+#endif
+
/* missing features that will be listed in the help window */
#if !XDVI_XT_TIMER_HACK
#define HAVE_MISSING_FEATURES 1
@@ -284,8 +292,7 @@ initialize_items(struct topic_info *info)
"Xdvik uses the following libraries:\n",
"- The kpathsea library, licensed in part under the GNU General Public\n",
" License, in part under the GNU Library General Public License.\n",
- "- t1lib, licensed in parts under the GNU Library General Public License,\n",
- " in parts under the X Consortium license.\n",
+ "- freetype2, licensed under the GNU General Public License.\n",
"There is NO WARRANTY of anything.\n",
"\n",
"Built using these configure options:\n",
@@ -304,8 +311,8 @@ initialize_items(struct topic_info *info)
#ifdef GREY
"- anti-aliasing (grey) enabled\n",
#endif
-#ifdef T1LIB
- "- T1lib (direct rendering of PS fonts) enabled\n",
+#if FREETYPE
+ "- freetype2 (direct rendering of PS fonts) enabled\n",
#endif
#if HAVE_ICONV_H
"- Iconv support compiled in\n",
@@ -1087,7 +1094,7 @@ show_help(Widget toplevel, const char *topic)
}
}
if (!matched) {
- XBell(DISP, 0);
+ XdviBell(DISP, XtWindow(help_shell), 0);
popup_message(help_shell,
MSG_WARN,
NULL,
diff --git a/Build/source/texk/xdvik/gui/mag.c b/Build/source/texk/xdvik/gui/mag.c
index 21526269c6d..2bf87904a0f 100644
--- a/Build/source/texk/xdvik/gui/mag.c
+++ b/Build/source/texk/xdvik/gui/mag.c
@@ -52,6 +52,14 @@
#include "util.h"
#include "pagesel.h"
+#if HAVE_XKB_BELL_EXT
+# include <X11/XKBlib.h>
+# define XdviBell(display, window, percent) \
+ XkbBell(display, window, percent, (Atom) None)
+#else
+# define XdviBell(display, window, percent) XBell(display, percent)
+#endif
+
/* to measure distance of pointer from ruler in ruler mode */
static int g_ruler_pos_x = 0, g_ruler_pos_y = 0;
@@ -627,7 +635,7 @@ void magnifier_move(String params, XEvent *event)
int n = atoi(p + 1) - 1;
if (n < 0 || n >= (int)get_magglass_items() || get_magglass_width(n) <= 0) {
- XBell(DISP, 0);
+ XdviBell(DISP, event->xany.window, 0);
return;
}
magnifier.width = get_magglass_width(n);
@@ -642,7 +650,7 @@ void magnifier_move(String params, XEvent *event)
magnifier.width = 0;
}
if (magnifier.width == 0) {
- XBell(DISP, 0);
+ XdviBell(DISP, event->xany.window, 0);
return;
}
}
diff --git a/Build/source/texk/xdvik/gui/pagesel.c b/Build/source/texk/xdvik/gui/pagesel.c
index 3d14e3a8426..dd1f4c71eec 100644
--- a/Build/source/texk/xdvik/gui/pagesel.c
+++ b/Build/source/texk/xdvik/gui/pagesel.c
@@ -728,7 +728,7 @@ wheel_scroll_list_callback(Widget widget, XtPointer data, XEvent *event, Boolean
int pageno = current_page;
if (button == 5) {
if (current_page >= total_pages - 1) {
- XBell(DISP, 0);
+ xdvi_bell();
/* statusline_info(STATUS_SHORT, "Last page of DVI file"); */
return;
}
@@ -736,7 +736,7 @@ wheel_scroll_list_callback(Widget widget, XtPointer data, XEvent *event, Boolean
}
else {
if (current_page == 0) {
- XBell(DISP, 0);
+ xdvi_bell();
/* statusline_info(STATUS_SHORT, "First page of DVI file"); */
return;
}
diff --git a/Build/source/texk/xdvik/gui/print-dialog.c b/Build/source/texk/xdvik/gui/print-dialog.c
index 5b489e2b51e..4724513f0ca 100644
--- a/Build/source/texk/xdvik/gui/print-dialog.c
+++ b/Build/source/texk/xdvik/gui/print-dialog.c
@@ -91,6 +91,11 @@ static Pixmap menu_double_arrow_bitmap;
#define XTranslations XtNtranslations
#endif /* MOTIF */
+#if HAVE_XKB_BELL_EXT
+# include <X11/XKBlib.h>
+# define XBell(dpy, percent) XkbBell(dpy, mane.win, percent, (Atom) None)
+#endif
+
struct output_format_mapping {
const char *fmt_string;
outputFormatT fmt;
diff --git a/Build/source/texk/xdvik/gui/search-dialog.c b/Build/source/texk/xdvik/gui/search-dialog.c
index 000d0b05db4..895db86480c 100644
--- a/Build/source/texk/xdvik/gui/search-dialog.c
+++ b/Build/source/texk/xdvik/gui/search-dialog.c
@@ -339,7 +339,7 @@ cb_regexp_search(Widget w, XtPointer client_data, XtPointer call_data)
return;
}
- XBell(DISP, 0);
+ xdvi_bell();
popup_message(get_matching_parent(w, globals.widgets.top_level, "find_popup", NULL),
MSG_ERR,
NULL,
diff --git a/Build/source/texk/xdvik/gui/sfSelFile.c b/Build/source/texk/xdvik/gui/sfSelFile.c
index 457fb74b148..7afcc1acedf 100644
--- a/Build/source/texk/xdvik/gui/sfSelFile.c
+++ b/Build/source/texk/xdvik/gui/sfSelFile.c
@@ -54,6 +54,14 @@
extern int errno;
#endif
+#if HAVE_XKB_BELL_EXT
+# include <X11/XKBlib.h>
+# define sfBell(display, window, percent) \
+ XkbBell(display, window, percent, (Atom) None)
+#else
+# define sfBell(display, window, percent) XBell(display, percent)
+#endif
+
#define SEL_FILE_CANCEL -1
#define SEL_FILE_OK 0
#define SEL_FILE_NULL 1
@@ -147,7 +155,7 @@ void
raise_file_selector(void)
{
if (selFile != NULL && XtIsManaged(selFile)) {
- XBell(DISP, 10);
+ sfBell(DISP, XtWindow(selFile), 10);
XRaiseWindow(DISP, XtWindow(selFile));
return;
}
@@ -795,7 +803,9 @@ SFopenFile(const char *name, const char *mode, const char *prompt, const char *f
SFchdir(SFstartDir);
errno = 0;
if (!name || *name == 0 || (fp = XFOPEN(name, mode)) == NULL) {
- XBell(DISP, 0);
+ sfBell(DISP,
+ (selFile != NULL && XtIsManaged(selFile))
+ ? XtWindow(selFile) : (Window) NULL, 0);
return NULL;
}
return fp;
@@ -854,7 +864,7 @@ XsraSelFilePopup(struct filesel_callback *callback)
XEvent event;
if (XtIsManaged(callback->shell)) {
- XBell(DISP, 10);
+ sfBell(DISP, XtWindow(callback->shell), 10);
XRaiseWindow(DISP, XtWindow(callback->shell));
return;
}
@@ -966,7 +976,7 @@ XsraSelFilePopup(struct filesel_callback *callback)
w = XtParent(w);
}
if (w == NULL || w == globals.widgets.top_level) {
- XBell(DISP, 0);
+ sfBell(DISP, event.xany.window, 0);
continue;
}
break;
diff --git a/Build/source/texk/xdvik/gui/xm_filesel.c b/Build/source/texk/xdvik/gui/xm_filesel.c
index 484e84d17c2..b7a2d6fe2f4 100644
--- a/Build/source/texk/xdvik/gui/xm_filesel.c
+++ b/Build/source/texk/xdvik/gui/xm_filesel.c
@@ -43,6 +43,14 @@
#include <Xm/Form.h>
#include <Xm/ToggleBG.h>
+#if HAVE_XKB_BELL_EXT
+# include <X11/XKBlib.h>
+# define XdviBell(display, window, percent) \
+ XkbBell(display, window, percent, (Atom) None)
+#else
+# define XdviBell(display, window, percent) XBell(display, percent)
+#endif
+
/* static Widget dialog = NULL; */
/* static char *browse_fname = NULL; */
@@ -156,7 +164,7 @@ void
XsraSelFilePopup(struct filesel_callback *callback)
{
if (XtIsManaged(callback->shell)) {
- XBell(DISP, 10);
+ XdviBell(DISP, XtWindow(callback->shell), 10);
XRaiseWindow(DISP, XtWindow(callback->shell));
return;
}