diff --git a/autobuild.xml b/autobuild.xml index 192c453c38..de2a053ea8 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -3,6 +3,62 @@ installables + glib + + copyright + Copyright (C) glib project + license + LGPL + license_file + LICENSES/glib.txt + name + glib + platforms + + linux64 + + archive + + hash + 9c93ba8b8af97fc8379f77de77e1540a + url + http://3p.firestormviewer.org/glib-2.48.0.202301938-linux64-202301938.tar.bz2 + + name + linux + + + version + 2.48.0 + + fltk + + copyright + Copyright (C) fltk project + license + LGPL/fltk + license_file + LICENSES/fltk.txt + name + fltk + platforms + + linux64 + + archive + + hash + 81fe1e927e4fe3c5e5f15ce6219ca883 + url + http://3p.firestormviewer.org/fltk-1.3.5.202282121-linux64-202282121.tar.bz2 + + name + linux + + + version + 1.3.5 + jemalloc copyright @@ -1577,46 +1633,6 @@ version 0.10.6.314267 - gtk-atk-pango-glib - - copyright - Copyright (various, see sources) - license - lgpl - license_file - LICENSES/gtk-atk-pango-glib.txt - name - gtk-atk-pango-glib - platforms - - linux - - archive - - hash - fb047d496c32cc3b9f99793ee6ebb1e3 - url - http://3p.firestormviewer.org/gtk_atk_pango_glib-2.1-linux-180871647.tar.bz2 - - name - linux - - linux64 - - archive - - hash - d918d894430c1d1d869b9f2e06570c65 - url - http://3p.firestormviewer.org/gtk_atk_pango_glib-2.1-linux64-180841902.tar.bz2 - - name - linux64 - - - version - 2.1 - havok-source copyright diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index c262d7f209..519f68b53e 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -245,16 +245,9 @@ elseif(LINUX) # have to deal with if (NOT USESYSTEMLIBS) set(release_files - #libapr-1.so.0 - #libaprutil-1.so.0 - libatk-1.0.so #libdb-5.1.so ${EXPAT_COPY} - #libfreetype.so.6.6.2 - #libfreetype.so.6 #libGLOD.so - libgmodule-2.0.so - libgobject-2.0.so libhunspell-1.3.so.0.0.0 libopenal.so #libopenjpeg.so diff --git a/indra/cmake/DBusGlib.cmake b/indra/cmake/DBusGlib.cmake index 5e46b6711a..160196a672 100644 --- a/indra/cmake/DBusGlib.cmake +++ b/indra/cmake/DBusGlib.cmake @@ -1,29 +1,27 @@ # -*- cmake -*- include(Prebuilt) +include(GLIB) -if (USESYSTEMLIBS) - include(FindPkgConfig) +if( GLIB_FOUND ) + if (USESYSTEMLIBS) + include(FindPkgConfig) - pkg_check_modules(DBUSGLIB REQUIRED dbus-glib-1) + pkg_check_modules(DBUSGLIB REQUIRED dbus-glib-1) -elseif (LINUX) - use_prebuilt_binary(dbus_glib) - set(DBUSGLIB_FOUND ON FORCE BOOL) - set(DBUSGLIB_INCLUDE_DIRS + elseif (LINUX) + use_prebuilt_binary(dbus_glib) + set(DBUSGLIB_FOUND ON FORCE BOOL) + set(DBUSGLIB_INCLUDE_DIRS + ${GLIB_INCLUDE_DIRS} ${LIBS_PREBUILT_DIR}/include/dbus ) - # We don't need to explicitly link against dbus-glib itself, because - # the viewer probes for the system's copy at runtime. - set(DBUSGLIB_LIBRARIES - gobject-2.0 - glib-2.0 - ) -endif (USESYSTEMLIBS) + endif (USESYSTEMLIBS) -if (DBUSGLIB_FOUND) - set(DBUSGLIB ON CACHE BOOL "Build with dbus-glib message bus support.") -endif (DBUSGLIB_FOUND) + if (DBUSGLIB_FOUND) + set(DBUSGLIB ON CACHE BOOL "Build with dbus-glib message bus support.") + endif (DBUSGLIB_FOUND) -if (DBUSGLIB) - add_definitions(-DLL_DBUS_ENABLED=1) -endif (DBUSGLIB) + if (DBUSGLIB) + add_definitions(-DLL_DBUS_ENABLED=1) + endif (DBUSGLIB) +endif() diff --git a/indra/cmake/GLIB.cmake b/indra/cmake/GLIB.cmake new file mode 100644 index 0000000000..0024cb26ac --- /dev/null +++ b/indra/cmake/GLIB.cmake @@ -0,0 +1,11 @@ + +include(Prebuilt) + +if( LINUX ) + use_prebuilt_binary(glib) + set(GLIB_FOUND ON CACHE BOOL "Build against glib 2") + set(GLIB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/glib-2.0 ${LIBS_PREBUILT_DIR}/lib/release/glib-2.0/include ) + set(GLIB_LIBRARIES libgobject-2.0.a libglib-2.0.a libffi.a libpcre.a) + + add_definitions(-DLL_GLIB=1) +endif() diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake index f1a8b68900..8c5d266cf5 100644 --- a/indra/cmake/UI.cmake +++ b/indra/cmake/UI.cmake @@ -5,23 +5,29 @@ include(FreeType) if (USESYSTEMLIBS) include(FindPkgConfig) + if( NOT GTK_VERSION ) + set( GTK_VERSION 2.0 ) + endif() if (LINUX) set(PKGCONFIG_PACKAGES atk cairo - gdk-2.0 + gdk-${GTK_VERSION} gdk-pixbuf-2.0 glib-2.0 gmodule-2.0 - gtk+-2.0 + gtk+-${GTK_VERSION} gthread-2.0 libpng pango pangoft2 - pangox - pangoxft - sdl + sdl2 ) + if( GTK_VERSION LESS "3.0" ) + LIST( APPEND PKGCONFIG_PACKAGES pangoxft ) + else() + add_definitions( -DGTK_DISABLE_DEPRECATED) + endif() endif (LINUX) foreach(pkg ${PKGCONFIG_PACKAGES}) @@ -31,29 +37,16 @@ if (USESYSTEMLIBS) list(APPEND UI_LIBRARIES ${${pkg}_LIBRARIES}) add_definitions(${${pkg}_CFLAGS_OTHERS}) endforeach(pkg) + list(APPEND UI_LIBRARIES X11) else (USESYSTEMLIBS) if (LINUX) - use_prebuilt_binary(gtk-atk-pango-glib) + use_prebuilt_binary(fltk) endif (LINUX) if (LINUX) set(UI_LIB_NAMES + libfltk.a freetype - atk-1.0 - gdk-x11-2.0 - gdk_pixbuf-2.0 - glib-2.0 - gmodule-2.0 - gobject-2.0 - gthread-2.0 - gtk-x11-2.0 - pango-1.0 - pangoft2-1.0 - pangox-1.0 - #pangoxft-1.0 - gio-2.0 - pangocairo-1.0 - ffi ) foreach(libname ${UI_LIB_NAMES}) @@ -80,5 +73,5 @@ else (USESYSTEMLIBS) endif (USESYSTEMLIBS) if (LINUX) - add_definitions(-DLL_GTK=1 -DLL_X11=1) + add_definitions(-DLL_X11=1 -DLL_FLTK=1) endif (LINUX) diff --git a/indra/linux_crash_logger/llcrashloggerlinux.cpp b/indra/linux_crash_logger/llcrashloggerlinux.cpp index f6fd71e849..0395935d04 100644 --- a/indra/linux_crash_logger/llcrashloggerlinux.cpp +++ b/indra/linux_crash_logger/llcrashloggerlinux.cpp @@ -40,6 +40,7 @@ #if LL_GTK # include "gtk/gtk.h" +#error "Direct use of GTK is deprecated" #endif // LL_GTK #define MAX_LOADSTRING 100 diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index b84d74a244..6945e8da67 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -43,6 +43,7 @@ #if LL_GTK extern "C" { # include "gtk/gtk.h" +#error "Direct use of GTK is deprecated" } #include #endif // LL_GTK @@ -2396,39 +2397,6 @@ static void color_changed_callback(GtkWidget *widget, gtk_color_selection_get_current_color(colorsel, colorp); } - -/* - Make the raw keyboard data available - used to poke through to LLQtWebKit so - that Qt/Webkit has access to the virtual keycodes etc. that it needs -*/ -LLSD LLWindowSDL::getNativeKeyData() -{ - LLSD result = LLSD::emptyMap(); - - U32 modifiers = 0; // pretend-native modifiers... oh what a tangled web we weave! - - // we go through so many levels of device abstraction that I can't really guess - // what a plugin under GDK under Qt under SL under SDL under X11 considers - // a 'native' modifier mask. this has been sort of reverse-engineered... they *appear* - // to match GDK consts, but that may be co-incidence. - modifiers |= (mKeyModifiers & KMOD_LSHIFT) ? 0x0001 : 0; - modifiers |= (mKeyModifiers & KMOD_RSHIFT) ? 0x0001 : 0;// munge these into the same shift - modifiers |= (mKeyModifiers & KMOD_CAPS) ? 0x0002 : 0; - modifiers |= (mKeyModifiers & KMOD_LCTRL) ? 0x0004 : 0; - modifiers |= (mKeyModifiers & KMOD_RCTRL) ? 0x0004 : 0;// munge these into the same ctrl - modifiers |= (mKeyModifiers & KMOD_LALT) ? 0x0008 : 0;// untested - modifiers |= (mKeyModifiers & KMOD_RALT) ? 0x0008 : 0;// untested - // *todo: test ALTs - I don't have a case for testing these. Do you? - // *todo: NUM? - I don't care enough right now (and it's not a GDK modifier). - - result["scan_code"] = (S32)mKeyScanCode; - result["virtual_key"] = (S32)mKeyVirtualKey; - result["modifiers"] = (S32)modifiers; - result[ "sdl_sym" ] = (S32)mSDLSym; // Store the SDL Keysym too. - return result; -} - - BOOL LLWindowSDL::dialogColorPicker( F32 *r, F32 *g, F32 *b) { BOOL rtn = FALSE; @@ -2513,6 +2481,37 @@ BOOL LLWindowSDL::dialogColorPicker( F32 *r, F32 *g, F32 *b) } #endif // LL_GTK +/* + Make the raw keyboard data available - used to poke through to LLQtWebKit so + that Qt/Webkit has access to the virtual keycodes etc. that it needs +*/ +LLSD LLWindowSDL::getNativeKeyData() +{ + LLSD result = LLSD::emptyMap(); + + U32 modifiers = 0; // pretend-native modifiers... oh what a tangled web we weave! + + // we go through so many levels of device abstraction that I can't really guess + // what a plugin under GDK under Qt under SL under SDL under X11 considers + // a 'native' modifier mask. this has been sort of reverse-engineered... they *appear* + // to match GDK consts, but that may be co-incidence. + modifiers |= (mKeyModifiers & KMOD_LSHIFT) ? 0x0001 : 0; + modifiers |= (mKeyModifiers & KMOD_RSHIFT) ? 0x0001 : 0;// munge these into the same shift + modifiers |= (mKeyModifiers & KMOD_CAPS) ? 0x0002 : 0; + modifiers |= (mKeyModifiers & KMOD_LCTRL) ? 0x0004 : 0; + modifiers |= (mKeyModifiers & KMOD_RCTRL) ? 0x0004 : 0;// munge these into the same ctrl + modifiers |= (mKeyModifiers & KMOD_LALT) ? 0x0008 : 0;// untested + modifiers |= (mKeyModifiers & KMOD_RALT) ? 0x0008 : 0;// untested + // *todo: test ALTs - I don't have a case for testing these. Do you? + // *todo: NUM? - I don't care enough right now (and it's not a GDK modifier). + + result["scan_code"] = (S32)mKeyScanCode; + result["virtual_key"] = (S32)mKeyVirtualKey; + result["modifiers"] = (S32)modifiers; + result[ "sdl_sym" ] = (S32)mSDLSym; // Store the SDL Keysym too. + return result; +} + #if LL_LINUX // extracted from spawnWebBrowser for clarity and to eliminate // compiler confusion regarding close(int fd) vs. LLWindow::close() diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 2151ece287..775d54ca5f 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2518,7 +2518,7 @@ target_link_libraries(${VIEWER_BINARY_NAME} ${BOOST_WAVE_LIBRARY} #FS specific ${BOOST_THREAD_LIBRARY} #FS specific ${BOOST_CONTEXT_LIBRARY} - ${DBUSGLIB_LIBRARIES} + ${GLIB_LIBRARIES} ${OPENGL_LIBRARIES} ${FMODWRAPPER_LIBRARY} # must come after LLAudio ${OPENAL_LIBRARIES} diff --git a/indra/newview/llappviewerlinux.h b/indra/newview/llappviewerlinux.h index ed71ff36fd..1196bc58c1 100644 --- a/indra/newview/llappviewerlinux.h +++ b/indra/newview/llappviewerlinux.h @@ -27,15 +27,17 @@ #ifndef LL_LLAPPVIEWERLINUX_H #define LL_LLAPPVIEWERLINUX_H +#ifdef LL_GLIB extern "C" { # include -} #if LL_DBUS_ENABLED -extern "C" { # include # include +#endif + } + #endif #ifndef LL_LLAPPVIEWER_H @@ -70,7 +72,7 @@ protected: virtual bool sendURLToOtherInstance(const std::string& url); }; -#if LL_DBUS_ENABLED +#if LL_DBUS_ENABLED && LL_GLIB typedef struct { GObject parent; diff --git a/indra/newview/lldirpicker.cpp b/indra/newview/lldirpicker.cpp index 01790ad19e..9db6aa1d8a 100644 --- a/indra/newview/lldirpicker.cpp +++ b/indra/newview/lldirpicker.cpp @@ -41,6 +41,11 @@ # include "llfilepicker.h" #endif +#ifdef LL_FLTK + #include "FL/Fl.H" + #include "FL/Fl_Native_File_Chooser.H" +#endif + // // Globals // @@ -193,32 +198,41 @@ LLDirPicker::LLDirPicker() : mFileName(NULL), mLocked(false) { +#ifndef LL_FLTK mFilePicker = new LLFilePicker(); +#endif + reset(); } LLDirPicker::~LLDirPicker() { +#ifndef LL_FLTK delete mFilePicker; +#endif } void LLDirPicker::reset() { +#ifndef LL_FLTK if (mFilePicker) - mFilePicker->reset(); + mFilePicker->reset(); +#else + mDir = ""; +#endif } BOOL LLDirPicker::getDir(std::string* filename, bool blocking) { reset(); - // if local file browsing is turned off, return without opening dialog if ( check_local_file_access_enabled() == false ) { return FALSE; } +#ifndef LL_FLTK #if !LL_MESA_HEADLESS if (mFilePicker) @@ -237,15 +251,38 @@ BOOL LLDirPicker::getDir(std::string* filename, bool blocking) #endif // !LL_MESA_HEADLESS return FALSE; +#else + Fl_Native_File_Chooser flDlg; + flDlg.title("Pick a dir"); + flDlg.type(Fl_Native_File_Chooser::BROWSE_DIRECTORY ); + + int res = flDlg.show(); + if( res == 0 ) + { + char const *pDir = flDlg.filename(0); + if( pDir ) + mDir = pDir; + } + else if( res == -1 ) + { + LL_WARNS() << "FLTK failed: " << flDlg.errmsg() << LL_ENDL; + } + + return !mDir.empty(); +#endif } std::string LLDirPicker::getDirName() { +#ifndef LL_FLTK if (mFilePicker) { return mFilePicker->getFirstFile(); } return ""; +#else + return mDir; +#endif } #else // not implemented diff --git a/indra/newview/lldirpicker.h b/indra/newview/lldirpicker.h index 52febe4523..5683e34131 100644 --- a/indra/newview/lldirpicker.h +++ b/indra/newview/lldirpicker.h @@ -80,7 +80,7 @@ private: #if LL_LINUX || LL_DARWIN // On Linux we just implement LLDirPicker on top of LLFilePicker - LLFilePicker *mFilePicker; + // LLFilePicker *mFilePicker; #endif diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index be62f7b3a9..f02363505f 100644 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -36,10 +36,16 @@ #include "llviewercontrol.h" #include "llwindow.h" // beforeDialog() +#undef LL_GTK #if LL_SDL #include "llwindowsdl.h" // for some X/GTK utils to help with filepickers #endif // LL_SDL +#ifdef LL_FLTK + #include "FL/Fl.H" + #include "FL/Fl_Native_File_Chooser.H" +#endif + #if LL_LINUX #include "llhttpconstants.h" // file picker uses some of thes constants on Linux #endif @@ -1566,12 +1572,79 @@ BOOL LLFilePicker::getMultipleOpenFiles( ELoadFilter filter, bool blocking) return rtn; } +#elif LL_FLTK +BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename, bool blocking ) +{ + return openFileDialog( filter, blocking, eSaveFile ); +} + +BOOL LLFilePicker::getOpenFile( ELoadFilter filter, bool blocking ) +{ + return openFileDialog( filter, blocking, eOpenFile ); +} + +BOOL LLFilePicker::getMultipleOpenFiles( ELoadFilter filter, bool blocking) +{ + return openFileDialog( filter, blocking, eOpenMultiple ); +} + +void setupFilter( Fl_Native_File_Chooser &chooser, LLFilePicker::ESaveFilter filter ) +{ +} + +void setupFilter( Fl_Native_File_Chooser &chooser, LLFilePicker::ELoadFilter filter ) +{ +} + +bool LLFilePicker::openFileDialog( int32_t filter, bool blocking, EType aType ) +{ + if ( check_local_file_access_enabled() == false ) + return false; + + reset(); + Fl_Native_File_Chooser::Type flType = Fl_Native_File_Chooser::BROWSE_FILE; + + if( aType == eOpenMultiple ) + flType = Fl_Native_File_Chooser::BROWSE_MULTI_FILE; + else if( aType == eSaveFile ) + flType = Fl_Native_File_Chooser::BROWSE_SAVE_FILE; + + Fl_Native_File_Chooser flDlg; + flDlg.title("Pick a file"); + flDlg.type( flType ); + + if( aType == eSaveFile ) + setupFilter( flDlg, (ESaveFilter) filter ); + else + setupFilter( flDlg, (ELoadFilter) filter ); + + int res = flDlg.show(); + if( res == 0 ) + { + int32_t count = flDlg.count(); + if( count < 0 ) + count = 0; + for( int32_t i = 0; i < count; ++i ) + { + char const *pFile = flDlg.filename(i); + if( pFile && strlen(pFile) > 0 ) + mFiles.push_back( pFile ); + } + } + else if( res == -1 ) + { + LL_WARNS() << "FLTK failed: " << flDlg.errmsg() << LL_ENDL; + } + + return mFiles.empty()?FALSE:TRUE; +} + # else // LL_GTK // Hacky stubs designed to facilitate fake getSaveFile and getOpenFile with // static results, when we don't have a real filepicker. -BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename ) +BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename, bool blocking ) { // if local file browsing is turned off, return without opening dialog // (Even though this is a stub, I think we still should not return anything at all) @@ -1634,7 +1707,7 @@ BOOL LLFilePicker::getMultipleOpenFiles( ELoadFilter filter, bool blocking) #else // not implemented -BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename ) +BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename, bool blockin ) { reset(); return FALSE; diff --git a/indra/newview/llfilepicker.h b/indra/newview/llfilepicker.h index 53ea7fd316..1aa5802d02 100644 --- a/indra/newview/llfilepicker.h +++ b/indra/newview/llfilepicker.h @@ -33,6 +33,12 @@ #ifndef LL_LLFILEPICKER_H #define LL_LLFILEPICKER_H +#if LL_FLTK + #if LL_GTK + #undef LL_GTK + #endif +#endif + #include "stdtypes.h" #if LL_DARWIN @@ -58,12 +64,13 @@ extern "C" { // mostly for Linux, possible on others #if LL_GTK # include "gtk/gtk.h" +#error "Direct use of GTK is deprecated" #endif // LL_GTK } class LLFilePicker { -#ifdef LL_GTK +#if LL_GTK friend class LLDirPicker; friend void chooser_responder(GtkWidget *, gint, gpointer); #endif // LL_GTK @@ -187,7 +194,14 @@ private: // we also remember the extension of the last added file. std::string mCurrentExtension; #endif - +#if LL_FLTK + enum EType + { + eSaveFile, eOpenFile, eOpenMultiple + }; + bool openFileDialog( int32_t filter, bool blocking, EType aType ); +#endif + std::vector mFiles; S32 mCurrentFile; bool mLocked; diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 99527894b6..67d7225287 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -2002,7 +2002,7 @@ class LinuxManifest(ViewerManifest): self.path("libopenal.so", "libopenal.so.1") # Install as versioned file in case it's missing from the 3p- and won't get copied below self.path("libopenal.so*") #self.path("libnotify.so.1.1.2", "libnotify.so.1") # LO - uncomment when testing libnotify(growl) on linux - self.path("libpangox-1.0.so*") + #self.path("libpangox-1.0.so*") # KLUDGE: As of 2012-04-11, the 'fontconfig' package installs # libfontconfig.so.1.4.4, along with symlinks libfontconfig.so.1 # and libfontconfig.so. Before we added support for library-file @@ -2087,7 +2087,7 @@ class LinuxManifest(ViewerManifest): [os.path.join(self.get_dst_prefix(), dir) for dir in ('bin', 'lib')] + # Remove VMP # ['-type', 'f', '!', '-name', '*.py', - ['-type', 'f', "!", "-name", "*.dat", "!", "-name", "*.pak", "!", "-name", "*.bin", + ['-type', 'f', "!", "-name", "*.dat", "!", "-name", "*.pak", "!", "-name", "*.bin", "!", "-name", "*.lib", "!", "-name", "*.pdb", # Remove VMP '!', '-name', 'update_install', '-exec', 'strip', '-S', '{}', ';']) @@ -2191,7 +2191,7 @@ class Linux_x86_64_Manifest(LinuxManifest): if self.is_packaging_viewer(): with self.prefix(src=os.path.join(pkgdir, 'lib', 'release'), dst="lib"): - self.path("libffi*.so*") + #self.path("libffi*.so*") # vivox 32-bit hack. # one has to extract libopenal.so from the 32-bit openal package, or official LL viewer, and rename it to libopenal32.so # and place it in the prebuilt lib/release directory