Initial commit

This commit is contained in:
matt
2020-09-20 12:16:44 +00:00
parent 09a4460ddb
commit 408c005d3e
839 changed files with 190481 additions and 0 deletions

View File

@@ -0,0 +1,106 @@
diff -up fltk-1.3.x-r8659/FL/Fl.H.orig fltk-1.3.x-r8659/FL/Fl.H
--- fltk-1.3.x-r8659/FL/Fl.H.orig 2011-05-17 16:25:56.671744548 +0200
+++ fltk-1.3.x-r8659/FL/Fl.H 2011-05-17 16:26:05.709101536 +0200
@@ -108,6 +108,9 @@ typedef int (*Fl_Args_Handler)(int argc,
\see Fl::event_dispatch(Fl_Event_Dispatch) */
typedef int (*Fl_Event_Dispatch)(int event, Fl_Window *w);
+/** Signature of add_clipboard_notify functions passed as parameters */
+typedef void (*Fl_Clipboard_Notify_Handler)(int source, void *data);
+
/** @} */ /* group callback_functions */
@@ -744,6 +747,19 @@ public:
*/
static void paste(Fl_Widget &receiver, int source /*=0*/); // platform dependent
/**
+ FLTK will call the registered callback whenever there is a change to the
+ selection buffer or the clipboard. The source argument indicates which
+ of the two has changed. Only changes by other applications are reported.
+ \note Some systems require polling to monitor the clipboard and may
+ therefore have some delay in detecting changes.
+ */
+ static void add_clipboard_notify(Fl_Clipboard_Notify_Handler h, void *data);
+ /**
+ Stop calling the specified callback when there are changes to the selection
+ buffer or the clipboard.
+ */
+ static void remove_clipboard_notify(Fl_Clipboard_Notify_Handler h);
+ /**
Initiate a Drag And Drop operation. The selection buffer should be
filled with relevant data before calling this method. FLTK will
then initiate the system wide drag and drop handling. Dropped data
diff -up fltk-1.3.x-r8659/src/Fl.cxx.orig fltk-1.3.x-r8659/src/Fl.cxx
--- fltk-1.3.x-r8659/src/Fl.cxx.orig 2011-05-18 15:20:26.667291459 +0200
+++ fltk-1.3.x-r8659/src/Fl.cxx 2011-05-18 16:31:15.522026086 +0200
@@ -430,6 +430,69 @@ static char in_idle;
#endif
////////////////////////////////////////////////////////////////
+// Clipboard notifications
+
+struct Clipboard_Notify {
+ Fl_Clipboard_Notify_Handler handler;
+ void *data;
+ struct Clipboard_Notify *next;
+};
+
+static struct Clipboard_Notify *clip_notify_list = NULL;
+
+extern void fl_clipboard_notify_change(); // in Fl_<platform>.cxx
+
+void Fl::add_clipboard_notify(Fl_Clipboard_Notify_Handler h, void *data) {
+ struct Clipboard_Notify *node;
+
+ remove_clipboard_notify(h);
+
+ node = new Clipboard_Notify;
+
+ node->handler = h;
+ node->data = data;
+ node->next = clip_notify_list;
+
+ clip_notify_list = node;
+
+ fl_clipboard_notify_change();
+}
+
+void Fl::remove_clipboard_notify(Fl_Clipboard_Notify_Handler h) {
+ struct Clipboard_Notify *node, **prev;
+
+ node = clip_notify_list;
+ prev = &clip_notify_list;
+ while (node != NULL) {
+ if (node->handler == h) {
+ *prev = node->next;
+ delete node;
+
+ fl_clipboard_notify_change();
+
+ return;
+ }
+
+ prev = &node->next;
+ node = node->next;
+ }
+}
+
+bool fl_clipboard_notify_empty(void) {
+ return clip_notify_list == NULL;
+}
+
+void fl_trigger_clipboard_notify(int source) {
+ struct Clipboard_Notify *node;
+
+ node = clip_notify_list;
+ while (node != NULL) {
+ node->handler(source, node->data);
+ node = node->next;
+ }
+}
+
+////////////////////////////////////////////////////////////////
// wait/run/check/ready:
void (*Fl::idle)(); // see Fl::add_idle.cxx for the add/remove functions

View File

@@ -0,0 +1,355 @@
diff -up fltk-1.3.2/CMakeLists.txt.clp-x11 fltk-1.3.2/CMakeLists.txt
--- fltk-1.3.2/CMakeLists.txt.clp-x11 2012-09-13 16:19:01.000000000 +0200
+++ fltk-1.3.2/CMakeLists.txt 2013-01-30 15:56:25.810663430 +0100
@@ -515,6 +515,20 @@ else()
endif(OPTION_USE_XINERAMA)
#######################################################################
+if(X11_Xfixes_FOUND)
+ option(OPTION_USE_XFIXES "use lib XFIXES" ON)
+endif(X11_Xfixes_FOUND)
+
+if(OPTION_USE_XFIXES)
+ set(HAVE_XFIXES ${X11_Xfixes_FOUND})
+ include_directories(${X11_Xfixes_INCLUDE_PATH})
+ list(APPEND FLTK_LDLIBS -lXfixes)
+ set(FLTK_XFIXES_FOUND TRUE)
+else()
+ set(FLTK_XFIXES_FOUND FALSE)
+endif(OPTION_USE_XFIXES)
+
+#######################################################################
if(X11_Xft_FOUND)
option(OPTION_USE_XFT "use lib Xft" ON)
endif(X11_Xft_FOUND)
diff -up fltk-1.3.2/configh.cmake.in.clp-x11 fltk-1.3.2/configh.cmake.in
--- fltk-1.3.2/configh.cmake.in.clp-x11 2011-07-19 06:49:30.000000000 +0200
+++ fltk-1.3.2/configh.cmake.in 2013-01-30 15:56:25.810663430 +0100
@@ -108,6 +108,14 @@
#define USE_XDBE HAVE_XDBE
/*
+ * HAVE_XFIXES:
+ *
+ * Do we have the X fixes extension?
+ */
+
+#cmakedefine01 HAVE_XFIXES
+
+/*
* __APPLE_QUARTZ__:
*
* If __APPLE_QUARTZ__ is defined, FLTK will be
diff -up fltk-1.3.2/configh.in.clp-x11 fltk-1.3.2/configh.in
--- fltk-1.3.2/configh.in.clp-x11 2011-10-04 11:21:47.000000000 +0200
+++ fltk-1.3.2/configh.in 2013-01-30 15:56:25.810663430 +0100
@@ -108,6 +108,14 @@
#define USE_XDBE HAVE_XDBE
/*
+ * HAVE_XFIXES:
+ *
+ * Do we have the X fixes extension?
+ */
+
+#define HAVE_XFIXES 0
+
+/*
* __APPLE_QUARTZ__:
*
* All Apple implementations are now based on Quartz and Cocoa,
diff -up fltk-1.3.2/configure.in.clp-x11 fltk-1.3.2/configure.in
--- fltk-1.3.2/configure.in.clp-x11 2013-01-30 15:56:25.802663573 +0100
+++ fltk-1.3.2/configure.in 2013-01-30 15:56:25.810663430 +0100
@@ -999,6 +999,16 @@ case $uname_GUI in
LIBS="-lXext $LIBS")
fi
+ dnl Check for the Xfixes extension unless disabled...
+ AC_ARG_ENABLE(xfixes, [ --enable-xfixes turn on Xfixes support [default=yes]])
+
+ if test x$enable_xfixes != xno; then
+ AC_CHECK_HEADER(X11/extensions/Xfixes.h, AC_DEFINE(HAVE_XFIXES),,
+ [#include <X11/Xlib.h>])
+ AC_CHECK_LIB(Xfixes, XFixesQueryExtension,
+ LIBS="-lXfixes $LIBS")
+ fi
+
dnl Check for overlay visuals...
AC_PATH_PROG(XPROP, xprop)
AC_CACHE_CHECK(for X overlay visuals, ac_cv_have_overlay,
diff -up fltk-1.3.2/fluid/CMakeLists.txt.clp-x11 fltk-1.3.2/fluid/CMakeLists.txt
diff -up fltk-1.3.2/src/CMakeLists.txt.clp-x11 fltk-1.3.2/src/CMakeLists.txt
--- fltk-1.3.2/src/CMakeLists.txt.clp-x11 2013-01-30 16:06:00.785430590 +0100
+++ fltk-1.3.2/src/CMakeLists.txt 2013-01-30 16:06:17.883126642 +0100
@@ -243,6 +243,10 @@ if(HAVE_XINERAMA)
target_link_libraries(fltk ${X11_Xinerama_LIB})
endif(HAVE_XINERAMA)
+if(HAVE_XFIXES)
+ target_link_libraries(fltk ${X11_Xfixes_LIB})
+endif(HAVE_XFIXES)
+
if(USE_XFT)
target_link_libraries(fltk ${X11_Xft_LIB})
endif(USE_XFT)
diff -up fltk-1.3.2/src/Fl_x.cxx.clp-x11 fltk-1.3.2/src/Fl_x.cxx
--- fltk-1.3.2/src/Fl_x.cxx.clp-x11 2013-01-30 15:56:25.793663733 +0100
+++ fltk-1.3.2/src/Fl_x.cxx 2013-01-30 16:03:37.355981103 +0100
@@ -53,6 +53,12 @@ static XRRUpdateConfiguration_type XRRUp
static int randrEventBase; // base of RandR-defined events
#endif
+# if HAVE_XFIXES
+# include <X11/extensions/Xfixes.h>
+static int xfixes_event_base = 0;
+static bool have_xfixes = false;
+# endif
+
static Fl_Xlib_Graphics_Driver fl_xlib_driver;
static Fl_Display_Device fl_xlib_display(&fl_xlib_driver);
Fl_Display_Device *Fl_Display_Device::_display = &fl_xlib_display;// the platform display
@@ -307,6 +313,9 @@ static Atom WM_PROTOCOLS;
static Atom fl_MOTIF_WM_HINTS;
static Atom TARGETS;
static Atom CLIPBOARD;
+static Atom TIMESTAMP;
+static Atom PRIMARY_TIMESTAMP;
+static Atom CLIPBOARD_TIMESTAMP;
Atom fl_XdndAware;
Atom fl_XdndSelection;
Atom fl_XdndEnter;
@@ -667,6 +676,9 @@ void fl_open_display(Display* d) {
fl_MOTIF_WM_HINTS = XInternAtom(d, "_MOTIF_WM_HINTS", 0);
TARGETS = XInternAtom(d, "TARGETS", 0);
CLIPBOARD = XInternAtom(d, "CLIPBOARD", 0);
+ TIMESTAMP = XInternAtom(d, "TIMESTAMP", 0);
+ PRIMARY_TIMESTAMP = XInternAtom(d, "PRIMARY_TIMESTAMP", 0);
+ CLIPBOARD_TIMESTAMP = XInternAtom(d, "CLIPBOARD_TIMESTAMP", 0);
fl_XdndAware = XInternAtom(d, "XdndAware", 0);
fl_XdndSelection = XInternAtom(d, "XdndSelection", 0);
fl_XdndEnter = XInternAtom(d, "XdndEnter", 0);
@@ -713,6 +725,15 @@ void fl_open_display(Display* d) {
#if !USE_COLORMAP
Fl::visual(FL_RGB);
#endif
+
+#if HAVE_XFIXES
+ int error_base;
+ if (XFixesQueryExtension(fl_display, &xfixes_event_base, &error_base))
+ have_xfixes = true;
+ else
+ have_xfixes = false;
+#endif
+
#if USE_XRANDR
void *libxrandr_addr = dlopen("libXrandr.so.2", RTLD_LAZY);
if (!libxrandr_addr) libxrandr_addr = dlopen("libXrandr.so", RTLD_LAZY);
@@ -901,6 +922,107 @@ void Fl::copy(const char *stuff, int len
}
////////////////////////////////////////////////////////////////
+// Code for tracking clipboard changes:
+
+static Time primary_timestamp = -1;
+static Time clipboard_timestamp = -1;
+
+extern bool fl_clipboard_notify_empty(void);
+extern void fl_trigger_clipboard_notify(int source);
+
+static void poll_clipboard_owner(void) {
+ Window xid;
+
+#if HAVE_XFIXES
+ // No polling needed with Xfixes
+ if (have_xfixes)
+ return;
+#endif
+
+ // No one is interested, so no point polling
+ if (fl_clipboard_notify_empty())
+ return;
+
+ // We need a window for this to work
+ if (!Fl::first_window())
+ return;
+ xid = fl_xid(Fl::first_window());
+ if (!xid)
+ return;
+
+ // Request an update of the selection time for both the primary and
+ // clipboard selections. Magic continues when we get a SelectionNotify.
+ if (!fl_i_own_selection[0])
+ XConvertSelection(fl_display, XA_PRIMARY, TIMESTAMP, PRIMARY_TIMESTAMP,
+ xid, fl_event_time);
+ if (!fl_i_own_selection[1])
+ XConvertSelection(fl_display, CLIPBOARD, TIMESTAMP, CLIPBOARD_TIMESTAMP,
+ xid, fl_event_time);
+}
+
+static void clipboard_timeout(void *data)
+{
+ // No one is interested, so stop polling
+ if (fl_clipboard_notify_empty())
+ return;
+
+ poll_clipboard_owner();
+
+ Fl::repeat_timeout(0.5, clipboard_timeout);
+}
+
+static void handle_clipboard_timestamp(int clipboard, Time time)
+{
+ Time *timestamp;
+
+ timestamp = clipboard ? &clipboard_timestamp : &primary_timestamp;
+
+#if HAVE_XFIXES
+ if (!have_xfixes)
+#endif
+ {
+ // Initial scan, just store the value
+ if (*timestamp == (Time)-1) {
+ *timestamp = time;
+ return;
+ }
+ }
+
+ // Same selection
+ if (time == *timestamp)
+ return;
+
+ *timestamp = time;
+
+ // The clipboard change is the event that caused us to request
+ // the clipboard data, so use that time as the latest event.
+ if (time > fl_event_time)
+ fl_event_time = time;
+
+ // Something happened! Let's tell someone!
+ fl_trigger_clipboard_notify(clipboard);
+}
+
+void fl_clipboard_notify_change() {
+ // Reset the timestamps if we've going idle so that you don't
+ // get a bogus immediate trigger next time they're activated.
+ if (fl_clipboard_notify_empty()) {
+ primary_timestamp = -1;
+ clipboard_timestamp = -1;
+ } else {
+#if HAVE_XFIXES
+ if (!have_xfixes)
+#endif
+ {
+ poll_clipboard_owner();
+
+ if (!Fl::has_timeout(clipboard_timeout))
+ Fl::add_timeout(0.5, clipboard_timeout);
+ }
+ }
+}
+
+////////////////////////////////////////////////////////////////
const XEvent* fl_xevent; // the current x event
ulong fl_event_time; // the last timestamp from an x event
@@ -1024,7 +1141,6 @@ int fl_handle(const XEvent& thisevent)
return 0;
case SelectionNotify: {
- if (!fl_selection_requestor) return 0;
static unsigned char* buffer = 0;
if (buffer) {XFree(buffer); buffer = 0;}
long bytesread = 0;
@@ -1040,6 +1156,19 @@ int fl_handle(const XEvent& thisevent)
bytesread/4, 65536, 1, 0,
&actual, &format, &count, &remaining,
&portion)) break; // quit on error
+
+ if ((fl_xevent->xselection.property == PRIMARY_TIMESTAMP) ||
+ (fl_xevent->xselection.property == CLIPBOARD_TIMESTAMP)) {
+ if (portion && format == 32 && count == 1) {
+ Time t = *(unsigned int*)portion;
+ if (fl_xevent->xselection.property == CLIPBOARD_TIMESTAMP)
+ handle_clipboard_timestamp(1, t);
+ else
+ handle_clipboard_timestamp(0, t);
+ }
+ return true;
+ }
+
if (actual == TARGETS || actual == XA_ATOM) {
Atom type = XA_STRING;
for (unsigned i = 0; i<count; i++) {
@@ -1076,6 +1205,9 @@ int fl_handle(const XEvent& thisevent)
buffer[bytesread] = 0;
convert_crlf(buffer, bytesread);
}
+
+ if (!fl_selection_requestor) return 0;
+
Fl::e_text = buffer ? (char*)buffer : (char *)"";
Fl::e_length = bytesread;
int old_event = Fl::e_number;
@@ -1096,6 +1228,7 @@ int fl_handle(const XEvent& thisevent)
case SelectionClear: {
int clipboard = fl_xevent->xselectionclear.selection == CLIPBOARD;
fl_i_own_selection[clipboard] = 0;
+ poll_clipboard_owner();
return 1;}
case SelectionRequest: {
@@ -1308,6 +1441,9 @@ int fl_handle(const XEvent& thisevent)
case FocusIn:
if (fl_xim_ic) XSetICFocus(fl_xim_ic);
event = FL_FOCUS;
+ // If the user has toggled from another application to this one,
+ // then it's a good time to check for clipboard changes.
+ poll_clipboard_owner();
break;
case FocusOut:
@@ -1676,6 +1812,25 @@ int fl_handle(const XEvent& thisevent)
}
}
+#if HAVE_XFIXES
+ switch (xevent.type - xfixes_event_base) {
+ case XFixesSelectionNotify: {
+ // Someone feeding us bogus events?
+ if (!have_xfixes)
+ return true;
+
+ XFixesSelectionNotifyEvent *selection_notify = (XFixesSelectionNotifyEvent *)&xevent;
+
+ if ((selection_notify->selection == XA_PRIMARY) && !fl_i_own_selection[0])
+ handle_clipboard_timestamp(0, selection_notify->selection_timestamp);
+ else if ((selection_notify->selection == CLIPBOARD) && !fl_i_own_selection[1])
+ handle_clipboard_timestamp(1, selection_notify->selection_timestamp);
+
+ return true;
+ }
+ }
+#endif
+
return Fl::handle(event, window);
}
@@ -1995,6 +2150,16 @@ void Fl_X::make_xid(Fl_Window* win, XVis
XChangeProperty(fl_display, xp->xid, net_wm_type, XA_ATOM, 32, PropModeReplace, (unsigned char*)&net_wm_type_kind, 1);
}
+#if HAVE_XFIXES
+ // register for clipboard change notifications
+ if (have_xfixes && !win->parent()) {
+ XFixesSelectSelectionInput(fl_display, xp->xid, XA_PRIMARY,
+ XFixesSetSelectionOwnerNotifyMask);
+ XFixesSelectSelectionInput(fl_display, xp->xid, CLIPBOARD,
+ XFixesSetSelectionOwnerNotifyMask);
+ }
+#endif
+
XMapWindow(fl_display, xp->xid);
if (showit) {
win->set_visible();
diff -up fltk-1.3.2/test/CMakeLists.txt.clp-x11 fltk-1.3.2/test/CMakeLists.txt

View File

@@ -0,0 +1,135 @@
diff -ur fltk-1.3.0r9110.org/src/Fl_win32.cxx fltk-1.3.0r9110/src/Fl_win32.cxx
--- fltk-1.3.0r9110.org/src/Fl_win32.cxx 2012-06-17 19:42:02.169422400 +0200
+++ fltk-1.3.0r9110/src/Fl_win32.cxx 2012-06-17 19:43:38.286031455 +0200
@@ -543,6 +543,37 @@
const char* GetValue() const { return(out); }
};
+void fl_update_clipboard(void) {
+ Fl_Window *w1 = Fl::first_window();
+ if (!w1)
+ return;
+
+ HWND hwnd = fl_xid(w1);
+
+ if (!OpenClipboard(hwnd))
+ return;
+
+ EmptyClipboard();
+
+ int utf16_len = fl_utf8toUtf16(fl_selection_buffer[1],
+ fl_selection_length[1], 0, 0);
+
+ HGLOBAL hMem = GlobalAlloc(GHND, utf16_len * 2 + 2); // moveable and zero'ed mem alloc.
+ LPVOID memLock = GlobalLock(hMem);
+
+ fl_utf8toUtf16(fl_selection_buffer[1], fl_selection_length[1],
+ (unsigned short*) memLock, utf16_len + 1);
+
+ GlobalUnlock(hMem);
+ SetClipboardData(CF_UNICODETEXT, hMem);
+
+ CloseClipboard();
+
+ // In case Windows managed to lob of a WM_DESTROYCLIPBOARD during
+ // the above.
+ fl_i_own_selection[1] = 1;
+}
+
// call this when you create a selection:
void Fl::copy(const char *stuff, int len, int clipboard) {
if (!stuff || len<0) return;
@@ -560,25 +591,9 @@
memcpy(fl_selection_buffer[clipboard], stuff, len);
fl_selection_buffer[clipboard][len] = 0; // needed for direct paste
fl_selection_length[clipboard] = len;
- if (clipboard) {
- // set up for "delayed rendering":
- if (OpenClipboard(NULL)) {
- // if the system clipboard works, use it
- int utf16_len = fl_utf8toUtf16(fl_selection_buffer[clipboard], fl_selection_length[clipboard], 0, 0);
- EmptyClipboard();
- HGLOBAL hMem = GlobalAlloc(GHND, utf16_len * 2 + 2); // moveable and zero'ed mem alloc.
- LPVOID memLock = GlobalLock(hMem);
- fl_utf8toUtf16(fl_selection_buffer[clipboard], fl_selection_length[clipboard], (unsigned short*) memLock, utf16_len + 1);
- GlobalUnlock(hMem);
- SetClipboardData(CF_UNICODETEXT, hMem);
- CloseClipboard();
- GlobalFree(hMem);
- fl_i_own_selection[clipboard] = 0;
- } else {
- // only if it fails, instruct paste() to use the internal buffers
- fl_i_own_selection[clipboard] = 1;
- }
- }
+ fl_i_own_selection[clipboard] = 1;
+ if (clipboard)
+ fl_update_clipboard();
}
// Call this when a "paste" operation happens:
@@ -1307,33 +1322,6 @@
fl_i_own_selection[1] = 0;
return 1;
- case WM_RENDERALLFORMATS:
- fl_i_own_selection[1] = 0;
- // Windoze seems unhappy unless I do these two steps. Documentation
- // seems to vary on whether opening the clipboard is necessary or
- // is in fact wrong:
- CloseClipboard();
- OpenClipboard(NULL);
- // fall through...
- case WM_RENDERFORMAT: {
- HANDLE h;
-
-// int l = fl_utf_nb_char((unsigned char*)fl_selection_buffer[1], fl_selection_length[1]);
- int l = fl_utf8toUtf16(fl_selection_buffer[1], fl_selection_length[1], NULL, 0); // Pass NULL buffer to query length required
- h = GlobalAlloc(GHND, (l+1) * sizeof(unsigned short));
- if (h) {
- unsigned short *g = (unsigned short*) GlobalLock(h);
-// fl_utf2unicode((unsigned char *)fl_selection_buffer[1], fl_selection_length[1], (xchar*)g);
- l = fl_utf8toUtf16(fl_selection_buffer[1], fl_selection_length[1], g, (l+1));
- g[l] = 0;
- GlobalUnlock(h);
- SetClipboardData(CF_UNICODETEXT, h);
- }
-
- // Windoze also seems unhappy if I don't do this. Documentation very
- // unclear on what is correct:
- if (fl_msg.message == WM_RENDERALLFORMATS) CloseClipboard();
- return 1;}
case WM_DISPLAYCHANGE: // occurs when screen configuration (number, position) changes
Fl::call_screen_init();
Fl::handle(FL_SCREEN_CONFIGURATION_CHANGED, NULL);
diff -ur fltk-1.3.0r9110.org/src/Fl.cxx fltk-1.3.0r9110/src/Fl.cxx
--- fltk-1.3.0r9110.org/src/Fl.cxx 2012-06-17 19:42:02.173422595 +0200
+++ fltk-1.3.0r9110/src/Fl.cxx 2012-06-17 19:42:02.317429497 +0200
@@ -1420,7 +1420,9 @@
////////////////////////////////////////////////////////////////
// hide() destroys the X window, it does not do unmap!
-#if !defined(WIN32) && USE_XFT
+#if defined(WIN32)
+extern void fl_update_clipboard(void);
+#elif USE_XFT
extern void fl_destroy_xft_draw(Window);
#endif
@@ -1467,14 +1469,8 @@
#if defined(WIN32)
// this little trick keeps the current clipboard alive, even if we are about
// to destroy the window that owns the selection.
- if (GetClipboardOwner()==ip->xid) {
- Fl_Window *w1 = Fl::first_window();
- if (w1 && OpenClipboard(fl_xid(w1))) {
- EmptyClipboard();
- SetClipboardData(CF_TEXT, NULL);
- CloseClipboard();
- }
- }
+ if (GetClipboardOwner()==ip->xid)
+ fl_update_clipboard();
// Send a message to myself so that I'll get out of the event loop...
PostMessage(ip->xid, WM_APP, 0, 0);
if (ip->private_dc) fl_release_dc(ip->xid, ip->private_dc);

View File

@@ -0,0 +1,99 @@
diff -ur fltk-1.3.0r9110.org/src/Fl.cxx fltk-1.3.0r9110/src/Fl.cxx
--- fltk-1.3.0r9110.org/src/Fl.cxx 2012-06-17 19:47:09.988183253 +0200
+++ fltk-1.3.0r9110/src/Fl.cxx 2012-06-17 19:47:10.127189919 +0200
@@ -1421,6 +1421,7 @@
// hide() destroys the X window, it does not do unmap!
#if defined(WIN32)
+extern void fl_clipboard_notify_untarget(HWND wnd);
extern void fl_update_clipboard(void);
#elif USE_XFT
extern void fl_destroy_xft_draw(Window);
@@ -1471,6 +1472,8 @@
// to destroy the window that owns the selection.
if (GetClipboardOwner()==ip->xid)
fl_update_clipboard();
+ // Make sure we unlink this window from the clipboard chain
+ fl_clipboard_notify_untarget(ip->xid);
// Send a message to myself so that I'll get out of the event loop...
PostMessage(ip->xid, WM_APP, 0, 0);
if (ip->private_dc) fl_release_dc(ip->xid, ip->private_dc);
diff -ur fltk-1.3.0r9110.org/src/Fl_win32.cxx fltk-1.3.0r9110/src/Fl_win32.cxx
--- fltk-1.3.0r9110.org/src/Fl_win32.cxx 2012-06-17 19:47:09.987183205 +0200
+++ fltk-1.3.0r9110/src/Fl_win32.cxx 2012-06-17 19:47:19.069618739 +0200
@@ -646,6 +646,38 @@
}
}
+static HWND clipboard_wnd = 0;
+static HWND next_clipboard_wnd = 0;
+
+static bool initial_clipboard = true;
+
+void fl_clipboard_notify_change() {
+ // No need to do anything here...
+}
+
+void fl_clipboard_notify_target(HWND wnd) {
+ if (clipboard_wnd)
+ return;
+
+ // We get one fake WM_DRAWCLIPBOARD immediately, which we therefore
+ // need to ignore.
+ initial_clipboard = true;
+
+ clipboard_wnd = wnd;
+ next_clipboard_wnd = SetClipboardViewer(wnd);
+}
+
+void fl_clipboard_notify_untarget(HWND wnd) {
+ if (wnd != clipboard_wnd)
+ return;
+
+ ChangeClipboardChain(wnd, next_clipboard_wnd);
+ clipboard_wnd = next_clipboard_wnd = 0;
+
+ if (Fl::first_window())
+ fl_clipboard_notify_target(fl_xid(Fl::first_window()));
+}
+
////////////////////////////////////////////////////////////////
char fl_is_ime = 0;
void fl_get_codepage()
@@ -1327,6 +1359,27 @@
Fl::handle(FL_SCREEN_CONFIGURATION_CHANGED, NULL);
return 0;
+ case WM_CHANGECBCHAIN:
+ if ((hWnd == clipboard_wnd) &&
+ (next_clipboard_wnd == (HWND)wParam)) {
+ next_clipboard_wnd = (HWND)lParam;
+ return 0;
+ }
+ break;
+
+ case WM_DRAWCLIPBOARD:
+ // When the clipboard moves between two FLTK windows,
+ // fl_i_own_selection will temporarily be false as we are
+ // processing this message. Hence the need to use fl_find().
+ if (!initial_clipboard && !fl_find(GetClipboardOwner()))
+ fl_trigger_clipboard_notify(1);
+ initial_clipboard = false;
+
+ if (next_clipboard_wnd)
+ SendMessage(next_clipboard_wnd, WM_DRAWCLIPBOARD, wParam, lParam);
+
+ return 0;
+
default:
if (Fl::handle(0,0)) return 0;
break;
@@ -1685,6 +1738,8 @@
x->next = Fl_X::first;
Fl_X::first = x;
+ fl_clipboard_notify_target(x->xid);
+
x->wait_for_expose = 1;
if (fl_show_iconic) {showit = 0; fl_show_iconic = 0;}
if (showit) {

View File

@@ -0,0 +1,44 @@
diff -bur fltk-1.3.0r9619.org/src/Fl_cocoa.mm fltk-1.3.0r9619/src/Fl_cocoa.mm
--- fltk-1.3.0r9619.org/src/Fl_cocoa.mm 2012-06-18 19:24:30.971688769 +0200
+++ fltk-1.3.0r9619/src/Fl_cocoa.mm 2012-06-18 19:25:25.700310375 +0200
@@ -1319,9 +1319,13 @@
}
@end
+static void clipboard_check(void);
+
@implementation FLApplication
+ (void)sendEvent:(NSEvent *)theEvent
{
+ // update clipboard status
+ clipboard_check();
NSEventType type = [theEvent type];
if (type == NSLeftMouseDown) {
fl_lock_function();
@@ -2790,6 +2794,26 @@
PasteboardCreate(kPasteboardClipboard, &myPasteboard);
}
+extern void fl_trigger_clipboard_notify(int source);
+
+void fl_clipboard_notify_change() {
+ // No need to do anything here...
+}
+
+static void clipboard_check(void)
+{
+ PasteboardSyncFlags flags;
+
+ allocatePasteboard();
+ flags = PasteboardSynchronize(myPasteboard);
+
+ if (!(flags & kPasteboardModified))
+ return;
+ if (flags & kPasteboardClientIsOwner)
+ return;
+
+ fl_trigger_clipboard_notify(1);
+}
/*
* create a selection

View File

@@ -0,0 +1,554 @@
diff -ur fltk-1.3.2.org/FL/Fl_Image.H fltk-1.3.2/FL/Fl_Image.H
--- fltk-1.3.2.org/FL/Fl_Image.H 2012-11-09 17:02:08.000000000 +0100
+++ fltk-1.3.2/FL/Fl_Image.H 2013-01-16 14:40:51.543230638 +0100
@@ -26,6 +26,7 @@
#include <stdlib.h>
class Fl_Widget;
+class Fl_Pixmap;
struct Fl_Menu_Item;
struct Fl_Label;
@@ -203,6 +204,7 @@
*/
Fl_RGB_Image(const uchar *bits, int W, int H, int D=3, int LD=0) :
Fl_Image(W,H,D), array(bits), alloc_array(0), id_(0), mask_(0) {data((const char **)&array, 1); ld(LD);}
+ Fl_RGB_Image(const Fl_Pixmap *pxm, Fl_Color bg=FL_GRAY);
virtual ~Fl_RGB_Image();
virtual Fl_Image *copy(int W, int H);
Fl_Image *copy() { return copy(w(), h()); }
diff -ur fltk-1.3.2.org/src/fl_draw_pixmap.cxx fltk-1.3.2/src/fl_draw_pixmap.cxx
--- fltk-1.3.2.org/src/fl_draw_pixmap.cxx 2012-04-22 05:09:31.000000000 +0200
+++ fltk-1.3.2/src/fl_draw_pixmap.cxx 2013-01-16 14:40:51.542230588 +0100
@@ -58,99 +58,6 @@
return 1;
}
-#ifdef U64
-
-// The callback from fl_draw_image to get a row of data passes this:
-struct pixmap_data {
- int w, h;
- const uchar*const* data;
- union {
- U64 colors[256];
- U64* byte1[256];
- };
-};
-
-// callback for 1 byte per pixel:
-static void cb1(void*v, int x, int y, int w, uchar* buf) {
- pixmap_data& d = *(pixmap_data*)v;
- const uchar* p = d.data[y]+x;
- U64* q = (U64*)buf;
- for (int X=w; X>0; X-=2, p += 2) {
- if (X>1) {
-# if WORDS_BIGENDIAN
- *q++ = (d.colors[p[0]]<<32) | d.colors[p[1]];
-# else
- *q++ = (d.colors[p[1]]<<32) | d.colors[p[0]];
-# endif
- } else {
-# if WORDS_BIGENDIAN
- *q++ = d.colors[p[0]]<<32;
-# else
- *q++ = d.colors[p[0]];
-# endif
- }
- }
-}
-
-// callback for 2 bytes per pixel:
-static void cb2(void*v, int x, int y, int w, uchar* buf) {
- pixmap_data& d = *(pixmap_data*)v;
- const uchar* p = d.data[y]+2*x;
- U64* q = (U64*)buf;
- for (int X=w; X>0; X-=2) {
- U64* colors = d.byte1[*p++];
- int index = *p++;
- if (X>1) {
- U64* colors1 = d.byte1[*p++];
- int index1 = *p++;
-# if WORDS_BIGENDIAN
- *q++ = (colors[index]<<32) | colors1[index1];
-# else
- *q++ = (colors1[index1]<<32) | colors[index];
-# endif
- } else {
-# if WORDS_BIGENDIAN
- *q++ = colors[index]<<32;
-# else
- *q++ = colors[index];
-# endif
- }
- }
-}
-
-#else // U32
-
-// The callback from fl_draw_image to get a row of data passes this:
-struct pixmap_data {
- int w, h;
- const uchar*const* data;
- union {
- U32 colors[256];
- U32* byte1[256];
- };
-};
-
-// callback for 1 byte per pixel:
-static void cb1(void*v, int x, int y, int w, uchar* buf) {
- pixmap_data& d = *(pixmap_data*)v;
- const uchar* p = d.data[y]+x;
- U32* q = (U32*)buf;
- for (int X=w; X--;) *q++ = d.colors[*p++];
-}
-
-// callback for 2 bytes per pixel:
-static void cb2(void*v, int x, int y, int w, uchar* buf) {
- pixmap_data& d = *(pixmap_data*)v;
- const uchar* p = d.data[y]+2*x;
- U32* q = (U32*)buf;
- for (int X=w; X--;) {
- U32* colors = d.byte1[*p++];
- *q++ = colors[*p++];
- }
-}
-
-#endif // U64 else U32
-
uchar **fl_mask_bitmap; // if non-zero, create bitmap and store pointer here
/**
@@ -200,34 +107,33 @@
}
#endif
-/**
- Draw XPM image data, with the top-left corner at the given position.
- \see fl_draw_pixmap(char* const* data, int x, int y, Fl_Color bg)
- */
-int fl_draw_pixmap(const char*const* cdata, int x, int y, Fl_Color bg) {
- pixmap_data d;
- if (!fl_measure_pixmap(cdata, d.w, d.h)) return 0;
+int fl_convert_pixmap(const char*const* cdata, uchar* out, Fl_Color bg) {
+ int w, h;
const uchar*const* data = (const uchar*const*)(cdata+1);
int transparent_index = -1;
+
+ if (!fl_measure_pixmap(cdata, w, h))
+ return 0;
+
+ if ((chars_per_pixel < 1) || (chars_per_pixel > 2))
+ return 0;
+
+ uchar colors[1<<(chars_per_pixel*8)][4];
+
#ifdef WIN32
uchar *transparent_c = (uchar *)0; // such that transparent_c[0,1,2] are the RGB of the transparent color
color_count = 0;
used_colors = (uchar *)malloc(abs(ncolors)*3*sizeof(uchar));
#endif
- if (ncolors < 0) { // FLTK (non standard) compressed colormap
+ if (ncolors < 0) {
+ // FLTK (non standard) compressed colormap
ncolors = -ncolors;
const uchar *p = *data++;
// if first color is ' ' it is transparent (put it later to make
// it not be transparent):
if (*p == ' ') {
- uchar* c = (uchar*)&d.colors[(int)' '];
-#ifdef U64
- *(U64*)c = 0;
-# if WORDS_BIGENDIAN
- c += 4;
-# endif
-#endif
+ uchar* c = colors[(int)' '];
transparent_index = ' ';
Fl::get_color(bg, c[0], c[1], c[2]); c[3] = 0;
#ifdef WIN32
@@ -238,13 +144,7 @@
}
// read all the rest of the colors:
for (int i=0; i < ncolors; i++) {
- uchar* c = (uchar*)&d.colors[*p++];
-#ifdef U64
- *(U64*)c = 0;
-# if WORDS_BIGENDIAN
- c += 4;
-# endif
-#endif
+ uchar* c = colors[*p++];
#ifdef WIN32
used_colors[3*color_count] = *p;
used_colors[3*color_count+1] = *(p+1);
@@ -254,69 +154,44 @@
*c++ = *p++;
*c++ = *p++;
*c++ = *p++;
-#ifdef __APPLE_QUARTZ__
*c = 255;
-#else
- *c = 0;
-#endif
}
- } else { // normal XPM colormap with names
- if (chars_per_pixel>1) memset(d.byte1, 0, sizeof(d.byte1));
+ } else {
+ // normal XPM colormap with names
for (int i=0; i<ncolors; i++) {
const uchar *p = *data++;
// the first 1 or 2 characters are the color index:
int ind = *p++;
uchar* c;
- if (chars_per_pixel>1) {
-#ifdef U64
- U64* colors = d.byte1[ind];
- if (!colors) colors = d.byte1[ind] = new U64[256];
-#else
- U32* colors = d.byte1[ind];
- if (!colors) colors = d.byte1[ind] = new U32[256];
-#endif
- c = (uchar*)&colors[*p];
- ind = (ind<<8)|*p++;
- } else {
- c = (uchar *)&d.colors[ind];
- }
+ if (chars_per_pixel>1)
+ ind = (ind<<8)|*p++;
+ c = colors[ind];
// look for "c word", or last word if none:
const uchar *previous_word = p;
for (;;) {
- while (*p && isspace(*p)) p++;
- uchar what = *p++;
- while (*p && !isspace(*p)) p++;
- while (*p && isspace(*p)) p++;
- if (!*p) {p = previous_word; break;}
- if (what == 'c') break;
- previous_word = p;
- while (*p && !isspace(*p)) p++;
+ while (*p && isspace(*p)) p++;
+ uchar what = *p++;
+ while (*p && !isspace(*p)) p++;
+ while (*p && isspace(*p)) p++;
+ if (!*p) {p = previous_word; break;}
+ if (what == 'c') break;
+ previous_word = p;
+ while (*p && !isspace(*p)) p++;
}
-#ifdef U64
- *(U64*)c = 0;
-# if WORDS_BIGENDIAN
- c += 4;
-# endif
-#endif
-#ifdef __APPLE_QUARTZ__
- c[3] = 255;
-#endif
int parse = fl_parse_color((const char*)p, c[0], c[1], c[2]);
+ c[3] = 255;
if (parse) {
#ifdef WIN32
- used_colors[3*color_count] = c[0];
- used_colors[3*color_count+1] = c[1];
- used_colors[3*color_count+2] = c[2];
- color_count++;
+ used_colors[3*color_count] = c[0];
+ used_colors[3*color_count+1] = c[1];
+ used_colors[3*color_count+2] = c[2];
+ color_count++;
#endif
- }
- else {
+ } else {
// assume "None" or "#transparent" for any errors
- // "bg" should be transparent...
- Fl::get_color(bg, c[0], c[1], c[2]);
-#ifdef __APPLE_QUARTZ__
+ // "bg" should be transparent...
+ Fl::get_color(bg, c[0], c[1], c[2]);
c[3] = 0;
-#endif
transparent_index = ind;
#ifdef WIN32
transparent_c = c;
@@ -324,7 +199,6 @@
}
}
}
- d.data = data;
#ifdef WIN32
if (transparent_c) {
make_unused_color(transparent_c[0], transparent_c[1], transparent_c[2]);
@@ -334,77 +208,76 @@
make_unused_color(r, g, b);
}
#endif
+
+ U32 *q = (U32*)out;
+ for (int Y = 0; Y < h; Y++) {
+ const uchar* p = data[Y];
+ if (chars_per_pixel <= 1) {
+ for (int X = 0; X < w; X++)
+ memcpy(q++, colors[*p++], 4);
+ } else {
+ for (int X = 0; X < w; X++) {
+ int ind = (*p++)<<8;
+ ind |= *p++;
+ memcpy(q++, colors[ind], 4);
+ }
+ }
+ }
+ return 1;
+}
+
+/**
+ Draw XPM image data, with the top-left corner at the given position.
+ \see fl_draw_pixmap(char* const* data, int x, int y, Fl_Color bg)
+ */
+int fl_draw_pixmap(const char*const* cdata, int x, int y, Fl_Color bg) {
+ int w, h;
+
+ if (!fl_measure_pixmap(cdata, w, h))
+ return 0;
+
+ uchar buffer[w*h*4];
+
+ if (!fl_convert_pixmap(cdata, buffer, bg))
+ return 0;
+
+ // FIXME: Hack until fl_draw_image() supports alpha properly
#ifdef __APPLE_QUARTZ__
if (Fl_Surface_Device::surface() == Fl_Display_Device::display_device()) {
- U32 *array = new U32[d.w * d.h], *q = array;
- for (int Y = 0; Y < d.h; Y++) {
- const uchar* p = data[Y];
- if (chars_per_pixel <= 1) {
- for (int X = 0; X < d.w; X++) {
- *q++ = d.colors[*p++];
- }
- } else {
- for (int X = 0; X < d.w; X++) {
- U32* colors = (U32*)d.byte1[*p++];
- *q++ = colors[*p++];
- }
- }
- }
- Fl_RGB_Image* rgb = new Fl_RGB_Image((uchar*)array, d.w, d.h, 4);
+ Fl_RGB_Image* rgb = new Fl_RGB_Image(buffer, w, h, 4);
rgb->draw(x, y);
delete rgb;
- delete[] array;
- }
- else {
+ } else {
#endif // __APPLE_QUARTZ__
-
// build the mask bitmap used by Fl_Pixmap:
- if (fl_mask_bitmap && transparent_index >= 0) {
- int W = (d.w+7)/8;
- uchar* bitmap = new uchar[W * d.h];
+ if (fl_mask_bitmap) {
+ int W = (w+7)/8;
+ uchar* bitmap = new uchar[W * h];
*fl_mask_bitmap = bitmap;
- for (int Y = 0; Y < d.h; Y++) {
- const uchar* p = data[Y];
- if (chars_per_pixel <= 1) {
- int dw = d.w;
- for (int X = 0; X < W; X++) {
- uchar b = (dw-->0 && *p++ != transparent_index);
- if (dw-->0 && *p++ != transparent_index) b |= 2;
- if (dw-->0 && *p++ != transparent_index) b |= 4;
- if (dw-->0 && *p++ != transparent_index) b |= 8;
- if (dw-->0 && *p++ != transparent_index) b |= 16;
- if (dw-->0 && *p++ != transparent_index) b |= 32;
- if (dw-->0 && *p++ != transparent_index) b |= 64;
- if (dw-->0 && *p++ != transparent_index) b |= 128;
+ const uchar *p = &buffer[3];
+ uchar b = 0;
+ for (int Y = 0; Y < h; Y++) {
+ b = 0;
+ for (int X = 0, bit = 1; X < w; X++, p += 4) {
+ if (*p > 127) b |= bit;
+ bit <<= 1;
+ if (bit > 0x80 || X == w-1) {
*bitmap++ = b;
- }
- } else {
- uchar b = 0, bit = 1;
- for (int X = 0; X < d.w; X++) {
- int ind = *p++;
- ind = (ind<<8) | (*p++);
- if (ind != transparent_index) b |= bit;
-
- if (bit < 128) bit <<= 1;
- else {
- *bitmap++ = b;
- b = 0;
- bit = 1;
+ bit = 1;
+ b = 0;
}
}
-
- if (bit > 1) *bitmap++ = b;
}
- }
+
}
- fl_draw_image(chars_per_pixel==1 ? cb1 : cb2, &d, x, y, d.w, d.h, 4);
+ fl_draw_image(buffer, x, y, w, h, 4);
+
#ifdef __APPLE_QUARTZ__
}
#endif
- if (chars_per_pixel > 1) for (int i = 0; i < 256; i++) delete[] d.byte1[i];
return 1;
}
diff -ur fltk-1.3.2.org/src/Fl_Image.cxx fltk-1.3.2/src/Fl_Image.cxx
--- fltk-1.3.2.org/src/Fl_Image.cxx 2012-11-09 17:02:08.000000000 +0100
+++ fltk-1.3.2/src/Fl_Image.cxx 2013-01-16 14:41:38.404162795 +0100
@@ -165,7 +165,22 @@
//
size_t Fl_RGB_Image::max_size_ = ~((size_t)0);
-/** The destructor free all memory and server resources that are used by the image. */
+int fl_convert_pixmap(const char*const* cdata, uchar* out, Fl_Color bg);
+
+/** The constructor creates a new RGBA image from the specified Fl_Pixmap.
+
+ The RGBA image is built fully opaque except for the transparent area
+ of the pixmap that is assigned the \par bg color with full transparency */
+Fl_RGB_Image::Fl_RGB_Image(const Fl_Pixmap *pxm, Fl_Color bg):
+ Fl_Image(pxm->w(), pxm->h(), 4), id_(0), mask_(0)
+{
+ array = new uchar[w() * h() * d()];
+ alloc_array = 1;
+ fl_convert_pixmap(pxm->data(), (uchar*)array, bg);
+ data((const char **)&array, 1);
+}
+
+/** The destructor frees all memory and server resources that are used by the image. */
Fl_RGB_Image::~Fl_RGB_Image() {
uncache();
if (alloc_array) delete[] (uchar *)array;
diff -ur fltk-1.3.2.org/src/ps_image.cxx fltk-1.3.2/src/ps_image.cxx
--- fltk-1.3.2.org/src/ps_image.cxx 2011-07-19 06:49:30.000000000 +0200
+++ fltk-1.3.2/src/ps_image.cxx 2013-01-16 14:40:51.541228080 +0100
@@ -185,72 +185,38 @@
extern uchar **fl_mask_bitmap;
+struct callback_data {
+ const uchar *data;
+ int D, LD;
+};
-void Fl_PostScript_Graphics_Driver::draw_image(const uchar *data, int ix, int iy, int iw, int ih, int D, int LD) {
- double x = ix, y = iy, w = iw, h = ih;
- if (D<3){ //mono
- draw_image_mono(data, ix, iy, iw, ih, D, LD);
- return;
- }
+static void draw_image_cb(void *data, int x, int y, int w, uchar *buf) {
+ struct callback_data *cb_data;
+ const uchar *curdata;
+ cb_data = (struct callback_data*)data;
+ curdata = cb_data->data + x*cb_data->D + y*cb_data->LD;
- int i,j, k;
+ memcpy(buf, curdata, w*cb_data->D);
+}
- fprintf(output,"save\n");
- const char * interpol;
- if (lang_level_>1){
- if (interpolate_)
- interpol="true";
- else
- interpol="false";
- if (mask && lang_level_>2)
- fprintf(output, "%g %g %g %g %i %i %i %i %s CIM\n", x , y+h , w , -h , iw , ih, mx, my, interpol);
- else
- fprintf(output, "%g %g %g %g %i %i %s CII\n", x , y+h , w , -h , iw , ih, interpol);
- } else
- fprintf(output , "%g %g %g %g %i %i CI", x , y+h , w , -h , iw , ih);
+void Fl_PostScript_Graphics_Driver::draw_image(const uchar *data, int ix, int iy, int iw, int ih, int D, int LD) {
+ if (D<3){ //mono
+ draw_image_mono(data, ix, iy, iw, ih, D, LD);
+ return;
+ }
+ struct callback_data cb_data;
if (!LD) LD = iw*D;
- uchar *curmask=mask;
-
- for (j=0; j<ih;j++){
- if (mask){
-
- for (k=0;k<my/ih;k++){
- for (i=0; i<((mx+7)/8);i++){
- if (!(i%80)) fprintf(output, "\n");
- fprintf(output, "%.2x",swap_byte(*curmask));
- curmask++;
- }
- fprintf(output,"\n");
- }
- }
- const uchar *curdata=data+j*LD;
- for (i=0 ; i<iw ; i++) {
- uchar r = curdata[0];
- uchar g = curdata[1];
- uchar b = curdata[2];
- if (lang_level_<3 && D>3) { //can do mixing using bg_* colors)
- unsigned int a2 = curdata[3]; //must be int
- unsigned int a = 255-a2;
- r = (a2 * r + bg_r * a)/255;
- g = (a2 * g + bg_g * a)/255;
- b = (a2 * b + bg_b * a)/255;
- }
- if (!(i%40)) fprintf(output, "\n");
- fprintf(output, "%.2x%.2x%.2x", r, g, b);
- curdata +=D;
- }
- fprintf(output,"\n");
-
- }
-
- fprintf(output," >\nrestore\n" );
+ cb_data.data = data;
+ cb_data.D = D;
+ cb_data.LD = LD;
+ draw_image(draw_image_cb, &cb_data, ix, iy, iw, ih, D);
}
void Fl_PostScript_Graphics_Driver::draw_image(Fl_Draw_Image_Cb call, void *data, int ix, int iy, int iw, int ih, int D) {
@@ -325,6 +291,14 @@
uchar g = curdata[1];
uchar b = curdata[2];
+ if (lang_level_<3 && D>3) { //can do mixing using bg_* colors)
+ unsigned int a2 = curdata[3]; //must be int
+ unsigned int a = 255-a2;
+ r = (a2 * r + bg_r * a)/255;
+ g = (a2 * g + bg_g * a)/255;
+ b = (a2 * b + bg_b * a)/255;
+ }
+
if (!(i%40)) fputs("\n", output);
fprintf(output, "%.2x%.2x%.2x", r, g, b);

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,75 @@
diff -bur fltk-1.3.0r9619.org/src/Fl_cocoa.mm fltk-1.3.0r9619/src/Fl_cocoa.mm
--- fltk-1.3.0r9619.org/src/Fl_cocoa.mm 2012-06-19 12:54:43.694231638 +0200
+++ fltk-1.3.0r9619/src/Fl_cocoa.mm 2012-06-19 12:57:05.899048602 +0200
@@ -697,12 +697,9 @@
return NO; // prevent the caption to be redrawn as active on click
// when another modal window is currently the key win
- return !(w->tooltip_window() || w->menu_window());
+ return !w->tooltip_window();
}
-// TODO see if we really need a canBecomeMainWindow ...
-#if 0
-
- (BOOL)canBecomeMainWindow
{
if (Fl::modal_ && (Fl::modal_ != w))
@@ -711,7 +708,6 @@
return !(w->tooltip_window() || w->menu_window());
}
-#endif
@end
diff -bur fltk-1.3.0r9619.org/src/Fl_win32.cxx fltk-1.3.0r9619/src/Fl_win32.cxx
--- fltk-1.3.0r9619.org/src/Fl_win32.cxx 2012-06-19 12:54:43.696231735 +0200
+++ fltk-1.3.0r9619/src/Fl_win32.cxx 2012-06-19 12:54:43.803236862 +0200
@@ -1065,6 +1065,10 @@
break;
case WM_SETFOCUS:
+ if ((Fl::modal_) && (Fl::modal_ != window)) {
+ SetFocus(fl_xid(Fl::modal_));
+ return 0;
+ }
Fl::handle(FL_FOCUS, window);
break;
@@ -1826,6 +1830,11 @@
Fl::e_number = old_event;
w->redraw(); // force draw to happen
}
+
+ // Needs to be done before ShowWindow() to get the correct behaviour
+ // when we get WM_SETFOCUS.
+ if (w->modal()) {Fl::modal_ = w; fl_fix_focus();}
+
// If we've captured the mouse, we dont want to activate any
// other windows from the code, or we lose the capture.
ShowWindow(x->xid, !showit ? SW_SHOWMINNOACTIVE :
@@ -1843,7 +1852,6 @@
}
}
- if (w->modal()) {Fl::modal_ = w; fl_fix_focus();}
return x;
}
diff -bur fltk-1.3.0r9619.org/src/Fl_x.cxx fltk-1.3.0r9619/src/Fl_x.cxx
--- fltk-1.3.0r9619.org/src/Fl_x.cxx 2012-06-19 12:54:43.697231783 +0200
+++ fltk-1.3.0r9619/src/Fl_x.cxx 2012-06-19 12:54:43.804236911 +0200
@@ -2101,6 +2101,12 @@
while (wp->parent()) wp = wp->window();
XSetTransientForHint(fl_display, xp->xid, fl_xid(wp));
if (!wp->visible()) showit = 0; // guess that wm will not show it
+ if (win->modal()) {
+ Atom net_wm_state = XInternAtom (fl_display, "_NET_WM_STATE", 0);
+ Atom net_wm_state_skip_taskbar = XInternAtom (fl_display, "_NET_WM_STATE_MODAL", 0);
+ XChangeProperty (fl_display, xp->xid, net_wm_state, XA_ATOM, 32,
+ PropModeAppend, (unsigned char*) &net_wm_state_skip_taskbar, 1);
+ }
}
// Make sure that borderless windows do not show in the task bar

View File

@@ -0,0 +1,645 @@
diff -ur fltk-1.3.2.org/FL/Fl_Window.H fltk-1.3.2/FL/Fl_Window.H
--- fltk-1.3.2.org/FL/Fl_Window.H 2013-01-16 10:49:40.904228200 +0100
+++ fltk-1.3.2/FL/Fl_Window.H 2013-01-16 10:49:55.554353925 +0100
@@ -22,6 +22,10 @@
#ifndef Fl_Window_H
#define Fl_Window_H
+#ifdef WIN32
+#include <windows.h>
+#endif
+
#include "Fl_Group.H"
#define FL_WINDOW 0xF0 ///< window type id all subclasses have type() >= this
@@ -73,9 +77,19 @@
friend class Fl_X;
Fl_X *i; // points at the system-specific stuff
+ struct icon_data {
+ const void *legacy_icon;
+ Fl_RGB_Image **icons;
+ int count;
+#ifdef WIN32
+ HICON big_icon;
+ HICON small_icon;
+#endif
+ };
+
const char* iconlabel_;
char* xclass_;
- const void* icon_;
+ struct icon_data *icon_;
// size_range stuff:
int minw, minh, maxw, maxh;
int dw, dh, aspect;
@@ -121,6 +135,8 @@
*/
int force_position() const { return ((flags() & FORCE_POSITION)?1:0); }
+ void free_icons();
+
public:
/**
@@ -350,6 +366,18 @@
static const char *default_xclass();
const char* xclass() const;
void xclass(const char* c);
+
+ static void default_icon(const Fl_RGB_Image*);
+ static void default_icons(const Fl_RGB_Image*[], int);
+ void icon(const Fl_RGB_Image*);
+ void icons(const Fl_RGB_Image*[], int);
+
+#ifdef WIN32
+ static void default_icons(HICON big_icon, HICON small_icon);
+ void icons(HICON big_icon, HICON small_icon);
+#endif
+
+ /* for legacy compatibility */
const void* icon() const;
void icon(const void * ic);
diff -ur fltk-1.3.2.org/FL/mac.H fltk-1.3.2/FL/mac.H
--- fltk-1.3.2.org/FL/mac.H 2013-01-16 10:49:40.904228200 +0100
+++ fltk-1.3.2/FL/mac.H 2013-01-16 10:49:55.554353925 +0100
@@ -120,6 +120,9 @@
void collapse(void);
WindowRef window_ref(void);
void set_key_window(void);
+ // OS X doesn't have per window icons
+ static void set_default_icons(const Fl_RGB_Image*[], int) {};
+ void set_icons() {};
int set_cursor(Fl_Cursor);
int set_cursor(const Fl_RGB_Image*, int, int);
static CGImageRef CGImage_from_window_rect(Fl_Window *win, int x, int y, int w, int h);
diff -ur fltk-1.3.2.org/FL/win32.H fltk-1.3.2/FL/win32.H
--- fltk-1.3.2.org/FL/win32.H 2013-01-16 10:49:40.904228200 +0100
+++ fltk-1.3.2/FL/win32.H 2013-01-16 10:49:55.555355617 +0100
@@ -84,6 +84,9 @@
void flush() {w->flush();}
void set_minmax(LPMINMAXINFO minmax);
void mapraise();
+ static void set_default_icons(const Fl_RGB_Image*[], int);
+ static void set_default_icons(HICON, HICON);
+ void set_icons();
int set_cursor(Fl_Cursor);
int set_cursor(const Fl_RGB_Image*, int, int);
static Fl_X* make(Fl_Window*);
diff -ur fltk-1.3.2.org/FL/x.H fltk-1.3.2/FL/x.H
--- fltk-1.3.2.org/FL/x.H 2013-01-16 10:49:40.904228200 +0100
+++ fltk-1.3.2/FL/x.H 2013-01-16 10:49:55.555355617 +0100
@@ -154,6 +154,8 @@
static Fl_X* i(const Fl_Window* wi) {return wi->i;}
void setwindow(Fl_Window* wi) {w=wi; wi->i=this;}
void sendxjunk();
+ static void set_default_icons(const Fl_RGB_Image*[], int);
+ void set_icons();
int set_cursor(Fl_Cursor);
int set_cursor(const Fl_RGB_Image*, int, int);
static void make_xid(Fl_Window*,XVisualInfo* =fl_visual, Colormap=fl_colormap);
diff -ur fltk-1.3.2.org/src/Fl.cxx fltk-1.3.2/src/Fl.cxx
--- fltk-1.3.2.org/src/Fl.cxx 2013-01-16 10:49:40.895228113 +0100
+++ fltk-1.3.2/src/Fl.cxx 2013-01-16 10:49:55.556137979 +0100
@@ -1530,6 +1530,8 @@
if (xclass_) {
free(xclass_);
}
+ free_icons();
+ delete icon_;
}
// FL_SHOW and FL_HIDE are called whenever the visibility of this widget
diff -ur fltk-1.3.2.org/src/Fl_win32.cxx fltk-1.3.2/src/Fl_win32.cxx
--- fltk-1.3.2.org/src/Fl_win32.cxx 2013-01-16 10:49:40.911227539 +0100
+++ fltk-1.3.2/src/Fl_win32.cxx 2013-01-16 10:49:55.556137979 +0100
@@ -1804,6 +1804,8 @@
);
if (lab) free(lab);
+ x->set_icons();
+
if (w->fullscreen_active()) {
/* We need to make sure that the fullscreen is created on the
default monitor, ie the desktop where the shortcut is located
@@ -2034,71 +2036,19 @@
////////////////////////////////////////////////////////////////
-#ifndef IDC_HAND
-# define IDC_HAND MAKEINTRESOURCE(32649)
-#endif // !IDC_HAND
-
-int Fl_X::set_cursor(Fl_Cursor c) {
- LPSTR n;
- HCURSOR new_cursor;
-
- if (c == FL_CURSOR_NONE)
- new_cursor = NULL;
- else {
- switch (c) {
- case FL_CURSOR_ARROW: n = IDC_ARROW; break;
- case FL_CURSOR_CROSS: n = IDC_CROSS; break;
- case FL_CURSOR_WAIT: n = IDC_WAIT; break;
- case FL_CURSOR_INSERT: n = IDC_IBEAM; break;
- case FL_CURSOR_HAND: n = IDC_HAND; break;
- case FL_CURSOR_HELP: n = IDC_HELP; break;
- case FL_CURSOR_MOVE: n = IDC_SIZEALL; break;
- case FL_CURSOR_N:
- case FL_CURSOR_S:
- // FIXME: Should probably have fallbacks for these instead
- case FL_CURSOR_NS: n = IDC_SIZENS; break;
- case FL_CURSOR_NE:
- case FL_CURSOR_SW:
- // FIXME: Dito.
- case FL_CURSOR_NESW: n = IDC_SIZENESW; break;
- case FL_CURSOR_E:
- case FL_CURSOR_W:
- // FIXME: Dito.
- case FL_CURSOR_WE: n = IDC_SIZEWE; break;
- case FL_CURSOR_SE:
- case FL_CURSOR_NW:
- // FIXME: Dito.
- case FL_CURSOR_NWSE: n = IDC_SIZENWSE; break;
- default:
- return 0;
- }
-
- new_cursor = LoadCursor(NULL, n);
- if (new_cursor == NULL)
- return 0;
- }
-
- if ((cursor != NULL) && custom_cursor)
- DestroyIcon(cursor);
-
- cursor = new_cursor;
- custom_cursor = 0;
-
- SetCursor(cursor);
-
- return 1;
-}
-
-int Fl_X::set_cursor(const Fl_RGB_Image *image, int hotx, int hoty) {
+static HICON image_to_icon(const Fl_RGB_Image *image, bool is_icon=true,
+ int hotx = 0, int hoty = 0) {
BITMAPV5HEADER bi;
HBITMAP bitmap, mask;
DWORD *bits;
- HCURSOR new_cursor;
+ HICON icon;
+ if (!is_icon) {
if ((hotx < 0) || (hotx >= image->w()))
- return 0;
+ return NULL;
if ((hoty < 0) || (hoty >= image->h()))
- return 0;
+ return NULL;
+ }
memset(&bi, 0, sizeof(BITMAPV5HEADER));
@@ -2120,7 +2070,7 @@
ReleaseDC(NULL, hdc);
if (bits == NULL)
- return 0;
+ return NULL;
const uchar *i = (const uchar*)*image->data();
for (int y = 0;y < image->h();y++) {
@@ -2149,22 +2099,206 @@
mask = CreateBitmap(image->w(),image->h(),1,1,NULL);
if (mask == NULL) {
DeleteObject(bitmap);
- return 0;
+ return NULL;
}
ICONINFO ii;
- ii.fIcon = FALSE;
+ ii.fIcon = is_icon;
ii.xHotspot = hotx;
ii.yHotspot = hoty;
ii.hbmMask = mask;
ii.hbmColor = bitmap;
- new_cursor = CreateIconIndirect(&ii);
+ icon = CreateIconIndirect(&ii);
DeleteObject(bitmap);
DeleteObject(mask);
+ if (icon == NULL)
+ return NULL;
+
+ return icon;
+}
+
+////////////////////////////////////////////////////////////////
+
+static HICON default_big_icon = NULL;
+static HICON default_small_icon = NULL;
+
+const Fl_RGB_Image *find_best_icon(int ideal_width,
+ const Fl_RGB_Image *icons[], int count) {
+ const Fl_RGB_Image *best;
+
+ best = NULL;
+
+ for (int i = 0;i < count;i++) {
+ if (best == NULL)
+ best = icons[i];
+ else {
+ if (best->w() < ideal_width) {
+ if (icons[i]->w() > best->w())
+ best = icons[i];
+ } else {
+ if ((icons[i]->w() >= ideal_width) &&
+ (icons[i]->w() < best->w()))
+ best = icons[i];
+ }
+ }
+ }
+
+ return best;
+}
+
+void Fl_X::set_default_icons(const Fl_RGB_Image *icons[], int count) {
+ const Fl_RGB_Image *best_big, *best_small;
+
+ if (default_big_icon != NULL)
+ DestroyIcon(default_big_icon);
+ if (default_small_icon != NULL)
+ DestroyIcon(default_small_icon);
+
+ best_big = find_best_icon(GetSystemMetrics(SM_CXICON), icons, count);
+ best_small = find_best_icon(GetSystemMetrics(SM_CXSMICON), icons, count);
+
+ if (best_big != NULL)
+ default_big_icon = image_to_icon(best_big);
+ else
+ default_big_icon = NULL;
+
+ if (best_small != NULL)
+ default_small_icon = image_to_icon(best_small);
+ else
+ default_small_icon = NULL;
+}
+
+void Fl_X::set_default_icons(HICON big_icon, HICON small_icon) {
+ if (default_big_icon != NULL)
+ DestroyIcon(default_big_icon);
+ if (default_small_icon != NULL)
+ DestroyIcon(default_small_icon);
+
+ if (big_icon != NULL)
+ default_big_icon = CopyIcon(big_icon);
+ if (small_icon != NULL)
+ default_small_icon = CopyIcon(small_icon);
+}
+
+void Fl_X::set_icons() {
+ HICON big_icon, small_icon;
+
+ big_icon = NULL;
+ small_icon = NULL;
+
+ if (w->icon_->count) {
+ const Fl_RGB_Image *best_big, *best_small;
+
+ best_big = find_best_icon(GetSystemMetrics(SM_CXICON),
+ (const Fl_RGB_Image **)w->icon_->icons,
+ w->icon_->count);
+ best_small = find_best_icon(GetSystemMetrics(SM_CXSMICON),
+ (const Fl_RGB_Image **)w->icon_->icons,
+ w->icon_->count);
+
+ if (best_big != NULL)
+ big_icon = image_to_icon(best_big);
+ if (best_small != NULL)
+ small_icon = image_to_icon(best_small);
+ } else {
+ big_icon = default_big_icon;
+ small_icon = default_small_icon;
+ }
+
+ if (big_icon != NULL)
+ SendMessage(xid, WM_SETICON, ICON_BIG, (LPARAM)big_icon);
+ if (small_icon != NULL)
+ SendMessage(xid, WM_SETICON, ICON_SMALL, (LPARAM)small_icon);
+
+ if (w->icon_->count) {
+ if (big_icon != NULL)
+ DestroyIcon(big_icon);
+ if (small_icon != NULL)
+ DestroyIcon(small_icon);
+ }
+}
+
+void Fl_Window::default_icons(HICON big_icon, HICON small_icon) {
+ Fl_X::set_default_icons(big_icon, small_icon);
+}
+
+void Fl_Window::icons(HICON big_icon, HICON small_icon) {
+ free_icons();
+
+ if (big_icon != NULL)
+ icon_->big_icon = CopyIcon(big_icon);
+ if (small_icon != NULL)
+ icon_->small_icon = CopyIcon(small_icon);
+
+ if (i)
+ i->set_icons();
+}
+
+////////////////////////////////////////////////////////////////
+
+#ifndef IDC_HAND
+# define IDC_HAND MAKEINTRESOURCE(32649)
+#endif // !IDC_HAND
+
+int Fl_X::set_cursor(Fl_Cursor c) {
+ LPSTR n;
+ HCURSOR new_cursor;
+
+ if (c == FL_CURSOR_NONE)
+ new_cursor = NULL;
+ else {
+ switch (c) {
+ case FL_CURSOR_ARROW: n = IDC_ARROW; break;
+ case FL_CURSOR_CROSS: n = IDC_CROSS; break;
+ case FL_CURSOR_WAIT: n = IDC_WAIT; break;
+ case FL_CURSOR_INSERT: n = IDC_IBEAM; break;
+ case FL_CURSOR_HAND: n = IDC_HAND; break;
+ case FL_CURSOR_HELP: n = IDC_HELP; break;
+ case FL_CURSOR_MOVE: n = IDC_SIZEALL; break;
+ case FL_CURSOR_N:
+ case FL_CURSOR_S:
+ // FIXME: Should probably have fallbacks for these instead
+ case FL_CURSOR_NS: n = IDC_SIZENS; break;
+ case FL_CURSOR_NE:
+ case FL_CURSOR_SW:
+ // FIXME: Dito.
+ case FL_CURSOR_NESW: n = IDC_SIZENESW; break;
+ case FL_CURSOR_E:
+ case FL_CURSOR_W:
+ // FIXME: Dito.
+ case FL_CURSOR_WE: n = IDC_SIZEWE; break;
+ case FL_CURSOR_SE:
+ case FL_CURSOR_NW:
+ // FIXME: Dito.
+ case FL_CURSOR_NWSE: n = IDC_SIZENWSE; break;
+ default:
+ return 0;
+ }
+
+ new_cursor = LoadCursor(NULL, n);
+ if (new_cursor == NULL)
+ return 0;
+ }
+
+ if ((cursor != NULL) && custom_cursor)
+ DestroyIcon(cursor);
+
+ cursor = new_cursor;
+ custom_cursor = 0;
+
+ SetCursor(cursor);
+
+ return 1;
+}
+
+int Fl_X::set_cursor(const Fl_RGB_Image *image, int hotx, int hoty) {
+ HCURSOR new_cursor;
+
+ new_cursor = image_to_icon(image, false, hotx, hoty);
if (new_cursor == NULL)
return 0;
diff -ur fltk-1.3.2.org/src/Fl_Window.cxx fltk-1.3.2/src/Fl_Window.cxx
--- fltk-1.3.2.org/src/Fl_Window.cxx 2013-01-16 10:49:40.908130903 +0100
+++ fltk-1.3.2/src/Fl_Window.cxx 2013-01-16 10:49:55.557353865 +0100
@@ -23,6 +23,7 @@
#include <config.h>
#include <FL/Fl.H>
#include <FL/x.H>
+#include <FL/Fl_RGB_Image.H>
#include <FL/Fl_Window.H>
#include <stdlib.h>
#include "flstring.h"
@@ -45,7 +46,8 @@
}
i = 0;
xclass_ = 0;
- icon_ = 0;
+ icon_ = new icon_data;
+ memset(icon_, 0, sizeof(*icon_));
iconlabel_ = 0;
resizable(0);
size_range_set = 0;
@@ -264,16 +266,68 @@
}
}
+void Fl_Window::default_icon(const Fl_RGB_Image *icon) {
+ default_icons(&icon, 1);
+}
+
+void Fl_Window::default_icons(const Fl_RGB_Image **icons, int count) {
+ Fl_X::set_default_icons(icons, count);
+}
+
+void Fl_Window::icon(const Fl_RGB_Image *icon) {
+ icons(&icon, 1);
+}
+
+void Fl_Window::icons(const Fl_RGB_Image **icons, int count) {
+ free_icons();
+
+ if (count > 0) {
+ icon_->icons = new Fl_RGB_Image*[count];
+ icon_->count = count;
+ // FIXME: Fl_RGB_Image lacks const modifiers on methods
+ for (int i = 0;i < count;i++)
+ icon_->icons[i] = (Fl_RGB_Image*)((Fl_RGB_Image*)icons[i])->copy();
+ }
+
+ if (i)
+ i->set_icons();
+}
+
/** Gets the current icon window target dependent data. */
const void *Fl_Window::icon() const {
- return icon_;
+ return icon_->legacy_icon;
}
/** Sets the current icon window target dependent data. */
void Fl_Window::icon(const void * ic) {
- icon_ = ic;
+ free_icons();
+ icon_->legacy_icon = ic;
}
+void Fl_Window::free_icons() {
+ int i;
+
+ icon_->legacy_icon = 0L;
+
+ if (icon_->icons) {
+ for (i = 0;i < icon_->count;i++)
+ delete icon_->icons[i];
+ delete [] icon_->icons;
+ icon_->icons = 0L;
+ }
+
+ icon_->count = 0;
+
+#ifdef WIN32
+ if (icon_->big_icon)
+ DestroyIcon(icon_->big_icon);
+ if (icon_->small_icon)
+ DestroyIcon(icon_->small_icon);
+
+ icon_->big_icon = NULL;
+ icon_->small_icon = NULL;
+#endif
+}
//
// End of "$Id: Fl_Window.cxx 9706 2012-11-06 20:46:14Z matt $".
diff -ur fltk-1.3.2.org/src/Fl_x.cxx fltk-1.3.2/src/Fl_x.cxx
--- fltk-1.3.2.org/src/Fl_x.cxx 2013-01-16 10:49:40.912227213 +0100
+++ fltk-1.3.2/src/Fl_x.cxx 2013-01-16 10:49:55.558137113 +0100
@@ -345,6 +345,7 @@
Atom fl_NET_WM_STATE;
Atom fl_NET_WM_STATE_FULLSCREEN;
Atom fl_NET_WORKAREA;
+Atom fl_NET_WM_ICON;
/*
X defines 32-bit-entities to have a format value of max. 32,
@@ -709,6 +710,7 @@
fl_NET_WM_STATE = XInternAtom(d, "_NET_WM_STATE", 0);
fl_NET_WM_STATE_FULLSCREEN = XInternAtom(d, "_NET_WM_STATE_FULLSCREEN", 0);
fl_NET_WORKAREA = XInternAtom(d, "_NET_WORKAREA", 0);
+ fl_NET_WM_ICON = XInternAtom(d, "_NET_WM_ICON", 0);
if (sizeof(Atom) < 4)
atom_bits = sizeof(Atom) * 8;
@@ -2138,12 +2140,14 @@
fl_show_iconic = 0;
showit = 0;
}
- if (win->icon()) {
- hints->icon_pixmap = (Pixmap)win->icon();
+ if (win->icon_->legacy_icon) {
+ hints->icon_pixmap = (Pixmap)win->icon_->legacy_icon;
hints->flags |= IconPixmapHint;
}
XSetWMHints(fl_display, xp->xid, hints);
XFree(hints);
+
+ xp->set_icons();
}
// set the window type for menu and tooltip windows to avoid animations (compiz)
@@ -2263,6 +2267,93 @@
////////////////////////////////////////////////////////////////
+static unsigned long *default_net_wm_icons = 0L;
+static size_t default_net_wm_icons_size = 0;
+
+void icons_to_property(const Fl_RGB_Image *icons[], int count,
+ unsigned long **property, size_t *len) {
+ size_t sz;
+ unsigned long *data;
+
+ sz = 0;
+ for (int i = 0;i < count;i++)
+ sz += 2 + icons[i]->w() * icons[i]->h();
+
+ // FIXME: Might want to sort the icons
+
+ *property = data = new unsigned long[sz];
+ *len = sz;
+
+ for (int i = 0;i < count;i++) {
+ const Fl_RGB_Image *image;
+
+ image = icons[i];
+
+ data[0] = image->w();
+ data[1] = image->h();
+ data += 2;
+
+ const uchar *in = (const uchar*)*image->data();
+ for (int y = 0;y < image->h();y++) {
+ for (int x = 0;x < image->w();x++) {
+ switch (image->d()) {
+ case 1:
+ *data = ( 0xff<<24) | (in[0]<<16) | (in[0]<<8) | in[0];
+ break;
+ case 2:
+ *data = (in[1]<<24) | (in[0]<<16) | (in[0]<<8) | in[0];
+ break;
+ case 3:
+ *data = ( 0xff<<24) | (in[0]<<16) | (in[1]<<8) | in[2];
+ break;
+ case 4:
+ *data = (in[3]<<24) | (in[0]<<16) | (in[1]<<8) | in[2];
+ break;
+ }
+ in += image->d();
+ data++;
+ }
+ in += image->ld();
+ }
+ }
+}
+
+void Fl_X::set_default_icons(const Fl_RGB_Image *icons[], int count) {
+ if (default_net_wm_icons) {
+ delete [] default_net_wm_icons;
+ default_net_wm_icons = 0L;
+ default_net_wm_icons_size = 0;
+ }
+
+ if (count > 0)
+ icons_to_property(icons, count,
+ &default_net_wm_icons, &default_net_wm_icons_size);
+}
+
+void Fl_X::set_icons() {
+ unsigned long *net_wm_icons;
+ size_t net_wm_icons_size;
+
+ if (w->icon_->count) {
+ icons_to_property((const Fl_RGB_Image **)w->icon_->icons, w->icon_->count,
+ &net_wm_icons, &net_wm_icons_size);
+ } else {
+ net_wm_icons = default_net_wm_icons;
+ net_wm_icons_size = default_net_wm_icons_size;
+ }
+
+ XChangeProperty (fl_display, xid, fl_NET_WM_ICON, XA_CARDINAL, 32,
+ PropModeReplace, (unsigned char*) net_wm_icons, net_wm_icons_size);
+
+ if (w->icon_->count) {
+ delete [] net_wm_icons;
+ net_wm_icons = 0L;
+ net_wm_icons_size = 0;
+ }
+}
+
+////////////////////////////////////////////////////////////////
+
int Fl_X::set_cursor(Fl_Cursor c) {
unsigned int shape;
Cursor xc;

View File

@@ -0,0 +1,131 @@
diff -up fltk-1.3.0r9619/FL/Fl.H.screen_num fltk-1.3.0r9619/FL/Fl.H
--- fltk-1.3.0r9619/FL/Fl.H.screen_num 2012-07-03 13:49:28.663085580 +0200
+++ fltk-1.3.0r9619/FL/Fl.H 2012-07-03 13:49:28.731084402 +0200
@@ -806,6 +806,8 @@ public:
static void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my);
static void screen_xywh(int &X, int &Y, int &W, int &H, int n);
static void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my, int mw, int mh);
+ static int screen_num(int x, int y);
+ static int screen_num(int x, int y, int w, int h);
static void screen_dpi(float &h, float &v, int n=0);
static void screen_work_area(int &X, int &Y, int &W, int &H, int mx, int my);
static void screen_work_area(int &X, int &Y, int &W, int &H, int n);
diff -up fltk-1.3.0r9619/src/screen_xywh.cxx.screen_num fltk-1.3.0r9619/src/screen_xywh.cxx
--- fltk-1.3.0r9619/src/screen_xywh.cxx.screen_num 2012-03-23 17:47:53.000000000 +0100
+++ fltk-1.3.0r9619/src/screen_xywh.cxx 2012-07-03 13:58:01.947195396 +0200
@@ -215,21 +215,6 @@ int Fl::screen_count() {
return num_screens ? num_screens : 1;
}
-static int find_screen_with_point(int mx, int my) {
- int screen = 0;
- if (num_screens < 0) screen_init();
-
- for (int i = 0; i < num_screens; i ++) {
- int sx, sy, sw, sh;
- Fl::screen_xywh(sx, sy, sw, sh, i);
- if ((mx >= sx) && (mx < (sx+sw)) && (my >= sy) && (my < (sy+sh))) {
- screen = i;
- break;
- }
- }
- return screen;
-}
-
/**
Gets the bounding box of a screen
that contains the specified screen position \p mx, \p my
@@ -237,7 +222,7 @@ static int find_screen_with_point(int mx
\param[in] mx, my the absolute screen position
*/
void Fl::screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my) {
- screen_xywh(X, Y, W, H, find_screen_with_point(mx, my));
+ screen_xywh(X, Y, W, H, screen_num(mx, my));
}
@@ -248,7 +233,7 @@ void Fl::screen_xywh(int &X, int &Y, int
\param[in] mx, my the absolute screen position
*/
void Fl::screen_work_area(int &X, int &Y, int &W, int &H, int mx, int my) {
- screen_work_area(X, Y, W, H, find_screen_with_point(mx, my));
+ screen_work_area(X, Y, W, H, screen_num(mx, my));
}
/**
@@ -321,6 +306,38 @@ void Fl::screen_xywh(int &X, int &Y, int
#endif // WIN32
}
+/**
+ Gets the screen bounding rect for the screen
+ which intersects the most with the rectangle
+ defined by \p mx, \p my, \p mw, \p mh.
+ \param[out] X,Y,W,H the corresponding screen bounding box
+ \param[in] mx, my, mw, mh the rectangle to search for intersection with
+ \see void screen_xywh(int &X, int &Y, int &W, int &H, int n)
+ */
+void Fl::screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my, int mw, int mh) {
+ screen_xywh(X, Y, W, H, screen_num(mx, my, mw, mh));
+}
+
+/**
+ Gets the screen number of a screen
+ that contains the specified screen position \p x, \p y
+ \param[in] x, y the absolute screen position
+*/
+int Fl::screen_num(int x, int y) {
+ int screen = 0;
+ if (num_screens < 0) screen_init();
+
+ for (int i = 0; i < num_screens; i ++) {
+ int sx, sy, sw, sh;
+ Fl::screen_xywh(sx, sy, sw, sh, i);
+ if ((x >= sx) && (x < (sx+sw)) && (y >= sy) && (y < (sy+sh))) {
+ screen = i;
+ break;
+ }
+ }
+ return screen;
+}
+
static inline float fl_intersection(int x1, int y1, int w1, int h1,
int x2, int y2, int w2, int h2) {
if(x1+w1 < x2 || x2+w2 < x1 || y1+h1 < y2 || y2+h2 < y1)
@@ -333,30 +350,27 @@ static inline float fl_intersection(int
}
/**
- Gets the screen bounding rect for the screen
+ Gets the screen number for the screen
which intersects the most with the rectangle
- defined by \p mx, \p my, \p mw, \p mh.
- \param[out] X,Y,W,H the corresponding screen bounding box
- \param[in] mx, my, mw, mh the rectangle to search for intersection with
- \see void screen_xywh(int &X, int &Y, int &W, int &H, int n)
+ defined by \p x, \p y, \p w, \p h.
+ \param[in] x, y, w, h the rectangle to search for intersection with
*/
-void Fl::screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my, int mw, int mh) {
+int Fl::screen_num(int x, int y, int w, int h) {
int best_screen = 0;
float best_intersection = 0.;
for(int i = 0; i < Fl::screen_count(); i++) {
int sx, sy, sw, sh;
Fl::screen_xywh(sx, sy, sw, sh, i);
- float sintersection = fl_intersection(mx, my, mw, mh, sx, sy, sw, sh);
+ float sintersection = fl_intersection(x, y, w, h, sx, sy, sw, sh);
if(sintersection > best_intersection) {
best_screen = i;
best_intersection = sintersection;
}
}
- screen_xywh(X, Y, W, H, best_screen);
+ return best_screen;
}
-
/**
Gets the screen resolution in dots-per-inch for the given screen.
\param[out] h, v horizontal and vertical resolution

View File

@@ -0,0 +1,468 @@
diff -urp fltk-1.3.2.org/FL/Fl_Window.H fltk-1.3.2/FL/Fl_Window.H
--- fltk-1.3.2.org/FL/Fl_Window.H 2013-01-16 10:52:33.017228122 +0100
+++ fltk-1.3.2/FL/Fl_Window.H 2013-01-16 10:52:47.876478968 +0100
@@ -54,7 +54,7 @@ class Fl_RGB_Image;
class FL_EXPORT Fl_Window : public Fl_Group {
static char *default_xclass_;
- // Note: we must use separate statements for each of the following 4 variables,
+ // Note: we must use separate statements for each of the following 8 variables,
// with the static attribute, otherwise MS VC++ 2008/2010 complains :-(
// AlbrechtS 04/2012
#if FLTK_ABI_VERSION < 10301
@@ -73,6 +73,22 @@ class FL_EXPORT Fl_Window : public Fl_Gr
static // when these members are static, ABI compatibility with 1.3.0 is respected
#endif
int no_fullscreen_h;
+#if FLTK_ABI_VERSION < 10302
+ static // when these members are static, ABI compatibility with 1.3.0 is respected
+#endif
+ int fullscreen_screen_top;
+#if FLTK_ABI_VERSION < 10302
+ static // when these members are static, ABI compatibility with 1.3.0 is respected
+#endif
+ int fullscreen_screen_bottom;
+#if FLTK_ABI_VERSION < 10302
+ static // when these members are static, ABI compatibility with 1.3.0 is respected
+#endif
+ int fullscreen_screen_left;
+#if FLTK_ABI_VERSION < 10302
+ static // when these members are static, ABI compatibility with 1.3.0 is respected
+#endif
+ int fullscreen_screen_right;
friend class Fl_X;
Fl_X *i; // points at the system-specific stuff
@@ -430,13 +446,15 @@ public:
*/
void show(int argc, char **argv);
/**
- Makes the window completely fill the screen, without any window
- manager border visible. You must use fullscreen_off() to undo
- this.
+ Makes the window completely fill one or more screens, without any
+ window manager border visible. You must use fullscreen_off() to
+ undo this.
\note On some platforms, this can result in the keyboard being
grabbed. The window may also be recreated, meaning hide() and
show() will be called.
+
+ \see void Fl_Window::fullscreen_screens()
*/
void fullscreen();
/**
@@ -453,6 +471,17 @@ public:
*/
unsigned int fullscreen_active() const { return flags() & FULLSCREEN; }
/**
+ Sets which screens should be used when this window is in fullscreen
+ mode. The window will be resized to the top of the screen with index
+ \p top, the bottom of the screen with index \p bottom, etc.
+
+ If this method is never called, or if any argument is < 0, then the
+ window will be resized to fill the screen it is currently on.
+
+ \see void Fl_Window::fullscreen()
+ */
+ void fullscreen_screens(int top, int bottom, int left, int right);
+ /**
Iconifies the window. If you call this when shown() is false
it will show() it as an icon. If the window is already
iconified this does nothing.
diff -urp fltk-1.3.2.org/FL/win32.H fltk-1.3.2/FL/win32.H
--- fltk-1.3.2.org/FL/win32.H 2013-01-16 10:52:33.017228122 +0100
+++ fltk-1.3.2/FL/win32.H 2013-01-16 10:52:47.876478968 +0100
@@ -80,6 +80,7 @@ public:
static Fl_X* i(const Fl_Window* w) {return w->i;}
static int fake_X_wm(const Fl_Window* w,int &X, int &Y,
int &bt,int &bx,int &by);
+ void make_fullscreen(int X, int Y, int W, int H);
void setwindow(Fl_Window* wi) {w=wi; wi->i=this;}
void flush() {w->flush();}
void set_minmax(LPMINMAXINFO minmax);
diff -urp fltk-1.3.2.org/src/Fl_cocoa.mm fltk-1.3.2/src/Fl_cocoa.mm
--- fltk-1.3.2.org/src/Fl_cocoa.mm 2013-01-16 10:52:33.014229574 +0100
+++ fltk-1.3.2/src/Fl_cocoa.mm 2013-01-16 10:52:47.877480606 +0100
@@ -2438,9 +2438,32 @@ void Fl_X::make(Fl_Window* w)
NSRect crect;
if (w->fullscreen_active()) {
- int sx, sy, sw, sh;
- Fl::screen_xywh(sx, sy, sw, sh, w->x(), w->y(), w->w(), w->h());
- w->resize(sx, sy, sw, sh);
+ int top, bottom, left, right;
+ int sx, sy, sw, sh, X, Y, W, H;
+
+ top = w->fullscreen_screen_top;
+ bottom = w->fullscreen_screen_bottom;
+ left = w->fullscreen_screen_left;
+ right = w->fullscreen_screen_right;
+
+ if ((top < 0) || (bottom < 0) || (left < 0) || (right < 0)) {
+ top = Fl::screen_num(w->x(), w->y(), w->w(), w->h());
+ bottom = top;
+ left = top;
+ right = top;
+ }
+
+ Fl::screen_xywh(sx, sy, sw, sh, top);
+ Y = sy;
+ Fl::screen_xywh(sx, sy, sw, sh, bottom);
+ H = sy + sh - Y;
+ Fl::screen_xywh(sx, sy, sw, sh, left);
+ X = sx;
+ Fl::screen_xywh(sx, sy, sw, sh, right);
+ W = sx + sw - X;
+
+ w->resize(X, Y, W, H);
+
winstyle = NSBorderlessWindowMask;
winlevel = NSStatusWindowLevel;
}
diff -urp fltk-1.3.2.org/src/Fl_win32.cxx fltk-1.3.2/src/Fl_win32.cxx
--- fltk-1.3.2.org/src/Fl_win32.cxx 2013-01-16 10:52:33.019230734 +0100
+++ fltk-1.3.2/src/Fl_win32.cxx 2013-01-16 10:52:47.878480504 +0100
@@ -1493,7 +1493,6 @@ int Fl_X::fake_X_wm(const Fl_Window* w,i
Y+=yoff;
if (w->fullscreen_active()) {
- X = Y = 0;
bx = by = bt = 0;
}
@@ -1547,19 +1546,42 @@ void Fl_Window::resize(int X,int Y,int W
}
}
-static void make_fullscreen(Fl_Window *w, Window xid, int X, int Y, int W, int H) {
+void Fl_X::make_fullscreen(int X, int Y, int W, int H) {
+ int top, bottom, left, right;
int sx, sy, sw, sh;
- Fl::screen_xywh(sx, sy, sw, sh, X, Y, W, H);
+
+ top = w->fullscreen_screen_top;
+ bottom = w->fullscreen_screen_bottom;
+ left = w->fullscreen_screen_left;
+ right = w->fullscreen_screen_right;
+
+ if ((top < 0) || (bottom < 0) || (left < 0) || (right < 0)) {
+ top = Fl::screen_num(X, Y, W, H);
+ bottom = top;
+ left = top;
+ right = top;
+ }
+
+ Fl::screen_xywh(sx, sy, sw, sh, top);
+ Y = sy;
+ Fl::screen_xywh(sx, sy, sw, sh, bottom);
+ H = sy + sh - Y;
+ Fl::screen_xywh(sx, sy, sw, sh, left);
+ X = sx;
+ Fl::screen_xywh(sx, sy, sw, sh, right);
+ W = sx + sw - X;
+
DWORD flags = GetWindowLong(xid, GWL_STYLE);
flags = flags & ~(WS_THICKFRAME|WS_CAPTION);
SetWindowLong(xid, GWL_STYLE, flags);
+
// SWP_NOSENDCHANGING is so that we can override size limits
- SetWindowPos(xid, HWND_TOP, sx, sy, sw, sh, SWP_NOSENDCHANGING | SWP_FRAMECHANGED);
+ SetWindowPos(xid, HWND_TOP, X, Y, W, H, SWP_NOSENDCHANGING | SWP_FRAMECHANGED);
}
void Fl_Window::fullscreen_x() {
_set_fullscreen();
- make_fullscreen(this, fl_xid(this), x(), y(), w(), h());
+ i->make_fullscreen(x(), y(), w(), h());
Fl::handle(FL_FULLSCREEN, this);
}
@@ -1814,8 +1836,8 @@ Fl_X* Fl_X::make(Fl_Window* w) {
monitor the window was placed on. */
RECT rect;
GetWindowRect(x->xid, &rect);
- make_fullscreen(w, x->xid, rect.left, rect.top,
- rect.right - rect.left, rect.bottom - rect.top);
+ x->make_fullscreen(rect.left, rect.top,
+ rect.right - rect.left, rect.bottom - rect.top);
}
x->next = Fl_X::first;
diff -urp fltk-1.3.2.org/src/Fl_Window_fullscreen.cxx fltk-1.3.2/src/Fl_Window_fullscreen.cxx
--- fltk-1.3.2.org/src/Fl_Window_fullscreen.cxx 2012-11-06 21:46:14.000000000 +0100
+++ fltk-1.3.2/src/Fl_Window_fullscreen.cxx 2013-01-16 10:52:47.879480608 +0100
@@ -36,6 +36,10 @@ int Fl_Window::no_fullscreen_x = 0;
int Fl_Window::no_fullscreen_y = 0;
int Fl_Window::no_fullscreen_w = 0;
int Fl_Window::no_fullscreen_h = 0;
+int Fl_Window::fullscreen_screen_top = -1;
+int Fl_Window::fullscreen_screen_bottom = -1;
+int Fl_Window::fullscreen_screen_left = -1;
+int Fl_Window::fullscreen_screen_right = -1;
#endif
void Fl_Window::border(int b) {
@@ -95,6 +99,23 @@ void Fl_Window::fullscreen_off() {
fullscreen_off(no_fullscreen_x, no_fullscreen_y, no_fullscreen_w, no_fullscreen_h);
}
+void Fl_Window::fullscreen_screens(int top, int bottom, int left, int right) {
+ if ((top < 0) || (bottom < 0) || (left < 0) || (right < 0)) {
+ fullscreen_screen_top = -1;
+ fullscreen_screen_bottom = -1;
+ fullscreen_screen_left = -1;
+ fullscreen_screen_right = -1;
+ } else {
+ fullscreen_screen_top = top;
+ fullscreen_screen_bottom = bottom;
+ fullscreen_screen_left = left;
+ fullscreen_screen_right = right;
+ }
+
+ if (shown() && (flags() & Fl_Widget::FULLSCREEN))
+ fullscreen_x();
+}
+
//
// End of "$Id: Fl_Window_fullscreen.cxx 9706 2012-11-06 20:46:14Z matt $".
diff -urp fltk-1.3.2.org/src/Fl_x.cxx fltk-1.3.2/src/Fl_x.cxx
--- fltk-1.3.2.org/src/Fl_x.cxx 2013-01-16 10:52:33.020228202 +0100
+++ fltk-1.3.2/src/Fl_x.cxx 2013-01-16 10:52:47.880480556 +0100
@@ -344,6 +344,7 @@ Atom fl_NET_WM_ICON_NAME; // utf8 aware
Atom fl_NET_SUPPORTING_WM_CHECK;
Atom fl_NET_WM_STATE;
Atom fl_NET_WM_STATE_FULLSCREEN;
+Atom fl_NET_WM_FULLSCREEN_MONITORS;
Atom fl_NET_WORKAREA;
Atom fl_NET_WM_ICON;
@@ -709,6 +710,7 @@ void fl_open_display(Display* d) {
fl_NET_SUPPORTING_WM_CHECK = XInternAtom(d, "_NET_SUPPORTING_WM_CHECK", 0);
fl_NET_WM_STATE = XInternAtom(d, "_NET_WM_STATE", 0);
fl_NET_WM_STATE_FULLSCREEN = XInternAtom(d, "_NET_WM_STATE_FULLSCREEN", 0);
+ fl_NET_WM_FULLSCREEN_MONITORS = XInternAtom(d, "_NET_WM_FULLSCREEN_MONITORS", 0);
fl_NET_WORKAREA = XInternAtom(d, "_NET_WORKAREA", 0);
fl_NET_WM_ICON = XInternAtom(d, "_NET_WM_ICON", 0);
@@ -1872,22 +1874,30 @@ void Fl_Window::resize(int X,int Y,int W
#define _NET_WM_STATE_ADD 1 /* add/set property */
#define _NET_WM_STATE_TOGGLE 2 /* toggle property */
-static void send_wm_state_event(Window wnd, int add, Atom prop) {
+static void send_wm_event(Window wnd, Atom message,
+ unsigned long d0, unsigned long d1=0,
+ unsigned long d2=0, unsigned long d3=0,
+ unsigned long d4=0) {
XEvent e;
e.xany.type = ClientMessage;
e.xany.window = wnd;
- e.xclient.message_type = fl_NET_WM_STATE;
+ e.xclient.message_type = message;
e.xclient.format = 32;
- e.xclient.data.l[0] = add ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE;
- e.xclient.data.l[1] = prop;
- e.xclient.data.l[2] = 0;
- e.xclient.data.l[3] = 0;
- e.xclient.data.l[4] = 0;
+ e.xclient.data.l[0] = d0;
+ e.xclient.data.l[1] = d1;
+ e.xclient.data.l[2] = d2;
+ e.xclient.data.l[3] = d3;
+ e.xclient.data.l[4] = d4;
XSendEvent(fl_display, RootWindow(fl_display, fl_screen),
0, SubstructureNotifyMask | SubstructureRedirectMask,
&e);
}
+static void send_wm_state_event(Window wnd, int add, Atom prop) {
+ send_wm_event(wnd, fl_NET_WM_STATE,
+ add ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE, prop);
+}
+
int Fl_X::ewmh_supported() {
static int result = -1;
@@ -1911,6 +1921,22 @@ int Fl_X::ewmh_supported() {
/* Change an existing window to fullscreen */
void Fl_Window::fullscreen_x() {
if (Fl_X::ewmh_supported()) {
+ int top, bottom, left, right;
+
+ top = fullscreen_screen_top;
+ bottom = fullscreen_screen_bottom;
+ left = fullscreen_screen_left;
+ right = fullscreen_screen_right;
+
+ if ((top < 0) || (bottom < 0) || (left < 0) || (right < 0)) {
+ top = Fl::screen_num(x(), y(), w(), h());
+ bottom = top;
+ left = top;
+ right = top;
+ }
+
+ send_wm_event(fl_xid(this), fl_NET_WM_FULLSCREEN_MONITORS,
+ top, bottom, left, right);
send_wm_state_event(fl_xid(this), 1, fl_NET_WM_STATE_FULLSCREEN);
} else {
_set_fullscreen();
@@ -1997,7 +2023,7 @@ void Fl_X::make_xid(Fl_Window* win, XVis
// force the window to be on-screen. Usually the X window manager
// does this, but a few don't, so we do it here for consistency:
int scr_x, scr_y, scr_w, scr_h;
- Fl::screen_xywh(scr_x, scr_y, scr_w, scr_h, X, Y);
+ Fl::screen_xywh(scr_x, scr_y, scr_w, scr_h, X, Y, W, H);
if (win->border()) {
// ensure border is on screen:
@@ -2026,6 +2052,23 @@ void Fl_X::make_xid(Fl_Window* win, XVis
return;
}
+ // Compute which screen(s) we should be on if we want to go fullscreen
+ int fullscreen_top, fullscreen_bottom, fullscreen_left, fullscreen_right;
+
+ fullscreen_top = win->fullscreen_screen_top;
+ fullscreen_bottom = win->fullscreen_screen_bottom;
+ fullscreen_left = win->fullscreen_screen_left;
+ fullscreen_right = win->fullscreen_screen_right;
+
+ if ((fullscreen_top < 0) || (fullscreen_bottom < 0) ||
+ (fullscreen_left < 0) || (fullscreen_right < 0)) {
+ fullscreen_top = Fl::screen_num(X, Y, W, H);
+ fullscreen_bottom = fullscreen_top;
+ fullscreen_left = fullscreen_top;
+ fullscreen_right = fullscreen_top;
+ }
+
+
ulong root = win->parent() ?
fl_xid(win->window()) : RootWindow(fl_display, fl_screen);
@@ -2049,9 +2092,17 @@ void Fl_X::make_xid(Fl_Window* win, XVis
// border, and cannot grab without an existing window. Besides,
// there is no clear_override().
if (win->flags() & Fl_Widget::FULLSCREEN && !Fl_X::ewmh_supported()) {
+ int sx, sy, sw, sh;
attr.override_redirect = 1;
mask |= CWOverrideRedirect;
- Fl::screen_xywh(X, Y, W, H, X, Y, W, H);
+ Fl::screen_xywh(sx, sy, sw, sh, fullscreen_left);
+ X = sx;
+ Fl::screen_xywh(sx, sy, sw, sh, fullscreen_right);
+ W = sx + sw - X;
+ Fl::screen_xywh(sx, sy, sw, sh, fullscreen_top);
+ Y = sy;
+ Fl::screen_xywh(sx, sy, sw, sh, fullscreen_bottom);
+ H = sy + sh - Y;
}
if (fl_background_pixel >= 0) {
@@ -2122,6 +2173,13 @@ void Fl_X::make_xid(Fl_Window* win, XVis
// If asked for, create fullscreen
if (win->flags() & Fl_Widget::FULLSCREEN && Fl_X::ewmh_supported()) {
+ unsigned long data[4];
+ data[0] = fullscreen_top;
+ data[1] = fullscreen_bottom;
+ data[2] = fullscreen_left;
+ data[3] = fullscreen_right;
+ XChangeProperty (fl_display, xp->xid, fl_NET_WM_FULLSCREEN_MONITORS, XA_ATOM, 32,
+ PropModeReplace, (unsigned char*) data, 4);
XChangeProperty (fl_display, xp->xid, fl_NET_WM_STATE, XA_ATOM, 32,
PropModeAppend, (unsigned char*) &fl_NET_WM_STATE_FULLSCREEN, 1);
}
diff -urp fltk-1.3.2.org/test/fullscreen.cxx fltk-1.3.2/test/fullscreen.cxx
--- fltk-1.3.2.org/test/fullscreen.cxx 2012-06-14 17:09:46.000000000 +0200
+++ fltk-1.3.2/test/fullscreen.cxx 2013-01-16 10:52:47.881104801 +0100
@@ -127,7 +127,7 @@ class fullscreen_window : public Fl_Sing
fullscreen_window(int W, int H, const char *t=0);
int handle (int e);
Fl_Toggle_Light_Button *b3;
-
+ Fl_Toggle_Light_Button *b4;
};
fullscreen_window::fullscreen_window(int W, int H, const char *t) : Fl_Single_Window(W, H, t) {
@@ -170,23 +170,54 @@ void border_cb(Fl_Widget *o, void *p) {
#endif
}
-int px,py,pw,ph;
Fl_Button *border_button;
void fullscreen_cb(Fl_Widget *o, void *p) {
Fl_Window *w = (Fl_Window *)p;
int d = ((Fl_Button *)o)->value();
if (d) {
- px = w->x();
- py = w->y();
- pw = w->w();
- ph = w->h();
+ if (((fullscreen_window*)w)->b4->value()) {
+ int top, bottom, left, right;
+ int top_y, bottom_y, left_x, right_x;
+
+ int sx, sy, sw, sh;
+
+ top = bottom = left = right = 0;
+
+ Fl::screen_xywh(sx, sy, sw, sh, 0);
+ top_y = sy;
+ bottom_y = sy + sh;
+ left_x = sx;
+ right_x = sx + sw;
+
+ for (int i = 1;i < Fl::screen_count();i++) {
+ Fl::screen_xywh(sx, sy, sw, sh, i);
+ if (sy < top_y) {
+ top = i;
+ top_y = sy;
+ }
+ if ((sy + sh) > bottom_y) {
+ bottom = i;
+ bottom_y = sy + sh;
+ }
+ if (sx < left_x) {
+ left = i;
+ left_x = sx;
+ }
+ if ((sx + sw) > right_x) {
+ right = i;
+ right_x = sx + sw;
+ }
+ }
+
+ w->fullscreen_screens(top, bottom, left, right);
+ } else {
+ w->fullscreen_screens(-1, -1, -1, -1);
+ }
w->fullscreen();
- w->override();
#ifndef WIN32 // update our border state in case border was turned off
border_button->value(w->border());
#endif
} else {
- //w->fullscreen_off(px,py,pw,ph);
w->fullscreen_off();
}
}
@@ -219,7 +250,7 @@ void exit_cb(Fl_Widget *, void *) {
exit(0);
}
-#define NUMB 7
+#define NUMB 8
int twowindow = 0;
int initfull = 0;
@@ -284,6 +315,9 @@ int main(int argc, char **argv) {
window.b3->callback(fullscreen_cb,w);
y+=30;
+ window.b4 = new Fl_Toggle_Light_Button(50,y,window.w()-60,30,"All Screens");
+ y+=30;
+
Fl_Button eb(50,y,window.w()-60,30,"Exit");
eb.callback(exit_cb);
y+=30;

View File

@@ -0,0 +1,203 @@
diff -up fltk-1.3.2/FL/Fl.H.xhandlers fltk-1.3.2/FL/Fl.H
--- fltk-1.3.2/FL/Fl.H.xhandlers 2014-07-22 15:23:18.087334467 +0200
+++ fltk-1.3.2/FL/Fl.H 2014-07-22 15:23:18.094334589 +0200
@@ -96,6 +96,9 @@ typedef void (*Fl_FD_Handler)(FL_SOCKET
/** Signature of add_handler functions passed as parameters */
typedef int (*Fl_Event_Handler)(int event);
+/** Signature of add_system_handler functions passed as parameters */
+typedef int (*Fl_System_Handler)(void *event, void *data);
+
/** Signature of set_abort functions passed as parameters */
typedef void (*Fl_Abort_Handler)(const char *format,...);
@@ -712,6 +715,8 @@ public:
static void focus(Fl_Widget*);
static void add_handler(Fl_Event_Handler h);
static void remove_handler(Fl_Event_Handler h);
+ static void add_system_handler(Fl_System_Handler h, void *data);
+ static void remove_system_handler(Fl_System_Handler h);
static void event_dispatch(Fl_Event_Dispatch d);
static Fl_Event_Dispatch event_dispatch();
/** @} */
diff -up fltk-1.3.2/src/Fl_cocoa.mm.xhandlers fltk-1.3.2/src/Fl_cocoa.mm
--- fltk-1.3.2/src/Fl_cocoa.mm.xhandlers 2014-07-22 15:23:18.089334502 +0200
+++ fltk-1.3.2/src/Fl_cocoa.mm 2014-07-22 15:23:18.095334607 +0200
@@ -1269,6 +1269,8 @@ void fl_open_callback(void (*cb)(const c
}
@end
+extern int fl_send_system_handlers(void *e);
+
static void clipboard_check(void);
@implementation FLApplication
@@ -1276,6 +1278,10 @@ static void clipboard_check(void);
{
// update clipboard status
clipboard_check();
+
+ if (fl_send_system_handlers(theEvent))
+ return;
+
NSEventType type = [theEvent type];
if (type == NSLeftMouseDown) {
fl_lock_function();
diff -up fltk-1.3.2/src/Fl.cxx.xhandlers fltk-1.3.2/src/Fl.cxx
--- fltk-1.3.2/src/Fl.cxx.xhandlers 2014-07-22 15:23:18.085334432 +0200
+++ fltk-1.3.2/src/Fl.cxx 2014-07-22 15:23:18.095334607 +0200
@@ -891,6 +891,83 @@ static int send_handlers(int e) {
return 0;
}
+
+////////////////////////////////////////////////////////////////
+// System event handlers:
+
+
+struct system_handler_link {
+ Fl_System_Handler handle;
+ void *data;
+ system_handler_link *next;
+};
+
+
+static system_handler_link *sys_handlers = 0;
+
+
+/**
+ \brief Install a function to intercept system events.
+
+ FLTK calls each of these functions as soon as a new system event is
+ received. The processing will stop at the first function to return
+ non-zero. If all functions return zero then the event is passed on
+ for normal handling by FLTK.
+
+ Each function will be called with a pointer to the system event as
+ the first argument and \p data as the second argument. The system
+ event pointer will always be void *, but will point to different
+ objects depending on the platform:
+ - X11: XEvent
+ - Windows: MSG
+ - OS X: NSEvent
+
+ \param ha The event handler function to register
+ \param data User data to include on each call
+
+ \see Fl::remove_system_handler(Fl_System_Handler)
+*/
+void Fl::add_system_handler(Fl_System_Handler ha, void *data) {
+ system_handler_link *l = new system_handler_link;
+ l->handle = ha;
+ l->data = data;
+ l->next = sys_handlers;
+ sys_handlers = l;
+}
+
+
+/**
+ Removes a previously added system event handler.
+
+ \param ha The event handler function to remove
+
+ \see Fl::add_system_handler(Fl_System_Handler)
+*/
+void Fl::remove_system_handler(Fl_System_Handler ha) {
+ system_handler_link *l, *p;
+
+ // Search for the handler in the list...
+ for (l = sys_handlers, p = 0; l && l->handle != ha; p = l, l = l->next);
+
+ if (l) {
+ // Found it, so remove it from the list...
+ if (p) p->next = l->next;
+ else sys_handlers = l->next;
+
+ // And free the record...
+ delete l;
+ }
+}
+
+int fl_send_system_handlers(void *e) {
+ for (const system_handler_link *hl = sys_handlers; hl; hl = hl->next) {
+ if (hl->handle(e, hl->data))
+ return 1;
+ }
+ return 0;
+}
+
+
////////////////////////////////////////////////////////////////
Fl_Widget* fl_oldfocus; // kludge for Fl_Group...
diff -up fltk-1.3.2/src/Fl_win32.cxx.xhandlers fltk-1.3.2/src/Fl_win32.cxx
--- fltk-1.3.2/src/Fl_win32.cxx.xhandlers 2014-07-22 15:23:18.092334554 +0200
+++ fltk-1.3.2/src/Fl_win32.cxx 2014-07-22 15:24:44.682843610 +0200
@@ -336,6 +336,8 @@ void* Fl::thread_message() {
return r;
}
+extern int fl_send_system_handlers(void *e);
+
IActiveIMMApp *fl_aimm = NULL;
MSG fl_msg;
@@ -401,23 +403,21 @@ int fl_wait(double time_to_wait) {
// Execute the message we got, and all other pending messages:
// have_message = PeekMessage(&fl_msg, NULL, 0, 0, PM_REMOVE);
- have_message = PeekMessageW(&fl_msg, NULL, 0, 0, PM_REMOVE);
- if (have_message > 0) {
- while (have_message != 0 && have_message != -1) {
- if (fl_msg.message == fl_wake_msg) {
- // Used for awaking wait() from another thread
- thread_message_ = (void*)fl_msg.wParam;
- Fl_Awake_Handler func;
- void *data;
- while (Fl::get_awake_handler_(func, data)==0) {
- func(data);
- }
- }
-
- TranslateMessage(&fl_msg);
- DispatchMessageW(&fl_msg);
- have_message = PeekMessageW(&fl_msg, NULL, 0, 0, PM_REMOVE);
+ while ((have_message = PeekMessageW(&fl_msg, NULL, 0, 0, PM_REMOVE)) > 0) {
+ if (fl_send_system_handlers(&fl_msg))
+ continue;
+
+ if (fl_msg.message == fl_wake_msg) {
+ // Used for awaking wait() from another thread
+ thread_message_ = (void*)fl_msg.wParam;
+ Fl_Awake_Handler func;
+ void *data;
+ while (Fl::get_awake_handler_(func, data)==0)
+ func(data);
}
+
+ TranslateMessage(&fl_msg);
+ DispatchMessageW(&fl_msg);
}
Fl::flush();
diff -up fltk-1.3.2/src/Fl_x.cxx.xhandlers fltk-1.3.2/src/Fl_x.cxx
--- fltk-1.3.2/src/Fl_x.cxx.xhandlers 2014-07-22 15:23:18.093334572 +0200
+++ fltk-1.3.2/src/Fl_x.cxx 2014-07-22 15:23:18.096334624 +0200
@@ -188,6 +188,8 @@ void Fl::remove_fd(int n) {
remove_fd(n, -1);
}
+extern int fl_send_system_handlers(void *e);
+
#if CONSOLIDATE_MOTION
static Fl_Window* send_motion;
extern Fl_Window* fl_xmousewin;
@@ -198,6 +200,8 @@ static void do_queued_events() {
while (XEventsQueued(fl_display,QueuedAfterReading)) {
XEvent xevent;
XNextEvent(fl_display, &xevent);
+ if (fl_send_system_handlers(&xevent))
+ continue;
fl_handle(xevent);
}
// we send FL_LEAVE only if the mouse did not enter some other window:

View File

@@ -0,0 +1,582 @@
diff -up fltk-1.3.2/FL/Fl.H.im fltk-1.3.2/FL/Fl.H
--- fltk-1.3.2/FL/Fl.H.im 2014-09-10 14:40:05.193265424 +0200
+++ fltk-1.3.2/FL/Fl.H 2014-09-10 14:40:05.196265471 +0200
@@ -699,6 +699,17 @@ public:
static int event_inside(const Fl_Widget*);
static int test_shortcut(Fl_Shortcut);
+ /**
+ Enables the system input methods facilities. This is the default.
+ \see disable_im()
+ */
+ static void enable_im();
+ /**
+ Disables the system input methods facilities.
+ \see enable_im()
+ */
+ static void disable_im();
+
// event destinations:
static int handle(int, Fl_Window*);
static int handle_(int, Fl_Window*);
diff -up fltk-1.3.2/FL/win32.H.im fltk-1.3.2/FL/win32.H
--- fltk-1.3.2/FL/win32.H.im 2014-09-10 14:40:05.186265315 +0200
+++ fltk-1.3.2/FL/win32.H 2014-09-10 14:40:05.196265471 +0200
@@ -102,6 +102,8 @@ extern FL_EXPORT void fl_save_dc( HWND w
inline Window fl_xid(const Fl_Window* w) { Fl_X *temp = Fl_X::i(w); return temp ? temp->xid : 0; }
+extern FL_EXPORT void fl_open_display();
+
#else
FL_EXPORT Window fl_xid_(const Fl_Window* w);
#define fl_xid(w) fl_xid_(w)
diff -up fltk-1.3.2/src/Fl_cocoa.mm.im fltk-1.3.2/src/Fl_cocoa.mm
--- fltk-1.3.2/src/Fl_cocoa.mm.im 2014-09-10 14:40:05.193265424 +0200
+++ fltk-1.3.2/src/Fl_cocoa.mm 2014-09-10 14:43:41.103642243 +0200
@@ -88,6 +88,7 @@ static void createAppleMenu(void);
static Fl_Region MacRegionMinusRect(Fl_Region r, int x,int y,int w,int h);
static void cocoaMouseHandler(NSEvent *theEvent);
static int calc_mac_os_version();
+static void im_update(void);
static Fl_Quartz_Graphics_Driver fl_quartz_driver;
static Fl_Display_Device fl_quartz_display(&fl_quartz_driver);
@@ -108,6 +109,30 @@ int fl_mac_os_version = calc_mac_os_vers
static int got_events = 0;
static Fl_Window* resize_from_system;
static int main_screen_height; // height of menubar-containing screen used to convert between Cocoa and FLTK global screen coordinates
+static int im_enabled = -1;
+
+// Carbon functions and definitions
+
+typedef void *TSMDocumentID;
+
+extern "C" enum {
+ kTSMDocumentEnabledInputSourcesPropertyTag = 'enis' // from Carbon/TextServices.h
+};
+
+// Undocumented voodoo. Taken from Mozilla.
+static const int smEnableRomanKybdsOnly = -23;
+
+typedef TSMDocumentID (*TSMGetActiveDocument_type)(void);
+static TSMGetActiveDocument_type TSMGetActiveDocument;
+typedef OSStatus (*TSMSetDocumentProperty_type)(TSMDocumentID, OSType, UInt32, void*);
+static TSMSetDocumentProperty_type TSMSetDocumentProperty;
+typedef OSStatus (*TSMRemoveDocumentProperty_type)(TSMDocumentID, OSType);
+static TSMRemoveDocumentProperty_type TSMRemoveDocumentProperty;
+typedef CFArrayRef (*TISCreateASCIICapableInputSourceList_type)(void);
+static TISCreateASCIICapableInputSourceList_type TISCreateASCIICapableInputSourceList;
+
+typedef void (*KeyScript_type)(short);
+static KeyScript_type KeyScript;
#if CONSOLIDATE_MOTION
static Fl_Window* send_motion;
@@ -978,6 +1003,7 @@ void fl_open_callback(void (*cb)(const c
#endif
{
BOOL seen_open_file;
+ TSMDocumentID currentDoc;
}
- (void)windowDidMove:(NSNotification *)notif;
- (void)windowDidResize:(NSNotification *)notif;
@@ -991,6 +1017,7 @@ void fl_open_callback(void (*cb)(const c
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)sender;
- (void)applicationDidBecomeActive:(NSNotification *)notify;
- (void)applicationDidChangeScreenParameters:(NSNotification *)aNotification;
+- (void)applicationDidUpdate:(NSNotification *)aNotification;
- (void)applicationWillResignActive:(NSNotification *)notify;
- (void)applicationWillHide:(NSNotification *)notify;
- (void)applicationWillUnhide:(NSNotification *)notify;
@@ -1175,6 +1202,23 @@ void fl_open_callback(void (*cb)(const c
}
Fl::handle(FL_SCREEN_CONFIGURATION_CHANGED, NULL);
}
+- (void)applicationDidUpdate:(NSNotification *)aNotification
+{
+ if ((fl_mac_os_version >= 100500) && (im_enabled != -1) &&
+ (TSMGetActiveDocument != NULL)) {
+ TSMDocumentID newDoc;
+ // It is extremely unclear when Cocoa decides to create/update
+ // the input context, but debugging reveals that it is done
+ // by NSApplication:updateWindows. So check if the input context
+ // has shifted after each such run so that we can update our
+ // input methods status.
+ newDoc = TSMGetActiveDocument();
+ if (newDoc != currentDoc) {
+ im_update();
+ currentDoc = newDoc;
+ }
+ }
+}
- (void)applicationWillResignActive:(NSNotification *)notify
{
fl_lock_function();
@@ -1322,6 +1365,13 @@ void fl_open_display() {
static char beenHereDoneThat = 0;
if ( !beenHereDoneThat ) {
beenHereDoneThat = 1;
+
+ TSMGetActiveDocument = (TSMGetActiveDocument_type)Fl_X::get_carbon_function("TSMGetActiveDocument");
+ TSMSetDocumentProperty = (TSMSetDocumentProperty_type)Fl_X::get_carbon_function("TSMSetDocumentProperty");
+ TSMRemoveDocumentProperty = (TSMRemoveDocumentProperty_type)Fl_X::get_carbon_function("TSMRemoveDocumentProperty");
+ TISCreateASCIICapableInputSourceList = (TISCreateASCIICapableInputSourceList_type)Fl_X::get_carbon_function("TISCreateASCIICapableInputSourceList");
+
+ KeyScript = (KeyScript_type)Fl_X::get_carbon_function("KeyScript");
BOOL need_new_nsapp = (NSApp == nil);
if (need_new_nsapp) [NSApplication sharedApplication];
@@ -1390,6 +1440,66 @@ void fl_open_display() {
void fl_close_display() {
}
+// Force a "Roman" or "ASCII" keyboard, which both the Mozilla and
+// Safari people seem to think implies turning off advanced IME stuff
+// (see nsTSMManager::SyncKeyScript in Mozilla and enableSecureTextInput
+// in Safari/Webcore). Should be good enough for us then...
+
+static void im_update(void) {
+ if (fl_mac_os_version >= 100500) {
+ TSMDocumentID doc;
+
+ if ((TSMGetActiveDocument == NULL) ||
+ (TSMSetDocumentProperty == NULL) ||
+ (TSMRemoveDocumentProperty == NULL) ||
+ (TISCreateASCIICapableInputSourceList == NULL))
+ return;
+
+ doc = TSMGetActiveDocument();
+
+ if (im_enabled)
+ TSMRemoveDocumentProperty(doc, kTSMDocumentEnabledInputSourcesPropertyTag);
+ else {
+ CFArrayRef inputSources;
+
+ inputSources = TISCreateASCIICapableInputSourceList();
+ TSMSetDocumentProperty(doc, kTSMDocumentEnabledInputSourcesPropertyTag,
+ sizeof(CFArrayRef), &inputSources);
+ CFRelease(inputSources);
+ }
+ } else {
+ if (KeyScript == NULL)
+ return;
+
+ if (im_enabled)
+ KeyScript(smKeyEnableKybds);
+ else
+ KeyScript(smEnableRomanKybdsOnly);
+ }
+}
+
+void Fl::enable_im() {
+ fl_open_display();
+
+ im_enabled = 1;
+
+ if (fl_mac_os_version >= 100500)
+ [NSApp updateWindows];
+ else
+ im_update();
+}
+
+void Fl::disable_im() {
+ fl_open_display();
+
+ im_enabled = 0;
+
+ if (fl_mac_os_version >= 100500)
+ [NSApp updateWindows];
+ else
+ im_update();
+}
+
// Gets the border sizes and the titlebar size
static void get_window_frame_sizes(int &bx, int &by, int &bt) {
diff -up fltk-1.3.2/src/Fl.cxx.im fltk-1.3.2/src/Fl.cxx
--- fltk-1.3.2/src/Fl.cxx.im 2014-09-10 14:40:05.194265440 +0200
+++ fltk-1.3.2/src/Fl.cxx 2014-09-10 14:40:05.197265486 +0200
@@ -593,45 +593,6 @@ int Fl::run() {
return 0;
}
-#ifdef WIN32
-
-// Function to initialize COM/OLE for usage. This must be done only once.
-// We define a flag to register whether we called it:
-static char oleInitialized = 0;
-
-// This calls the Windows function OleInitialize() exactly once.
-void fl_OleInitialize() {
- if (!oleInitialized) {
- OleInitialize(0L);
- oleInitialized = 1;
- }
-}
-
-// This calls the Windows function OleUninitialize() only, if
-// OleInitialize has been called before.
-void fl_OleUninitialize() {
- if (oleInitialized) {
- OleUninitialize();
- oleInitialized = 0;
- }
-}
-
-class Fl_Win32_At_Exit {
-public:
- Fl_Win32_At_Exit() { }
- ~Fl_Win32_At_Exit() {
- fl_free_fonts(); // do some WIN32 cleanup
- fl_cleanup_pens();
- fl_OleUninitialize();
- fl_brush_action(1);
- fl_cleanup_dc_list();
- }
-};
-static Fl_Win32_At_Exit win32_at_exit;
-#endif
-
-
-
/**
Waits until "something happens" and then returns. Call this
repeatedly to "run" your program. You can also check what happened
diff -up fltk-1.3.2/src/Fl_Native_File_Chooser_WIN32.cxx.im fltk-1.3.2/src/Fl_Native_File_Chooser_WIN32.cxx
--- fltk-1.3.2/src/Fl_Native_File_Chooser_WIN32.cxx.im 2012-06-26 09:03:46.000000000 +0200
+++ fltk-1.3.2/src/Fl_Native_File_Chooser_WIN32.cxx 2014-09-10 14:40:05.197265486 +0200
@@ -34,6 +34,7 @@ LPCWSTR utf8towchar(const char *in); //M
char *wchartoutf8(LPCWSTR in); //MG
#include <FL/Fl_Native_File_Chooser.H>
+#include <FL/x.H>
#define LCURLY_CHR '{'
#define RCURLY_CHR '}'
@@ -41,8 +42,6 @@ char *wchartoutf8(LPCWSTR in); //MG
#define RBRACKET_CHR ']'
#define MAXFILTERS 80
-void fl_OleInitialize(); // in Fl.cxx (Windows only)
-
// STATIC: PRINT WINDOWS 'DOUBLE NULL' STRING (DEBUG)
#ifdef DEBUG
static void dnullprint(char *wp) {
@@ -471,7 +470,7 @@ int CALLBACK Fl_Native_File_Chooser::Dir
// SHOW DIRECTORY BROWSER
int Fl_Native_File_Chooser::showdir() {
// initialize OLE only once
- fl_OleInitialize(); // init needed by BIF_USENEWUI
+ fl_open_display(); // init needed by BIF_USENEWUI
ClearBINF();
clear_pathnames();
// PARENT WINDOW
diff -up fltk-1.3.2/src/Fl_win32.cxx.im fltk-1.3.2/src/Fl_win32.cxx
--- fltk-1.3.2/src/Fl_win32.cxx.im 2014-09-10 14:40:05.194265440 +0200
+++ fltk-1.3.2/src/Fl_win32.cxx 2014-09-10 14:40:05.197265486 +0200
@@ -60,8 +60,6 @@
#include <ole2.h>
#include <shellapi.h>
-#include "aimm.h"
-
//
// USE_ASYNC_SELECT - define it if you have WSAAsyncSelect()...
// USE_ASYNC_SELECT is OBSOLETED in 1.3 for the following reasons:
@@ -121,27 +119,24 @@ static HMODULE get_wsock_mod() {
* size and link dependencies.
*/
static HMODULE s_imm_module = 0;
+typedef BOOL (WINAPI* flTypeImmAssociateContextEx)(HWND, HIMC, DWORD);
+static flTypeImmAssociateContextEx flImmAssociateContextEx = 0;
typedef HIMC (WINAPI* flTypeImmGetContext)(HWND);
static flTypeImmGetContext flImmGetContext = 0;
typedef BOOL (WINAPI* flTypeImmSetCompositionWindow)(HIMC, LPCOMPOSITIONFORM);
static flTypeImmSetCompositionWindow flImmSetCompositionWindow = 0;
typedef BOOL (WINAPI* flTypeImmReleaseContext)(HWND, HIMC);
static flTypeImmReleaseContext flImmReleaseContext = 0;
-typedef BOOL (WINAPI* flTypeImmIsIME)(HKL);
-static flTypeImmIsIME flImmIsIME = 0;
-static HMODULE get_imm_module() {
- if (!s_imm_module) {
- s_imm_module = LoadLibrary("IMM32.DLL");
- if (!s_imm_module)
- Fl::fatal("FLTK Lib Error: IMM32.DLL file not found!\n\n"
- "Please check your input method manager library accessibility.");
- flImmGetContext = (flTypeImmGetContext)GetProcAddress(s_imm_module, "ImmGetContext");
- flImmSetCompositionWindow = (flTypeImmSetCompositionWindow)GetProcAddress(s_imm_module, "ImmSetCompositionWindow");
- flImmReleaseContext = (flTypeImmReleaseContext)GetProcAddress(s_imm_module, "ImmReleaseContext");
- flImmIsIME = (flTypeImmIsIME)GetProcAddress(s_imm_module, "ImmIsIME");
- }
- return s_imm_module;
+static void get_imm_module() {
+ s_imm_module = LoadLibrary("IMM32.DLL");
+ if (!s_imm_module)
+ Fl::fatal("FLTK Lib Error: IMM32.DLL file not found!\n\n"
+ "Please check your input method manager library accessibility.");
+ flImmAssociateContextEx = (flTypeImmAssociateContextEx)GetProcAddress(s_imm_module, "ImmAssociateContextEx");
+ flImmGetContext = (flTypeImmGetContext)GetProcAddress(s_imm_module, "ImmGetContext");
+ flImmSetCompositionWindow = (flTypeImmSetCompositionWindow)GetProcAddress(s_imm_module, "ImmSetCompositionWindow");
+ flImmReleaseContext = (flTypeImmReleaseContext)GetProcAddress(s_imm_module, "ImmReleaseContext");
}
// USE_TRACK_MOUSE - define NO_TRACK_MOUSE if you don't have
@@ -259,7 +254,9 @@ void fl_set_spot(int font, int size, int
Fl_Window* tw = win;
while (tw->parent()) tw = tw->window(); // find top level window
- get_imm_module();
+ if (!tw->shown())
+ return;
+
HIMC himc = flImmGetContext(fl_xid(tw));
if (himc) {
@@ -338,7 +335,6 @@ void* Fl::thread_message() {
extern int fl_send_system_handlers(void *e);
-IActiveIMMApp *fl_aimm = NULL;
MSG fl_msg;
// This is never called with time_to_wait < 0.0.
@@ -441,6 +437,58 @@ int fl_ready() {
return get_wsock_mod() ? s_wsock_select(0,&fdt[0],&fdt[1],&fdt[2],&t) : 0;
}
+void fl_open_display() {
+ static char beenHereDoneThat = 0;
+
+ if (beenHereDoneThat)
+ return;
+
+ beenHereDoneThat = 1;
+
+ OleInitialize(0L);
+
+ get_imm_module();
+}
+
+class Fl_Win32_At_Exit {
+public:
+ Fl_Win32_At_Exit() { }
+ ~Fl_Win32_At_Exit() {
+ fl_free_fonts(); // do some WIN32 cleanup
+ fl_cleanup_pens();
+ OleUninitialize();
+ fl_brush_action(1);
+ fl_cleanup_dc_list();
+ }
+};
+static Fl_Win32_At_Exit win32_at_exit;
+
+static char im_enabled = 1;
+
+void Fl::enable_im() {
+ fl_open_display();
+
+ Fl_X* i = Fl_X::first;
+ while (i) {
+ flImmAssociateContextEx(i->xid, 0, IACE_DEFAULT);
+ i = i->next;
+ }
+
+ im_enabled = 1;
+}
+
+void Fl::disable_im() {
+ fl_open_display();
+
+ Fl_X* i = Fl_X::first;
+ while (i) {
+ flImmAssociateContextEx(i->xid, 0, 0);
+ i = i->next;
+ }
+
+ im_enabled = 0;
+}
+
////////////////////////////////////////////////////////////////
int Fl::x()
@@ -683,7 +731,6 @@ void fl_clipboard_notify_untarget(HWND w
}
////////////////////////////////////////////////////////////////
-char fl_is_ime = 0;
void fl_get_codepage()
{
HKL hkl = GetKeyboardLayout(0);
@@ -691,14 +738,8 @@ void fl_get_codepage()
GetLocaleInfo (LOWORD(hkl), LOCALE_IDEFAULTANSICODEPAGE, ld, 6);
DWORD ccp = atol(ld);
- fl_is_ime = 0;
fl_codepage = ccp;
- if (fl_aimm) {
- fl_aimm->GetCodePageA(GetKeyboardLayout(0), &fl_codepage);
- } else if (get_imm_module() && flImmIsIME(hkl)) {
- fl_is_ime = 1;
- }
}
HWND fl_capture;
@@ -1564,6 +1605,8 @@ int fl_disable_transient_for; // secret
Fl_X* Fl_X::make(Fl_Window* w) {
Fl_Group::current(0); // get rid of very common user bug: forgot end()
+ fl_open_display();
+
// if the window is a subwindow and our parent is not mapped yet, we
// mark this window visible, so that mapping the parent at a later
// point in time will call this function again to finally map the subwindow.
@@ -1767,16 +1810,10 @@ Fl_X* Fl_X::make(Fl_Window* w) {
(Fl::grab() || (styleEx & WS_EX_TOOLWINDOW)) ? SW_SHOWNOACTIVATE : SW_SHOWNORMAL);
// Register all windows for potential drag'n'drop operations
- fl_OleInitialize();
RegisterDragDrop(x->xid, flIDropTarget);
- if (!fl_aimm) {
- CoCreateInstance(CLSID_CActiveIMM, NULL, CLSCTX_INPROC_SERVER,
- IID_IActiveIMMApp, (void**) &fl_aimm);
- if (fl_aimm) {
- fl_aimm->Activate(TRUE);
- }
- }
+ if (!im_enabled)
+ flImmAssociateContextEx(x->xid, 0, 0);
return x;
}
diff -up fltk-1.3.2/src/Fl_x.cxx.im fltk-1.3.2/src/Fl_x.cxx
--- fltk-1.3.2/src/Fl_x.cxx.im 2014-09-10 14:40:05.194265440 +0200
+++ fltk-1.3.2/src/Fl_x.cxx 2014-09-10 14:40:05.198265502 +0200
@@ -313,6 +313,7 @@ XVisualInfo *fl_visual;
Colormap fl_colormap;
XIM fl_xim_im = 0;
XIC fl_xim_ic = 0;
+Window fl_xim_win = 0;
char fl_is_over_the_spot = 0;
static XRectangle status_area;
@@ -603,6 +604,55 @@ void fl_init_xim() {
if(xim_styles) XFree(xim_styles);
}
+void fl_xim_deactivate(void);
+
+void fl_xim_activate(Window xid) {
+ if (!fl_xim_im)
+ return;
+
+ // If the focused window has changed, then use the brute force method
+ // of completely recreating the input context.
+ if (fl_xim_win != xid) {
+ fl_xim_deactivate();
+
+ fl_new_ic();
+ fl_xim_win = xid;
+
+ XSetICValues(fl_xim_ic,
+ XNFocusWindow, fl_xim_win,
+ XNClientWindow, fl_xim_win,
+ NULL);
+ }
+
+ fl_set_spot(spotf, spots, spot.x, spot.y, spot.width, spot.height);
+}
+
+void fl_xim_deactivate(void) {
+ if (!fl_xim_ic)
+ return;
+
+ XDestroyIC(fl_xim_ic);
+ fl_xim_ic = NULL;
+
+ fl_xim_win = 0;
+}
+
+void Fl::enable_im() {
+ Fl_Window *win;
+
+ win = Fl::first_window();
+ if (win && win->shown()) {
+ fl_xim_activate(fl_xid(win));
+ XSetICFocus(fl_xim_ic);
+ } else {
+ fl_new_ic();
+ }
+}
+
+void Fl::disable_im() {
+ fl_xim_deactivate();
+}
+
void fl_open_display() {
if (fl_display) return;
@@ -1053,10 +1103,9 @@ int fl_handle(const XEvent& thisevent)
XEvent xevent = thisevent;
fl_xevent = &thisevent;
Window xid = xevent.xany.window;
- static Window xim_win = 0;
if (fl_xim_ic && xevent.type == DestroyNotify &&
- xid != xim_win && !fl_find(xid))
+ xid != fl_xim_win && !fl_find(xid))
{
XIM xim_im;
xim_im = XOpenIM(fl_display, NULL, NULL, NULL);
@@ -1072,46 +1121,9 @@ int fl_handle(const XEvent& thisevent)
}
if (fl_xim_ic && (xevent.type == FocusIn))
- {
-#define POOR_XIM
-#ifdef POOR_XIM
- if (xim_win != xid)
- {
- xim_win = xid;
- XDestroyIC(fl_xim_ic);
- fl_xim_ic = NULL;
- fl_new_ic();
- XSetICValues(fl_xim_ic,
- XNFocusWindow, xevent.xclient.window,
- XNClientWindow, xid,
- NULL);
- }
- fl_set_spot(spotf, spots, spot.x, spot.y, spot.width, spot.height);
-#else
- if (Fl::first_window() && Fl::first_window()->modal()) {
- Window x = fl_xid(Fl::first_window());
- if (x != xim_win) {
- xim_win = x;
- XSetICValues(fl_xim_ic,
- XNFocusWindow, xim_win,
- XNClientWindow, xim_win,
- NULL);
- fl_set_spot(spotf, spots, spot.x, spot.y, spot.width, spot.height);
- }
- } else if (xim_win != xid && xid) {
- xim_win = xid;
- XSetICValues(fl_xim_ic,
- XNFocusWindow, xevent.xclient.window,
- XNClientWindow, xid,
- //XNFocusWindow, xim_win,
- //XNClientWindow, xim_win,
- NULL);
- fl_set_spot(spotf, spots, spot.x, spot.y, spot.width, spot.height);
- }
-#endif
- }
+ fl_xim_activate(xid);
- if ( XFilterEvent((XEvent *)&xevent, 0) )
+ if (fl_xim_ic && XFilterEvent((XEvent *)&xevent, 0))
return(1);
#if USE_XRANDR

View File

@@ -0,0 +1,67 @@
>From 7a15d1c9a908afe429c1aba1c27516d18bdea299 Mon Sep 17 00:00:00 2001
From: DRC <information@virtualgl.org>
Date: Tue, 26 Feb 2013 03:37:12 -0600
Subject: [PATCH 1/4] Add BUILD_STATIC feature from TigerVNC to (optionally)
prevent FLTK from depending on libgcc and libstdc++
---
CMakeLists.txt | 43 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a1ee285..7d9d94b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -150,6 +150,49 @@ mark_as_advanced(LIB_CAIRO LIB_fontconfig LIB_freetype)
mark_as_advanced(LIB_GL LIB_MesaGL)
mark_as_advanced(LIB_jpeg LIB_png LIB_zlib)
+# This ensures that we don't depend on libstdc++ or libgcc
+if(CMAKE_COMPILER_IS_GNUCXX AND NOT APPLE AND NOT CYGWIN)
+ option(BUILD_STATIC
+ "Link statically against libgcc and libstdc++, if possible" OFF)
+ if(BUILD_STATIC)
+ # For some reason, simply passing ${CMAKE_CXX_FLAGS} to the compiler in
+ # execute_process() doesn't work. Grrr...
+ if(CMAKE_SIZEOF_VOID_P MATCHES 8)
+ execute_process(COMMAND ${CMAKE_CXX_COMPILER} -m64
+ --print-file-name=libstdc++.a OUTPUT_VARIABLE LIBSTDCPLUSPLUS
+ RESULT_VARIABLE RESULT)
+ else()
+ execute_process(COMMAND ${CMAKE_CXX_COMPILER} -m32
+ --print-file-name=libstdc++.a OUTPUT_VARIABLE LIBSTDCPLUSPLUS
+ RESULT_VARIABLE RESULT)
+ endif()
+ string(REGEX REPLACE "\n" "" LIBSTDCPLUSPLUS ${LIBSTDCPLUSPLUS})
+ if(RESULT MATCHES 0 AND LIBSTDCPLUSPLUS)
+ message(STATUS "Linking with static libstdc++:\n ${LIBSTDCPLUSPLUS}")
+ file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/staticlib)
+ execute_process(COMMAND ${CMAKE_COMMAND} -E remove
+ ${CMAKE_BINARY_DIR}/staticlib/libstdc++.a)
+ if(MINGW)
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy
+ ${LIBSTDCPLUSPLUS} ${CMAKE_BINARY_DIR}/staticlib/libstdc++.a)
+ else()
+ execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
+ ${LIBSTDCPLUSPLUS} ${CMAKE_BINARY_DIR}/staticlib/libstdc++.a)
+ endif()
+ set(CMAKE_EXE_LINKER_FLAGS
+ "${CMAKE_EXE_LINKER_FLAGS} -L${CMAKE_BINARY_DIR}/staticlib")
+ set(CMAKE_SHARED_LINKER_FLAGS
+ "${CMAKE_SHARED_LINKER_FLAGS} -L${CMAKE_BINARY_DIR}/staticlib")
+ else()
+ message(WARNING Cannot find static libstdc++. TigerVNC will depend on dynamic libstdc++.)
+ endif()
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc")
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc")
+ set(CMAKE_SHARED_LINKER_FLAGS
+ "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc")
+ endif()
+endif()
+
#######################################################################
# functions
include(CheckFunctionExists)
--
1.8.1.3

View File

@@ -0,0 +1,26 @@
>From bf06cdf83375c11a47bddc3683143b3e2c0fdfcb Mon Sep 17 00:00:00 2001
From: DRC <information@virtualgl.org>
Date: Tue, 26 Feb 2013 03:38:45 -0600
Subject: [PATCH 2/4] Fl_cocoa.mm depends on some Carbon functions, so we need
to include that framework.
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7d9d94b..cae895e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -51,7 +51,7 @@ if(APPLE)
set(HAVE_STRTOLL 1)
set(HAVE_STRCASECMP 1)
set(HAVE_DIRENT_H 1)
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework Cocoa")
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework Cocoa -framework Carbon")
endif(APPLE)
if(WIN32)
--
1.8.1.3

View File

@@ -0,0 +1,30 @@
>From bb02d8426a9a279df76376313349c17774030753 Mon Sep 17 00:00:00 2001
From: DRC <information@virtualgl.org>
Date: Tue, 26 Feb 2013 04:01:36 -0600
Subject: [PATCH 3/4] We need to unset CMAKE_REQUIRED_LIBRARIES after checking
for the libpng functions. Otherwise, under certain circumstances (known to
be an issue when building on OS X with the in-tree libpng implementation),
the scandir() function check will fail, leaving HAVE_SCANDIR unset, and the
build will subsequently fail.
---
CMakeLists.txt | 3 +++
1 file changed, 3 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cae895e..0984aae 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -210,6 +210,9 @@ if(LIB_png)
endif(LIB_png)
CHECK_FUNCTION_EXISTS(png_get_valid HAVE_PNG_GET_VALID)
CHECK_FUNCTION_EXISTS(png_set_tRNS_to_alpha HAVE_PNG_SET_TRNS_TO_ALPHA)
+if(LIB_png)
+ set(CMAKE_REQUIRED_LIBRARIES "")
+endif(LIB_png)
CHECK_FUNCTION_EXISTS(scandir HAVE_SCANDIR)
CHECK_FUNCTION_EXISTS(snprintf HAVE_SNPRINTF)
--
1.8.1.3

View File

@@ -0,0 +1,11 @@
--- fltk-1.3.2.org/src/Fl_cocoa.mm 2013-01-16 11:32:11.788478228 +0100
+++ fltk-1.3.2/src/Fl_cocoa.mm 2013-01-16 11:32:55.824101285 +0100
@@ -3727,7 +3727,7 @@ CGImageRef Fl_X::CGImage_from_window_rec
CGImageRef img;
if (fl_mac_os_version >= 100500) {
NSBitmapImageRep *bitmap = rect_to_NSBitmapImageRep(win, x, y, w, h);
- img = [bitmap CGImage]; // requires Mac OS 10.5
+ img = (CGImageRef)[bitmap CGImage]; // requires Mac OS 10.5
CGImageRetain(img);
[bitmap release];
}

View File

@@ -0,0 +1,77 @@
diff -up fltk-1.3.3/src/Fl_cocoa.mm.clip fltk-1.3.3/src/Fl_cocoa.mm
--- fltk-1.3.3/src/Fl_cocoa.mm.clip 2014-11-02 22:06:07.000000000 +0100
+++ fltk-1.3.3/src/Fl_cocoa.mm 2015-04-20 13:45:03.526688921 +0200
@@ -3061,6 +3061,14 @@ static void clipboard_check(void)
fl_trigger_clipboard_notify(1);
}
+static void resize_selection_buffer(int len, int clipboard) {
+ if (len <= fl_selection_buffer_length[clipboard])
+ return;
+ delete[] fl_selection_buffer[clipboard];
+ fl_selection_buffer[clipboard] = new char[len+100];
+ fl_selection_buffer_length[clipboard] = len+100;
+}
+
/*
* create a selection
* stuff: pointer to selected data
@@ -3069,11 +3077,7 @@ static void clipboard_check(void)
*/
void Fl::copy(const char *stuff, int len, int clipboard, const char *type) {
if (!stuff || len<0) return;
- if (len+1 > fl_selection_buffer_length[clipboard]) {
- delete[] fl_selection_buffer[clipboard];
- fl_selection_buffer[clipboard] = new char[len+100];
- fl_selection_buffer_length[clipboard] = len+100;
- }
+ resize_selection_buffer(len+1, clipboard);
memcpy(fl_selection_buffer[clipboard], stuff, len);
fl_selection_buffer[clipboard][len] = 0; // needed for direct paste
fl_selection_length[clipboard] = len;
@@ -3087,7 +3091,7 @@ void Fl::copy(const char *stuff, int len
}
}
-static int get_plain_text_from_clipboard(char **buffer, int previous_length)
+static int get_plain_text_from_clipboard(int clipboard)
{
NSInteger length = 0;
NSPasteboard *clip = [NSPasteboard generalPasteboard];
@@ -3109,21 +3113,17 @@ static int get_plain_text_from_clipboard
len = strlen(aux_c) + 1;
}
else len = [data length] + 1;
- if ( len >= previous_length ) {
- length = len;
- delete[] *buffer;
- *buffer = new char[len];
- }
+ resize_selection_buffer(len, clipboard);
if (![found isEqualToString:utf8_format]) {
- strcpy(*buffer, aux_c);
- free(aux_c);
+ strcpy(fl_selection_buffer[clipboard], aux_c);
+ free(aux_c);
}
else {
- [data getBytes:*buffer];
+ [data getBytes:fl_selection_buffer[clipboard]];
}
- (*buffer)[len - 1] = 0;
+ fl_selection_buffer[clipboard][len - 1] = 0;
length = len - 1;
- convert_crlf(*buffer, len - 1); // turn all \r characters into \n:
+ convert_crlf(fl_selection_buffer[clipboard], len - 1); // turn all \r characters into \n:
Fl::e_clipboard_type = Fl::clipboard_plain_text;
}
}
@@ -3218,7 +3218,7 @@ void Fl::paste(Fl_Widget &receiver, int
if (clipboard) {
Fl::e_clipboard_type = "";
if (strcmp(type, Fl::clipboard_plain_text) == 0) {
- fl_selection_length[1] = get_plain_text_from_clipboard( &fl_selection_buffer[1], fl_selection_length[1]);
+ fl_selection_length[1] = get_plain_text_from_clipboard(1);
}
else if (strcmp(type, Fl::clipboard_image) == 0) {
Fl::e_clipboard_data = get_image_from_clipboard( );

View File

@@ -0,0 +1,31 @@
tigervnc (1.3.0-3ubuntu1) precise; urgency=low
* Build Xvnc against native upstream xorg sources, using native config
options. Use distro-specific fltk1.3 sources.
-- Brian P. Hinz <bphinz@users.sourceforge.net> Sun, 14 Jul 2013 15:22:28 -0400
tigervnc (1.3.0-3) precise; urgency=low
* Additional dependencies (derived from ldd | dpkg -S).
-- Brian P. Hinz <bphinz@users.sourceforge.net> Sun, 07 Jul 2013 11:01:33 -0400
tigervnc (1.3.0-2) precise; urgency=low
* Added build dependencies to improve font support in viewer.
-- Brian P. Hinz <bphinz@users.sourceforge.net> Sun, 07 Jul 2013 10:44:05 -0400
tigervnc (1.3.0-1) precise; urgency=low
* Removed java viewer from server package. Fixed typo in server
dependencies.
-- Brian P. Hinz <bphinz@users.sourceforge.net> Sun, 07 Jul 2013 09:55:44 -0400
tigervnc (1.3.0) precise; urgency=low
* Initial release.
-- Brian P. Hinz <bphinz@users.sourceforge.net> Fri, 05 Jul 2013 00:47:02 -0400

View File

@@ -0,0 +1 @@
9

View File

@@ -0,0 +1,70 @@
Source: tigervnc
Section: x11
Priority: optional
Maintainer: Brian P. Hinz <bphinz@users.sourceforge.net>
Standards-Version: 3.8.4
Build-Depends: debhelper (>> 7.1), zlib1g-dev, libjpeg-turbo8-dev, libxaw7-dev (>> 4.1.0), perl-modules, xfonts-base, xutils-dev, libx11-dev, libxau-dev, libxext-dev, libxi-dev, libxkbfile-dev, libxmu-dev, libxt-dev, x11proto-core-dev, cmake (>> 2.8), libgnutls28-dev, libpam0g-dev, libpng-dev, automake, autoconf, libtool, pkg-config, libpixman-1-dev, x11proto-bigreqs-dev, x11proto-composite-dev, x11proto-damage-dev, x11proto-dri2-dev, x11proto-fixes-dev, x11proto-fonts-dev, x11proto-gl-dev, x11proto-input-dev, x11proto-kb-dev, x11proto-randr-dev, x11proto-render-dev, x11proto-resource-dev, x11proto-scrnsaver-dev, x11proto-video-dev, x11proto-xcmisc-dev, x11proto-xext-dev, x11proto-xf86bigfont-dev, x11proto-xf86dga-dev, x11proto-xf86dri-dev, x11proto-xf86misc-dev, x11proto-xf86vidmode-dev, x11proto-xinerama-dev, libosmesa6-dev, libgl1-mesa-dev, libgl1-mesa-dri, libgl1-mesa-glx, libxfont-dev, x11proto-record-dev, default-jdk, libxtst-dev, libxft-dev, libexpat1-dev, libfontconfig1-dev, libxrender-dev, libt1-dev, libpciaccess-dev, curl, bzip2, quilt, libglu1-mesa-dev, libxcursor-dev, libxinerama-dev, libxfixes-dev, libxdamage-dev, libgcrypt11-dev
Homepage: http://www.tigervnc.com
Package: tigervncserver
Architecture: any
Provides: xserver, vnc-server
Depends: x11-common | xserver-common, x11-utils, xauth, libbz2-1.0, libc6, libfontenc1, libfreetype6, libgcc1, libgl1-mesa-dri, libgnutls28, libjpeg-turbo8, libp11-kit0, libpam0g, libpixman-1-0, libstdc++6, libtasn1-3, libx11-6, libxau6, libxcb1, libxdmcp6, libxext6, libxfont1, libxtst6, zlib1g, libglu1-mesa, libxcursor1, libxinerama1, libxfixes3, x11-xkb-utils, libgcrypt11
Recommends: xfonts-base, x11-xserver-utils
Suggests: xtigervncviewer, tigervnc-java
Description: virtual network computing server software
Virtual Network Computing (VNC) is a remote display system which allows you to
view and interact with a virtual desktop environment that is running on another
computer on the network. Using VNC, you can run graphical applications on a
remote machine and send only the display from these applications to your local
machine. VNC is platform-independent and supports a wide variety of operating
systems and architectures as both servers and clients.
.
TigerVNC is a high-speed version of VNC based on the RealVNC 4 and X.org code
bases. TigerVNC started as a next-generation development effort for TightVNC
on Unix and Linux platforms, but it split from its parent project in early 2009
so that TightVNC could focus on Windows platforms. TigerVNC supports a variant
of Tight encoding that is greatly accelerated by the use of the libjpeg-turbo
JPEG codec.
Package: xtigervncviewer
Architecture: any
Provides: vncviewer, vnc-viewer
Depends: libc6, libexpat1, libfontconfig1, libfreetype6, libgcc1, libgnutls28, libjpeg-turbo8, libp11-kit0, libpng12-0, libstdc++6, libtasn1-3, libx11-6, libxau6, libxcb1, libxdmcp6, libxext6, libxft2, libxrender1, zlib1g, libglu1-mesa
Recommends: xfonts-base
Suggests: tigervncserver, ssh
Description: virtual network computing client software for X
Virtual Network Computing (VNC) is a remote display system which allows you to
view and interact with a virtual desktop environment that is running on another
computer on the network. Using VNC, you can run graphical applications on a
remote machine and send only the display from these applications to your local
machine. VNC is platform-independent and supports a wide variety of operating
systems and architectures as both servers and clients.
.
TigerVNC is a high-speed version of VNC based on the RealVNC 4 and X.org code
bases. TigerVNC started as a next-generation development effort for TightVNC
on Unix and Linux platforms, but it split from its parent project in early 2009
so that TightVNC could focus on Windows platforms. TigerVNC supports a variant
of Tight encoding that is greatly accelerated by the use of the libjpeg-turbo
JPEG codec.
Package: tigervnc-java
Architecture: any
Suggests: tigervncserver
Provides: vncviewer, vnc-viewer
Depends: default-jre
Description: TigerVNC java applet
Virtual Network Computing (VNC) is a remote display system which allows you to
view and interact with a virtual desktop environment that is running on another
computer on the network. Using VNC, you can run graphical applications on a
remote machine and send only the display from these applications to your local
machine. VNC is platform-independent and supports a wide variety of operating
systems and architectures as both servers and clients.
.
TigerVNC is a high-speed version of VNC based on the RealVNC 4 and X.org code
bases. TigerVNC started as a next-generation development effort for TightVNC
on Unix and Linux platforms, but it split from its parent project in early 2009
so that TightVNC could focus on Windows platforms. TigerVNC supports a variant
of Tight encoding that is greatly accelerated by the use of the libjpeg-turbo
JPEG codec.

View File

@@ -0,0 +1,116 @@
This package was packaged for Debian by Brian P. Hinz <bphinz@users.sourceforge.net>
on Tue, 02 Jul 2013 21:33:24 +0500 using the tightvnc package as a base.
It was downloaded from:
http://www.tigervnc.org/
COPYRIGHT:
==========
TigerVNC is
Copyright (C) 1999 AT&T Laboratories Cambridge
Copyright (C) 2002-2005 RealVNC Ltd.
Copyright (C) 2000-2006 TightVNC Group
Copyright (C) 2005-2006 Martin Koegler
Copyright (C) 2005-2006 Sun Microsystems, Inc.
Copyright (C) 2006 OCCAM Financial Technology
Copyright (C) 2000-2008 Constantin Kaplinsky
Copyright (C) 2004-2009 Peter Astrand for Cendio AB
Copyright (C) 2010 Antoine Martin
Copyright (C) 2010 m-privacy GmbH
Copyright (C) 2009-2011 D. R. Commander
Copyright (C) 2009-2011 Pierre Ossman for Cendio AB
Copyright (C) 2004, 2009-2011 Red Hat, Inc.
Copyright (C) 2009-2011 TigerVNC Team
All Rights Reserved.
This software is distributed under the GNU General Public Licence as published
by the Free Software Foundation. See the file LICENCE.TXT for the conditions
under which this software is made available. TigerVNC also contains code from
other sources. See the Acknowledgements section below, and the individual
source files, for details of the conditions under which they are made
available.
ACKNOWLEDGEMENTS
================
This distribution contains zlib compression software. This is:
Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Jean-loup Gailly Mark Adler
jloup@gzip.org madler@alumni.caltech.edu
The data format used by the zlib library is described by RFCs (Request for
Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt
(zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
This distribution contains public domain DES software by Richard Outerbridge.
This is:
Copyright (c) 1988,1989,1990,1991,1992 by Richard Outerbridge.
(GEnie : OUTER; CIS : [71755,204]) Graven Imagery, 1992.
This distribution contains software from the X Window System. This is:
Copyright 1987, 1988, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.

View File

@@ -0,0 +1,38 @@
#!/bin/bash
#curl -L -o tigervnc-1.3.0.tar.bz2 "http://downloads.sourceforge.net/project/tigervnc/tigervnc/1.3.0/tigervnc-1.3.0.tar.bz2"
#tar xjf tigervnc-*.tar.bz2
#rm tigervnc-*.tar.bz2
curl -OL http://sourceforge.net/code-snapshots/svn/t/ti/tigervnc/code/tigervnc-code-5136-trunk.zip
unzip tigervnc-code-*-trunk.zip
mv tigervnc-code-*-trunk tigervnc-1.3.80
rm tigervnc-code-*-trunk.zip
pushd tigervnc-*
curl -L -o fltk-1.3.2-source.tar.gz 'http://anonscm.debian.org/gitweb/?p=users/ucko/fltk1.3.git;a=snapshot;h=HEAD;sf=tgz'
tar xzf fltk-*-source.tar.gz
rm fltk-*-source.tar.gz
mv fltk1.3-* fltk-1.3.2
pushd fltk-*
sh ../../debian/patch_fltk.sh
find . -name "*.orig" -exec rm {} \;
popd
curl -L -o xorg-server-1.11.4-0ubuntu10.3.tar.gz 'http://anonscm.debian.org/gitweb/?p=pkg-xorg/xserver/xorg-server.git;a=snapshot;h=cbf435a091906484112f5c4cf35b17738e779ce9;sf=tgz'
tar xzf xorg-server-*.tar.gz
rm xorg-server-*.tar.gz
pushd xorg-server-*
QUILT_PATCHES=debian/patches quilt push -a
popd
cp -r xorg-server-*/* unix/xserver
rm -rf xorg-server-*
pushd unix/xserver
for all in `find . -type f -perm -001`; do
chmod -x "$all"
done
patch -p1 -b --suffix .vnc < ../xserver111.patch
popd
popd
if [ -e tigervnc_1.3.80.orig.tar.gz ] ; then
rm tigervnc_1.3.80.orig.tar.gz
fi
tar czf tigervnc_1.3.80.orig.tar.gz tigervnc-1.3.80
rm -rf tigervnc-1.3.80

View File

@@ -0,0 +1,94 @@
#!/bin/bash
#
# Init file for TigerVNC Server
#
# chkconfig: - 91 35
# description: TigerVNC remote X administration daemon.
#
# processname: Xvnc
### BEGIN INIT INFO
# Provides: vncservers
# Required-Start: networking
# Required-Stop: networking
# Default-Start:
# Default-Stop: 0 1 2 3 4 5 6
# Short-Description: Starts and stops vncserver
# Description: Used to provide remote X administration services.
### END INIT INFO
# Source function library.
. /lib/lsb/init-functions
### Default variables
SYSCONFIG="/etc/default/vncservers"
VNCSERVERS=""
### Read configuration
[ -r "$SYSCONFIG" ] && . "$SYSCONFIG"
RETVAL=0
prog=$"VNC server"
start() {
echo -n $"Starting $prog: "
ulimit -S -c 0 >/dev/null 2>&1
for display in ${VNCSERVERS}; do
echo -n "${display} "
if [ -r $(eval echo ~${display##*:})/.vnc/passwd ]; then
unset BASH_ENV ENV
log_begin_msg "Starting VNC Server for user ${display##*:}:"
su ${display##*:} -c "cd ~${display##*:} && [ -f .vnc/passwd ] && vncserver :${display%%:*} ${VNCSERVERARGS[${display%:*}]}"
RETVAL="$?"
if [ "$RETVAL" -ne 0 ]; then
log_end_msg 1
break
else
log_end_msg 0
fi
else
log_begin_msg "Not starting VNC Server for user ${display##*:}.\n File \"~${display##*:}/.vnc/passwd\" not found.\n Create a password file for the VNC server with vncpasswd"
log_end_msg 1
fi
done
echo
[ "$RETVAL" -eq 0 ] && touch "/var/lock/vncserver"
return $RETVAL
}
stop() {
echo -n $"Shutting down $desc: "
for display in ${VNCSERVERS}; do
echo -n "${display} "
unset BASH_ENV ENV
log_begin_msg "Shutting down VNC Server for user ${display##*:}: "
su ${display##*:} -c "vncserver -kill :${display%%:*}" >/dev/null 2>&1
RETVAL="$?"
[ "$RETVAL" -eq 0 ] && log_end_msg 0 || log_end_msg 1
done
echo
[ "$RETVAL" -eq 0 ] && rm -f "/var/lock/vncserver"
return $RETVAL
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
restart
;;
*)
echo $"Usage: $0 {start|stop|restart}"
RETVAL=1
esac
exit $RETVAL

View File

@@ -0,0 +1,19 @@
# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the lines below to start a VNC server on display :2
# as my 'myusername' (adjust this to your own). You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted! For a secure way of using VNC, see this URL:
# http://kbase.redhat.com/faq/docs/DOC-7028
# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel. See the "-via" option in the
# `man vncviewer' manual page.
# VNCSERVERS="2:myusername"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"

View File

@@ -0,0 +1,52 @@
#!/bin/bash
set -e
apply_patch()
{
rm -f $2
curl -OL http://www.fltk.org/strfiles/$1/$2
patch -p1 < $2
}
# Export dead key information from FLTK to the apps
# http://www.fltk.org/str.php?L2599
apply_patch 2599 fltk-1_v4.3.x-keyboard-x11.patch
apply_patch 2599 fltk-1_v4.3.x-keyboard-win32.patch
apply_patch 2599 fltk-1_v6.3.x-keyboard-osx.patch
# Notify applications of changes to the clipboard
# http://www.fltk.org/str.php?L2636
apply_patch 2636 fltk-1.3.x-clipboard.patch
apply_patch 2636 fltk-1_v6.3.x-clipboard-x11.patch
apply_patch 2636 fltk-1_v3.3.x-clipboard-win32-fix.patch
apply_patch 2636 fltk-1_v2.3.x-clipboard-win32.patch
apply_patch 2636 fltk-1_v2.3.x-clipboard-osx.patch
# Ability to convert a Fl_Pixmap to a Fl_RGB_Image
# http://www.fltk.org/str.php?L2659
apply_patch 2659 pixmap_v2.patch
# Support for custom cursors
# http://www.fltk.org/str.php?L2660
apply_patch 2660 fltk-1_v5.3.x-cursor.patch
# Improve modality interaction with WM
# http://www.fltk.org/str.php?L2802
apply_patch 2802 fltk-1_v2.3.0-modal.patch
# Window icons
# http://www.fltk.org/str.php?L2816
apply_patch 2816 fltk-1_v3.3.0-icons.patch
# Multihead
# http://fltk.org/str.php?L2860
apply_patch 2860 fltk-1.3.x-screen_num.patch
apply_patch 2860 fltk-1_v3.3.x-multihead.patch
# Apply DRC's patches to FLTK
curl -L 'https://sourceforge.net/mailarchive/attachment.php?list_name=tigervnc-devel&message_id=512DD1FE.7090609%40users.sourceforge.net&counter=1' -o 0001-Add-BUILD_STATIC-feature-from-TigerVNC-to-optionally.patch
curl -L 'https://sourceforge.net/mailarchive/attachment.php?list_name=tigervnc-devel&message_id=512DD1FE.7090609%40users.sourceforge.net&counter=2' -o 0002-Fl_cocoa.mm-depends-on-some-Carbon-functions-so-we-n.patch
curl -L 'https://sourceforge.net/mailarchive/attachment.php?list_name=tigervnc-devel&message_id=512DD1FE.7090609%40users.sourceforge.net&counter=3' -o 0003-We-need-to-unset-CMAKE_REQUIRED_LIBRARIES-after-chec.patch
patch -p1 -i 0001-Add-BUILD_STATIC-feature-from-TigerVNC-to-optionally.patch
patch -p1 -i 0002-Fl_cocoa.mm-depends-on-some-Carbon-functions-so-we-n.patch
patch -p1 -i 0003-We-need-to-unset-CMAKE_REQUIRED_LIBRARIES-after-chec.patch

View File

@@ -0,0 +1,26 @@
--- a/unix/xserver/hw/vnc/xvnc.c 2013-07-14 14:05:29.963390223 -0400
+++ b/unix/xserver/hw/vnc/xvnc.c 2013-07-14 14:04:12.840357191 -0400
@@ -250,7 +250,7 @@
#if XORG < 111
AbortDDX()
#else
-AbortDDX(enum ExitCode error)
+SigAbortDDX(int signo, enum ExitCode error)
#endif
{
#if XORG < 111
@@ -260,6 +260,14 @@
#endif
}
+#if XORG >= 111
+void
+AbortDDX(enum ExitCode error)
+{
+ SigAbortDDX(0, error);
+}
+#endif
+
#ifdef __DARWIN__
void
DarwinHandleGUI(int argc, char *argv[])

View File

@@ -0,0 +1,10 @@
--- a/unix/xserver/man/Makefile.am 2013-03-30 17:51:01.707258746 -0400
+++ b/unix/xserver/man/Makefile.am 2013-03-30 17:51:47.606569692 -0400
@@ -2,5 +2,7 @@
# (i.e. those handled in the os/utils.c options processing instead of in
# the DDX-level options processing)
+if ENABLE_DOCS
include $(top_srcdir)/manpages.am
appman_PRE = Xserver.man
+endif ENABLE_DOCS

View File

@@ -0,0 +1,52 @@
--- a/ltmain.sh 2016-05-11 23:23:25.796742323 -0400
+++ b/ltmain.sh 2016-05-11 23:24:47.173010324 -0400
@@ -6447,6 +6447,9 @@
# It is a libtool convenience library, so add in its objects.
func_append convenience " $ladir/$objdir/$old_library"
func_append old_convenience " $ladir/$objdir/$old_library"
+ elif test "$linkmode" != prog && test "$linkmode" != lib; then
+ func_fatal_error "\`$lib' is not a convenience library"
+ fi
tmp_libs=
for deplib in $dependency_libs; do
deplibs="$deplib $deplibs"
@@ -6457,9 +6460,6 @@
fi
func_append tmp_libs " $deplib"
done
- elif test "$linkmode" != prog && test "$linkmode" != lib; then
- func_fatal_error "\`$lib' is not a convenience library"
- fi
continue
fi # $pass = conv
--- a/m4/libtool.m4 2016-05-11 23:26:23.801328557 -0400
+++ b/m4/libtool.m4 2016-05-11 23:27:12.701489603 -0400
@@ -4589,9 +4589,6 @@
;;
esac
;;
- linux* | k*bsd*-gnu | gnu*)
- _LT_TAGVAR(link_all_deplibs, $1)=no
- ;;
*)
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
;;
@@ -4654,9 +4651,6 @@
openbsd*)
with_gnu_ld=no
;;
- linux* | k*bsd*-gnu | gnu*)
- _LT_TAGVAR(link_all_deplibs, $1)=no
- ;;
esac
_LT_TAGVAR(ld_shlibs, $1)=yes
@@ -5055,7 +5049,6 @@
if test "$aix_use_runtimelinking" = yes; then
shared_flag="$shared_flag "'${wl}-G'
fi
- _LT_TAGVAR(link_all_deplibs, $1)=no
else
# not using gcc
if test "$host_cpu" = ia64; then

View File

@@ -0,0 +1,8 @@
## Patches with a number < 100 are applied in debian.
## Ubuntu patches start with 100.
# Ubuntu patches
100_rethrow_signals.patch
# Upstream patches
516_tigervnc-xorg-manpages.patch

View File

@@ -0,0 +1,277 @@
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 by Joey Hess.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
#DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
#DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
confflags += --build=$(DEB_HOST_GNU_TYPE)
else
confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
endif
SOURCE_NAME := tigervnc
SOURCE_VERSION := $(shell dpkg-parsechangelog | awk -F': ' '/^Version: / {print $$2}')
BUILDER=For technical support please see http://sourceforge.net/projects/tigervnc/support
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CFLAGS += -g -O2 -fPIC
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
export CC = gcc
get-orig-source: $(SOURCE_NAME)_$(SOURCE_VERSION).orig.tar.gz
@
$(SOURCE_NAME)_$(SOURCE_VERSION).orig.tar.gz:
$(CURDIR)/get-orig-source.sh
configure: config-stamp
config-stamp:
dh_testdir
# Add here commands to configure the package.
(cd fltk-*;cmake -G"Unix Makefiles" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DOPTION_PREFIX_LIB=/usr/lib \
-DOPTION_PREFIX_CONFIG=/usr/lib \
-DOPTION_BUILD_EXAMPLES=off \
-DOPTION_USE_SYSTEM_LIBPNG=on;make)
cmake -G"Unix Makefiles" \
-DBUILD_STATIC=off \
-DCMAKE_INSTALL_PREFIX=/usr \
-DFLTK_LIBRARIES="$(CURDIR)/fltk-1.3.3/lib/libfltk.a;$(CURDIR)/fltk-1.3.3/lib/libfltk_images.a;-lpng" \
-DFLTK_INCLUDE_DIR=$(CURDIR)/fltk-1.3.3
(cd unix/xserver; \
export PIXMANINCDIR=/usr/include/pixman-1; \
autoreconf -fiv; \
patch -p1 -i ../../debian/patches/debian_libtool.patch; \
./configure --prefix=/usr \
--disable-silent-rules \
--disable-static \
--without-dtrace \
--disable-strict-compilation \
--disable-debug \
--disable-unit-tests \
--with-int10=x86emu \
--with-extra-module-dir="/usr/lib/${DEB_HOST_MULTIARCH}/xorg/extra-modules,/usr/lib/xorg/extra-modules" \
--with-os-vendor="$(VENDOR)" \
--with-builderstring="$(SOURCE_NAME) $(SOURCE_VERSION) ($(BUILDER))" \
--with-xkb-path=/usr/share/X11/xkb \
--with-xkb-output=/var/lib/xkb \
--with-default-xkb-rules=evdev \
--disable-devel-docs \
--disable-install-libxf86config \
--enable-mitshm \
--enable-xres \
--disable-xcsecurity \
--disable-xcalibrate \
--disable-tslib \
--enable-dbe \
--disable-xf86bigfont \
--disable-dpms \
--disable-config-dbus \
--disable-config-hal \
--disable-config-udev \
--disable-xorg \
--disable-xquartz \
--disable-xwin \
--disable-xfake \
--disable-install-setuid \
--enable-gestures \
--with-default-font-path="/usr/share/fonts/X11/misc,/usr/share/fonts/X11/cyrillic,/usr/share/fonts/X11/100dpi/:unscaled,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Type1,/usr/share/fonts/X11/100dpi,/usr/share/fonts/X11/75dpi,/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType,built-ins" \
--enable-aiglx \
--enable-glx-tls \
--enable-registry \
--enable-composite \
--enable-record \
--enable-xv \
--enable-xvmc \
--enable-dga \
--enable-screensaver \
--enable-xdmcp \
--enable-xdm-auth-1 \
--enable-glx \
--disable-dri --enable-dri2 \
--enable-xinerama \
--enable-xf86vidmode \
--enable-xace \
--disable-selinux \
--enable-xfree86-utils \
--disable-dmx \
--disable-xvfb \
--disable-xnest \
--disable-kdrive \
--disable-xephyr \
--enable-xfbdev \
--with-sha1=libgcrypt \
--enable-xcsecurity \
--disable-docs \
--disable-selective-werror)
touch config-stamp
build-arch: config-stamp build-arch-stamp
build-arch-stamp:
dh_testdir
# Add here command to compile/build the package.
# Build first things.
# Build Xvnc
make LDFLAGS="-lpng"
(cd unix/xserver;make)
touch build-arch-stamp
build-indep: config-stamp build-indep-stamp
build-indep-stamp:
dh_testdir
# Add here command to compile/build the arch indep package.
# It's ok not to do anything here, if you don't need to build
# anything for this package.
#/usr/bin/docbook-to-man debian/vnc.sgml > vnc.1
(cd media;make)
(cd java;cmake -G"Unix Makefiles";make)
touch build-indep-stamp
build: build-arch build-indep
clean:
dh_testdir
dh_testroot
rm -f build-arch-stamp build-indep-stamp config-stamp
# Add here commands to clean up after the build process.
dh_clean
install: DH_OPTIONS=
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_prep
dh_installdirs
# Add here commands to install the package into debian/vnc.
# tigervncserver
make install DESTDIR=$(CURDIR)/debian/tigervncserver
(cd unix/xserver/hw/vnc; make install DESTDIR=$(CURDIR)/debian/tigervncserver)
mv $(CURDIR)/debian/tigervncserver/usr/bin/Xvnc \
$(CURDIR)/debian/tigervncserver/usr/bin/Xtigervnc
mv $(CURDIR)/debian/tigervncserver/usr/bin/vncconfig \
$(CURDIR)/debian/tigervncserver/usr/bin/tigervncconfig
mv $(CURDIR)/debian/tigervncserver/usr/bin/vncpasswd \
$(CURDIR)/debian/tigervncserver/usr/bin/tigervncpasswd
mv $(CURDIR)/debian/tigervncserver/usr/bin/vncserver \
$(CURDIR)/debian/tigervncserver/usr/bin/tigervncserver
mv $(CURDIR)/debian/tigervncserver/usr/bin/x0vncserver \
$(CURDIR)/debian/tigervncserver/usr/bin/x0tigervncserver
mv $(CURDIR)/debian/tigervncserver/usr/share/man/man1/vncconfig.1 \
$(CURDIR)/debian/tigervncserver/usr/share/man/man1/tigervncconfig.1
mv $(CURDIR)/debian/tigervncserver/usr/share/man/man1/vncpasswd.1 \
$(CURDIR)/debian/tigervncserver/usr/share/man/man1/tigervncpasswd.1
mv $(CURDIR)/debian/tigervncserver/usr/share/man/man1/vncserver.1 \
$(CURDIR)/debian/tigervncserver/usr/share/man/man1/tigervncserver.1
mv $(CURDIR)/debian/tigervncserver/usr/share/man/man1/x0vncserver.1 \
$(CURDIR)/debian/tigervncserver/usr/share/man/man1/x0tigervncserver.1
mv $(CURDIR)/debian/tigervncserver/usr/share/man/man1/Xvnc.1 \
$(CURDIR)/debian/tigervncserver/usr/share/man/man1/Xtigervnc.1
mv $(CURDIR)/debian/tigervncserver/usr/share/doc/tigervnc-* \
$(CURDIR)/debian/tigervncserver/usr/share/doc/tigervncserver
rm $(CURDIR)/debian/tigervncserver/usr/lib/xorg/modules/extensions/libvnc.la
rm $(CURDIR)/debian/tigervncserver/usr/bin/vncviewer
rm $(CURDIR)/debian/tigervncserver/usr/share/man/man1/vncviewer.1
install -o root -g root -m 755 -D $(CURDIR)/debian/local/vncserver.service \
$(CURDIR)/debian/tigervncserver/etc/init.d/vncserver
install -o root -g root -m 644 -D $(CURDIR)/debian/local/vncserver.sysconfig \
$(CURDIR)/debian/tigervncserver/etc/default/vncservers
# xtigervncviewer
(cd vncviewer; make install DESTDIR=$(CURDIR)/debian/xtigervncviewer)
# Install desktop stuff
mv $(CURDIR)/debian/xtigervncviewer/usr/bin/vncviewer \
$(CURDIR)/debian/xtigervncviewer/usr/bin/xtigervncviewer
mv $(CURDIR)/debian/xtigervncviewer/usr/share/man/man1/vncviewer.1 \
$(CURDIR)/debian/xtigervncviewer/usr/share/man/man1/xtigervncviewer.1
# tigervnc-java
mkdir -p $(CURDIR)/debian/tigervnc-java/usr/share
(cd java; make install DESTDIR=$(CURDIR)/debian/tigervnc-java/usr/share)
#dh_movefiles
# Build architecture-independent files here.
# Pass -i to all debhelper commands in this target to reduce clutter.
binary-indep: build install
binary-indep-keep:
dh_testdir -i
dh_testroot -i
# dh_installdebconf -i
dh_install
dh_installdocs -i
dh_installexamples -i
dh_installmenu -i
# dh_installlogrotate -i
# dh_installemacsen -i
# dh_installpam -i
# dh_installmime -i
# dh_installinit -i
dh_installcron -i
dh_installman -i
dh_installinfo -i
# dh_undocumented -i
dh_installchangelogs -i
dh_link -i
dh_compress -i
dh_fixperms -i
dh_installdeb -i
dh_perl -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir -a
dh_testroot -a
# dh_installdebconf -a
dh_installdocs -a
# dh_installexamples -a
dh_installmenu -a
# dh_installlogrotate -a
# dh_installemacsen -a
# dh_installpam -a
# dh_installmime -a
dh_install
dh_installinit -a
# dh_installcron -a
dh_installman -a
dh_installinfo -a
# dh_undocumented -a
dh_installchangelogs -a
# Remove empty directories
dh_strip -a
dh_link -a
dh_compress -a
dh_fixperms -a
dh_makeshlibs -a
dh_installdeb -a
dh_perl -a
dh_shlibdeps -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install get-orig-source

View File

@@ -0,0 +1 @@
3.0 (quilt)

View File

@@ -0,0 +1,30 @@
#!/bin/sh -e
if [ "$1" = "configure" ]; then
MAN=/usr/share/man/man1
BIN=/usr/bin
update-alternatives --install \
$BIN/vncserver vncserver $BIN/tigervncserver 64 \
--slave \
$MAN/vncserver.1.gz vncserver.1.gz $MAN/tigervncserver.1.gz
update-alternatives --install \
$BIN/Xvnc Xvnc $BIN/Xtigervnc 74 \
--slave \
$MAN/Xvnc.1.gz Xvnc.1.gz $MAN/Xtigervnc.1.gz
update-alternatives --install \
$BIN/x0vncserver x0vncserver $BIN/x0tigervncserver 74 \
--slave \
$MAN/x0vncserver.1.gz x0vncserver.1.gz $MAN/x0tigervncserver.1.gz
update-alternatives --install \
$BIN/vncpasswd vncpasswd $BIN/tigervncpasswd 74 \
--slave \
$MAN/vncpasswd.1.gz vncpasswd.1.gz $MAN/tigervncpasswd.1.gz
update-alternatives --install \
$BIN/vncconfig vncconfig $BIN/tigervncconfig 64 \
--slave \
$MAN/vncconfig.1.gz vncconfig.1.gz $MAN/tigervncconfig.1.gz
fi
#DEBHELPER#
exit 0

View File

@@ -0,0 +1,19 @@
#!/bin/sh -e
if [ "$1" = "remove" ] ; then
BIN=/usr/bin
update-alternatives --remove \
vncserver $BIN/tigervncserver
update-alternatives --remove \
Xvnc $BIN/Xtigervnc
update-alternatives --remove \
x0vncserver $BIN/x0tigervncserver
update-alternatives --remove \
vncpasswd $BIN/tigervncpasswd
update-alternatives --remove \
tigervncconfig $BIN/tigervncconfig
fi
#DEBHELPER#
exit 0

View File

@@ -0,0 +1,5 @@
?package(xtigervncviewer):needs="x11" \
section="Applications/Network/Communication" \
hints="VNC,remote-control"\
title="xtigervncviewer" \
command="/usr/bin/xtigervncviewer"

View File

@@ -0,0 +1,18 @@
#!/bin/sh -e
if [ "$1" = "configure" ]; then
MAN=/usr/share/man/man1
BIN=/usr/bin
update-alternatives --install \
$BIN/vncviewer vncviewer $BIN/xtigervncviewer 74 \
--slave \
$MAN/vncviewer.1.gz vncviewer.1.gz $MAN/xtigervncviewer.1.gz \
--slave \
$MAN/xvncviewer.1.gz xvncviewer.1.gz $MAN/xtigervncviewer.1.gz \
--slave \
$BIN/xvncviewer xvncviewer $BIN/xtigervncviewer
fi
#DEBHELPER#
exit 0

View File

@@ -0,0 +1,11 @@
#!/bin/sh -e
if [ "$1" = "remove" ] ; then
BIN=/usr/bin
update-alternatives --remove \
vncviewer $BIN/xtigervncviewer
fi
#DEBHELPER#
exit 0

View File

@@ -0,0 +1,31 @@
tigervnc (1.3.0-3ubuntu1) precise; urgency=low
* Build Xvnc against native upstream xorg sources, using native config
options. Use distro-specific fltk1.3 sources.
-- Brian P. Hinz <bphinz@users.sourceforge.net> Sun, 14 Jul 2013 15:22:28 -0400
tigervnc (1.3.0-3) precise; urgency=low
* Additional dependencies (derived from ldd | dpkg -S).
-- Brian P. Hinz <bphinz@users.sourceforge.net> Sun, 07 Jul 2013 11:01:33 -0400
tigervnc (1.3.0-2) precise; urgency=low
* Added build dependencies to improve font support in viewer.
-- Brian P. Hinz <bphinz@users.sourceforge.net> Sun, 07 Jul 2013 10:44:05 -0400
tigervnc (1.3.0-1) precise; urgency=low
* Removed java viewer from server package. Fixed typo in server
dependencies.
-- Brian P. Hinz <bphinz@users.sourceforge.net> Sun, 07 Jul 2013 09:55:44 -0400
tigervnc (1.3.0) precise; urgency=low
* Initial release.
-- Brian P. Hinz <bphinz@users.sourceforge.net> Fri, 05 Jul 2013 00:47:02 -0400

View File

@@ -0,0 +1 @@
9

View File

@@ -0,0 +1,70 @@
Source: tigervnc
Section: x11
Priority: optional
Maintainer: Brian P. Hinz <bphinz@users.sourceforge.net>
Standards-Version: 3.8.4
Build-Depends: debhelper (>> 7.1), zlib1g-dev, libjpeg-turbo8-dev, libxaw7-dev (>> 4.1.0), perl-modules, xfonts-base, xutils-dev, libx11-dev, libxau-dev, libxext-dev, libxi-dev, libxkbfile-dev, libxmu-dev, libxt-dev, x11proto-core-dev, cmake (>> 2.8), libgnutls28-dev, libpam0g-dev, libpng-dev, automake, autoconf, libtool, pkg-config, libpixman-1-dev, x11proto-bigreqs-dev, x11proto-composite-dev, x11proto-damage-dev, x11proto-dri2-dev, x11proto-fixes-dev, x11proto-fonts-dev, x11proto-gl-dev, x11proto-input-dev, x11proto-kb-dev, x11proto-randr-dev, x11proto-render-dev, x11proto-resource-dev, x11proto-scrnsaver-dev, x11proto-video-dev, x11proto-xext-dev, x11proto-xf86bigfont-dev, x11proto-xf86dga-dev, x11proto-xf86dri-dev, x11proto-xf86vidmode-dev, x11proto-xinerama-dev, libosmesa6-dev, libgl1-mesa-dev, libgl1-mesa-dri, libgl1-mesa-glx, libxfont-dev, x11proto-record-dev, default-jdk, libxtst-dev, libxft-dev, libexpat1-dev, libfontconfig1-dev, libxrender-dev, libt1-dev, libpciaccess-dev, curl, bzip2, quilt, libglu1-mesa-dev, libxcursor-dev, libxinerama-dev, libxfixes-dev, libcairo2-dev, x11proto-dri3-dev, libgcrypt20-dev, x11proto-xcmisc-dev, x11proto-present-dev, libtasn1-dev
Homepage: http://www.tigervnc.com
Package: tigervncserver
Architecture: any
Provides: xserver, vnc-server
Depends: x11-common | xserver-common, x11-utils, xauth, libbz2-1.0, libc6, libfontenc1, libfreetype6, libgcc1, libgl1-mesa-dri, libgnutls28, libjpeg-turbo8, libp11-kit0, libpam0g, libpixman-1-0, libstdc++6, libtasn1-bin, libx11-6, libxau6, libxcb1, libxdmcp6, libxext6, libxfont1, libxtst6, zlib1g, libglu1-mesa, libxcursor1, libxinerama1, libxfixes3, x11-xkb-utils, libgcrypt20
Recommends: xfonts-base, x11-xserver-utils
Suggests: xtigervncviewer, tigervnc-java
Description: virtual network computing server software
Virtual Network Computing (VNC) is a remote display system which allows you to
view and interact with a virtual desktop environment that is running on another
computer on the network. Using VNC, you can run graphical applications on a
remote machine and send only the display from these applications to your local
machine. VNC is platform-independent and supports a wide variety of operating
systems and architectures as both servers and clients.
.
TigerVNC is a high-speed version of VNC based on the RealVNC 4 and X.org code
bases. TigerVNC started as a next-generation development effort for TightVNC
on Unix and Linux platforms, but it split from its parent project in early 2009
so that TightVNC could focus on Windows platforms. TigerVNC supports a variant
of Tight encoding that is greatly accelerated by the use of the libjpeg-turbo
JPEG codec.
Package: xtigervncviewer
Architecture: any
Provides: vncviewer, vnc-viewer
Depends: libc6, libexpat1, libfontconfig1, libfreetype6, libgcc1, libgnutls28, libjpeg-turbo8, libp11-kit0, libpng12-0, libstdc++6, libtasn1-bin, libx11-6, libxau6, libxcb1, libxdmcp6, libxext6, libxft2, libxrender1, zlib1g, libglu1-mesa, libxcursor1, libxinerama1, libxfixes3
Recommends: xfonts-base
Suggests: tigervncserver, ssh
Description: virtual network computing client software for X
Virtual Network Computing (VNC) is a remote display system which allows you to
view and interact with a virtual desktop environment that is running on another
computer on the network. Using VNC, you can run graphical applications on a
remote machine and send only the display from these applications to your local
machine. VNC is platform-independent and supports a wide variety of operating
systems and architectures as both servers and clients.
.
TigerVNC is a high-speed version of VNC based on the RealVNC 4 and X.org code
bases. TigerVNC started as a next-generation development effort for TightVNC
on Unix and Linux platforms, but it split from its parent project in early 2009
so that TightVNC could focus on Windows platforms. TigerVNC supports a variant
of Tight encoding that is greatly accelerated by the use of the libjpeg-turbo
JPEG codec.
Package: tigervnc-java
Architecture: any
Suggests: tigervncserver
Provides: vncviewer, vnc-viewer
Depends: default-jre
Description: TigerVNC java applet
Virtual Network Computing (VNC) is a remote display system which allows you to
view and interact with a virtual desktop environment that is running on another
computer on the network. Using VNC, you can run graphical applications on a
remote machine and send only the display from these applications to your local
machine. VNC is platform-independent and supports a wide variety of operating
systems and architectures as both servers and clients.
.
TigerVNC is a high-speed version of VNC based on the RealVNC 4 and X.org code
bases. TigerVNC started as a next-generation development effort for TightVNC
on Unix and Linux platforms, but it split from its parent project in early 2009
so that TightVNC could focus on Windows platforms. TigerVNC supports a variant
of Tight encoding that is greatly accelerated by the use of the libjpeg-turbo
JPEG codec.

View File

@@ -0,0 +1,116 @@
This package was packaged for Debian by Brian P. Hinz <bphinz@users.sourceforge.net>
on Tue, 02 Jul 2013 21:33:24 +0500 using the tightvnc package as a base.
It was downloaded from:
http://www.tigervnc.org/
COPYRIGHT:
==========
TigerVNC is
Copyright (C) 1999 AT&T Laboratories Cambridge
Copyright (C) 2002-2005 RealVNC Ltd.
Copyright (C) 2000-2006 TightVNC Group
Copyright (C) 2005-2006 Martin Koegler
Copyright (C) 2005-2006 Sun Microsystems, Inc.
Copyright (C) 2006 OCCAM Financial Technology
Copyright (C) 2000-2008 Constantin Kaplinsky
Copyright (C) 2004-2009 Peter Astrand for Cendio AB
Copyright (C) 2010 Antoine Martin
Copyright (C) 2010 m-privacy GmbH
Copyright (C) 2009-2011 D. R. Commander
Copyright (C) 2009-2011 Pierre Ossman for Cendio AB
Copyright (C) 2004, 2009-2011 Red Hat, Inc.
Copyright (C) 2009-2011 TigerVNC Team
All Rights Reserved.
This software is distributed under the GNU General Public Licence as published
by the Free Software Foundation. See the file LICENCE.TXT for the conditions
under which this software is made available. TigerVNC also contains code from
other sources. See the Acknowledgements section below, and the individual
source files, for details of the conditions under which they are made
available.
ACKNOWLEDGEMENTS
================
This distribution contains zlib compression software. This is:
Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Jean-loup Gailly Mark Adler
jloup@gzip.org madler@alumni.caltech.edu
The data format used by the zlib library is described by RFCs (Request for
Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt
(zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
This distribution contains public domain DES software by Richard Outerbridge.
This is:
Copyright (c) 1988,1989,1990,1991,1992 by Richard Outerbridge.
(GEnie : OUTER; CIS : [71755,204]) Graven Imagery, 1992.
This distribution contains software from the X Window System. This is:
Copyright 1987, 1988, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.

View File

@@ -0,0 +1,38 @@
#!/bin/bash
#curl -L -o tigervnc-1.3.0.tar.bz2 "http://downloads.sourceforge.net/project/tigervnc/tigervnc/1.3.0/tigervnc-1.3.0.tar.bz2"
#tar xjf tigervnc-*.tar.bz2
#rm tigervnc-*.tar.bz2
curl -OL http://sourceforge.net/code-snapshots/svn/t/ti/tigervnc/code/tigervnc-code-5136-trunk.zip
unzip tigervnc-code-*-trunk.zip
mv tigervnc-code-*-trunk tigervnc-1.3.80
rm tigervnc-code-*-trunk.zip
pushd tigervnc-*
curl -L -o fltk-1.3.2-source.tar.gz 'http://anonscm.debian.org/gitweb/?p=users/ucko/fltk1.3.git;a=snapshot;h=HEAD;sf=tgz'
tar xzf fltk-*-source.tar.gz
rm fltk-*-source.tar.gz
mv fltk1.3-* fltk-1.3.2
pushd fltk-*
sh ../../debian/patch_fltk.sh
find . -name "*.orig" -exec rm {} \;
popd
curl -L -o xorg-server-1.11.4-0ubuntu10.3.tar.gz 'http://anonscm.debian.org/gitweb/?p=pkg-xorg/xserver/xorg-server.git;a=snapshot;h=cbf435a091906484112f5c4cf35b17738e779ce9;sf=tgz'
tar xzf xorg-server-*.tar.gz
rm xorg-server-*.tar.gz
pushd xorg-server-*
QUILT_PATCHES=debian/patches quilt push -a
popd
cp -r xorg-server-*/* unix/xserver
rm -rf xorg-server-*
pushd unix/xserver
for all in `find . -type f -perm -001`; do
chmod -x "$all"
done
patch -p1 -b --suffix .vnc < ../xserver111.patch
popd
popd
if [ -e tigervnc_1.3.80.orig.tar.gz ] ; then
rm tigervnc_1.3.80.orig.tar.gz
fi
tar czf tigervnc_1.3.80.orig.tar.gz tigervnc-1.3.80
rm -rf tigervnc-1.3.80

View File

@@ -0,0 +1,94 @@
#!/bin/bash
#
# Init file for TigerVNC Server
#
# chkconfig: - 91 35
# description: TigerVNC remote X administration daemon.
#
# processname: Xvnc
### BEGIN INIT INFO
# Provides: vncservers
# Required-Start: networking
# Required-Stop: networking
# Default-Start:
# Default-Stop: 0 1 2 3 4 5 6
# Short-Description: Starts and stops vncserver
# Description: Used to provide remote X administration services.
### END INIT INFO
# Source function library.
. /lib/lsb/init-functions
### Default variables
SYSCONFIG="/etc/default/vncservers"
VNCSERVERS=""
### Read configuration
[ -r "$SYSCONFIG" ] && . "$SYSCONFIG"
RETVAL=0
prog=$"VNC server"
start() {
echo -n $"Starting $prog: "
ulimit -S -c 0 >/dev/null 2>&1
for display in ${VNCSERVERS}; do
echo -n "${display} "
if [ -r $(eval echo ~${display##*:})/.vnc/passwd ]; then
unset BASH_ENV ENV
log_begin_msg "Starting VNC Server for user ${display##*:}:"
su ${display##*:} -c "cd ~${display##*:} && [ -f .vnc/passwd ] && vncserver :${display%%:*} ${VNCSERVERARGS[${display%:*}]}"
RETVAL="$?"
if [ "$RETVAL" -ne 0 ]; then
log_end_msg 1
break
else
log_end_msg 0
fi
else
log_begin_msg "Not starting VNC Server for user ${display##*:}.\n File \"~${display##*:}/.vnc/passwd\" not found.\n Create a password file for the VNC server with vncpasswd"
log_end_msg 1
fi
done
echo
[ "$RETVAL" -eq 0 ] && touch "/var/lock/vncserver"
return $RETVAL
}
stop() {
echo -n $"Shutting down $desc: "
for display in ${VNCSERVERS}; do
echo -n "${display} "
unset BASH_ENV ENV
log_begin_msg "Shutting down VNC Server for user ${display##*:}: "
su ${display##*:} -c "vncserver -kill :${display%%:*}" >/dev/null 2>&1
RETVAL="$?"
[ "$RETVAL" -eq 0 ] && log_end_msg 0 || log_end_msg 1
done
echo
[ "$RETVAL" -eq 0 ] && rm -f "/var/lock/vncserver"
return $RETVAL
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
restart
;;
*)
echo $"Usage: $0 {start|stop|restart}"
RETVAL=1
esac
exit $RETVAL

View File

@@ -0,0 +1,19 @@
# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the lines below to start a VNC server on display :2
# as my 'myusername' (adjust this to your own). You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted! For a secure way of using VNC, see this URL:
# http://kbase.redhat.com/faq/docs/DOC-7028
# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel. See the "-via" option in the
# `man vncviewer' manual page.
# VNCSERVERS="2:myusername"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"

View File

@@ -0,0 +1,52 @@
#!/bin/bash
set -e
apply_patch()
{
rm -f $2
curl -OL http://www.fltk.org/strfiles/$1/$2
patch -p1 < $2
}
# Export dead key information from FLTK to the apps
# http://www.fltk.org/str.php?L2599
apply_patch 2599 fltk-1_v4.3.x-keyboard-x11.patch
apply_patch 2599 fltk-1_v4.3.x-keyboard-win32.patch
apply_patch 2599 fltk-1_v6.3.x-keyboard-osx.patch
# Notify applications of changes to the clipboard
# http://www.fltk.org/str.php?L2636
apply_patch 2636 fltk-1.3.x-clipboard.patch
apply_patch 2636 fltk-1_v6.3.x-clipboard-x11.patch
apply_patch 2636 fltk-1_v3.3.x-clipboard-win32-fix.patch
apply_patch 2636 fltk-1_v2.3.x-clipboard-win32.patch
apply_patch 2636 fltk-1_v2.3.x-clipboard-osx.patch
# Ability to convert a Fl_Pixmap to a Fl_RGB_Image
# http://www.fltk.org/str.php?L2659
apply_patch 2659 pixmap_v2.patch
# Support for custom cursors
# http://www.fltk.org/str.php?L2660
apply_patch 2660 fltk-1_v5.3.x-cursor.patch
# Improve modality interaction with WM
# http://www.fltk.org/str.php?L2802
apply_patch 2802 fltk-1_v2.3.0-modal.patch
# Window icons
# http://www.fltk.org/str.php?L2816
apply_patch 2816 fltk-1_v3.3.0-icons.patch
# Multihead
# http://fltk.org/str.php?L2860
apply_patch 2860 fltk-1.3.x-screen_num.patch
apply_patch 2860 fltk-1_v3.3.x-multihead.patch
# Apply DRC's patches to FLTK
curl -L 'https://sourceforge.net/mailarchive/attachment.php?list_name=tigervnc-devel&message_id=512DD1FE.7090609%40users.sourceforge.net&counter=1' -o 0001-Add-BUILD_STATIC-feature-from-TigerVNC-to-optionally.patch
curl -L 'https://sourceforge.net/mailarchive/attachment.php?list_name=tigervnc-devel&message_id=512DD1FE.7090609%40users.sourceforge.net&counter=2' -o 0002-Fl_cocoa.mm-depends-on-some-Carbon-functions-so-we-n.patch
curl -L 'https://sourceforge.net/mailarchive/attachment.php?list_name=tigervnc-devel&message_id=512DD1FE.7090609%40users.sourceforge.net&counter=3' -o 0003-We-need-to-unset-CMAKE_REQUIRED_LIBRARIES-after-chec.patch
patch -p1 -i 0001-Add-BUILD_STATIC-feature-from-TigerVNC-to-optionally.patch
patch -p1 -i 0002-Fl_cocoa.mm-depends-on-some-Carbon-functions-so-we-n.patch
patch -p1 -i 0003-We-need-to-unset-CMAKE_REQUIRED_LIBRARIES-after-chec.patch

View File

@@ -0,0 +1,26 @@
--- a/unix/xserver/hw/vnc/xvnc.c 2013-07-14 14:05:29.963390223 -0400
+++ b/unix/xserver/hw/vnc/xvnc.c 2013-07-14 14:04:12.840357191 -0400
@@ -250,7 +250,7 @@
#if XORG < 111
AbortDDX()
#else
-AbortDDX(enum ExitCode error)
+SigAbortDDX(int signo, enum ExitCode error)
#endif
{
#if XORG < 111
@@ -260,6 +260,14 @@
#endif
}
+#if XORG >= 111
+void
+AbortDDX(enum ExitCode error)
+{
+ SigAbortDDX(0, error);
+}
+#endif
+
#ifdef __DARWIN__
void
DarwinHandleGUI(int argc, char *argv[])

View File

@@ -0,0 +1,10 @@
--- a/unix/xserver/man/Makefile.am 2013-03-30 17:51:01.707258746 -0400
+++ b/unix/xserver/man/Makefile.am 2013-03-30 17:51:47.606569692 -0400
@@ -2,5 +2,7 @@
# (i.e. those handled in the os/utils.c options processing instead of in
# the DDX-level options processing)
+if ENABLE_DOCS
include $(top_srcdir)/manpages.am
appman_PRE = Xserver.man
+endif ENABLE_DOCS

View File

@@ -0,0 +1,52 @@
--- a/ltmain.sh 2016-05-11 23:23:25.796742323 -0400
+++ b/ltmain.sh 2016-05-11 23:24:47.173010324 -0400
@@ -6447,6 +6447,9 @@
# It is a libtool convenience library, so add in its objects.
func_append convenience " $ladir/$objdir/$old_library"
func_append old_convenience " $ladir/$objdir/$old_library"
+ elif test "$linkmode" != prog && test "$linkmode" != lib; then
+ func_fatal_error "\`$lib' is not a convenience library"
+ fi
tmp_libs=
for deplib in $dependency_libs; do
deplibs="$deplib $deplibs"
@@ -6457,9 +6460,6 @@
fi
func_append tmp_libs " $deplib"
done
- elif test "$linkmode" != prog && test "$linkmode" != lib; then
- func_fatal_error "\`$lib' is not a convenience library"
- fi
continue
fi # $pass = conv
--- a/m4/libtool.m4 2016-05-11 23:26:23.801328557 -0400
+++ b/m4/libtool.m4 2016-05-11 23:27:12.701489603 -0400
@@ -4589,9 +4589,6 @@
;;
esac
;;
- linux* | k*bsd*-gnu | gnu*)
- _LT_TAGVAR(link_all_deplibs, $1)=no
- ;;
*)
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
;;
@@ -4654,9 +4651,6 @@
openbsd*)
with_gnu_ld=no
;;
- linux* | k*bsd*-gnu | gnu*)
- _LT_TAGVAR(link_all_deplibs, $1)=no
- ;;
esac
_LT_TAGVAR(ld_shlibs, $1)=yes
@@ -5055,7 +5049,6 @@
if test "$aix_use_runtimelinking" = yes; then
shared_flag="$shared_flag "'${wl}-G'
fi
- _LT_TAGVAR(link_all_deplibs, $1)=no
else
# not using gcc
if test "$host_cpu" = ia64; then

View File

@@ -0,0 +1,8 @@
## Patches with a number < 100 are applied in debian.
## Ubuntu patches start with 100.
# Ubuntu patches
100_rethrow_signals.patch
# Upstream patches
516_tigervnc-xorg-manpages.patch

View File

@@ -0,0 +1,284 @@
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 by Joey Hess.
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
CFLAGS := $(shell dpkg-buildflags --get CFLAGS)
CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS)
LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
export CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
#DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
#DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
confflags += --build=$(DEB_HOST_GNU_TYPE)
else
confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
endif
SOURCE_NAME := tigervnc
SOURCE_VERSION := $(shell dpkg-parsechangelog | awk -F': ' '/^Version: / {print $$2}')
BUILDER=For technical support please see http://sourceforge.net/projects/tigervnc/support
libdir = /usr/lib/$(DEB_HOST_MULTIARCH)
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CFLAGS += -g -O2 -fPIC
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
export CC = gcc
XCFLAGS = -Wall -Wunused -Wno-format-y2k -fPIE -fno-strict-aliasing
get-orig-source: $(SOURCE_NAME)_$(SOURCE_VERSION).orig.tar.gz
@
$(SOURCE_NAME)_$(SOURCE_VERSION).orig.tar.gz:
$(CURDIR)/get-orig-source.sh
configure: config-stamp
config-stamp:
dh_testdir
# Add here commands to configure the package.
(cd fltk-*;DSOFLAGS="$(filter-out -fPIE -pie,$(LDFLAGS))" \
./configure --enable-shared=no --enable-cairo --enable-cp936 \
--with-optim="$(CFLAGS) $(XCFLAGS)" --libdir=$(libdir);make)
cmake -G"Unix Makefiles" \
-DBUILD_STATIC=off \
-DCMAKE_INSTALL_PREFIX=/usr \
-DFLTK_LIBRARIES="$(CURDIR)/fltk-1.3.3/lib/libfltk.a;$(CURDIR)/fltk-1.3.3/lib/libfltk_images.a;-lpng" \
-DFLTK_INCLUDE_DIR=$(CURDIR)/fltk-1.3.3
(cd unix/xserver; \
export PIXMANINCDIR=/usr/include/pixman-1; \
autoreconf -fiv; \
patch -p1 -i ../../debian/patches/debian_libtool.patch; \
./configure --prefix=/usr \
--disable-silent-rules \
--disable-static \
--without-dtrace \
--disable-strict-compilation \
--disable-debug \
--disable-unit-tests \
--with-int10=x86emu \
--with-extra-module-dir="/usr/lib/${DEB_HOST_MULTIARCH}/xorg/extra-modules,/usr/lib/xorg/extra-modules" \
--with-os-vendor="$(VENDOR)" \
--with-builderstring="$(SOURCE_NAME) $(SOURCE_VERSION) ($(BUILDER))" \
--with-xkb-path=/usr/share/X11/xkb \
--with-xkb-output=/var/lib/xkb \
--with-default-xkb-rules=evdev \
--disable-devel-docs \
--disable-install-libxf86config \
--enable-mitshm \
--enable-xres \
--disable-xcsecurity \
--disable-xcalibrate \
--disable-tslib \
--enable-dbe \
--disable-xf86bigfont \
--disable-dpms \
--disable-config-dbus \
--disable-config-hal \
--disable-config-udev \
--disable-xorg \
--disable-xquartz \
--disable-xwin \
--disable-xfake \
--disable-install-setuid \
--enable-gestures \
--with-default-font-path="/usr/share/fonts/X11/misc,/usr/share/fonts/X11/cyrillic,/usr/share/fonts/X11/100dpi/:unscaled,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Type1,/usr/share/fonts/X11/100dpi,/usr/share/fonts/X11/75dpi,/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType,built-ins" \
--enable-aiglx \
--enable-glx-tls \
--enable-registry \
--enable-composite \
--enable-record \
--enable-xv \
--enable-xvmc \
--enable-dga \
--enable-screensaver \
--enable-xdmcp \
--enable-xdm-auth-1 \
--enable-glx \
--disable-dri --enable-dri2 --enable-dri3 \
--enable-xinerama \
--enable-xf86vidmode \
--enable-xace \
--disable-selinux \
--enable-xfree86-utils \
--disable-dmx \
--disable-xvfb \
--disable-xnest \
--disable-kdrive \
--disable-xephyr \
--enable-xfbdev \
--with-sha1=libgcrypt \
--enable-xcsecurity \
--disable-docs \
--disable-selective-werror)
touch config-stamp
build-arch: config-stamp build-arch-stamp
build-arch-stamp:
dh_testdir
# Add here command to compile/build the package.
# Build first things.
# Build Xvnc
make LDFLAGS="-lpng"
(cd unix/xserver;make)
touch build-arch-stamp
build-indep: config-stamp build-indep-stamp
build-indep-stamp:
dh_testdir
# Add here command to compile/build the arch indep package.
# It's ok not to do anything here, if you don't need to build
# anything for this package.
#/usr/bin/docbook-to-man debian/vnc.sgml > vnc.1
(cd media;make)
(cd java;cmake -G"Unix Makefiles";make)
touch build-indep-stamp
build: build-arch build-indep
clean:
dh_testdir
dh_testroot
rm -f build-arch-stamp build-indep-stamp config-stamp
# Add here commands to clean up after the build process.
dh_clean
install: DH_OPTIONS=
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_prep
dh_installdirs
# Add here commands to install the package into debian/vnc.
# tigervncserver
make install DESTDIR=$(CURDIR)/debian/tigervncserver
(cd unix/xserver/hw/vnc; make install DESTDIR=$(CURDIR)/debian/tigervncserver)
mv $(CURDIR)/debian/tigervncserver/usr/bin/Xvnc \
$(CURDIR)/debian/tigervncserver/usr/bin/Xtigervnc
mv $(CURDIR)/debian/tigervncserver/usr/bin/vncconfig \
$(CURDIR)/debian/tigervncserver/usr/bin/tigervncconfig
mv $(CURDIR)/debian/tigervncserver/usr/bin/vncpasswd \
$(CURDIR)/debian/tigervncserver/usr/bin/tigervncpasswd
mv $(CURDIR)/debian/tigervncserver/usr/bin/vncserver \
$(CURDIR)/debian/tigervncserver/usr/bin/tigervncserver
mv $(CURDIR)/debian/tigervncserver/usr/bin/x0vncserver \
$(CURDIR)/debian/tigervncserver/usr/bin/x0tigervncserver
mv $(CURDIR)/debian/tigervncserver/usr/share/man/man1/vncconfig.1 \
$(CURDIR)/debian/tigervncserver/usr/share/man/man1/tigervncconfig.1
mv $(CURDIR)/debian/tigervncserver/usr/share/man/man1/vncpasswd.1 \
$(CURDIR)/debian/tigervncserver/usr/share/man/man1/tigervncpasswd.1
mv $(CURDIR)/debian/tigervncserver/usr/share/man/man1/vncserver.1 \
$(CURDIR)/debian/tigervncserver/usr/share/man/man1/tigervncserver.1
mv $(CURDIR)/debian/tigervncserver/usr/share/man/man1/x0vncserver.1 \
$(CURDIR)/debian/tigervncserver/usr/share/man/man1/x0tigervncserver.1
mv $(CURDIR)/debian/tigervncserver/usr/share/man/man1/Xvnc.1 \
$(CURDIR)/debian/tigervncserver/usr/share/man/man1/Xtigervnc.1
mv $(CURDIR)/debian/tigervncserver/usr/share/doc/tigervnc-* \
$(CURDIR)/debian/tigervncserver/usr/share/doc/tigervncserver
rm $(CURDIR)/debian/tigervncserver/usr/lib/xorg/modules/extensions/libvnc.la
rm $(CURDIR)/debian/tigervncserver/usr/bin/vncviewer
rm $(CURDIR)/debian/tigervncserver/usr/share/man/man1/vncviewer.1
install -o root -g root -m 755 -D $(CURDIR)/debian/local/vncserver.service \
$(CURDIR)/debian/tigervncserver/etc/init.d/vncserver
install -o root -g root -m 644 -D $(CURDIR)/debian/local/vncserver.sysconfig \
$(CURDIR)/debian/tigervncserver/etc/default/vncservers
# xtigervncviewer
(cd vncviewer; make install DESTDIR=$(CURDIR)/debian/xtigervncviewer)
# Install desktop stuff
mv $(CURDIR)/debian/xtigervncviewer/usr/bin/vncviewer \
$(CURDIR)/debian/xtigervncviewer/usr/bin/xtigervncviewer
mv $(CURDIR)/debian/xtigervncviewer/usr/share/man/man1/vncviewer.1 \
$(CURDIR)/debian/xtigervncviewer/usr/share/man/man1/xtigervncviewer.1
# tigervnc-java
mkdir -p $(CURDIR)/debian/tigervnc-java/usr/share
(cd java; make install DESTDIR=$(CURDIR)/debian/tigervnc-java/usr/share)
#dh_movefiles
# Build architecture-independent files here.
# Pass -i to all debhelper commands in this target to reduce clutter.
binary-indep: build install
binary-indep-keep:
dh_testdir -i
dh_testroot -i
# dh_installdebconf -i
dh_install
dh_installdocs -i
dh_installexamples -i
dh_installmenu -i
# dh_installlogrotate -i
# dh_installemacsen -i
# dh_installpam -i
# dh_installmime -i
# dh_installinit -i
dh_installcron -i
dh_installman -i
dh_installinfo -i
# dh_undocumented -i
dh_installchangelogs -i
dh_link -i
dh_compress -i
dh_fixperms -i
dh_installdeb -i
dh_perl -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir -a
dh_testroot -a
# dh_installdebconf -a
dh_installdocs -a
# dh_installexamples -a
dh_installmenu -a
# dh_installlogrotate -a
# dh_installemacsen -a
# dh_installpam -a
# dh_installmime -a
dh_install
dh_installinit -a
# dh_installcron -a
dh_installman -a
dh_installinfo -a
# dh_undocumented -a
dh_installchangelogs -a
# Remove empty directories
dh_strip -a
dh_link -a
dh_compress -a
dh_fixperms -a
dh_makeshlibs -a
dh_installdeb -a
dh_perl -a
dh_shlibdeps -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install get-orig-source

View File

@@ -0,0 +1 @@
3.0 (quilt)

View File

@@ -0,0 +1,32 @@
#!/bin/sh
set -e
if [ "$1" = "configure" ]; then
MAN=/usr/share/man/man1
BIN=/usr/bin
update-alternatives --install \
$BIN/vncserver vncserver $BIN/tigervncserver 64 \
--slave \
$MAN/vncserver.1.gz vncserver.1.gz $MAN/tigervncserver.1.gz
update-alternatives --install \
$BIN/Xvnc Xvnc $BIN/Xtigervnc 74 \
--slave \
$MAN/Xvnc.1.gz Xvnc.1.gz $MAN/Xtigervnc.1.gz
update-alternatives --install \
$BIN/x0vncserver x0vncserver $BIN/x0tigervncserver 74 \
--slave \
$MAN/x0vncserver.1.gz x0vncserver.1.gz $MAN/x0tigervncserver.1.gz
update-alternatives --install \
$BIN/vncpasswd vncpasswd $BIN/tigervncpasswd 74 \
--slave \
$MAN/vncpasswd.1.gz vncpasswd.1.gz $MAN/tigervncpasswd.1.gz
update-alternatives --install \
$BIN/vncconfig vncconfig $BIN/tigervncconfig 64 \
--slave \
$MAN/vncconfig.1.gz vncconfig.1.gz $MAN/tigervncconfig.1.gz
fi
#DEBHELPER#
exit 0

View File

@@ -0,0 +1,21 @@
#!/bin/sh
set -e
if [ "$1" = "remove" ] ; then
BIN=/usr/bin
update-alternatives --remove \
vncserver $BIN/tigervncserver
update-alternatives --remove \
Xvnc $BIN/Xtigervnc
update-alternatives --remove \
x0vncserver $BIN/x0tigervncserver
update-alternatives --remove \
vncpasswd $BIN/tigervncpasswd
update-alternatives --remove \
tigervncconfig $BIN/tigervncconfig
fi
#DEBHELPER#
exit 0

View File

@@ -0,0 +1,5 @@
?package(xtigervncviewer):needs="x11" \
section="Applications/Network/Communication" \
hints="VNC,remote-control"\
title="xtigervncviewer" \
command="/usr/bin/xtigervncviewer"

View File

@@ -0,0 +1,18 @@
#!/bin/sh -e
if [ "$1" = "configure" ]; then
MAN=/usr/share/man/man1
BIN=/usr/bin
update-alternatives --install \
$BIN/vncviewer vncviewer $BIN/xtigervncviewer 74 \
--slave \
$MAN/vncviewer.1.gz vncviewer.1.gz $MAN/xtigervncviewer.1.gz \
--slave \
$MAN/xvncviewer.1.gz xvncviewer.1.gz $MAN/xtigervncviewer.1.gz \
--slave \
$BIN/xvncviewer xvncviewer $BIN/xtigervncviewer
fi
#DEBHELPER#
exit 0

View File

@@ -0,0 +1,11 @@
#!/bin/sh -e
if [ "$1" = "remove" ] ; then
BIN=/usr/bin
update-alternatives --remove \
vncviewer $BIN/xtigervncviewer
fi
#DEBHELPER#
exit 0

View File

@@ -0,0 +1,38 @@
tigervnc (1.6.80-4) xenial; urgency=low
* Build using libfltk1.3-dev as provided by ubuntu.
* Build using xorg-server-source as provided by ubuntu.
-- Dominik Muth <dominik.muth@gmx.de> Thu, 07 Apr 2016 22:17:09 +0200
tigervnc (1.3.0-3ubuntu1) precise; urgency=low
* Build Xvnc against native upstream xorg sources, using native config
options. Use distro-specific fltk1.3 sources.
-- Brian P. Hinz <bphinz@users.sourceforge.net> Sun, 14 Jul 2013 15:22:28 -0400
tigervnc (1.3.0-3) precise; urgency=low
* Additional dependencies (derived from ldd | dpkg -S).
-- Brian P. Hinz <bphinz@users.sourceforge.net> Sun, 07 Jul 2013 11:01:33 -0400
tigervnc (1.3.0-2) precise; urgency=low
* Added build dependencies to improve font support in viewer.
-- Brian P. Hinz <bphinz@users.sourceforge.net> Sun, 07 Jul 2013 10:44:05 -0400
tigervnc (1.3.0-1) precise; urgency=low
* Removed java viewer from server package. Fixed typo in server
dependencies.
-- Brian P. Hinz <bphinz@users.sourceforge.net> Sun, 07 Jul 2013 09:55:44 -0400
tigervnc (1.3.0) precise; urgency=low
* Initial release.
-- Brian P. Hinz <bphinz@users.sourceforge.net> Fri, 05 Jul 2013 00:47:02 -0400

View File

@@ -0,0 +1 @@
9

View File

@@ -0,0 +1,70 @@
Source: tigervnc
Section: x11
Priority: optional
Maintainer: Brian P. Hinz <bphinz@users.sourceforge.net>
Standards-Version: 3.8.4
Build-Depends: debhelper (>> 7.1), zlib1g-dev, libjpeg-turbo8-dev, libxaw7-dev (>> 4.1.0), perl-modules, xfonts-base, xutils-dev, libx11-dev, libxau-dev, libxext-dev, libxi-dev, libxkbfile-dev, libxmu-dev, libxt-dev, x11proto-core-dev, cmake (>> 2.8), libgnutls-dev, libpam0g-dev, libpng12-dev, automake, autoconf, libtool, pkg-config, libpixman-1-dev, x11proto-bigreqs-dev, x11proto-composite-dev, x11proto-damage-dev, x11proto-dri2-dev, x11proto-fixes-dev, x11proto-fonts-dev, x11proto-gl-dev, x11proto-input-dev, x11proto-kb-dev, x11proto-randr-dev, x11proto-render-dev, x11proto-resource-dev, x11proto-scrnsaver-dev, x11proto-video-dev, x11proto-xext-dev, x11proto-xf86bigfont-dev, x11proto-xf86dga-dev, x11proto-xf86dri-dev, x11proto-xf86vidmode-dev, x11proto-xinerama-dev, libosmesa6-dev, libgl1-mesa-dev, libgl1-mesa-dri, libgl1-mesa-glx, libxfont-dev, x11proto-record-dev, default-jdk, libxtst-dev, libxft-dev, libexpat1-dev, libfontconfig1-dev, libxrender-dev, libpciaccess-dev, curl, bzip2, quilt, libglu1-mesa-dev, libxcursor-dev, libxinerama-dev, libxfixes-dev, libcairo2-dev, x11proto-dri3-dev, libgcrypt20-dev, x11proto-xcmisc-dev, x11proto-present-dev, xorg-server-source, libfltk1.3-dev, fluid
Homepage: http://www.tigervnc.com
Package: tigervncserver
Architecture: any
Provides: xserver, vnc-server
Depends: x11-common | xserver-common, x11-utils, xauth, libbz2-1.0, libc6, libfontenc1, libfreetype6, libgcc1, libgl1-mesa-dri, libgnutls30, libjpeg-turbo8, libp11-kit0, libpam0g, libpixman-1-0, libstdc++6, libtasn1-3-bin, libx11-6, libxau6, libxcb1, libxdmcp6, libxext6, libxfont1, libxfont1-dev, libxtst6, zlib1g, libglu1-mesa, libxcursor1, libxinerama1, libxfixes3, x11-xkb-utils, libgcrypt20
Recommends: xfonts-base, x11-xserver-utils
Suggests: xtigervncviewer, tigervnc-java
Description: virtual network computing server software
Virtual Network Computing (VNC) is a remote display system which allows you to
view and interact with a virtual desktop environment that is running on another
computer on the network. Using VNC, you can run graphical applications on a
remote machine and send only the display from these applications to your local
machine. VNC is platform-independent and supports a wide variety of operating
systems and architectures as both servers and clients.
.
TigerVNC is a high-speed version of VNC based on the RealVNC 4 and X.org code
bases. TigerVNC started as a next-generation development effort for TightVNC
on Unix and Linux platforms, but it split from its parent project in early 2009
so that TightVNC could focus on Windows platforms. TigerVNC supports a variant
of Tight encoding that is greatly accelerated by the use of the libjpeg-turbo
JPEG codec.
Package: xtigervncviewer
Architecture: any
Provides: vncviewer, vnc-viewer
Depends: libc6, libexpat1, libfontconfig1, libfreetype6, libgcc1, libgnutls30, libjpeg-turbo8, libp11-kit0, libpng12-0, libstdc++6, libtasn1-3-bin, libx11-6, libxau6, libxcb1, libxdmcp6, libxext6, libxft2, libxrender1, zlib1g, libglu1-mesa, libxcursor1, libxinerama1, libxfixes3, libfltk1.3, libfltk-images1.3
Recommends: xfonts-base
Suggests: tigervncserver, ssh
Description: virtual network computing client software for X
Virtual Network Computing (VNC) is a remote display system which allows you to
view and interact with a virtual desktop environment that is running on another
computer on the network. Using VNC, you can run graphical applications on a
remote machine and send only the display from these applications to your local
machine. VNC is platform-independent and supports a wide variety of operating
systems and architectures as both servers and clients.
.
TigerVNC is a high-speed version of VNC based on the RealVNC 4 and X.org code
bases. TigerVNC started as a next-generation development effort for TightVNC
on Unix and Linux platforms, but it split from its parent project in early 2009
so that TightVNC could focus on Windows platforms. TigerVNC supports a variant
of Tight encoding that is greatly accelerated by the use of the libjpeg-turbo
JPEG codec.
Package: tigervnc-java
Architecture: any
Suggests: tigervncserver
Provides: vncviewer, vnc-viewer
Depends: default-jre
Description: TigerVNC java applet
Virtual Network Computing (VNC) is a remote display system which allows you to
view and interact with a virtual desktop environment that is running on another
computer on the network. Using VNC, you can run graphical applications on a
remote machine and send only the display from these applications to your local
machine. VNC is platform-independent and supports a wide variety of operating
systems and architectures as both servers and clients.
.
TigerVNC is a high-speed version of VNC based on the RealVNC 4 and X.org code
bases. TigerVNC started as a next-generation development effort for TightVNC
on Unix and Linux platforms, but it split from its parent project in early 2009
so that TightVNC could focus on Windows platforms. TigerVNC supports a variant
of Tight encoding that is greatly accelerated by the use of the libjpeg-turbo
JPEG codec.

View File

@@ -0,0 +1,116 @@
This package was packaged for Debian by Brian P. Hinz <bphinz@users.sourceforge.net>
on Tue, 02 Jul 2013 21:33:24 +0500 using the tightvnc package as a base.
It was downloaded from:
http://www.tigervnc.org/
COPYRIGHT:
==========
TigerVNC is
Copyright (C) 1999 AT&T Laboratories Cambridge
Copyright (C) 2002-2005 RealVNC Ltd.
Copyright (C) 2000-2006 TightVNC Group
Copyright (C) 2005-2006 Martin Koegler
Copyright (C) 2005-2006 Sun Microsystems, Inc.
Copyright (C) 2006 OCCAM Financial Technology
Copyright (C) 2000-2008 Constantin Kaplinsky
Copyright (C) 2004-2009 Peter Astrand for Cendio AB
Copyright (C) 2010 Antoine Martin
Copyright (C) 2010 m-privacy GmbH
Copyright (C) 2009-2011 D. R. Commander
Copyright (C) 2009-2011 Pierre Ossman for Cendio AB
Copyright (C) 2004, 2009-2011 Red Hat, Inc.
Copyright (C) 2009-2011 TigerVNC Team
All Rights Reserved.
This software is distributed under the GNU General Public Licence as published
by the Free Software Foundation. See the file LICENCE.TXT for the conditions
under which this software is made available. TigerVNC also contains code from
other sources. See the Acknowledgements section below, and the individual
source files, for details of the conditions under which they are made
available.
ACKNOWLEDGEMENTS
================
This distribution contains zlib compression software. This is:
Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Jean-loup Gailly Mark Adler
jloup@gzip.org madler@alumni.caltech.edu
The data format used by the zlib library is described by RFCs (Request for
Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt
(zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
This distribution contains public domain DES software by Richard Outerbridge.
This is:
Copyright (c) 1988,1989,1990,1991,1992 by Richard Outerbridge.
(GEnie : OUTER; CIS : [71755,204]) Graven Imagery, 1992.
This distribution contains software from the X Window System. This is:
Copyright 1987, 1988, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.

View File

@@ -0,0 +1,94 @@
#!/bin/bash
#
# Init file for TigerVNC Server
#
# chkconfig: - 91 35
# description: TigerVNC remote X administration daemon.
#
# processname: Xvnc
### BEGIN INIT INFO
# Provides: vncservers
# Required-Start: networking
# Required-Stop: networking
# Default-Start:
# Default-Stop: 0 1 2 3 4 5 6
# Short-Description: Starts and stops vncserver
# Description: Used to provide remote X administration services.
### END INIT INFO
# Source function library.
. /lib/lsb/init-functions
### Default variables
SYSCONFIG="/etc/default/vncservers"
VNCSERVERS=""
### Read configuration
[ -r "$SYSCONFIG" ] && . "$SYSCONFIG"
RETVAL=0
prog=$"VNC server"
start() {
echo -n $"Starting $prog: "
ulimit -S -c 0 >/dev/null 2>&1
for display in ${VNCSERVERS}; do
echo -n "${display} "
if [ -r $(eval echo ~${display##*:})/.vnc/passwd ]; then
unset BASH_ENV ENV
log_begin_msg "Starting VNC Server for user ${display##*:}:"
su ${display##*:} -c "cd ~${display##*:} && [ -f .vnc/passwd ] && vncserver :${display%%:*} ${VNCSERVERARGS[${display%:*}]}"
RETVAL="$?"
if [ "$RETVAL" -ne 0 ]; then
log_end_msg 1
break
else
log_end_msg 0
fi
else
log_begin_msg "Not starting VNC Server for user ${display##*:}.\n File \"~${display##*:}/.vnc/passwd\" not found.\n Create a password file for the VNC server with vncpasswd"
log_end_msg 1
fi
done
echo
[ "$RETVAL" -eq 0 ] && touch "/var/lock/vncserver"
return $RETVAL
}
stop() {
echo -n $"Shutting down $desc: "
for display in ${VNCSERVERS}; do
echo -n "${display} "
unset BASH_ENV ENV
log_begin_msg "Shutting down VNC Server for user ${display##*:}: "
su ${display##*:} -c "vncserver -kill :${display%%:*}" >/dev/null 2>&1
RETVAL="$?"
[ "$RETVAL" -eq 0 ] && log_end_msg 0 || log_end_msg 1
done
echo
[ "$RETVAL" -eq 0 ] && rm -f "/var/lock/vncserver"
return $RETVAL
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
restart
;;
*)
echo $"Usage: $0 {start|stop|restart}"
RETVAL=1
esac
exit $RETVAL

View File

@@ -0,0 +1,19 @@
# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the lines below to start a VNC server on display :2
# as my 'myusername' (adjust this to your own). You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted! For a secure way of using VNC, see this URL:
# http://kbase.redhat.com/faq/docs/DOC-7028
# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel. See the "-via" option in the
# `man vncviewer' manual page.
# VNCSERVERS="2:myusername"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"

View File

@@ -0,0 +1,286 @@
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 by Joey Hess.
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
CFLAGS := $(shell dpkg-buildflags --get CFLAGS)
CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS)
LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
export CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
confflags += --build=$(DEB_HOST_GNU_TYPE)
else
confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
endif
SOURCE_NAME := tigervnc
SOURCE_VERSION := $(shell dpkg-parsechangelog | awk -F': ' '/^Version: / {print $$2}')
BUILDER=For technical support please see http://sourceforge.net/projects/tigervnc/support
libdir = /usr/lib/$(DEB_HOST_MULTIARCH)
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CFLAGS += -g -O2 -fPIC
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
export CC = gcc
# use xorg sources as shipped in xorg-server-source package
XORG_SOURCE_ARCHIVE = /usr/src/xorg-server.tar.xz
xorg-source-stamp: $(XORG_SOURCE_ARCHIVE)
tar -C unix/xserver -axf $(XORG_SOURCE_ARCHIVE) --strip-components=1
patch -p1 < debian/xorg-source-patches/xserver118-patch.patch
cd unix/xserver && patch -p1 < ../xserver118.patch
patch -p1 < debian/xorg-source-patches/100_rethrow_signals.patch
patch -p1 < debian/xorg-source-patches/516_tigervnc-xorg-manpages.patch
touch xorg-source-stamp
configure: config-stamp
config-stamp: xorg-source-stamp
dh_testdir
# Add here commands to configure the package.
cmake -G"Unix Makefiles" \
-DBUILD_STATIC=off \
-DCMAKE_INSTALL_PREFIX=/usr
(cd unix/xserver; \
export PIXMANINCDIR=/usr/include/pixman-1; \
autoreconf -fiv; \
patch -p1 -i ../../debian/xorg-source-patches/debian_libtool.patch; \
./configure --prefix=/usr \
--disable-silent-rules \
--disable-static \
--without-dtrace \
--disable-strict-compilation \
--disable-debug \
--disable-unit-tests \
--with-int10=x86emu \
--with-extra-module-dir="/usr/lib/${DEB_HOST_MULTIARCH}/xorg/extra-modules,/usr/lib/xorg/extra-modules" \
--with-os-vendor="$(VENDOR)" \
--with-builderstring="$(SOURCE_NAME) $(SOURCE_VERSION) ($(BUILDER))" \
--with-xkb-path=/usr/share/X11/xkb \
--with-xkb-output=/var/lib/xkb \
--with-default-xkb-rules=evdev \
--disable-devel-docs \
--enable-mitshm \
--enable-xres \
--disable-xcsecurity \
--disable-tslib \
--enable-dbe \
--disable-xf86bigfont \
--disable-dpms \
--disable-config-hal \
--disable-config-udev \
--disable-xorg \
--disable-xquartz \
--disable-xwin \
--disable-xfake \
--disable-install-setuid \
--with-default-font-path="/usr/share/fonts/X11/misc,/usr/share/fonts/X11/cyrillic,/usr/share/fonts/X11/100dpi/:unscaled,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Type1,/usr/share/fonts/X11/100dpi,/usr/share/fonts/X11/75dpi,/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType,built-ins" \
--enable-aiglx \
--enable-composite \
--enable-record \
--enable-xv \
--enable-xvmc \
--enable-dga \
--enable-screensaver \
--enable-xdmcp \
--enable-xdm-auth-1 \
--enable-glx \
--disable-dri --enable-dri2 --enable-dri3 \
--enable-xinerama \
--enable-xf86vidmode \
--enable-xace \
--enable-xfree86-utils \
--disable-dmx \
--disable-xvfb \
--disable-xnest \
--disable-kdrive \
--disable-xephyr \
--enable-xfbdev \
--with-sha1=libgcrypt \
--enable-xcsecurity \
--disable-docs \
--disable-selective-werror)
touch config-stamp
build-arch: config-stamp build-arch-stamp
build-arch-stamp:
dh_testdir
# Add here command to compile/build the package.
# Build first things.
# Build Xvnc
make LDFLAGS="-lpng"
(cd unix/xserver;make)
touch build-arch-stamp
build-indep: config-stamp build-indep-stamp
build-indep-stamp:
dh_testdir
# Add here command to compile/build the arch indep package.
# It's ok not to do anything here, if you don't need to build
# anything for this package.
#/usr/bin/docbook-to-man debian/vnc.sgml > vnc.1
(cd media;make)
(cd java;cmake -G"Unix Makefiles";make)
touch build-indep-stamp
build: build-arch build-indep
clean:
dh_testdir
dh_testroot
rm -f build-arch-stamp build-indep-stamp config-stamp
# Add here commands to clean up after the build process.
dh_clean
install: DH_OPTIONS=
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_prep
dh_installdirs
# Add here commands to install the package into debian/vnc.
make install DESTDIR=$(CURDIR)/debian/tigervncserver
(cd unix/xserver/hw/vnc; make install DESTDIR=$(CURDIR)/debian/tigervncserver)
# rename server files to tigervnc specific names
mv $(CURDIR)/debian/tigervncserver/usr/bin/Xvnc \
$(CURDIR)/debian/tigervncserver/usr/bin/Xtigervnc
mv $(CURDIR)/debian/tigervncserver/usr/bin/vncconfig \
$(CURDIR)/debian/tigervncserver/usr/bin/tigervncconfig
mv $(CURDIR)/debian/tigervncserver/usr/bin/vncpasswd \
$(CURDIR)/debian/tigervncserver/usr/bin/tigervncpasswd
mv $(CURDIR)/debian/tigervncserver/usr/bin/vncserver \
$(CURDIR)/debian/tigervncserver/usr/bin/tigervncserver
mv $(CURDIR)/debian/tigervncserver/usr/bin/x0vncserver \
$(CURDIR)/debian/tigervncserver/usr/bin/x0tigervncserver
mv $(CURDIR)/debian/tigervncserver/usr/share/man/man1/vncconfig.1 \
$(CURDIR)/debian/tigervncserver/usr/share/man/man1/tigervncconfig.1
mv $(CURDIR)/debian/tigervncserver/usr/share/man/man1/vncpasswd.1 \
$(CURDIR)/debian/tigervncserver/usr/share/man/man1/tigervncpasswd.1
mv $(CURDIR)/debian/tigervncserver/usr/share/man/man1/vncserver.1 \
$(CURDIR)/debian/tigervncserver/usr/share/man/man1/tigervncserver.1
mv $(CURDIR)/debian/tigervncserver/usr/share/man/man1/x0vncserver.1 \
$(CURDIR)/debian/tigervncserver/usr/share/man/man1/x0tigervncserver.1
mv $(CURDIR)/debian/tigervncserver/usr/share/man/man1/Xvnc.1 \
$(CURDIR)/debian/tigervncserver/usr/share/man/man1/Xtigervnc.1
# delete development files
rm -f $(CURDIR)/debian/tigervncserver/usr/lib/xorg/modules/extensions/libvnc.la
# install server service
install -o root -g root -m 755 -D $(CURDIR)/debian/local/vncserver.service \
$(CURDIR)/debian/tigervncserver/etc/init.d/vncserver
install -o root -g root -m 644 -D $(CURDIR)/debian/local/vncserver.sysconfig \
$(CURDIR)/debian/tigervncserver/etc/default/vncservers
# move viewer files to viewer package, rename on the fly
mkdir -p $(CURDIR)/debian/xtigervncviewer/usr/bin
mv $(CURDIR)/debian/tigervncserver/usr/bin/vncviewer \
$(CURDIR)/debian/xtigervncviewer/usr/bin/xtigervncviewer
mkdir -p $(CURDIR)/debian/xtigervncviewer/usr/share/man/man1
mv $(CURDIR)/debian/tigervncserver/usr/share/man/man1/vncviewer.1 \
$(CURDIR)/debian/xtigervncviewer/usr/share/man/man1/xtigervncviewer.1
mkdir -p $(CURDIR)/debian/xtigervncviewer/usr/share
mv $(CURDIR)/debian/tigervncserver/usr/share/applications \
$(CURDIR)/debian/xtigervncviewer/usr/share/
mkdir -p $(CURDIR)/debian/xtigervncviewer/usr/share
mv $(CURDIR)/debian/tigervncserver/usr/share/icons \
$(CURDIR)/debian/xtigervncviewer/usr/share/
# tigervnc-java
mkdir -p $(CURDIR)/debian/tigervnc-java/usr/share
(cd java; make install DESTDIR=$(CURDIR)/debian/tigervnc-java/usr/share)
# install additional license files
mkdir -p $(CURDIR)/debian/xtigervncviewer/usr/share/doc/xtigervncviewer
cp $(CURDIR)/debian/tigervncserver/usr/share/doc/tigervnc-*/* \
$(CURDIR)/debian/xtigervncviewer/usr/share/doc/xtigervncviewer/
mkdir -p $(CURDIR)/debian/tigervnc-java/usr/share/doc/tigervnc-java
cp $(CURDIR)/debian/tigervncserver/usr/share/doc/tigervnc-*/* \
$(CURDIR)/debian/tigervnc-java/usr/share/doc/tigervnc-java/
mkdir -p $(CURDIR)/debian/tigervncserver/usr/share/doc/tigervncserver
mv $(CURDIR)/debian/tigervncserver/usr/share/doc/tigervnc-*/* \
$(CURDIR)/debian/tigervncserver/usr/share/doc/tigervncserver/
rm -rf $(CURDIR)/debian/tigervncserver/usr/share/doc/tigervnc-*/
# dh_movefiles
# Build architecture-independent files here.
# Pass -i to all debhelper commands in this target to reduce clutter.
binary-indep: build install
binary-indep-keep:
dh_testdir -i
dh_testroot -i
# dh_installdebconf -i
dh_install
dh_installdocs -i
dh_installexamples -i
dh_installmenu -i
# dh_installlogrotate -i
# dh_installemacsen -i
# dh_installpam -i
# dh_installmime -i
# dh_installinit -i
dh_installcron -i
dh_installman -i
dh_installinfo -i
# dh_undocumented -i
dh_installchangelogs -i
dh_link -i
dh_compress -i
dh_fixperms -i
dh_installdeb -i
dh_perl -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir -a
dh_testroot -a
# dh_installdebconf -a
dh_installdocs -a
# dh_installexamples -a
dh_installmenu -a
# dh_installlogrotate -a
# dh_installemacsen -a
# dh_installpam -a
# dh_installmime -a
dh_install
dh_installinit -a
# dh_installcron -a
dh_installman -a
dh_installinfo -a
# dh_undocumented -a
dh_installchangelogs -a
# Remove empty directories
dh_strip -a
dh_link -a
dh_compress -a
dh_fixperms -a
dh_makeshlibs -a
dh_installdeb -a
dh_perl -a
dh_shlibdeps -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install

View File

@@ -0,0 +1 @@
3.0 (quilt)

View File

@@ -0,0 +1,32 @@
#!/bin/sh
set -e
if [ "$1" = "configure" ]; then
MAN=/usr/share/man/man1
BIN=/usr/bin
update-alternatives --install \
$BIN/vncserver vncserver $BIN/tigervncserver 64 \
--slave \
$MAN/vncserver.1.gz vncserver.1.gz $MAN/tigervncserver.1.gz
update-alternatives --install \
$BIN/Xvnc Xvnc $BIN/Xtigervnc 74 \
--slave \
$MAN/Xvnc.1.gz Xvnc.1.gz $MAN/Xtigervnc.1.gz
update-alternatives --install \
$BIN/x0vncserver x0vncserver $BIN/x0tigervncserver 74 \
--slave \
$MAN/x0vncserver.1.gz x0vncserver.1.gz $MAN/x0tigervncserver.1.gz
update-alternatives --install \
$BIN/vncpasswd vncpasswd $BIN/tigervncpasswd 74 \
--slave \
$MAN/vncpasswd.1.gz vncpasswd.1.gz $MAN/tigervncpasswd.1.gz
update-alternatives --install \
$BIN/vncconfig vncconfig $BIN/tigervncconfig 64 \
--slave \
$MAN/vncconfig.1.gz vncconfig.1.gz $MAN/tigervncconfig.1.gz
fi
#DEBHELPER#
exit 0

View File

@@ -0,0 +1,21 @@
#!/bin/sh
set -e
if [ "$1" = "remove" ] ; then
BIN=/usr/bin
update-alternatives --remove \
vncserver $BIN/tigervncserver
update-alternatives --remove \
Xvnc $BIN/Xtigervnc
update-alternatives --remove \
x0vncserver $BIN/x0tigervncserver
update-alternatives --remove \
vncpasswd $BIN/tigervncpasswd
update-alternatives --remove \
tigervncconfig $BIN/tigervncconfig
fi
#DEBHELPER#
exit 0

View File

@@ -0,0 +1,26 @@
--- a/unix/xserver/hw/vnc/xvnc.c 2013-07-14 14:05:29.963390223 -0400
+++ b/unix/xserver/hw/vnc/xvnc.c 2013-07-14 14:04:12.840357191 -0400
@@ -250,7 +250,7 @@
#if XORG < 111
AbortDDX()
#else
-AbortDDX(enum ExitCode error)
+SigAbortDDX(int signo, enum ExitCode error)
#endif
{
#if XORG < 111
@@ -260,6 +260,14 @@
#endif
}
+#if XORG >= 111
+void
+AbortDDX(enum ExitCode error)
+{
+ SigAbortDDX(0, error);
+}
+#endif
+
#ifdef __DARWIN__
void
DarwinHandleGUI(int argc, char *argv[])

View File

@@ -0,0 +1,10 @@
--- a/unix/xserver/man/Makefile.am 2013-03-30 17:51:01.707258746 -0400
+++ b/unix/xserver/man/Makefile.am 2013-03-30 17:51:47.606569692 -0400
@@ -2,5 +2,7 @@
# (i.e. those handled in the os/utils.c options processing instead of in
# the DDX-level options processing)
+if ENABLE_DOCS
include $(top_srcdir)/manpages.am
appman_PRE = Xserver.man
+endif ENABLE_DOCS

View File

@@ -0,0 +1,87 @@
Index: a/ltmain.sh
===================================================================
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -7890,19 +7890,19 @@
# It is a libtool convenience library, so add in its objects.
func_append convenience " $ladir/$objdir/$old_library"
func_append old_convenience " $ladir/$objdir/$old_library"
- tmp_libs=
- for deplib in $dependency_libs; do
- deplibs="$deplib $deplibs"
- if $opt_preserve_dup_deps; then
- case "$tmp_libs " in
- *" $deplib "*) func_append specialdeplibs " $deplib" ;;
- esac
- fi
- func_append tmp_libs " $deplib"
- done
elif test prog != "$linkmode" && test lib != "$linkmode"; then
func_fatal_error "'$lib' is not a convenience library"
fi
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ deplibs="$deplib $deplibs"
+ if $opt_preserve_dup_deps; then
+ case "$tmp_libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append tmp_libs " $deplib"
+ done
continue
fi # $pass = conv
## Do not link against deplibs. This is not needed for shared libs
## on atleast ELF systems since those already know which libs they
## need themself. This seems to break a few things and will be fixed
## in a better way in a future upstream version.
Index: a/ltmain.sh
===================================================================
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -7568,10 +7568,7 @@
case $pass in
dlopen) libs=$dlfiles ;;
dlpreopen) libs=$dlprefiles ;;
- link)
- libs="$deplibs %DEPLIBS%"
- test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
- ;;
+ link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
esac
fi
if test lib,dlpreopen = "$linkmode,$pass"; then
Index: a/m4/libtool.m4
===================================================================
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -4936,9 +4936,6 @@
;;
esac
;;
- linux* | k*bsd*-gnu | gnu*)
- _LT_TAGVAR(link_all_deplibs, $1)=no
- ;;
*)
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
;;
@@ -4998,9 +5001,6 @@
openbsd* | bitrig*)
with_gnu_ld=no
;;
- linux* | k*bsd*-gnu | gnu*)
- _LT_TAGVAR(link_all_deplibs, $1)=no
- ;;
esac
_LT_TAGVAR(ld_shlibs, $1)=yes
@@ -5773,7 +5779,6 @@
if test yes = "$lt_cv_irix_exported_symbol"; then
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
fi
- _LT_TAGVAR(link_all_deplibs, $1)=no
else
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'

View File

@@ -0,0 +1,22 @@
--- a/unix/xserver118.patch 2016-05-07 15:32:50.000000000 -0400
+++ b/unix/xserver118.patch 2016-04-28 07:11:31.000000000 -0400
@@ -48,14 +48,15 @@
diff -ur xorg-server.orig/hw/Makefile.am xorg-server/hw/Makefile.am
--- xorg-server.orig/hw/Makefile.am 2016-04-09 21:28:27.059999965 +0200
+++ xorg-server/hw/Makefile.am 2016-04-09 21:28:57.587999860 +0200
-@@ -43,6 +43,7 @@
+@@ -43,7 +43,8 @@
$(KDRIVE_SUBDIRS) \
$(XQUARTZ_SUBDIRS) \
-- $(XWAYLAND_SUBDIRS)
-+ $(XWAYLAND_SUBDIRS) \
+ $(XWAYLAND_SUBDIRS) \
+- $(XMIR_SUBDIRS)
++ $(XMIR_SUBDIRS) \
+ vnc
- DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive xwayland
+ DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive xwayland xmir
diff -ur xorg-server.orig/mi/miinitext.c xorg-server/mi/miinitext.c
--- xorg-server.orig/mi/miinitext.c 2016-04-09 21:28:27.015999965 +0200

View File

@@ -0,0 +1,5 @@
?package(xtigervncviewer):needs="x11" \
section="Applications/Network/Communication" \
hints="VNC,remote-control"\
title="xtigervncviewer" \
command="/usr/bin/xtigervncviewer"

View File

@@ -0,0 +1,18 @@
#!/bin/sh -e
if [ "$1" = "configure" ]; then
MAN=/usr/share/man/man1
BIN=/usr/bin
update-alternatives --install \
$BIN/vncviewer vncviewer $BIN/xtigervncviewer 74 \
--slave \
$MAN/vncviewer.1.gz vncviewer.1.gz $MAN/xtigervncviewer.1.gz \
--slave \
$MAN/xvncviewer.1.gz xvncviewer.1.gz $MAN/xtigervncviewer.1.gz \
--slave \
$BIN/xvncviewer xvncviewer $BIN/xtigervncviewer
fi
#DEBHELPER#
exit 0

View File

@@ -0,0 +1,11 @@
#!/bin/sh -e
if [ "$1" = "remove" ] ; then
BIN=/usr/bin
update-alternatives --remove \
vncviewer $BIN/xtigervncviewer
fi
#DEBHELPER#
exit 0

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,26 @@
diff --git a/include/dix.h b/include/dix.h
index 21176a8..921156b 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -80,7 +80,7 @@ SOFTWARE.
#define REQUEST_FIXED_SIZE(req, n)\
if (((sizeof(req) >> 2) > client->req_len) || \
- ((n >> 2) >= client->req_len) || \
+ (((n) >> 2) >= client->req_len) || \
((((uint64_t) sizeof(req) + (n) + 3) >> 2) != (uint64_t) client->req_len)) \
return(BadLength)
diff --git a/os/access.c b/os/access.c
index f393c8d..28f2d32 100644
--- a/os/access.c
+++ b/os/access.c
@@ -1308,7 +1308,7 @@ GetHosts(void **data, int *pnHosts, int *pLen, BOOL * pEnabled)
}
for (host = validhosts; host; host = host->next) {
len = host->len;
- if ((ptr + sizeof(xHostEntry) + len) > (data + n))
+ if ((ptr + sizeof(xHostEntry) + len) > ((unsigned char *) *data + n))
break;
((xHostEntry *) ptr)->family = host->family;
((xHostEntry *) ptr)->length = len;

View File

@@ -0,0 +1,80 @@
From 39547d600a13713e15429f49768e54c3173c828d Mon Sep 17 00:00:00 2001
From: Karl Tomlinson <xmail@karlt.net>
Date: Mon, 18 Feb 2013 01:25:34 +0000
Subject: MakeBigReq: don't move the last word, already handled by Data32
MakeBigReq inserts a length field after the first 4 bytes of the request
(after req->length), pushing everything else back by 4 bytes.
The current memmove moves everything but the first 4 bytes back.
If a request aligns to the end of the buffer pointer when MakeBigReq is
invoked for that request, this runs over the buffer.
Instead, we need to memmove minus the first 4 bytes (which aren't moved),
minus the last 4 bytes (so we still align to the previous tail).
The 4 bytes that fell out are already handled with Data32, which will
handle the buffermax correctly.
The case where req->length = 1 was already not functional.
Reported by Abhishek Arya <inferno@chromium.org>.
https://bugzilla.mozilla.org/show_bug.cgi?id=803762
Reviewed-by: Jeff Muizelaar <jmuizelaar@mozilla.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
diff --git a/include/X11/Xlibint.h b/include/X11/Xlibint.h
index 40965c4..06395b3 100644
--- a/include/X11/Xlibint.h
+++ b/include/X11/Xlibint.h
@@ -486,6 +486,14 @@ extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len);
req = (xReq *) _XGetRequest(dpy, X_/**/name, SIZEOF(xReq))
#endif
+/*
+ * MakeBigReq sets the CARD16 "req->length" to 0 and inserts a new CARD32
+ * length, after req->length, before the data in the request. The new length
+ * includes the "n" extra 32-bit words.
+ *
+ * Do not use MakeBigReq if there is no data already in the request.
+ * req->length must already be >= 2.
+ */
#ifdef WORD64
#define MakeBigReq(req,n) \
{ \
@@ -493,7 +501,7 @@ extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len);
CARD32 _BRlen = req->length - 1; \
req->length = 0; \
_BRdat = ((CARD32 *)req)[_BRlen]; \
- memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \
+ memmove(((char *)req) + 8, ((char *)req) + 4, (_BRlen - 1) << 2); \
((CARD32 *)req)[1] = _BRlen + n + 2; \
Data32(dpy, &_BRdat, 4); \
}
@@ -504,13 +512,20 @@ extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len);
CARD32 _BRlen = req->length - 1; \
req->length = 0; \
_BRdat = ((CARD32 *)req)[_BRlen]; \
- memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \
+ memmove(((char *)req) + 8, ((char *)req) + 4, (_BRlen - 1) << 2); \
((CARD32 *)req)[1] = _BRlen + n + 2; \
Data32(dpy, &_BRdat, 4); \
}
#endif
#endif
+/*
+ * SetReqLen increases the count of 32-bit words in the request by "n",
+ * or by "badlen" if "n" is too large.
+ *
+ * Do not use SetReqLen if "req" does not already have data after the
+ * xReq header. req->length must already be >= 2.
+ */
#ifndef __clang_analyzer__
#define SetReqLen(req,n,badlen) \
if ((req->length + n) > (unsigned)65535) { \
--
cgit v0.10.2

View File

@@ -0,0 +1,240 @@
From 81c90dc8f0aae3b65730409b1b615b5fa7280ebd Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Fri, 16 Jan 2015 20:08:59 +0100
Subject: xkb: Don't swap XkbSetGeometry data in the input buffer
The XkbSetGeometry request embeds data which needs to be swapped when the
server and the client have different endianess.
_XkbSetGeometry() invokes functions that swap these data directly in the
input buffer.
However, ProcXkbSetGeometry() may call _XkbSetGeometry() more than once
(if there is more than one keyboard), thus causing on swapped clients the
same data to be swapped twice in memory, further causing a server crash
because the strings lengths on the second time are way off bounds.
To allow _XkbSetGeometry() to run reliably more than once with swapped
clients, do not swap the data in the buffer, use variables instead.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
diff --git a/xkb/xkb.c b/xkb/xkb.c
index 15c7f34..b9a3ac4 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -4961,14 +4961,13 @@ static char *
_GetCountedString(char **wire_inout, Bool swap)
{
char *wire, *str;
- CARD16 len, *plen;
+ CARD16 len;
wire = *wire_inout;
- plen = (CARD16 *) wire;
+ len = *(CARD16 *) wire;
if (swap) {
- swaps(plen);
+ swaps(&len);
}
- len = *plen;
str = malloc(len + 1);
if (str) {
memcpy(str, &wire[2], len);
@@ -4985,25 +4984,28 @@ _CheckSetDoodad(char **wire_inout,
{
char *wire;
xkbDoodadWireDesc *dWire;
+ xkbAnyDoodadWireDesc any;
+ xkbTextDoodadWireDesc text;
XkbDoodadPtr doodad;
dWire = (xkbDoodadWireDesc *) (*wire_inout);
+ any = dWire->any;
wire = (char *) &dWire[1];
if (client->swapped) {
- swapl(&dWire->any.name);
- swaps(&dWire->any.top);
- swaps(&dWire->any.left);
- swaps(&dWire->any.angle);
+ swapl(&any.name);
+ swaps(&any.top);
+ swaps(&any.left);
+ swaps(&any.angle);
}
CHK_ATOM_ONLY(dWire->any.name);
- doodad = XkbAddGeomDoodad(geom, section, dWire->any.name);
+ doodad = XkbAddGeomDoodad(geom, section, any.name);
if (!doodad)
return BadAlloc;
doodad->any.type = dWire->any.type;
doodad->any.priority = dWire->any.priority;
- doodad->any.top = dWire->any.top;
- doodad->any.left = dWire->any.left;
- doodad->any.angle = dWire->any.angle;
+ doodad->any.top = any.top;
+ doodad->any.left = any.left;
+ doodad->any.angle = any.angle;
switch (doodad->any.type) {
case XkbOutlineDoodad:
case XkbSolidDoodad:
@@ -5026,12 +5028,13 @@ _CheckSetDoodad(char **wire_inout,
dWire->text.colorNdx);
return BadMatch;
}
+ text = dWire->text;
if (client->swapped) {
- swaps(&dWire->text.width);
- swaps(&dWire->text.height);
+ swaps(&text.width);
+ swaps(&text.height);
}
- doodad->text.width = dWire->text.width;
- doodad->text.height = dWire->text.height;
+ doodad->text.width = text.width;
+ doodad->text.height = text.height;
doodad->text.color_ndx = dWire->text.colorNdx;
doodad->text.text = _GetCountedString(&wire, client->swapped);
doodad->text.font = _GetCountedString(&wire, client->swapped);
--
cgit v0.10.2
From 20079c36cf7d377938ca5478447d8b9045cb7d43 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Fri, 16 Jan 2015 08:44:45 +0100
Subject: xkb: Check strings length against request size
Ensure that the given strings length in an XkbSetGeometry request remain
within the limits of the size of the request.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
diff --git a/xkb/xkb.c b/xkb/xkb.c
index b9a3ac4..f3988f9 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -4957,25 +4957,29 @@ ProcXkbGetGeometry(ClientPtr client)
/***====================================================================***/
-static char *
-_GetCountedString(char **wire_inout, Bool swap)
+static Status
+_GetCountedString(char **wire_inout, ClientPtr client, char **str)
{
- char *wire, *str;
+ char *wire, *next;
CARD16 len;
wire = *wire_inout;
len = *(CARD16 *) wire;
- if (swap) {
+ if (client->swapped) {
swaps(&len);
}
- str = malloc(len + 1);
- if (str) {
- memcpy(str, &wire[2], len);
- str[len] = '\0';
- }
- wire += XkbPaddedSize(len + 2);
- *wire_inout = wire;
- return str;
+ next = wire + XkbPaddedSize(len + 2);
+ /* Check we're still within the size of the request */
+ if (client->req_len <
+ bytes_to_int32(next - (char *) client->requestBuffer))
+ return BadValue;
+ *str = malloc(len + 1);
+ if (!*str)
+ return BadAlloc;
+ memcpy(*str, &wire[2], len);
+ *(*str + len) = '\0';
+ *wire_inout = next;
+ return Success;
}
static Status
@@ -4987,6 +4991,7 @@ _CheckSetDoodad(char **wire_inout,
xkbAnyDoodadWireDesc any;
xkbTextDoodadWireDesc text;
XkbDoodadPtr doodad;
+ Status status;
dWire = (xkbDoodadWireDesc *) (*wire_inout);
any = dWire->any;
@@ -5036,8 +5041,14 @@ _CheckSetDoodad(char **wire_inout,
doodad->text.width = text.width;
doodad->text.height = text.height;
doodad->text.color_ndx = dWire->text.colorNdx;
- doodad->text.text = _GetCountedString(&wire, client->swapped);
- doodad->text.font = _GetCountedString(&wire, client->swapped);
+ status = _GetCountedString(&wire, client, &doodad->text.text);
+ if (status != Success)
+ return status;
+ status = _GetCountedString(&wire, client, &doodad->text.font);
+ if (status != Success) {
+ free (doodad->text.text);
+ return status;
+ }
break;
case XkbIndicatorDoodad:
if (dWire->indicator.onColorNdx >= geom->num_colors) {
@@ -5072,7 +5083,9 @@ _CheckSetDoodad(char **wire_inout,
}
doodad->logo.color_ndx = dWire->logo.colorNdx;
doodad->logo.shape_ndx = dWire->logo.shapeNdx;
- doodad->logo.logo_name = _GetCountedString(&wire, client->swapped);
+ status = _GetCountedString(&wire, client, &doodad->logo.logo_name);
+ if (status != Success)
+ return status;
break;
default:
client->errorValue = _XkbErrCode2(0x4F, dWire->any.type);
@@ -5304,18 +5317,20 @@ _CheckSetGeom(XkbGeometryPtr geom, xkbSetGeometryReq * req, ClientPtr client)
char *wire;
wire = (char *) &req[1];
- geom->label_font = _GetCountedString(&wire, client->swapped);
+ status = _GetCountedString(&wire, client, &geom->label_font);
+ if (status != Success)
+ return status;
for (i = 0; i < req->nProperties; i++) {
char *name, *val;
- name = _GetCountedString(&wire, client->swapped);
- if (!name)
- return BadAlloc;
- val = _GetCountedString(&wire, client->swapped);
- if (!val) {
+ status = _GetCountedString(&wire, client, &name);
+ if (status != Success)
+ return status;
+ status = _GetCountedString(&wire, client, &val);
+ if (status != Success) {
free(name);
- return BadAlloc;
+ return status;
}
if (XkbAddGeomProperty(geom, name, val) == NULL) {
free(name);
@@ -5349,9 +5364,9 @@ _CheckSetGeom(XkbGeometryPtr geom, xkbSetGeometryReq * req, ClientPtr client)
for (i = 0; i < req->nColors; i++) {
char *name;
- name = _GetCountedString(&wire, client->swapped);
- if (!name)
- return BadAlloc;
+ status = _GetCountedString(&wire, client, &name);
+ if (status != Success)
+ return status;
if (!XkbAddGeomColor(geom, name, geom->num_colors)) {
free(name);
return BadAlloc;
--
cgit v0.10.2

View File

@@ -0,0 +1,30 @@
From 2deda9906480f9c8ae07b8c2a5510cc7e4c59a8e Mon Sep 17 00:00:00 2001
From: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Fri, 6 Feb 2015 15:50:45 -0800
Subject: bdfReadProperties: property count needs range check [CVE-2015-1802]
Avoid integer overflow or underflow when allocating memory arrays
by multiplying the number of properties reported for a BDF font.
Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
diff --git a/src/bitmap/bdfread.c b/src/bitmap/bdfread.c
index 914a024..6387908 100644
--- a/src/bitmap/bdfread.c
+++ b/src/bitmap/bdfread.c
@@ -604,7 +604,9 @@ bdfReadProperties(FontFilePtr file, FontPtr pFont, bdfFileState *pState)
bdfError("missing 'STARTPROPERTIES'\n");
return (FALSE);
}
- if (sscanf((char *) line, "STARTPROPERTIES %d", &nProps) != 1) {
+ if ((sscanf((char *) line, "STARTPROPERTIES %d", &nProps) != 1) ||
+ (nProps <= 0) ||
+ (nProps > ((INT32_MAX / sizeof(FontPropRec)) - BDF_GENPROPS))) {
bdfError("bad 'STARTPROPERTIES'\n");
return (FALSE);
}
--
cgit v0.10.2

View File

@@ -0,0 +1,33 @@
From 78c2e3d70d29698244f70164428bd2868c0ab34c Mon Sep 17 00:00:00 2001
From: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Fri, 6 Feb 2015 15:54:00 -0800
Subject: bdfReadCharacters: bailout if a char's bitmap cannot be read
[CVE-2015-1803]
Previously would charge on ahead with a NULL pointer in ci->bits, and
then crash later in FontCharInkMetrics() trying to access the bits.
Found with afl-1.23b.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
diff --git a/src/bitmap/bdfread.c b/src/bitmap/bdfread.c
index 6387908..1b29b81 100644
--- a/src/bitmap/bdfread.c
+++ b/src/bitmap/bdfread.c
@@ -458,7 +458,10 @@ bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState,
ci->metrics.descent = -bb;
ci->metrics.characterWidth = wx;
ci->bits = NULL;
- bdfReadBitmap(ci, file, bit, byte, glyph, scan, bitmapsSizes);
+ if (!bdfReadBitmap(ci, file, bit, byte, glyph, scan, bitmapsSizes)) {
+ bdfError("could not read bitmap for character '%s'\n", charName);
+ goto BAILOUT;
+ }
ci++;
ndx++;
} else
--
cgit v0.10.2

View File

@@ -0,0 +1,73 @@
From 2351c83a77a478b49cba6beb2ad386835e264744 Mon Sep 17 00:00:00 2001
From: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Fri, 6 Mar 2015 22:54:58 -0800
Subject: bdfReadCharacters: ensure metrics fit into xCharInfo struct
[CVE-2015-1804]
We use 32-bit ints to read from the bdf file, but then try to stick
into a 16-bit int in the xCharInfo struct, so make sure they won't
overflow that range.
Found by afl-1.24b.
v2: Verify that additions won't overflow 32-bit int range either.
v3: As Julien correctly observes, the previous check for bh & bw not
being < 0 reduces the number of cases we need to check for overflow.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
diff --git a/src/bitmap/bdfread.c b/src/bitmap/bdfread.c
index 1b29b81..a0ace8f 100644
--- a/src/bitmap/bdfread.c
+++ b/src/bitmap/bdfread.c
@@ -62,8 +62,16 @@ from The Open Group.
#if HAVE_STDINT_H
#include <stdint.h>
-#elif !defined(INT32_MAX)
-#define INT32_MAX 0x7fffffff
+#else
+# ifndef INT32_MAX
+# define INT32_MAX 0x7fffffff
+# endif
+# ifndef INT16_MAX
+# define INT16_MAX 0x7fff
+# endif
+# ifndef INT16_MIN
+# define INT16_MIN (0 - 0x8000)
+# endif
#endif
#define INDICES 256
@@ -417,6 +425,12 @@ bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState,
bdfError("DWIDTH y value must be zero\n");
goto BAILOUT;
}
+ /* xCharInfo metrics are stored as INT16 */
+ if ((wx < 0) || (wx > INT16_MAX)) {
+ bdfError("character '%s' has out of range width, %d\n",
+ charName, wx);
+ goto BAILOUT;
+ }
line = bdfGetLine(file, lineBuf, BDFLINELEN);
if ((!line) || (sscanf((char *) line, "BBX %d %d %d %d", &bw, &bh, &bl, &bb) != 4)) {
bdfError("bad 'BBX'\n");
@@ -427,6 +441,14 @@ bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState,
charName, bw, bh);
goto BAILOUT;
}
+ /* xCharInfo metrics are read as int, but stored as INT16 */
+ if ((bl > INT16_MAX) || (bl < INT16_MIN) ||
+ (bb > INT16_MAX) || (bb < INT16_MIN) ||
+ (bw > (INT16_MAX - bl)) || (bh > (INT16_MAX - bb))) {
+ bdfError("character '%s' has out of range metrics, %d %d %d %d\n",
+ charName, bl, (bl+bw), (bh+bb), -bb);
+ goto BAILOUT;
+ }
line = bdfGetLine(file, lineBuf, BDFLINELEN);
if ((line) && (bdfIsPrefix(line, "ATTRIBUTES"))) {
for (p = line + strlen("ATTRIBUTES ");
--
cgit v0.10.2

View File

@@ -0,0 +1,511 @@
# - Find X11 installation
# Try to find X11 on UNIX systems. The following values are defined
# X11_FOUND - True if X11 is available
# X11_INCLUDE_DIR - include directories to use X11
# X11_LIBRARIES - link against these to use X11
#
# and also the following more fine grained variables:
# Include paths: X11_ICE_INCLUDE_PATH, X11_ICE_LIB, X11_ICE_FOUND
# X11_SM_INCLUDE_PATH, X11_SM_LIB, X11_SM_FOUND
# X11_X11_INCLUDE_PATH, X11_X11_LIB
# X11_Xaccessrules_INCLUDE_PATH, X11_Xaccess_FOUND
# X11_Xaccessstr_INCLUDE_PATH, X11_Xaccess_FOUND
# X11_Xau_INCLUDE_PATH, X11_Xau_LIB, X11_Xau_FOUND
# X11_Xcomposite_INCLUDE_PATH, X11_Xcomposite_LIB, X11_Xcomposite_FOUND
# X11_Xcursor_INCLUDE_PATH, X11_Xcursor_LIB, X11_Xcursor_FOUND
# X11_Xdamage_INCLUDE_PATH, X11_Xdamage_LIB, X11_Xdamage_FOUND
# X11_Xdmcp_INCLUDE_PATH, X11_Xdmcp_LIB, X11_Xdmcp_FOUND
# X11_Xext_LIB, X11_Xext_FOUND
# X11_dpms_INCLUDE_PATH, (in X11_Xext_LIB), X11_dpms_FOUND
# X11_XShm_INCLUDE_PATH, (in X11_Xext_LIB), X11_XShm_FOUND
# X11_Xshape_INCLUDE_PATH, (in X11_Xext_LIB), X11_Xshape_FOUND
# X11_xf86misc_INCLUDE_PATH, X11_Xxf86misc_LIB, X11_xf86misc_FOUND
# X11_xf86vmode_INCLUDE_PATH, X11_Xxf86vm_LIB X11_xf86vmode_FOUND
# X11_Xfixes_INCLUDE_PATH, X11_Xfixes_LIB, X11_Xfixes_FOUND
# X11_Xft_INCLUDE_PATH, X11_Xft_LIB, X11_Xft_FOUND
# X11_Xi_INCLUDE_PATH, X11_Xi_LIB, X11_Xi_FOUND
# X11_Xinerama_INCLUDE_PATH, X11_Xinerama_LIB, X11_Xinerama_FOUND
# X11_Xinput_INCLUDE_PATH, X11_Xinput_LIB, X11_Xinput_FOUND
# X11_Xkb_INCLUDE_PATH, X11_Xkb_FOUND
# X11_Xkblib_INCLUDE_PATH, X11_Xkb_FOUND
# X11_Xkbfile_INCLUDE_PATH, X11_Xkbfile_LIB, X11_Xkbfile_FOUND
# X11_Xmu_INCLUDE_PATH, X11_Xmu_LIB, X11_Xmu_FOUND
# X11_Xpm_INCLUDE_PATH, X11_Xpm_LIB, X11_Xpm_FOUND
# X11_XTest_INCLUDE_PATH, X11_XTest_LIB, X11_XTest_FOUND
# X11_Xrandr_INCLUDE_PATH, X11_Xrandr_LIB, X11_Xrandr_FOUND
# X11_Xrender_INCLUDE_PATH, X11_Xrender_LIB, X11_Xrender_FOUND
# X11_Xscreensaver_INCLUDE_PATH, X11_Xscreensaver_LIB, X11_Xscreensaver_FOUND
# X11_Xt_INCLUDE_PATH, X11_Xt_LIB, X11_Xt_FOUND
# X11_Xutil_INCLUDE_PATH, X11_Xutil_FOUND
# X11_Xv_INCLUDE_PATH, X11_Xv_LIB, X11_Xv_FOUND
# X11_XSync_INCLUDE_PATH, (in X11_Xext_LIB), X11_XSync_FOUND
#=============================================================================
# Copyright 2001-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
if (UNIX)
set(X11_FOUND 0)
# X11 is never a framework and some header files may be
# found in tcl on the mac
set(CMAKE_FIND_FRAMEWORK_SAVE ${CMAKE_FIND_FRAMEWORK})
set(CMAKE_FIND_FRAMEWORK NEVER)
set(X11_INC_SEARCH_PATH
@_includedir@
/usr/pkg/xorg/include
/usr/X11R6/include
/usr/X11R7/include
/usr/include/X11
/usr/openwin/include
/usr/openwin/share/include
/opt/graphics/OpenGL/include
)
set(X11_LIB_SEARCH_PATH
@_libdir@
@_libdir@/tigervnc
/usr/pkg/xorg/lib
/usr/X11R6/lib
/usr/X11R7/lib
/usr/openwin/lib
)
find_path(X11_X11_INCLUDE_PATH X11/X.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xlib_INCLUDE_PATH X11/Xlib.h ${X11_INC_SEARCH_PATH})
# Look for includes; keep the list sorted by name of the cmake *_INCLUDE_PATH
# variable (which doesn't need to match the include file name).
# Solaris lacks XKBrules.h, so we should skip kxkbd there.
find_path(X11_ICE_INCLUDE_PATH X11/ICE/ICE.h ${X11_INC_SEARCH_PATH})
find_path(X11_SM_INCLUDE_PATH X11/SM/SM.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xaccessrules_INCLUDE_PATH X11/extensions/XKBrules.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xaccessstr_INCLUDE_PATH X11/extensions/XKBstr.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xau_INCLUDE_PATH X11/Xauth.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xcomposite_INCLUDE_PATH X11/extensions/Xcomposite.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xcursor_INCLUDE_PATH X11/Xcursor/Xcursor.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xdamage_INCLUDE_PATH X11/extensions/Xdamage.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xdmcp_INCLUDE_PATH X11/Xdmcp.h ${X11_INC_SEARCH_PATH})
find_path(X11_dpms_INCLUDE_PATH X11/extensions/dpms.h ${X11_INC_SEARCH_PATH})
find_path(X11_xf86misc_INCLUDE_PATH X11/extensions/xf86misc.h ${X11_INC_SEARCH_PATH})
find_path(X11_xf86vmode_INCLUDE_PATH X11/extensions/xf86vmode.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xfixes_INCLUDE_PATH X11/extensions/Xfixes.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xft_INCLUDE_PATH X11/Xft/Xft.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xi_INCLUDE_PATH X11/extensions/XInput.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xinerama_INCLUDE_PATH X11/extensions/Xinerama.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xinput_INCLUDE_PATH X11/extensions/XInput.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xkb_INCLUDE_PATH X11/extensions/XKB.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xkblib_INCLUDE_PATH X11/XKBlib.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xkbfile_INCLUDE_PATH X11/extensions/XKBfile.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xmu_INCLUDE_PATH X11/Xmu/Xmu.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xpm_INCLUDE_PATH X11/xpm.h ${X11_INC_SEARCH_PATH})
find_path(X11_XTest_INCLUDE_PATH X11/extensions/XTest.h ${X11_INC_SEARCH_PATH})
find_path(X11_XShm_INCLUDE_PATH X11/extensions/XShm.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xrandr_INCLUDE_PATH X11/extensions/Xrandr.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xrender_INCLUDE_PATH X11/extensions/Xrender.h ${X11_INC_SEARCH_PATH})
find_path(X11_XRes_INCLUDE_PATH X11/extensions/XRes.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xscreensaver_INCLUDE_PATH X11/extensions/scrnsaver.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xshape_INCLUDE_PATH X11/extensions/shape.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xutil_INCLUDE_PATH X11/Xutil.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xt_INCLUDE_PATH X11/Intrinsic.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xv_INCLUDE_PATH X11/extensions/Xvlib.h ${X11_INC_SEARCH_PATH})
find_path(X11_XSync_INCLUDE_PATH X11/extensions/sync.h ${X11_INC_SEARCH_PATH})
find_path(X11_xcb_INCLUDE_PATH X11/xcb.h ${X11_INC_SEARCH_PATH})
find_library(X11_X11_LIB X11 ${X11_LIB_SEARCH_PATH})
# Find additional X libraries. Keep list sorted by library name.
find_library(X11_ICE_LIB ICE ${X11_LIB_SEARCH_PATH})
find_library(X11_SM_LIB SM ${X11_LIB_SEARCH_PATH})
find_library(X11_Xau_LIB Xau ${X11_LIB_SEARCH_PATH})
find_library(X11_Xcomposite_LIB Xcomposite ${X11_LIB_SEARCH_PATH})
find_library(X11_Xcursor_LIB Xcursor ${X11_LIB_SEARCH_PATH})
find_library(X11_Xdamage_LIB Xdamage ${X11_LIB_SEARCH_PATH})
find_library(X11_Xdmcp_LIB Xdmcp ${X11_LIB_SEARCH_PATH})
find_library(X11_Xext_LIB Xext ${X11_LIB_SEARCH_PATH})
find_library(X11_Xfixes_LIB Xfixes ${X11_LIB_SEARCH_PATH})
find_library(X11_Xft_LIB Xft ${X11_LIB_SEARCH_PATH})
find_library(X11_Xi_LIB Xi ${X11_LIB_SEARCH_PATH})
find_library(X11_Xinerama_LIB Xinerama ${X11_LIB_SEARCH_PATH})
find_library(X11_Xinput_LIB Xi ${X11_LIB_SEARCH_PATH})
find_library(X11_Xkbfile_LIB xkbfile ${X11_LIB_SEARCH_PATH})
find_library(X11_Xmu_LIB Xmu ${X11_LIB_SEARCH_PATH})
find_library(X11_Xpm_LIB Xpm ${X11_LIB_SEARCH_PATH})
find_library(X11_Xrandr_LIB Xrandr ${X11_LIB_SEARCH_PATH})
find_library(X11_Xrender_LIB Xrender ${X11_LIB_SEARCH_PATH})
find_library(X11_XRes_LIB XRes ${X11_LIB_SEARCH_PATH})
find_library(X11_Xscreensaver_LIB Xss ${X11_LIB_SEARCH_PATH})
find_library(X11_Xt_LIB Xt ${X11_LIB_SEARCH_PATH})
find_library(X11_XTest_LIB Xtst ${X11_LIB_SEARCH_PATH})
find_library(X11_Xv_LIB Xv ${X11_LIB_SEARCH_PATH})
find_library(X11_Xxf86misc_LIB Xxf86misc ${X11_LIB_SEARCH_PATH})
find_library(X11_Xxf86vm_LIB Xxf86vm ${X11_LIB_SEARCH_PATH})
find_library(X11_xcb_LIB xcb ${X11_LIB_SEARCH_PATH})
set(X11_LIBRARY_DIR "")
if(X11_X11_LIB)
get_filename_component(X11_LIBRARY_DIR ${X11_X11_LIB} PATH)
endif()
set(X11_INCLUDE_DIR) # start with empty list
if(X11_X11_INCLUDE_PATH)
set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_X11_INCLUDE_PATH})
endif()
if(X11_Xlib_INCLUDE_PATH)
set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xlib_INCLUDE_PATH})
endif()
if(X11_Xutil_INCLUDE_PATH)
set(X11_Xutil_FOUND TRUE)
set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xutil_INCLUDE_PATH})
endif()
if(X11_Xshape_INCLUDE_PATH)
set(X11_Xshape_FOUND TRUE)
set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xshape_INCLUDE_PATH})
endif()
set(X11_LIBRARIES) # start with empty list
if(X11_X11_LIB)
set(X11_LIBRARIES ${X11_LIBRARIES} ${X11_X11_LIB} ${X11_xcb_LIB})
endif()
if(X11_Xext_LIB)
set(X11_Xext_FOUND TRUE)
set(X11_LIBRARIES ${X11_LIBRARIES} ${X11_Xext_LIB})
endif()
if(X11_Xt_LIB AND X11_Xt_INCLUDE_PATH)
set(X11_Xt_FOUND TRUE)
endif()
if(X11_Xft_LIB AND X11_Xft_INCLUDE_PATH)
set(X11_Xft_FOUND TRUE)
set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xft_INCLUDE_PATH})
endif()
if(X11_Xv_LIB AND X11_Xv_INCLUDE_PATH)
set(X11_Xv_FOUND TRUE)
set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xv_INCLUDE_PATH})
endif()
if (X11_Xau_LIB AND X11_Xau_INCLUDE_PATH)
set(X11_Xau_FOUND TRUE)
set(X11_LIBRARIES ${X11_LIBRARIES} ${X11_Xau_LIB})
endif ()
if (X11_Xdmcp_INCLUDE_PATH AND X11_Xdmcp_LIB)
set(X11_Xdmcp_FOUND TRUE)
set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xdmcp_INCLUDE_PATH})
set(X11_LIBRARIES ${X11_LIBRARIES} ${X11_Xdmcp_LIB})
endif ()
if (X11_Xaccessrules_INCLUDE_PATH AND X11_Xaccessstr_INCLUDE_PATH)
set(X11_Xaccess_FOUND TRUE)
set(X11_Xaccess_INCLUDE_PATH ${X11_Xaccessstr_INCLUDE_PATH})
set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xaccess_INCLUDE_PATH})
endif ()
if (X11_Xpm_INCLUDE_PATH AND X11_Xpm_LIB)
set(X11_Xpm_FOUND TRUE)
set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xpm_INCLUDE_PATH})
endif ()
if (X11_Xcomposite_INCLUDE_PATH AND X11_Xcomposite_LIB)
set(X11_Xcomposite_FOUND TRUE)
set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xcomposite_INCLUDE_PATH})
endif ()
if (X11_Xdamage_INCLUDE_PATH AND X11_Xdamage_LIB)
set(X11_Xdamage_FOUND TRUE)
set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xdamage_INCLUDE_PATH})
endif ()
if (X11_XShm_INCLUDE_PATH)
set(X11_XShm_FOUND TRUE)
set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XShm_INCLUDE_PATH})
endif ()
if (X11_XTest_INCLUDE_PATH AND X11_XTest_LIB)
set(X11_XTest_FOUND TRUE)
set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XTest_INCLUDE_PATH})
endif ()
if (X11_Xi_INCLUDE_PATH AND X11_Xi_LIB)
set(X11_Xi_FOUND TRUE)
set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xi_INCLUDE_PATH})
endif ()
if (X11_Xinerama_INCLUDE_PATH AND X11_Xinerama_LIB)
set(X11_Xinerama_FOUND TRUE)
set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinerama_INCLUDE_PATH})
endif ()
if (X11_Xfixes_INCLUDE_PATH AND X11_Xfixes_LIB)
set(X11_Xfixes_FOUND TRUE)
set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xfixes_INCLUDE_PATH})
endif ()
if (X11_Xrender_INCLUDE_PATH AND X11_Xrender_LIB)
set(X11_Xrender_FOUND TRUE)
set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xrender_INCLUDE_PATH})
endif ()
if (X11_XRes_INCLUDE_PATH AND X11_XRes_LIB)
set(X11_XRes_FOUND TRUE)
set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XRes_INCLUDE_PATH})
endif ()
if (X11_Xrandr_INCLUDE_PATH AND X11_Xrandr_LIB)
set(X11_Xrandr_FOUND TRUE)
set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xrandr_INCLUDE_PATH})
endif ()
if (X11_xf86misc_INCLUDE_PATH AND X11_Xxf86misc_LIB)
set(X11_xf86misc_FOUND TRUE)
set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_xf86misc_INCLUDE_PATH})
endif ()
if (X11_xf86vmode_INCLUDE_PATH AND X11_Xxf86vm_LIB)
set(X11_xf86vmode_FOUND TRUE)
set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_xf86vmode_INCLUDE_PATH})
endif ()
if (X11_Xcursor_INCLUDE_PATH AND X11_Xcursor_LIB)
set(X11_Xcursor_FOUND TRUE)
set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xcursor_INCLUDE_PATH})
endif ()
if (X11_Xscreensaver_INCLUDE_PATH AND X11_Xscreensaver_LIB)
set(X11_Xscreensaver_FOUND TRUE)
set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xscreensaver_INCLUDE_PATH})
endif ()
if (X11_dpms_INCLUDE_PATH)
set(X11_dpms_FOUND TRUE)
set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_dpms_INCLUDE_PATH})
endif ()
if (X11_Xkb_INCLUDE_PATH AND X11_Xkblib_INCLUDE_PATH AND X11_Xlib_INCLUDE_PATH)
set(X11_Xkb_FOUND TRUE)
set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkb_INCLUDE_PATH} )
endif ()
if (X11_Xkbfile_INCLUDE_PATH AND X11_Xkbfile_LIB AND X11_Xlib_INCLUDE_PATH)
set(X11_Xkbfile_FOUND TRUE)
set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkbfile_INCLUDE_PATH} )
endif ()
if (X11_Xmu_INCLUDE_PATH AND X11_Xmu_LIB)
set(X11_Xmu_FOUND TRUE)
set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xmu_INCLUDE_PATH})
endif ()
if (X11_Xinput_INCLUDE_PATH AND X11_Xinput_LIB)
set(X11_Xinput_FOUND TRUE)
set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinput_INCLUDE_PATH})
endif ()
if (X11_XSync_INCLUDE_PATH)
set(X11_XSync_FOUND TRUE)
set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XSync_INCLUDE_PATH})
endif ()
if(X11_ICE_LIB AND X11_ICE_INCLUDE_PATH)
set(X11_ICE_FOUND TRUE)
endif()
if(X11_SM_LIB AND X11_SM_INCLUDE_PATH)
set(X11_SM_FOUND TRUE)
endif()
if(X11_xcb_LIB AND X11_xcb_INCLUDE_PATH)
set(X11_xcb_FOUND TRUE)
endif()
# Most of the X11 headers will be in the same directories, avoid
# creating a huge list of duplicates.
if (X11_INCLUDE_DIR)
list(REMOVE_DUPLICATES X11_INCLUDE_DIR)
endif ()
# Deprecated variable for backwards compatibility with CMake 1.4
if (X11_X11_INCLUDE_PATH AND X11_LIBRARIES)
set(X11_FOUND 1)
endif ()
if(X11_FOUND)
include(/usr/share/cmake28/Modules/CheckFunctionExists.cmake)
include(/usr/share/cmake28/Modules/CheckLibraryExists.cmake)
# Translated from an autoconf-generated configure script.
# See libs.m4 in autoconf's m4 directory.
if($ENV{ISC} MATCHES "^yes$")
set(X11_X_EXTRA_LIBS -lnsl_s -linet)
else()
set(X11_X_EXTRA_LIBS "-Wl,-Bdynamic -ldl")
# See if XOpenDisplay in X11 works by itself.
CHECK_LIBRARY_EXISTS("${X11_LIBRARIES}" "XOpenDisplay" "${X11_LIBRARY_DIR}" X11_LIB_X11_SOLO)
if(NOT X11_LIB_X11_SOLO)
# Find library needed for dnet_ntoa.
CHECK_LIBRARY_EXISTS("dnet" "dnet_ntoa" "" X11_LIB_DNET_HAS_DNET_NTOA)
if (X11_LIB_DNET_HAS_DNET_NTOA)
set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet)
else ()
CHECK_LIBRARY_EXISTS("dnet_stub" "dnet_ntoa" "" X11_LIB_DNET_STUB_HAS_DNET_NTOA)
if (X11_LIB_DNET_STUB_HAS_DNET_NTOA)
set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet_stub)
endif ()
endif ()
endif()
# Find library needed for gethostbyname.
CHECK_FUNCTION_EXISTS("gethostbyname" CMAKE_HAVE_GETHOSTBYNAME)
if(NOT CMAKE_HAVE_GETHOSTBYNAME)
CHECK_LIBRARY_EXISTS("nsl" "gethostbyname" "" CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
if (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lnsl)
else ()
CHECK_LIBRARY_EXISTS("bsd" "gethostbyname" "" CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
if (CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lbsd)
endif ()
endif ()
endif()
# Find library needed for connect.
CHECK_FUNCTION_EXISTS("connect" CMAKE_HAVE_CONNECT)
if(NOT CMAKE_HAVE_CONNECT)
CHECK_LIBRARY_EXISTS("socket" "connect" "" CMAKE_LIB_SOCKET_HAS_CONNECT)
if (CMAKE_LIB_SOCKET_HAS_CONNECT)
set (X11_X_EXTRA_LIBS -lsocket ${X11_X_EXTRA_LIBS})
endif ()
endif()
# Find library needed for remove.
CHECK_FUNCTION_EXISTS("remove" CMAKE_HAVE_REMOVE)
if(NOT CMAKE_HAVE_REMOVE)
CHECK_LIBRARY_EXISTS("posix" "remove" "" CMAKE_LIB_POSIX_HAS_REMOVE)
if (CMAKE_LIB_POSIX_HAS_REMOVE)
set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lposix)
endif ()
endif()
# Find library needed for shmat.
CHECK_FUNCTION_EXISTS("shmat" CMAKE_HAVE_SHMAT)
if(NOT CMAKE_HAVE_SHMAT)
CHECK_LIBRARY_EXISTS("ipc" "shmat" "" CMAKE_LIB_IPS_HAS_SHMAT)
if (CMAKE_LIB_IPS_HAS_SHMAT)
set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lipc)
endif ()
endif()
endif()
if (X11_ICE_FOUND)
CHECK_LIBRARY_EXISTS("ICE" "IceConnectionNumber" "${X11_LIBRARY_DIR}"
CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
if(CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
set (X11_X_PRE_LIBS ${X11_ICE_LIB})
if(X11_SM_LIB)
set (X11_X_PRE_LIBS ${X11_SM_LIB} ${X11_X_PRE_LIBS})
endif()
endif()
endif ()
# Build the final list of libraries.
set(X11_LIBRARIES ${X11_X_PRE_LIBS} ${X11_LIBRARIES} ${X11_X_EXTRA_LIBS})
include(/usr/share/cmake28/Modules/FindPackageMessage.cmake)
FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}"
"[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
else ()
if (X11_FIND_REQUIRED)
message(FATAL_ERROR "Could not find X11")
endif ()
endif ()
mark_as_advanced(
X11_X11_INCLUDE_PATH
X11_X11_LIB
X11_Xext_LIB
X11_Xau_LIB
X11_Xau_INCLUDE_PATH
X11_Xlib_INCLUDE_PATH
X11_Xutil_INCLUDE_PATH
X11_Xcomposite_INCLUDE_PATH
X11_Xcomposite_LIB
X11_Xaccess_INCLUDE_PATH
X11_Xfixes_LIB
X11_Xfixes_INCLUDE_PATH
X11_Xrandr_LIB
X11_Xrandr_INCLUDE_PATH
X11_Xdamage_LIB
X11_Xdamage_INCLUDE_PATH
X11_Xrender_LIB
X11_Xrender_INCLUDE_PATH
X11_XRes_LIB
X11_XRes_INCLUDE_PATH
X11_Xxf86misc_LIB
X11_xf86misc_INCLUDE_PATH
X11_Xxf86vm_LIB
X11_xf86vmode_INCLUDE_PATH
X11_Xi_LIB
X11_Xi_INCLUDE_PATH
X11_Xinerama_LIB
X11_Xinerama_INCLUDE_PATH
X11_XTest_LIB
X11_XTest_INCLUDE_PATH
X11_Xcursor_LIB
X11_Xcursor_INCLUDE_PATH
X11_dpms_INCLUDE_PATH
X11_Xt_LIB
X11_Xt_INCLUDE_PATH
X11_Xdmcp_LIB
X11_LIBRARIES
X11_Xaccessrules_INCLUDE_PATH
X11_Xaccessstr_INCLUDE_PATH
X11_Xdmcp_INCLUDE_PATH
X11_Xkb_INCLUDE_PATH
X11_Xkblib_INCLUDE_PATH
X11_Xkbfile_INCLUDE_PATH
X11_Xkbfile_LIB
X11_Xmu_INCLUDE_PATH
X11_Xmu_LIB
X11_Xscreensaver_INCLUDE_PATH
X11_Xscreensaver_LIB
X11_Xpm_INCLUDE_PATH
X11_Xpm_LIB
X11_Xinput_LIB
X11_Xinput_INCLUDE_PATH
X11_Xft_LIB
X11_Xft_INCLUDE_PATH
X11_Xshape_INCLUDE_PATH
X11_Xv_LIB
X11_Xv_INCLUDE_PATH
X11_XShm_INCLUDE_PATH
X11_ICE_LIB
X11_ICE_INCLUDE_PATH
X11_SM_LIB
X11_SM_INCLUDE_PATH
X11_xcb_LIB
X11_xcb_INCLUDE_PATH
X11_XSync_INCLUDE_PATH
)
set(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_SAVE})
endif ()
# X11_FIND_REQUIRED_<component> could be checked too

View File

@@ -0,0 +1,29 @@
--- a/configure 2015-02-22 16:20:48.000000000 -0500
+++ b/configure 2015-02-22 16:21:52.000000000 -0500
@@ -6793,7 +6793,7 @@
# See if we find them without any special options.
# Don't add to $LIBS permanently.
ac_save_LIBS=$LIBS
- LIBS="-lX11 $LIBS"
+ LIBS="-lX11 -lfreetype -lexpat -lXext -lXrender -lxcb -lXdmcp -lXau -lz $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <X11/Xlib.h>
@@ -6935,7 +6935,7 @@
# Martyn Johnson says this is needed for Ultrix, if the X
# libraries were built with DECnet support. And Karl Berry says
# the Alpha needs dnet_stub (dnet does not exist).
- ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
+ ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lfreetype -lexpat -lX11 -lXext -lXrender -lxcb -lXdmcp -lXau -lz"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7359,7 +7359,7 @@
$as_echo "$as_me: WARNING: Ignoring libraries \"$X_PRE_LIBS\" requested by configure." >&2;}
fi
- LIBS="$LIBS -lX11 $X_EXTRA_LIBS"
+ LIBS="$LIBS -lfreetype -lexpat -lX11 -lXext -lXrender -lxcb -lXdmcp -lXau -lz $X_EXTRA_LIBS"
CFLAGS="$CFLAGS $X_CFLAGS"
CXXFLAGS="$CXXFLAGS $X_CFLAGS"
LDFLAGS="$X_LIBS $LDFLAGS"

View File

@@ -0,0 +1,11 @@
--- freetype-2.1.10/include/freetype/config/ftoption.h.enable-ft2-bci 2005-10-12 13:50:40.000000000 -0400
+++ freetype-2.1.10/include/freetype/config/ftoption.h 2005-10-12 14:18:50.000000000 -0400
@@ -436,7 +436,7 @@
/* Do not #undef this macro here, since the build system might */
/* define it for certain configurations only. */
/* */
-/* #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
+#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
/*************************************************************************/

View File

@@ -0,0 +1,20 @@
--- freetype-2.2.1/modules.cfg.orig 2006-07-07 21:01:09.000000000 -0400
+++ freetype-2.2.1/modules.cfg 2006-07-07 21:01:54.000000000 -0400
@@ -110,7 +110,7 @@
AUX_MODULES += cache
# TrueType GX/AAT table validation. Needs ftgxval.c below.
-# AUX_MODULES += gxvalid
+AUX_MODULES += gxvalid
# Support for streams compressed with gzip (files with suffix .gz).
#
@@ -124,7 +124,7 @@
# OpenType table validation. Needs ftotval.c below.
#
-# AUX_MODULES += otvalid
+AUX_MODULES += otvalid
# Auxiliary PostScript driver component to share common code.
#

View File

@@ -0,0 +1,11 @@
--- freetype-2.3.0/include/freetype/config/ftoption.h.spf 2007-01-18 14:27:34.000000000 -0500
+++ freetype-2.3.0/include/freetype/config/ftoption.h 2007-01-18 14:27:48.000000000 -0500
@@ -92,7 +92,7 @@
/* This is done to allow FreeType clients to run unmodified, forcing */
/* them to display normal gray-level anti-aliased glyphs. */
/* */
-/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
+#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING
/*************************************************************************/

View File

@@ -0,0 +1,101 @@
--- freetype-2.3.11/src/cff/cffgload.c.CVE-2010-1797-2 2009-09-10 17:52:21.000000000 +0200
+++ freetype-2.3.11/src/cff/cffgload.c 2010-08-11 13:39:32.000000000 +0200
@@ -2358,8 +2358,11 @@
return CFF_Err_Unimplemented_Feature;
}
- decoder->top = args;
+ decoder->top = args;
+ if ( decoder->top - stack >= CFF_MAX_OPERANDS )
+ goto Stack_Overflow;
+
} /* general operator processing */
} /* while ip < limit */
@@ -2627,48 +2630,54 @@
/* now load the unscaled outline */
error = cff_get_glyph_data( face, glyph_index,
&charstring, &charstring_len );
- if ( !error )
- {
- error = cff_decoder_prepare( &decoder, size, glyph_index );
- if ( !error )
- {
- error = cff_decoder_parse_charstrings( &decoder,
- charstring,
- charstring_len );
+ if ( error )
+ goto Glyph_Build_Finished;
+
+ error = cff_decoder_prepare( &decoder, size, glyph_index );
+ if ( error )
+ goto Glyph_Build_Finished;
- cff_free_glyph_data( face, &charstring, charstring_len );
+ error = cff_decoder_parse_charstrings( &decoder,
+ charstring,
+ charstring_len );
+
+ cff_free_glyph_data( face, &charstring, charstring_len );
+
+ if ( error )
+ goto Glyph_Build_Finished;
#ifdef FT_CONFIG_OPTION_INCREMENTAL
- /* Control data and length may not be available for incremental */
- /* fonts. */
- if ( face->root.internal->incremental_interface )
- {
- glyph->root.control_data = 0;
- glyph->root.control_len = 0;
- }
- else
+ /* Control data and length may not be available for incremental */
+ /* fonts. */
+ if ( face->root.internal->incremental_interface )
+ {
+ glyph->root.control_data = 0;
+ glyph->root.control_len = 0;
+ }
+ else
#endif /* FT_CONFIG_OPTION_INCREMENTAL */
- /* We set control_data and control_len if charstrings is loaded. */
- /* See how charstring loads at cff_index_access_element() in */
- /* cffload.c. */
- {
- CFF_Index csindex = &cff->charstrings_index;
+ /* We set control_data and control_len if charstrings is loaded. */
+ /* See how charstring loads at cff_index_access_element() in */
+ /* cffload.c. */
+ {
+ CFF_Index csindex = &cff->charstrings_index;
- if ( csindex->offsets )
- {
- glyph->root.control_data = csindex->bytes +
- csindex->offsets[glyph_index] - 1;
- glyph->root.control_len = charstring_len;
- }
- }
+ if ( csindex->offsets )
+ {
+ glyph->root.control_data = csindex->bytes +
+ csindex->offsets[glyph_index] - 1;
+ glyph->root.control_len = charstring_len;
}
}
- /* save new glyph tables */
- cff_builder_done( &decoder.builder );
+ Glyph_Build_Finished:
+ /* save new glyph tables, if no error */
+ if ( !error )
+ cff_builder_done( &decoder.builder );
+ /* XXX: anything to do for broken glyph entry? */
}
#ifdef FT_CONFIG_OPTION_INCREMENTAL

View File

@@ -0,0 +1,35 @@
--- freetype-2.3.11/src/pshinter/pshalgo.c 2009-07-03 15:28:24.000000000 +0200
+++ freetype-2.3.11/src/pshinter/pshalgo.c 2010-07-13 13:14:22.000000000 +0200
@@ -4,7 +4,8 @@
/* */
/* PostScript hinting algorithm (body). */
/* */
-/* Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
+/* Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 */
+/* by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used */
@@ -1690,7 +1691,10 @@
/* process secondary hints to `selected' points */
if ( num_masks > 1 && glyph->num_points > 0 )
{
- first = mask->end_point;
+ /* the `endchar' op can reduce the number of points */
+ first = mask->end_point > glyph->num_points
+ ? glyph->num_points
+ : mask->end_point;
mask++;
for ( ; num_masks > 1; num_masks--, mask++ )
{
@@ -1698,7 +1702,9 @@
FT_Int count;
- next = mask->end_point;
+ next = mask->end_point > glyph->num_points
+ ? glyph->num_points
+ : mask->end_point;
count = next - first;
if ( count > 0 )
{

View File

@@ -0,0 +1,39 @@
--- freetype-2.3.11/src/base/ftobjs.c 2009-09-02 08:42:41.000000000 +0200
+++ freetype-2.3.11/src/base/ftobjs.c 2010-07-12 16:39:13.000000000 +0200
@@ -1531,6 +1531,8 @@
len += rlen;
else
{
+ if ( pfb_lenpos + 3 > pfb_len + 2 )
+ goto Exit2;
pfb_data[pfb_lenpos ] = (FT_Byte)( len );
pfb_data[pfb_lenpos + 1] = (FT_Byte)( len >> 8 );
pfb_data[pfb_lenpos + 2] = (FT_Byte)( len >> 16 );
@@ -1539,6 +1541,8 @@
if ( ( flags >> 8 ) == 5 ) /* End of font mark */
break;
+ if ( pfb_pos + 6 > pfb_len + 2 )
+ goto Exit2;
pfb_data[pfb_pos++] = 0x80;
type = flags >> 8;
@@ -1553,12 +1557,18 @@
}
error = FT_Stream_Read( stream, (FT_Byte *)pfb_data + pfb_pos, rlen );
+ if ( error )
+ goto Exit2;
pfb_pos += rlen;
}
+ if ( pfb_pos + 2 > pfb_len + 2 )
+ goto Exit2;
pfb_data[pfb_pos++] = 0x80;
pfb_data[pfb_pos++] = 3;
+ if ( pfb_lenpos + 3 > pfb_len + 2 )
+ goto Exit2;
pfb_data[pfb_lenpos ] = (FT_Byte)( len );
pfb_data[pfb_lenpos + 1] = (FT_Byte)( len >> 8 );
pfb_data[pfb_lenpos + 2] = (FT_Byte)( len >> 16 );

View File

@@ -0,0 +1,31 @@
--- freetype-2.3.11/src/smooth/ftgrays.c 2009-07-31 18:45:19.000000000 +0200
+++ freetype-2.3.11/src/smooth/ftgrays.c 2010-07-13 10:26:58.000000000 +0200
@@ -1189,7 +1189,7 @@
/* first of all, compute the scanline offset */
p = (unsigned char*)map->buffer - y * map->pitch;
if ( map->pitch >= 0 )
- p += ( map->rows - 1 ) * map->pitch;
+ p += (unsigned)( ( map->rows - 1 ) * map->pitch );
for ( ; count > 0; count--, spans++ )
{
--- freetype-2.3.11/src/smooth/ftsmooth.c 2009-07-31 18:45:19.000000000 +0200
+++ freetype-2.3.11/src/smooth/ftsmooth.c 2010-07-13 10:26:58.000000000 +0200
@@ -4,7 +4,7 @@
/* */
/* Anti-aliasing renderer interface (body). */
/* */
-/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2009 by */
+/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -200,7 +200,7 @@
/* Required check is ( pitch * height < FT_ULONG_MAX ), */
/* but we care realistic cases only. Always pitch <= width. */
- if ( width > 0xFFFFU || height > 0xFFFFU )
+ if ( width > 0x7FFFU || height > 0x7FFFU )
{
FT_ERROR(( "ft_smooth_render_generic: glyph too large: %d x %d\n",
width, height ));

View File

@@ -0,0 +1,23 @@
--- freetype-2.3.11/src/base/ftobjs.c 2010-07-12 17:03:47.000000000 +0200
+++ freetype-2.3.11/src/base/ftobjs.c 2010-07-12 17:07:06.000000000 +0200
@@ -1526,7 +1526,19 @@
goto Exit;
if ( FT_READ_USHORT( flags ) )
goto Exit;
- rlen -= 2; /* the flags are part of the resource */
+ FT_TRACE3(( "POST fragment[%d]: offsets=0x%08x, rlen=0x%08x, flags=0x%04x\n",
+ i, offsets[i], rlen, flags ));
+
+ if ( ( flags >> 8 ) == 0 ) /* Comment, should not be loaded */
+ continue;
+
+ /* the flags are part of the resource, so rlen >= 2. */
+ /* but some fonts declare rlen = 0 for empty fragment */
+ if ( rlen > 2 )
+ rlen -= 2;
+ else
+ rlen = 0;
+
if ( ( flags >> 8 ) == type )
len += rlen;
else

View File

@@ -0,0 +1,13 @@
--- freetype-2.3.11/src/truetype/ttinterp.c 2009-07-31 18:45:19.000000000 +0200
+++ freetype-2.3.11/src/truetype/ttinterp.c 2010-07-15 14:44:23.000000000 +0200
@@ -6466,8 +6466,8 @@
end_point = CUR.pts.contours[contour] - CUR.pts.first_point;
first_point = point;
- if ( CUR.pts.n_points <= end_point )
- end_point = CUR.pts.n_points;
+ if ( BOUNDS ( end_point, CUR.pts.n_points ) )
+ end_point = CUR.pts.n_points - 1;
while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 )
point++;

View File

@@ -0,0 +1,154 @@
--- freetype-2.3.11/ft2demos-2.3.11/src/ftdiff.c 2009-04-30 18:07:48.000000000 +0200
+++ freetype-2.3.11/ft2demos-2.3.11/src/ftdiff.c 2010-07-22 18:18:06.000000000 +0200
@@ -1054,11 +1054,11 @@
state->message = state->message0;
if ( total > 1 )
- sprintf( state->message0, "%s %d/%d @ %5.1fpt",
+ sprintf( state->message0, "%.100s %d/%d @ %5.1fpt",
state->filename, idx + 1, total,
state->char_size );
else
- sprintf( state->message0, "%s @ %5.1fpt",
+ sprintf( state->message0, "%.100s @ %5.1fpt",
state->filename,
state->char_size );
}
--- freetype-2.3.11/ft2demos-2.3.11/src/ftgrid.c 2009-04-30 18:15:21.000000000 +0200
+++ freetype-2.3.11/ft2demos-2.3.11/src/ftgrid.c 2010-07-22 18:18:06.000000000 +0200
@@ -2,7 +2,7 @@
/* */
/* The FreeType project -- a free and portable quality TrueType renderer. */
/* */
-/* Copyright 1996-2000, 2003, 2004, 2005, 2006, 2007, 2009 by */
+/* Copyright 1996-2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */
/* D. Turner, R.Wilhelm, and W. Lemberg */
/* */
/* */
@@ -787,22 +787,22 @@ grid_status_draw_outline( GridStatus
switch ( error_code )
{
case FT_Err_Ok:
- sprintf( status.header_buffer, "%s %s (file `%s')",
+ sprintf( status.header_buffer, "%.50s %.50s (file `%.100s')",
face->family_name, face->style_name, basename );
break;
case FT_Err_Invalid_Pixel_Size:
- sprintf( status.header_buffer, "Invalid pixel size (file `%s')",
+ sprintf( status.header_buffer, "Invalid pixel size (file `%.100s')",
basename );
break;
case FT_Err_Invalid_PPem:
- sprintf( status.header_buffer, "Invalid ppem value (file `%s')",
+ sprintf( status.header_buffer, "Invalid ppem value (file `%.100s')",
basename );
break;
default:
- sprintf( status.header_buffer, "File `%s': error 0x%04x",
+ sprintf( status.header_buffer, "File `%.100s': error 0x%04x",
basename, (FT_UShort)error_code );
break;
}
--- freetype-2.3.11/ft2demos-2.3.11/src/ftmulti.c 2009-03-14 14:58:28.000000000 +0100
+++ freetype-2.3.11/ft2demos-2.3.11/src/ftmulti.c 2010-07-22 18:18:39.000000000 +0200
@@ -2,7 +2,7 @@
/* */
/* The FreeType project -- a free and portable quality TrueType renderer. */
/* */
-/* Copyright 1996-2000, 2003, 2004, 2005 by */
+/* Copyright 1996-2000, 2003, 2004, 2005, 2010 by */
/* D. Turner, R.Wilhelm, and W. Lemberg */
/* */
/* */
@@ -34,7 +34,7 @@
#define MAXPTSIZE 500 /* dtp */
- char Header[128];
+ char Header[256];
char* new_header = 0;
const unsigned char* Text = (unsigned char*)
@@ -795,7 +795,7 @@
Render_All( Num, ptsize );
}
- sprintf( Header, "%s %s (file %s)",
+ sprintf( Header, "%.50s %.50s (file %.100s)",
face->family_name,
face->style_name,
ft_basename( argv[file] ) );
@@ -830,7 +830,7 @@
}
else
{
- sprintf( Header, "%s: not an MM font file, or could not be opened",
+ sprintf( Header, "%.100s: not an MM font file, or could not be opened",
ft_basename( argv[file] ) );
}
--- freetype-2.3.11/ft2demos-2.3.11/src/ftstring.c 2009-03-14 14:58:28.000000000 +0100
+++ freetype-2.3.11/ft2demos-2.3.11/src/ftstring.c 2010-07-22 18:18:06.000000000 +0200
@@ -2,7 +2,7 @@
/* */
/* The FreeType project -- a free and portable quality TrueType renderer. */
/* */
-/* Copyright 1996-2002, 2003, 2004, 2005, 2006, 2007, 2009 by */
+/* Copyright 1996-2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */
/* D. Turner, R.Wilhelm, and W. Lemberg */
/* */
/* */
@@ -413,19 +413,20 @@
switch ( error_code )
{
case FT_Err_Ok:
- sprintf( status.header_buffer, "%s %s (file `%s')", face->family_name,
+ sprintf( status.header_buffer,
+ "%.50s %.50s (file `%.100s')", face->family_name,
face->style_name, basename );
break;
case FT_Err_Invalid_Pixel_Size:
- sprintf( status.header_buffer, "Invalid pixel size (file `%s')",
+ sprintf( status.header_buffer, "Invalid pixel size (file `%.100s')",
basename );
break;
case FT_Err_Invalid_PPem:
- sprintf( status.header_buffer, "Invalid ppem value (file `%s')",
+ sprintf( status.header_buffer, "Invalid ppem value (file `%.100s')",
basename );
break;
default:
- sprintf( status.header_buffer, "File `%s': error 0x%04x", basename,
+ sprintf( status.header_buffer, "File `%.100s': error 0x%04x", basename,
(FT_UShort)error_code );
break;
}
--- freetype-2.3.11/ft2demos-2.3.11/src/ftview.c 2009-04-30 20:08:25.000000000 +0200
+++ freetype-2.3.11/ft2demos-2.3.11/src/ftview.c 2010-07-22 18:18:06.000000000 +0200
@@ -1086,19 +1086,19 @@
switch ( error_code )
{
case FT_Err_Ok:
- sprintf( status.header_buffer, "%s %s (file `%s')",
+ sprintf( status.header_buffer, "%.50s %.50s (file `%.100s')",
face->family_name, face->style_name, basename );
break;
case FT_Err_Invalid_Pixel_Size:
- sprintf( status.header_buffer, "Invalid pixel size (file `%s')",
+ sprintf( status.header_buffer, "Invalid pixel size (file `%.100s')",
basename );
break;
case FT_Err_Invalid_PPem:
- sprintf( status.header_buffer, "Invalid ppem value (file `%s')",
+ sprintf( status.header_buffer, "Invalid ppem value (file `%.100s')",
basename );
break;
default:
- sprintf( status.header_buffer, "File `%s': error 0x%04x",
+ sprintf( status.header_buffer, "File `%.100s': error 0x%04x",
basename, (FT_UShort)error_code );
break;
}

View File

@@ -0,0 +1,11 @@
--- freetype-2.3.11/src/base/ftstream.c 2009-08-03 19:51:40.000000000 +0200
+++ freetype-2.3.11/src/base/ftstream.c 2010-09-30 13:46:08.000000000 +0200
@@ -275,7 +275,7 @@
{
/* check current and new position */
if ( stream->pos >= stream->size ||
- stream->pos + count > stream->size )
+ stream->size - stream->pos < count )
{
FT_ERROR(( "FT_Stream_EnterFrame:"
" invalid i/o; pos = 0x%lx, count = %lu, size = 0x%lx\n",

View File

@@ -0,0 +1,41 @@
--- freetype-2.3.11/src/type42/t42parse.c 2009-07-03 15:28:24.000000000 +0200
+++ freetype-2.3.11/src/type42/t42parse.c 2010-09-23 12:15:56.000000000 +0200
@@ -4,7 +4,7 @@
/* */
/* Type 42 font parser (body). */
/* */
-/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
+/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by */
/* Roberto Alameda. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -575,6 +575,12 @@
}
string_size = T1_ToInt( parser );
+ if ( string_size < 0 )
+ {
+ FT_ERROR(( "t42_parse_sfnts: invalid string size\n" ));
+ error = T42_Err_Invalid_File_Format;
+ goto Fail;
+ }
T1_Skip_PS_Token( parser ); /* `RD' */
if ( parser->root.error )
@@ -582,13 +588,14 @@
string_buf = parser->root.cursor + 1; /* one space after `RD' */
- parser->root.cursor += string_size + 1;
- if ( parser->root.cursor >= limit )
+ if ( limit - parser->root.cursor < string_size )
{
FT_ERROR(( "t42_parse_sfnts: too many binary data\n" ));
error = T42_Err_Invalid_File_Format;
goto Fail;
}
+ else
+ parser->root.cursor += string_size + 1;
}
if ( !string_buf )

View File

@@ -0,0 +1,21 @@
--- freetype-2.3.11/src/base/ftobjs.c 2010-09-30 13:58:50.000000000 +0200
+++ freetype-2.3.11/src/base/ftobjs.c 2010-09-30 13:59:31.000000000 +0200
@@ -1529,6 +1529,7 @@
FT_TRACE3(( "POST fragment[%d]: offsets=0x%08x, rlen=0x%08x, flags=0x%04x\n",
i, offsets[i], rlen, flags ));
+ /* postpone the check of rlen longer than buffer until FT_Stream_Read() */
if ( ( flags >> 8 ) == 0 ) /* Comment, should not be loaded */
continue;
@@ -1568,6 +1569,10 @@
pfb_data[pfb_pos++] = 0;
}
+ error = FT_Err_Cannot_Open_Resource;
+ if ( pfb_pos > pfb_len || pfb_pos + rlen > pfb_len )
+ goto Exit2;
+
error = FT_Stream_Read( stream, (FT_Byte *)pfb_data + pfb_pos, rlen );
if ( error )
goto Exit2;

View File

@@ -0,0 +1,37 @@
--- freetype-2.3.11/src/base/ftstream.c 2010-09-30 14:12:38.000000000 +0200
+++ freetype-2.3.11/src/base/ftstream.c 2010-09-30 14:12:59.000000000 +0200
@@ -59,8 +59,17 @@
{
FT_Error error = FT_Err_Ok;
+ /* note that seeking to the first position after the file is valid */
+ if ( pos > stream->size )
+ {
+ FT_ERROR(( "FT_Stream_Seek:"
+ " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
+ pos, stream->size ));
- if ( stream->read )
+ error = FT_Err_Invalid_Stream_Operation;
+ }
+
+ if ( !error && stream->read )
{
if ( stream->read( stream, pos, 0, 0 ) )
{
@@ -71,15 +80,6 @@
error = FT_Err_Invalid_Stream_Operation;
}
}
- /* note that seeking to the first position after the file is valid */
- else if ( pos > stream->size )
- {
- FT_ERROR(( "FT_Stream_Seek:"
- " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
- pos, stream->size ));
-
- error = FT_Err_Invalid_Stream_Operation;
- }
if ( !error )
stream->pos = pos;

View File

@@ -0,0 +1,20 @@
--- freetype-2.3.11/src/truetype/ttgxvar.c.orig 2009-07-31 18:45:19.000000000 +0200
+++ freetype-2.3.11/src/truetype/ttgxvar.c 2010-10-22 08:52:37.000000000 +0200
@@ -157,7 +157,7 @@
runcnt = runcnt & GX_PT_POINT_RUN_COUNT_MASK;
first = points[i++] = FT_GET_USHORT();
- if ( runcnt < 1 )
+ if ( runcnt < 1 || i + runcnt >= n )
goto Exit;
/* first point not included in runcount */
@@ -168,7 +168,7 @@
{
first = points[i++] = FT_GET_BYTE();
- if ( runcnt < 1 )
+ if ( runcnt < 1 || i + runcnt >= n )
goto Exit;
for ( j = 0; j < runcnt; ++j )

View File

@@ -0,0 +1,108 @@
--- freetype-2.3.11/src/psaux/t1decode.c 2009-09-29 19:51:31.000000000 +0200
+++ freetype-2.3.11/src/psaux/t1decode.c 2011-07-20 14:39:24.000000000 +0200
@@ -4,7 +4,7 @@
/* */
/* PostScript Type 1 decoding routines (body). */
/* */
-/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
+/* Copyright 2000-2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -27,6 +27,8 @@
#include "psauxerr.h"
+/* ensure proper sign extension */
+#define Fix2Int( f ) ( (FT_Int)(FT_Short)( (f) >> 16 ) )
/*************************************************************************/
/* */
@@ -665,7 +667,7 @@
if ( large_int )
FT_TRACE4(( " %ld", value ));
else
- FT_TRACE4(( " %ld", (FT_Int32)( value >> 16 ) ));
+ FT_TRACE4(( " %ld", Fix2Int( value ) ));
#endif
*top++ = value;
@@ -687,8 +689,8 @@
top -= 2;
- subr_no = (FT_Int)( top[1] >> 16 );
- arg_cnt = (FT_Int)( top[0] >> 16 );
+ subr_no = Fix2Int( top[1] );
+ arg_cnt = Fix2Int( top[0] );
/***********************************************************/
/* */
@@ -861,7 +863,7 @@
if ( arg_cnt != 1 || blend == NULL )
goto Unexpected_OtherSubr;
- idx = (FT_Int)( top[0] >> 16 );
+ idx = Fix2Int( top[0] );
if ( idx < 0 ||
idx + blend->num_designs > decoder->len_buildchar )
@@ -929,7 +931,7 @@
if ( arg_cnt != 2 || blend == NULL )
goto Unexpected_OtherSubr;
- idx = (FT_Int)( top[1] >> 16 );
+ idx = Fix2Int( top[1] );
if ( idx < 0 || (FT_UInt) idx >= decoder->len_buildchar )
goto Unexpected_OtherSubr;
@@ -950,7 +952,7 @@
if ( arg_cnt != 1 || blend == NULL )
goto Unexpected_OtherSubr;
- idx = (FT_Int)( top[0] >> 16 );
+ idx = Fix2Int( top[0] );
if ( idx < 0 || (FT_UInt) idx >= decoder->len_buildchar )
goto Unexpected_OtherSubr;
@@ -1008,11 +1010,15 @@
break;
default:
- FT_ERROR(( "t1_decoder_parse_charstrings:"
- " unknown othersubr [%d %d], wish me luck\n",
- arg_cnt, subr_no ));
- unknown_othersubr_result_cnt = arg_cnt;
- break;
+ if ( arg_cnt >= 0 && subr_no >= 0 )
+ {
+ FT_ERROR(( "t1_decoder_parse_charstrings:"
+ " unknown othersubr [%d %d], wish me luck\n",
+ arg_cnt, subr_no ));
+ unknown_othersubr_result_cnt = arg_cnt;
+ break;
+ }
+ /* fall through */
Unexpected_OtherSubr:
FT_ERROR(( "t1_decoder_parse_charstrings:"
@@ -1138,8 +1144,8 @@
top[0],
top[1],
top[2],
- (FT_Int)( top[3] >> 16 ),
- (FT_Int)( top[4] >> 16 ) );
+ Fix2Int( top[3] ),
+ Fix2Int( top[4] ) );
case op_sbw:
FT_TRACE4(( " sbw" ));
@@ -1313,7 +1319,7 @@
FT_TRACE4(( " callsubr" ));
- idx = (FT_Int)( top[0] >> 16 );
+ idx = Fix2Int( top[0] );
if ( idx < 0 || idx >= (FT_Int)decoder->num_subrs )
{
FT_ERROR(( "t1_decoder_parse_charstrings:"

View File

@@ -0,0 +1,92 @@
--- freetype-2.3.11/src/base/ftbitmap.c 2009-07-31 18:45:18.000000000 +0200
+++ freetype-2.3.11/src/base/ftbitmap.c 2011-10-19 12:25:26.000000000 +0200
@@ -4,7 +4,7 @@
/* */
/* FreeType utility functions for bitmaps (body). */
/* */
-/* Copyright 2004, 2005, 2006, 2007, 2008, 2009 by */
+/* Copyright 2004-2009, 2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -417,6 +417,10 @@
target->pitch = source->width + pad;
+ if ( target->pitch > 0 &&
+ target->rows > FT_ULONG_MAX / target->pitch )
+ return FT_Err_Invalid_Argument;
+
if ( target->rows * target->pitch > old_size &&
FT_QREALLOC( target->buffer,
old_size, target->rows * target->pitch ) )
--- freetype-2.3.11/src/psaux/t1decode.c 2011-10-19 12:25:26.000000000 +0200
+++ freetype-2.3.11/src/psaux/t1decode.c 2011-10-19 12:25:26.000000000 +0200
@@ -748,6 +748,13 @@
if ( arg_cnt != 0 )
goto Unexpected_OtherSubr;
+ if ( decoder->flex_state == 0 )
+ {
+ FT_ERROR(( "t1_decoder_parse_charstrings:"
+ " missing flex start\n" ));
+ goto Syntax_Error;
+ }
+
/* note that we should not add a point for index 0; */
/* this will move our current position to the flex */
/* point without adding any point to the outline */
--- freetype-2.3.11/src/raster/ftrend1.c 2009-07-03 15:28:24.000000000 +0200
+++ freetype-2.3.11/src/raster/ftrend1.c 2011-10-19 13:26:02.000000000 +0200
@@ -4,7 +4,7 @@
/* */
/* The FreeType glyph rasterizer interface (body). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2005, 2006 by */
+/* Copyright 1996-2003, 2005, 2006, 2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -25,6 +25,7 @@
#include "rasterrs.h"
+#define FT_USHORT_MAX USHRT_MAX
/* initialize renderer -- init its raster */
static FT_Error
@@ -168,6 +169,13 @@
width = (FT_UInt)( ( cbox.xMax - cbox.xMin ) >> 6 );
height = (FT_UInt)( ( cbox.yMax - cbox.yMin ) >> 6 );
+
+ if ( width > FT_USHORT_MAX || height > FT_USHORT_MAX )
+ {
+ error = Raster_Err_Invalid_Argument;
+ goto Exit;
+ }
+
bitmap = &slot->bitmap;
memory = render->root.memory;
--- freetype-2.3.11/src/truetype/ttgxvar.c 2011-10-19 12:25:26.000000000 +0200
+++ freetype-2.3.11/src/truetype/ttgxvar.c 2011-10-19 12:25:26.000000000 +0200
@@ -4,7 +4,7 @@
/* */
/* TrueType GX Font Variation loader */
/* */
-/* Copyright 2004, 2005, 2006, 2007, 2008, 2009 by */
+/* Copyright 2004-2011 by */
/* David Turner, Robert Wilhelm, Werner Lemberg, and George Williams. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -1473,6 +1473,9 @@
{
for ( j = 0; j < point_count; ++j )
{
+ if ( localpoints[j] >= n_points )
+ continue;
+
delta_xy[localpoints[j]].x += FT_MulFix( deltas_x[j], apply );
delta_xy[localpoints[j]].y += FT_MulFix( deltas_y[j], apply );
}

View File

@@ -0,0 +1,76 @@
--- freetype-2.3.11/src/cid/cidload.c 2009-07-03 15:28:24.000000000 +0200
+++ freetype-2.3.11/src/cid/cidload.c 2011-11-15 12:58:41.000000000 +0100
@@ -4,7 +4,7 @@
/* */
/* CID-keyed Type1 font loader (body). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2009 by */
+/* Copyright 1996-2006, 2009, 2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -110,7 +110,7 @@
CID_FaceDict dict;
- if ( parser->num_dict < 0 )
+ if ( parser->num_dict < 0 || parser->num_dict >= cid->num_dicts )
{
FT_ERROR(( "cid_load_keyword: invalid use of `%s'\n",
keyword->ident ));
@@ -158,7 +158,7 @@
FT_Fixed temp_scale;
- if ( parser->num_dict >= 0 )
+ if ( parser->num_dict >= 0 && parser->num_dict < face->cid.num_dicts )
{
dict = face->cid.font_dicts + parser->num_dict;
matrix = &dict->font_matrix;
@@ -249,7 +249,7 @@
CID_FaceDict dict;
- if ( parser->num_dict >= 0 )
+ if ( parser->num_dict >= 0 && parser->num_dict < face->cid.num_dicts )
{
dict = face->cid.font_dicts + parser->num_dict;
@@ -413,12 +413,25 @@
FT_Byte* p;
+ /* Check for possible overflow. */
+ if ( num_subrs == FT_UINT_MAX )
+ {
+ error = CID_Err_Syntax_Error;
+ goto Fail;
+ }
+
/* reallocate offsets array if needed */
if ( num_subrs + 1 > max_offsets )
{
FT_UInt new_max = FT_PAD_CEIL( num_subrs + 1, 4 );
+ if ( new_max <= max_offsets )
+ {
+ error = CID_Err_Syntax_Error;
+ goto Fail;
+ }
+
if ( FT_RENEW_ARRAY( offsets, max_offsets, new_max ) )
goto Fail;
@@ -436,6 +449,11 @@
FT_FRAME_EXIT();
+ /* offsets must be ordered */
+ for ( count = 1; count <= num_subrs; count++ )
+ if ( offsets[count - 1] > offsets[count] )
+ goto Fail;
+
/* now, compute the size of subrs charstrings, */
/* allocate, and read them */
data_len = offsets[num_subrs] - offsets[0];

Some files were not shown because too many files have changed in this diff Show More