From 0e865e2b7e566235912012e357111792f4e31d8c Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 3 Feb 2010 01:37:00 +0000 Subject: Added abandoned KDE3 version of the GTK Qt theme engine git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/gtk-qt-engine@1084394 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- AUTHORS | 1 + CMake/Modules/COPYING-CMAKE-SCRIPTS | 27 + CMake/Modules/FindMsgfmt.cmake | 86 ++ CMake/Modules/GtkQt.cmake | 56 + CMakeLists.txt | 94 ++ COPYING | 340 ++++++ ChangeLog | 31 + Doxyfile | 248 ++++ INSTALL | 167 +++ NEWS | 1 + README | 25 + TODO | 5 + autopackage/default.apspec | 96 ++ config.guess | 1561 ++++++++++++++++++++++++ config.guess.cdbs-orig | 1516 ++++++++++++++++++++++++ config.sub | 1686 ++++++++++++++++++++++++++ config.sub.cdbs-orig | 1626 +++++++++++++++++++++++++ configure | 15 + kcm_gtk/CMakeLists.txt | 30 + kcm_gtk/emacsdetails.ui | 233 ++++ kcm_gtk/kcmgtk.cpp | 704 +++++++++++ kcm_gtk/kcmgtk.desktop | 28 + kcm_gtk/kcmgtk.h | 104 ++ kcm_gtk/kcmgtkwidget.ui | 645 ++++++++++ kcm_gtk/mozillaprofile.ui | 74 ++ kcm_gtk/searchpaths.ui | 152 +++ po/CMakeLists.txt | 45 + po/bg.po | 184 +++ po/de.po | 203 ++++ po/es.po | 197 ++++ po/fr.po | 203 ++++ po/gtkqtengine.pot | 174 +++ po/it.po | 186 +++ po/nn.po | 191 +++ po/ru.po | 197 ++++ po/sv.po | 194 +++ po/tr.po | 181 +++ src/CMakeLists.txt | 28 + src/gtkrc | 7 + src/qt_main.c | 29 + src/qt_qt_wrapper.cpp | 2216 +++++++++++++++++++++++++++++++++++ src/qt_qt_wrapper.h | 79 ++ src/qt_rc_style.c | 101 ++ src/qt_rc_style.h | 27 + src/qt_style.h | 29 + src/qt_theme_draw.c | 1918 ++++++++++++++++++++++++++++++ 46 files changed, 15940 insertions(+) create mode 100644 AUTHORS create mode 100644 CMake/Modules/COPYING-CMAKE-SCRIPTS create mode 100644 CMake/Modules/FindMsgfmt.cmake create mode 100644 CMake/Modules/GtkQt.cmake create mode 100644 CMakeLists.txt create mode 100644 COPYING create mode 100644 ChangeLog create mode 100644 Doxyfile create mode 100644 INSTALL create mode 100644 NEWS create mode 100644 README create mode 100644 TODO create mode 100644 autopackage/default.apspec create mode 100755 config.guess create mode 100644 config.guess.cdbs-orig create mode 100755 config.sub create mode 100644 config.sub.cdbs-orig create mode 100755 configure create mode 100644 kcm_gtk/CMakeLists.txt create mode 100644 kcm_gtk/emacsdetails.ui create mode 100644 kcm_gtk/kcmgtk.cpp create mode 100644 kcm_gtk/kcmgtk.desktop create mode 100644 kcm_gtk/kcmgtk.h create mode 100644 kcm_gtk/kcmgtkwidget.ui create mode 100644 kcm_gtk/mozillaprofile.ui create mode 100644 kcm_gtk/searchpaths.ui create mode 100644 po/CMakeLists.txt create mode 100644 po/bg.po create mode 100644 po/de.po create mode 100644 po/es.po create mode 100644 po/fr.po create mode 100644 po/gtkqtengine.pot create mode 100644 po/it.po create mode 100644 po/nn.po create mode 100755 po/ru.po create mode 100644 po/sv.po create mode 100644 po/tr.po create mode 100644 src/CMakeLists.txt create mode 100644 src/gtkrc create mode 100644 src/qt_main.c create mode 100644 src/qt_qt_wrapper.cpp create mode 100644 src/qt_qt_wrapper.h create mode 100644 src/qt_rc_style.c create mode 100644 src/qt_rc_style.h create mode 100644 src/qt_style.h create mode 100644 src/qt_theme_draw.c diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..4410359 --- /dev/null +++ b/AUTHORS @@ -0,0 +1 @@ +David Sansome diff --git a/CMake/Modules/COPYING-CMAKE-SCRIPTS b/CMake/Modules/COPYING-CMAKE-SCRIPTS new file mode 100644 index 0000000..9cb049d --- /dev/null +++ b/CMake/Modules/COPYING-CMAKE-SCRIPTS @@ -0,0 +1,27 @@ +This licence file applies only to FindMsgfmt.cmake and was taken from: +http://code.google.com/p/cmake-modules/ + +----------------------------------------------------------------------- + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/CMake/Modules/FindMsgfmt.cmake b/CMake/Modules/FindMsgfmt.cmake new file mode 100644 index 0000000..60e33ee --- /dev/null +++ b/CMake/Modules/FindMsgfmt.cmake @@ -0,0 +1,86 @@ +# +# - Try to find the msgfmt executeable +# +# It will set the following variables: +# +# MSGFMT_FOUND +# MSGFMT_EXECUTABLE +# +################################################################### +# +# Copyright (c) 2006, Andreas Schneider +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +################################################################### +# +# Copyright (c) 2006 Andreas Schneider +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# +# * Neither the name of the cmake-modules nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +IF (MSGFMT_EXECUTABLE) + # in cache alread? + SET(MSGFMT_FOUND TRUE) +ELSE (MSGFMT_EXECUTABLE) + IF (UNIX) + FIND_PROGRAM(MSGFMT_EXECUTABLE + NAMES + msgfmt + PATHS + /usr/bin + /usr/local/bin + ) + + IF(MSGFMT_EXECUTABLE) + SET(MSGFMT_FOUND TRUE) + ELSE(MSGFMT_EXECUTABLE) + MESSAGE(FATAL_ERROR "msgfmt not found - po files can't be processed") + ENDIF(MSGFMT_EXECUTABLE) + + MARK_AS_ADVANCED(MSGFMT_EXECUTABLE) + ENDIF(UNIX) +ENDIF (MSGFMT_EXECUTABLE) + +# vim:et ts=2 sw=2 comments=\:\# diff --git a/CMake/Modules/GtkQt.cmake b/CMake/Modules/GtkQt.cmake new file mode 100644 index 0000000..1251d95 --- /dev/null +++ b/CMake/Modules/GtkQt.cmake @@ -0,0 +1,56 @@ +# Both these macros are taken from KDE3Macros.cmake +# Apart from the names, the only modification is that they take a destination argument + +MACRO(GTKQT_KDE3_ADD_KPART _target_NAME _destination _with_PREFIX) +#is the first argument is "WITH_PREFIX" then keep the standard "lib" prefix, otherwise SET the prefix empty + IF (${_with_PREFIX} STREQUAL "WITH_PREFIX") + SET(_first_SRC) + ELSE (${_with_PREFIX} STREQUAL "WITH_PREFIX") + SET(_first_SRC ${_with_PREFIX}) + ENDIF (${_with_PREFIX} STREQUAL "WITH_PREFIX") + + IF (KDE3_ENABLE_FINAL) + KDE3_CREATE_FINAL_FILE(${_target_NAME}_final.cpp ${_first_SRC} ${ARGN}) + ADD_LIBRARY(${_target_NAME} MODULE ${_target_NAME}_final.cpp) + ELSE (KDE3_ENABLE_FINAL) + ADD_LIBRARY(${_target_NAME} MODULE ${_first_SRC} ${ARGN}) + ENDIF (KDE3_ENABLE_FINAL) + + IF(_first_SRC) + SET_TARGET_PROPERTIES(${_target_NAME} PROPERTIES PREFIX "") + ENDIF(_first_SRC) + + GTKQT_KDE3_INSTALL_LIBTOOL_FILE(${_target_NAME} ${_destination}) + +ENDMACRO(GTKQT_KDE3_ADD_KPART) + +MACRO(GTKQT_KDE3_INSTALL_LIBTOOL_FILE _target _destination) + GET_TARGET_PROPERTY(_target_location ${_target} LOCATION) + + GET_FILENAME_COMPONENT(_laname ${_target_location} NAME_WE) + GET_FILENAME_COMPONENT(_soname ${_target_location} NAME) + SET(_laname ${CMAKE_CURRENT_BINARY_DIR}/${_laname}.la) + + FILE(WRITE ${_laname} "# ${_laname} - a libtool library file, generated by cmake \n") + FILE(APPEND ${_laname} "# The name that we can dlopen(3).\n") + FILE(APPEND ${_laname} "dlname='${_soname}'\n") + FILE(APPEND ${_laname} "# Names of this library\n") + FILE(APPEND ${_laname} "library_names='${_soname} ${_soname} ${_soname}'\n") + FILE(APPEND ${_laname} "# The name of the static archive\n") + FILE(APPEND ${_laname} "old_library=''\n") + FILE(APPEND ${_laname} "# Libraries that this one depends upon.\n") + FILE(APPEND ${_laname} "dependency_libs=''\n") +# FILE(APPEND ${_laname} "dependency_libs='${${_target}_LIB_DEPENDS}'\n") + FILE(APPEND ${_laname} "# Version information.\ncurrent=0\nage=0\nrevision=0\n") + FILE(APPEND ${_laname} "# Is this an already installed library?\ninstalled=yes\n") + FILE(APPEND ${_laname} "# Should we warn about portability when linking against -modules?\nshouldnotlink=yes\n") + FILE(APPEND ${_laname} "# Files to dlopen/dlpreopen\ndlopen=''\ndlpreopen=''\n") + FILE(APPEND ${_laname} "# Directory that this library needs to be installed in:\n") + FILE(APPEND ${_laname} "libdir='${CMAKE_INSTALL_PREFIX}/lib/kde3'\n") + + INSTALL( + FILES ${_laname} + DESTINATION ${_destination} + ) + +ENDMACRO(GTKQT_KDE3_INSTALL_LIBTOOL_FILE) \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..bd85e91 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,94 @@ +PROJECT (gtk-qt-engine) +INCLUDE (UsePkgConfig) + +# Find KDE +FIND_PACKAGE(KDE3 REQUIRED) + +# Find Qt +FIND_PACKAGE(Qt3 REQUIRED) +MESSAGE(STATUS "Found Qt library: ${QT_QT_LIBRARY}") + +# Find GTK +PKGCONFIG(gtk+-2.0 GTK_INCLUDE_DIR GTK_LIB_DIR GTK_LINK_FLAGS GTK_CFLAGS) +IF (NOT GTK_INCLUDE_DIR) + MESSAGE(FATAL_ERROR "GTK was not found. Ensure you have the GTK development libraries installed, and GTK's pkgconfig files are in your pkgconfig search path.") +ENDIF (NOT GTK_INCLUDE_DIR) +MESSAGE(STATUS "Found GTK include dir: ${GTK_INCLUDE_DIR}") +MESSAGE(STATUS "Found GTK library dir: ${GTK_LIB_DIR}") + +# Find Bonobo +PKGCONFIG(libbonoboui-2.0 BONOBO_INCLUDE_DIR BONOBO_LIB_DIR BONOBO_LINK_FLAGS BONOBO_CFLAGS) +IF (NOT BONOBO_INCLUDE_DIR) + MESSAGE(STATUS "bonoboui not found. Some features of the theme engine will not work as intended.") +ELSE (NOT BONOBO_INCLUDE_DIR) + MESSAGE(STATUS "Found Bonobo include dir: ${BONOBO_INCLUDE_DIR}") + MESSAGE(STATUS "Found Bonobo library dir: ${BONOBO_LIB_DIR}") + SET(BONOBO_DEFINITIONS -D HAVE_BONOBO) +ENDIF (NOT BONOBO_INCLUDE_DIR) + +# Find msgfmt +SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake/Modules) +FIND_PACKAGE(Msgfmt REQUIRED) + +# Find xgettext +FIND_PROGRAM( + XGETTEXT_PATH + NAMES "xgettext" + PATHS "/usr/bin" +) +IF(${XGETTEXT_PATH} STREQUAL "XGETTEXT_PATH-NOTFOUND") + MESSAGE(STATUS "xgettext not found. You will not be able to run 'make extract_messages' in the 'po' directory.") +ELSE(${XGETTEXT_PATH} STREQUAL "XGETTEXT_PATH-NOTFOUND") + MESSAGE(STATUS "Found xgettext: ${XGETTEXT_PATH}") +ENDIF(${XGETTEXT_PATH} STREQUAL "XGETTEXT_PATH-NOTFOUND") + +# Find extractrc +FIND_PROGRAM( + EXTRACTRC_PATH + NAMES "extractrc" + PATHS "/usr/bin" +) +IF(${EXTRACTRC_PATH} STREQUAL "EXTRACTRC_PATH-NOTFOUND") + MESSAGE(STATUS "extractrc not found. You will not be able to run 'make extract_messages' in the 'po' directory.") +ELSE(${EXTRACTRC_PATH} STREQUAL "EXTRACTRC_PATH-NOTFOUND") + MESSAGE(STATUS "Found extractrc: ${EXTRACTRC_PATH}") +ENDIF(${EXTRACTRC_PATH} STREQUAL "EXTRACTRC_PATH-NOTFOUND") + +# Work out where to install stuff +EXEC_PROGRAM( + ${PKGCONFIG_EXECUTABLE} + ARGS --variable=gtk_binary_version gtk+-2.0 + OUTPUT_VARIABLE GTK_VERSION) +SET(INSTALL_PATH_GTK_ENGINES "${GTK_LIB_DIR}/gtk-2.0/${GTK_VERSION}/engines" CACHE PATH "The directory in which to install the theme engine library (eg. /usr/lib/gtk-2.0/2.4.0/engines)") +MESSAGE(STATUS "Installing the GTK theme engine library to: ${INSTALL_PATH_GTK_ENGINES}") + +EXEC_PROGRAM( + ${PKGCONFIG_EXECUTABLE} + ARGS --variable=prefix gtk+-2.0 + OUTPUT_VARIABLE GTK_PREFIX) +SET(INSTALL_PATH_GTK_THEMES "${GTK_PREFIX}/share/themes" CACHE PATH "The directory in which to install the theme data (eg. /usr/share/themes)") +MESSAGE(STATUS "Installing the GTK theme engine data to: ${INSTALL_PATH_GTK_THEMES}") + +SET(INSTALL_PATH_KCONTROL_MODULES "${KDE3_LIB_DIR}" CACHE PATH "The directory in which to install KControl plugins (eg. /usr/lib)") +MESSAGE(STATUS "Installing the KControl plugins to: ${INSTALL_PATH_KCONTROL_MODULES}") + +MESSAGE(STATUS "Installing everything else to: ${CMAKE_INSTALL_PREFIX}") + +# Setup definitions and directories to be used in all subdirectories +ADD_DEFINITIONS(${QT_DEFINITIONS} ${KDE3_DEFINITIONS} ${BONOBO_DEFINITIONS}) +LINK_DIRECTORIES(${KDE3_LIB_DIR} ${GTK_LIB_DIR} ${BONOBO_LIB_DIR}) +INCLUDE_DIRECTORIES(${KDE3_INCLUDE_DIRS} ${GTK_INCLUDE_DIR} ${BONOBO_INCLUDE_DIR}) + +# Subdirectories +ADD_SUBDIRECTORY(src) +ADD_SUBDIRECTORY(kcm_gtk) +ADD_SUBDIRECTORY(po) + +# Uninstall support +CONFIGURE_FILE( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" + IMMEDIATE @ONLY) + +ADD_CUSTOM_TARGET(uninstall + "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..c13faf0 --- /dev/null +++ b/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..d644270 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,31 @@ +Changes since 0.7: + * Switch the buildsystem from autotools to CMake. CMake 2.4 is now required to build the project. + * Fix scrollbar sliders in the Domino widget style + * Fix a bug that caused Qt colours not to be applied to GTK applications. This fixes several graphical problems when using dark colour schemes. + * Fix a bug that would disable Bonobo support even when the correct packages were installed + * The control center module will now write a configuration file that will only affect applications inside KDE. Applications running in GNOME can be themed separately using the GNOME tools. + * Add a setting for emacs keyboard shortcuts + * Fix OpenOffice detection on Fedora Core. + * Draw default buttons properly. + * Provide a fallback icon even when one of the right size doesn't exist + * Fix invalid CSS comments. + * When the Qt theme can't be found, display a dialog allowing the user to modify the search paths. + * Respect KDE's "Show icons on buttons" setting + * Fix icon themes in GNOME apps such as evolution on Fedora Core 5 and 6 + * GTK apps will now respect KDE's toolbar icon display settings (thanks Bastian Venthur) + * Merge fix-iconpaths.patch from suse. This fixes icon loading issues with inherited icon themes. + * Highlighted menu items are now always white. + * Italian translation from Davide Madrisan + * Fix button appearance in the Motif Plus style + * Turkish translation by S.Çağlar Onur + * Patch from Martin Michlmayr to fix compilation on GCC 4.3 + * Bulgarian translation by Zlatko Popov + * Russian translation by Viktor Ponasenkov + * Patch from Patrick Lamaizière to fix command line parsing on FreeBSD + * Fix corrupt scrollbar ends on Firefox with the Domino style + * Make buttons, checkboxes and radio buttons indicate keyboard focus + * Fix icon loading code when dealing with multiple inheritance + * Map more GTK icons (thanks to bm@cage.ugent.be) + * Setting a font with bold or italic options now works correctly + * Fix a bug where menu checkmarks would be displayed as a series of + horizontal lines diff --git a/Doxyfile b/Doxyfile new file mode 100644 index 0000000..8c6f392 --- /dev/null +++ b/Doxyfile @@ -0,0 +1,248 @@ +# Doxyfile 1.3.5-KDevelop + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = gtkqtengine.kdevelop +PROJECT_NUMBER = 0.3 +OUTPUT_DIRECTORY = +OUTPUT_LANGUAGE = English +USE_WINDOWS_ENCODING = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = /home/david/gtk-qt-engine-0.4/ +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +DISTRIBUTE_GROUP_DOC = NO +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +SUBGROUPING = YES +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = NO +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = NO +EXTRACT_LOCAL_CLASSES = YES +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = /home/david/gtk-qt-engine-0.4 +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.inc \ + *.C \ + *.H \ + *.tlh \ + *.diff \ + *.patch \ + *.moc \ + *.xpm \ + *.dox +RECURSIVE = yes +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = * +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +VERBATIM_HEADERS = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = YES +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = yes +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +UML_LOOK = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +MAX_DOT_GRAPH_DEPTH = 1000 +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..02a4a07 --- /dev/null +++ b/INSTALL @@ -0,0 +1,167 @@ +Basic Installation +================== + + These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, a file +`config.cache' that saves the results of its tests to speed up +reconfiguring, and a file `config.log' containing compiler output +(useful mainly for debugging `configure'). + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If at some point `config.cache' +contains results you don't want to keep, you may remove or edit it. + + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need `configure.in' if you want to change +it or regenerate `configure' using a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes a while. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Type `make install' to install the programs and any data files and + documentation. + + 4. You can remove the program binaries and object files from the + source code directory by typing `make clean'. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + +Or on systems that have the `env' program, you can do it like this: + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not supports the `VPATH' +variable, you have to compile the package for one architecture at a time +in the source code directory. After you have installed the package for +one architecture, use `make distclean' before reconfiguring for another +architecture. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' can not figure out +automatically, but needs to determine by the type of host the package +will run on. Usually `configure' can figure that out, but if it prints +a message saying it can not guess the host type, give it the +`--host=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name with three fields: + CPU-COMPANY-SYSTEM + +See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the host type. + + If you are building compiler tools for cross-compiling, you can also +use the `--target=TYPE' option to select the type of system they will +produce code for and the `--build=TYPE' option to select the type of +system on which you are compiling the package. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Operation Controls +================== + + `configure' recognizes the following options to control how it +operates. + +`--cache-file=FILE' + Use and save the results of the tests in FILE instead of + `./config.cache'. Set FILE to `/dev/null' to disable caching, for + debugging `configure'. + +`--help' + Print a summary of the options to `configure', and exit. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`configure' also accepts some other, not widely useful, options. + diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/NEWS @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/README b/README new file mode 100644 index 0000000..0404464 --- /dev/null +++ b/README @@ -0,0 +1,25 @@ +A GTK theme engine that uses QT for drawing. + + +Installing: + +make -f Makefile.cvs (only if compiling from CVS) +./configure +make +make install + + +Using: + +Open the "GTK Styles and Fonts" section in the KDE control center +and select "Use my KDE style in GTK applications". + + +Uninstalling: + +make uninstall + + + +David Sansome +me@davidsansome.com diff --git a/TODO b/TODO new file mode 100644 index 0000000..ab7a342 --- /dev/null +++ b/TODO @@ -0,0 +1,5 @@ + * Fix eclipse memory leaks + * Find out why destructor is never called. + * Take into account custom widget colors + * Listen for KIPC + * Force tooltip font to always be black \ No newline at end of file diff --git a/autopackage/default.apspec b/autopackage/default.apspec new file mode 100644 index 0000000..cb6b436 --- /dev/null +++ b/autopackage/default.apspec @@ -0,0 +1,96 @@ +# -*-shell-script-*- + +[Meta] +RootName: @freedesktop.org/gtkqtengine:$SOFTWAREVERSION +DisplayName: Gtk-Qt theme engine +ShortName: gtk-qt-engine +Maintainer: David Sansome +Packager: David Sansome +Summary: A GTK theme engine that mimics the active Qt style +SoftwareVersion: 0.8 +InterfaceVersion: 0 +AutopackageTarget: 1.2 +Repository: http://gtk-qt.ecs.soton.ac.uk/files/$SOFTWAREVERSION/$SHORTNAME.xml + +[BuildPrepare] +arg1="INSTALL_PATH_GTK_ENGINES:PATH=$build_root/lib/gtk-2.0/2.4.0/engines" +arg2="INSTALL_PATH_GTK_THEMES:PATH=$build_root/share/themes" +arg3="INSTALL_PATH_KCONTROL_MODULES:PATH=$build_root/lib" +arg4="CMAKE_INSTALL_PREFIX:PATH=$build_root" + +export APBUILD_STATIC="Xrender" +export CC=`which apgcc` +export CXX=`which apg++` + +if [[ "$APKG_BUILD_SKIP_CONFIGURE" != "1" ]]; then + out "$intl_CONFIGURING" + + rm CMakeCache.txt + cmake -D $arg1 -D $arg2 -D $arg3 -D $arg4 . + + if [[ "$?" == "0" ]]; then + outn "$intl_CONFIGURING"; green; out "$intl_DONE"; normal; + else + outn "$intl_CONFIGURING"; red; echo "$intl_FAILED"; normal; + exit 1; + fi +fi + +if [[ "$APKG_BUILD_SKIP_MAKE" != "1" ]]; then + out "$intl_MAKING"; + + make clean + make + + if [[ "$?" == "0" ]]; then + outn "$intl_MAKING"; green; out "$intl_DONE"; normal; + else + outn "$intl_MAKING"; red; echo "$intl_FAILED"; normal; + exit 1; + fi +fi + + +out "$intl_INSTALLING" "$build_root"; +make install +if [[ "$?" == "0" ]]; then + outn "$intl_INSTALLING"; green; out "$intl_DONE"; normal; +else + outn "$intl_INSTALLING"; red; echo "$intl_FAILED"; normal; + exit 1; +fi + + +export _virtual_build_root="$build_root" + +[BuildUnprepare] +unprepareBuild + +[Imports] +echo '*' | import + +[Prepare] +require @kde.org/kdelibs 3.1 +require @gtk.org/gtk 2 +removeOwningPackage $PREFIX/lib/gtk-2.0/engines/libqtengine.so + +[Install] +outputStatus "Installing theme engine library..." +mkdirs "$PREFIX/lib/gtk-2.0/engines/" +copyFile --silent lib/gtk-2.0/2.4.0/engines/libqtengine.so "$PREFIX/lib/gtk-2.0/engines/libqtengine.so" + +outputStatus "Installing theme..." +mkdirs "$PREFIX/share/themes/Qt/gtk-2.0" +copyFile --silent share/themes/Qt/gtk-2.0/gtkrc "$PREFIX/share/themes/Qt/gtk-2.0/gtkrc" + +outputStatus "Installing KDE control center module..." +mkdirs "$PREFIX/lib/kde3" +copyFile --silent lib/kde3/kcm_kcmgtk.so "$PREFIX/lib/kde3/kcm_kcmgtk.so" +copyFile --silent lib/kde3/kcm_kcmgtk.la "$PREFIX/lib/kde3/kcm_kcmgtk.la" +installMenuItem --no-path-adjust "Settings/LookNFeel" "share/applications/kcmgtk.desktop" + +updateEnv GTK_PATH "$PREFIX/lib/gtk-2.0" +updateEnv KDEDIRS "$PREFIX" + +[Uninstall] +uninstallFromLog diff --git a/config.guess b/config.guess new file mode 100755 index 0000000..da83314 --- /dev/null +++ b/config.guess @@ -0,0 +1,1561 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# Free Software Foundation, Inc. + +timestamp='2009-04-27' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[456]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:[3456]*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T | authenticamd | genuineintel) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^LIBC/{ + s: ::g + p + }'`" + test x"${LIBC}" != x && { + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit + } + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/config.guess.cdbs-orig b/config.guess.cdbs-orig new file mode 100644 index 0000000..278f9e9 --- /dev/null +++ b/config.guess.cdbs-orig @@ -0,0 +1,1516 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, +# Inc. + +timestamp='2007-07-22' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:[3456]*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T | authenticamd) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + xtensa:Linux:*:*) + echo xtensa-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^LIBC/{ + s: ::g + p + }'`" + test x"${LIBC}" != x && { + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit + } + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/config.sub b/config.sub new file mode 100755 index 0000000..a39437d --- /dev/null +++ b/config.sub @@ -0,0 +1,1686 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# Free Software Foundation, Inc. + +timestamp='2009-04-17' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nios | nios2 \ + | ns16k | ns32k \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tile*) + basic_machine=tile-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -kopensolaris* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/config.sub.cdbs-orig b/config.sub.cdbs-orig new file mode 100644 index 0000000..1761d8b --- /dev/null +++ b/config.sub.cdbs-orig @@ -0,0 +1,1626 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, +# Inc. + +timestamp='2007-06-28' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | mt \ + | msp430 \ + | nios | nios2 \ + | ns16k | ns32k \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | score \ + | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/configure b/configure new file mode 100755 index 0000000..2d9fa9c --- /dev/null +++ b/configure @@ -0,0 +1,15 @@ +#!/bin/sh + +echo "Warning: The GTK-Qt Theme Engine now uses cmake instead of ./configure." +echo + +cmakepath=`which cmake 2>/dev/null` +if [ "$?" -eq "1" ]; then + echo "cmake was not found on your system." + echo "Please download cmake from http://www.cmake.org and ensure it is in your \$PATH" + exit 1 +fi + +echo "Found cmake in $cmakepath, executing it for you..." + +cmake . diff --git a/kcm_gtk/CMakeLists.txt b/kcm_gtk/CMakeLists.txt new file mode 100644 index 0000000..d5537c5 --- /dev/null +++ b/kcm_gtk/CMakeLists.txt @@ -0,0 +1,30 @@ +INCLUDE(KDE3Macros) +INCLUDE(GtkQt) + +# Sources +SET(kcm_kcmgtk_SOURCES + kcmgtk.cpp) + +KDE3_AUTOMOC(${kcm_kcmgtk_SOURCES}) + +# UI files +SET(kcm_kcmgtk_UI + kcmgtkwidget.ui + mozillaprofile.ui + emacsdetails.ui + searchpaths.ui) + +KDE3_ADD_UI_FILES(kcm_kcmgtk_SOURCES ${kcm_kcmgtk_UI}) + +GTKQT_KDE3_ADD_KPART(kcm_kcmgtk "${INSTALL_PATH_KCONTROL_MODULES}/kde3" ${kcm_kcmgtk_SOURCES}) + +INSTALL( + TARGETS kcm_kcmgtk + DESTINATION ${INSTALL_PATH_KCONTROL_MODULES}/kde3 +) + +INSTALL( + FILES kcmgtk.desktop + DESTINATION share/applications/ +) + diff --git a/kcm_gtk/emacsdetails.ui b/kcm_gtk/emacsdetails.ui new file mode 100644 index 0000000..677a69c --- /dev/null +++ b/kcm_gtk/emacsdetails.ui @@ -0,0 +1,233 @@ + +EmacsDetails + + + EmacsDetails + + + + 0 + 0 + 489 + 296 + + + + Emacs Keyboard Shortcuts + + + + unnamed + + + + textLabel2 + + + These keyboard shortcuts are useful for Emacs users. +When enabled, they will override the standard keyboard shortcuts in GTK applications. + + + + + + Shortcut + + + false + + + false + + + + + Description + + + false + + + false + + + + + Ctrl+A + + + Go to beginning of line + + + + + + + + + + + Ctrl+E + + + Go to end of line + + + + + + + + + + + Ctrl+F + + + Go right one character + + + + + + + + + + + Ctrl+B + + + Go left one character + + + + + + + + + + + Ctrl+K + + + Delete to end of line + + + + + + + + + + + Ctrl+U + + + Delete entire line + + + + + + + + + + + Ctrl+W + + + Delete word, left + + + + + + + + + + + Ctrl+H + + + Delete character, left + + + + + + + + + + + Ctrl+D + + + Delete character, right + + + + + + + + + + list + + + true + + + + + layout13 + + + + unnamed + + + + spacer12 + + + Horizontal + + + Expanding + + + + 101 + 21 + + + + + + pushButton4 + + + C&lose + + + + + + + + + pushButton4 + clicked() + EmacsDetails + close() + + + + diff --git a/kcm_gtk/kcmgtk.cpp b/kcm_gtk/kcmgtk.cpp new file mode 100644 index 0000000..036836d --- /dev/null +++ b/kcm_gtk/kcmgtk.cpp @@ -0,0 +1,704 @@ +/*************************************************************************** + * Copyright (C) 2004 by David Sansome * + * david@dave-linux * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "kcmgtk.h" +#include "mozillaprofile.h" + +const QString KcmGtk::GTK_RC_FILE(".gtkrc-2.0-kde-kde4"); +const QString KcmGtk::KDE_RC_DIR(KGlobal::dirs()->localkdedir() + "/env/"); +const QString KcmGtk::GTK_QT_RC_FILE("gtk-qt-engine.rc.sh"); + +/*typedef KGenericFactory KcmGtkFactory; +K_EXPORT_COMPONENT_FACTORY( kcm_gtk, KcmGtkFactory("gtk"))*/ + +extern "C" +{ + KCModule *create_kcmgtk( QWidget * parent, const char * name ) + { + KGlobal::locale()->insertCatalogue( "gtkqtengine" ); + return new KcmGtk( parent, "kcmgtk" ); + } +} + +GtkRcParser::GtkRcParser() + : emacs(false) +{ +} + +void GtkRcParser::parse(QString fileName) +{ + QFile file(fileName); + file.open(IO_ReadOnly); + QTextStream stream(&file); + + QRegExp includeRe("include\\s*\"([^\"]*)\""); + QRegExp fontRe("font_name\\s*=\\s*\"([^\"]*)\""); + QRegExp keyThemeRe("gtk-key-theme-name\\s*=\\s*\"([^\"]*)\""); + + QStringList includes; + + while (1) + { + QString line = stream.readLine(); + if (line.isNull()) + break; + if (line.startsWith("#")) + continue; + + line = line.stripWhiteSpace(); + + if (line.startsWith("include")) + { + if (includeRe.search(line) == -1) + continue; + QString themePath = includeRe.cap(1); + if (themePath.endsWith("/gtk-2.0/gtkrc") && !themePath.startsWith("/etc")) + style = includeRe.cap(1); + } + if (line.startsWith("font_name")) + { + if (fontRe.search(line) == -1) + continue; + // Assume there will only be one font line + font = parseFont(fontRe.cap(1)); + } + if (line.startsWith("gtk-key-theme-name")) + { + if (keyThemeRe.search(line) == -1) + continue; + if (keyThemeRe.cap(1).lower() == "emacs") + emacs = true; + } + } + + file.close(); +} + +QFont GtkRcParser::parseFont(QString fontString) +{ + QFont ret; + while (true) + { + int lastSpacePos = fontString.findRev(' '); + if (lastSpacePos == -1) + break; + + QString lastWord = fontString.right(fontString.length() - lastSpacePos).stripWhiteSpace(); + + if (lastWord.lower() == "bold") + ret.setBold(true); + else if (lastWord.lower() == "italic") + ret.setItalic(true); + else + { + bool ok; + int fontSize = lastWord.toInt(&ok); + if (!ok) + break; + ret.setPointSize(fontSize); + } + + fontString = fontString.left(lastSpacePos); + } + ret.setFamily(fontString); + return ret; +} + +KcmGtk::KcmGtk(QWidget *parent, const char *name, const QStringList&) + : KCModule(parent, name), + myAboutData(0), + emacsDetailsDialog(NULL), + searchPathsDialog(NULL) +{ + KGlobal::locale()->insertCatalogue("gtkqtengine"); + + config = new KConfig("kcmgtkrc"); + + QStringList gtkSearchPathsDefault; + gtkSearchPathsDefault.append("/usr"); + gtkSearchPathsDefault.append("/usr/local"); + gtkSearchPathsDefault.append("/opt/gnome"); + gtkSearchPathsDefault.append(QDir::homeDirPath() + "/.local"); + + gtkSearchPaths = config->readListEntry("gtkSearchPaths", gtkSearchPathsDefault); + + + // Add the widget to our layout + QBoxLayout* l = new QVBoxLayout(this); + widget = new KcmGtkWidget(this); + l->addWidget(widget); + + // Load the icons + KIconLoader iconLoader; + widget->styleIcon->setPixmap(iconLoader.loadIcon("style", KIcon::Desktop)); + widget->fontIcon->setPixmap(iconLoader.loadIcon("fonts", KIcon::Desktop)); + widget->firefoxIcon->setPixmap(iconLoader.loadIcon("firefox", KIcon::Desktop)); + widget->keyboardIcon->setPixmap(iconLoader.loadIcon("keyboard", KIcon::Desktop)); + + getInstalledThemes(); + load(); + + // Connect some signals + connect(widget->warning2, SIGNAL(leftClickedURL(const QString&)), KApplication::kApplication(), SLOT(invokeBrowser(const QString&))); + connect(widget->styleGroup, SIGNAL(clicked(int)), SLOT(itemChanged())); + connect(widget->fontGroup, SIGNAL(clicked(int)), SLOT(itemChanged())); + connect(widget->styleBox, SIGNAL(activated(int)), SLOT(itemChanged())); + connect(widget->styleBox, SIGNAL(activated(int)), SLOT(styleChanged())); + connect(widget->emacsBox, SIGNAL(toggled(bool)), SLOT(itemChanged())); + connect(widget->fontChange, SIGNAL(clicked()), SLOT(fontChangeClicked())); + connect(widget->firefoxFix, SIGNAL(clicked()), SLOT(firefoxFixClicked())); + connect(widget->emacsDetails, SIGNAL(clicked()), SLOT(emacsDetailsClicked())); + connect(widget->warning3, SIGNAL(clicked()), SLOT(searchPathsClicked())); +} + +void KcmGtk::getInstalledThemes() +{ + themes.clear(); + for ( QStringList::Iterator it = gtkSearchPaths.begin(); it != gtkSearchPaths.end(); ++it ) + { + QString path = (*it) + "/share/themes/"; + QDir dir(path); + QStringList entryList = dir.entryList(QDir::Dirs, QDir::Unsorted); + for ( QStringList::Iterator it2 = entryList.begin(); it2 != entryList.end(); ++it2 ) + { + if ((*it2).startsWith(".")) + continue; + if (themes.find(*it2) != themes.end()) + continue; + if (!QFile::exists(path + (*it2) + "/gtk-2.0/gtkrc")) + continue; + themes.insert((*it2), path + (*it2) + "/gtk-2.0/gtkrc"); + } + } + + widget->styleBox->clear(); + widget->styleBox->insertStringList(themes.keys()); + + bool installed = (themes.find("Qt") != themes.end()); + widget->styleKde->setEnabled(installed); + widget->warning1->setHidden(installed); + widget->warning2->setHidden(installed); + widget->warning3->setHidden(installed); +} + +void KcmGtk::itemChanged() +{ + // In KDE < 3.3 there is no changed() slot - only a signal. + emit changed(true); +} + +void KcmGtk::fontChangeClicked() +{ + if ( KFontDialog::getFont( font ) == KFontDialog::Accepted ) + { + updateFontPreview(); + widget->fontGroup->setButton(widget->fontGroup->id(widget->fontOther)); + itemChanged(); + } +} + +void KcmGtk::styleChanged() +{ + widget->styleGroup->setButton(widget->styleGroup->id(widget->styleOther)); + itemChanged(); +} + +QString KcmGtk::env(QString key) +{ + char* value = getenv(key.latin1()); + if (value == NULL) + return QString::null; + else + return QString(value); +} + +void KcmGtk::updateFontPreview() +{ + widget->fontPreview->setFont(font); + widget->fontPreview->setText( + i18n("%1 (size %2)").arg(font.family()).arg(QString::number(font.pointSize()))); + widget->fontPreview2->setFont(font); +} + + +KcmGtk::~KcmGtk() +{ + delete config; +} + + +void KcmGtk::load() +{ + parser.parse(QDir::homeDirPath() + "/" + GTK_RC_FILE); + + bool usingQtEngine = false; + if (!parser.style.isEmpty()) + { + for ( QMapIterator it = themes.begin(); it != themes.end(); ++it ) + { + if (it.data() != parser.style) + continue; + + if (it.key() == "Qt") + usingQtEngine = true; + + for (int i=0 ; istyleBox->count() ; ++i) + { + if (widget->styleBox->text(i) == it.key()) + { + widget->styleBox->setCurrentItem(i); + break; + } + } + + break; + } + + if (usingQtEngine) + widget->styleGroup->setButton(widget->styleGroup->id(widget->styleKde)); + else + widget->styleGroup->setButton(widget->styleGroup->id(widget->styleOther)); + } + + font = parser.font; + if (QApplication::font().family() == font.family() && + QApplication::font().pointSize() == font.pointSize() && + QApplication::font().bold() == font.bold() && + QApplication::font().italic() == font.italic()) + widget->fontGroup->setButton(widget->fontGroup->id(widget->fontKde)); + else + widget->fontGroup->setButton(widget->fontGroup->id(widget->fontOther)); + + widget->emacsBox->setChecked(parser.emacs); + + updateFontPreview(); +} + + +void KcmGtk::save() +{ + // First write out the gtkrc file + QFile file(QDir::homeDirPath() + "/" + GTK_RC_FILE); + file.open(IO_WriteOnly); + QTextStream stream(&file); + + QFont selectedFont(widget->fontKde->isChecked() ? QApplication::font() : font); + QString fontName = selectedFont.family() + " " + + QString(selectedFont.bold() ? "Bold " : "") + + QString(selectedFont.italic() ? "Italic " : "") + + QString::number(selectedFont.pointSize()); + + QString themeName = widget->styleKde->isChecked() ? themes["Qt"] : themes[widget->styleBox->currentText()]; + QString themeNameShort = widget->styleKde->isChecked() ? QString("Qt") : widget->styleBox->currentText(); + + stream << "# This file was written by KDE\n"; + stream << "# You can edit it in the KDE control center, under \"GTK Styles and Fonts\"\n"; + stream << "\n"; + stream << "include \"" << themeName << "\"\n"; + if (QFile::exists("/etc/gtk-2.0/gtkrc")) + stream << "include \"/etc/gtk-2.0/gtkrc\"\n"; + stream << "\n"; + stream << "style \"user-font\"\n"; + stream << "{\n"; + stream << "\tfont_name=\"" << fontName << "\"\n"; + stream << "}\n"; + stream << "widget_class \"*\" style \"user-font\"\n"; + stream << "\n"; + stream << "gtk-theme-name=\"" << themeNameShort << "\"\n"; + stream << "gtk-font-name=\"" << fontName << "\"\n"; + + if (widget->emacsBox->isChecked()) + stream << "gtk-key-theme-name=\"Emacs\"\n"; + + file.close(); + + // Now we check if that file is actually being loaded. + QDir kdeRcDir; + if (!kdeRcDir.exists(KDE_RC_DIR)) + { + // Make sure KDE's rc dir exists + kdeRcDir.mkdir(KDE_RC_DIR); + } + file.setName(KDE_RC_DIR + "/" + GTK_QT_RC_FILE); + + bool envFileDidNotExist = (!file.exists()); + + file.open(IO_ReadWrite); + stream.setDevice(&file); + bool found = false; + for (;;) + { + QString line = stream.readLine(); + if (line.isNull()) + break; + + if (line.stripWhiteSpace().startsWith("export GTK2_RC_FILES=$HOME/" + GTK_RC_FILE)) + { + found = true; + break; + } + } + if (!found) + { + stream << "#!/bin/bash\n\n"; + stream << "# Make sure our customised gtkrc file is loaded.\n"; + stream << "export GTK2_RC_FILES=$HOME/" + GTK_RC_FILE + "\n"; + } + file.close(); + + // Make it executable + if (!found) + chmod(file.name().utf8(), 0755); + + // Tell the user to restart KDE if the environment file was created this time + if (envFileDidNotExist) + QMessageBox::information(this, "Restart KDE", "Your changes have been saved, but you will have to restart KDE for them to take effect.", QMessageBox::Ok); + + // Older versions of the Gtk-Qt theme engine wrote directly into ~/.gtkrc-2.0 + // If the user has upgraded, that file needs to be deleted so the old settings + // won't override the new ones set now. + file.setName(QDir::homeDirPath() + "/.gtkrc-2.0"); + if (file.exists()) + { + file.open(IO_ReadOnly); + QString firstLine; + file.readLine(firstLine, 50); + file.close(); + + if (firstLine == "# This file was written by KDE") + file.remove(); + } + + // Simarly, remove the line we added to ~/.bashrc to tell GTK to load ~/.gtkrc-2.0 + file.setName(QDir::homeDirPath() + "/.bashrc"); + if (file.exists()) + { + file.open(IO_ReadOnly); + QByteArray fileData = file.readAll(); + file.close(); + + QString rcLine = "export GTK2_RC_FILES=$HOME/.gtkrc-2.0"; + QString fileDataString(fileData); + fileDataString.replace("\n" + rcLine, "\n# (This is no longer needed from version 0.8 of the theme engine)\n# " + rcLine); + + file.open(IO_WriteOnly); + stream.setDevice(&file); + stream << fileDataString; + file.close(); + } + + emit changed(true); +} + + +int KcmGtk::buttons() +{ + return KCModule::Apply; +} + +QString KcmGtk::quickHelp() const +{ + return i18n(""); +} + + +void KcmGtk::firefoxFixClicked() +{ + profiles.clear(); + getProfiles(QDir::homeDirPath() + "/.mozilla/firefox/", 0); + getProfiles(QDir::homeDirPath() + "/.thunderbird/", 1); + + QString profilePath; + if (profiles.count() == 0) + { + KMessageBox::error(this, i18n("No Mozilla profiles found"), i18n("Could not load Mozilla profiles")); + return; + } + else if (profiles.count() == 1) + { + fixProfile(profiles.begin().data()); + } + else + { + KDialogBase* dialog = new KDialogBase(this, "", true, i18n("Mozilla profile"), KDialogBase::Ok | KDialogBase::Cancel); + MozillaProfileWidget* w = new MozillaProfileWidget(dialog); + w->profilesList->header()->hide(); + w->profilesList->hideColumn(1); + + QPixmap icon = KGlobal::iconLoader()->loadIcon("kuser", KIcon::Small); + + for ( QMapIterator it = profiles.begin(); it != profiles.end(); ++it ) + { + KListViewItem* i = new KListViewItem(w->profilesList); + i->setPixmap(0, icon); + i->setText(0, it.key()); + i->setText(1, it.data()); + } + + dialog->setMainWidget(w); + if (dialog->exec() == QDialog::Rejected) + { + delete dialog; + return; + } + + QListViewItemIterator it2(w->profilesList, QListViewItemIterator::Selected); + while (it2.current()) + { + KListViewItem* i = (KListViewItem*) it2.current(); + ++it2; + + fixProfile(i->text(1)); + } + delete dialog; + } + + KMessageBox::information(this, i18n("Your Mozilla profile was updated sucessfully. You must close and restart all Firefox and Thunderbird windows for the changes to take effect"), i18n("Mozilla profile")); +} + +void KcmGtk::getProfiles(const QString& basePath, int type) +{ + QString fileName = basePath + "/profiles.ini"; + if (QFile::exists(fileName)) + { + KConfig config(fileName, true, false); + QStringList groups = config.groupList(); + + for ( QStringList::Iterator it = groups.begin(); it != groups.end(); ++it ) + { + if (!(*it).lower().startsWith("profile")) + continue; + + config.setGroup(*it); + QString name = (type ? i18n("Thunderbird") : i18n("Firefox")) + " - " + config.readEntry("Name"); + QString path = config.readEntry("Path"); + if (!path.startsWith("/")) + path = basePath + path; + profiles.insert(name, path); + } + } +} + +void KcmGtk::fixProfile(const QString& path) +{ + if (!QFile::exists(path + "/chrome")) + { + QDir dir(path); + dir.mkdir("chrome"); + } + + QString data = scrollBarCSS(); + writeFirefoxCSS(path + "/chrome/userChrome.css", data); + writeFirefoxCSS(path + "/chrome/userContent.css", data); +} + +QString KcmGtk::scrollBarCSS() +{ + // The following code determines how many buttons are on a scrollbar + // It works by looking at each pixel of the scrollbar's area not taken up by the groove, + // and asking the style which subcontrol is at that location. + QScrollBar sbar(NULL); + sbar.setOrientation(Qt::Horizontal); + sbar.setValue(1); + sbar.resize(200,25); + + QRect rect = qApp->style().querySubControlMetrics(QStyle::CC_ScrollBar, &sbar, QStyle::SC_ScrollBarGroove); + + bool back1 = false; + bool forward1 = false; + bool back2 = false; + bool forward2 = false; + + QStyle::SubControl sc = QStyle::SC_None; + for (QPoint pos(0,7) ; pos.x()style().querySubControl(QStyle::CC_ScrollBar, &sbar, pos); + if (sc != sc2) + { + if (sc2 == QStyle::SC_ScrollBarAddLine) forward1 = true; + if (sc2 == QStyle::SC_ScrollBarSubLine) back1 = true; + sc = sc2; + } + } + sc = QStyle::SC_None; + for (QPoint pos(rect.x()+rect.width(),7) ; pos.x()<200 ; pos.setX(pos.x()+1)) + { + QStyle::SubControl sc2 = qApp->style().querySubControl(QStyle::CC_ScrollBar, &sbar, pos); + if (sc != sc2) + { + if (sc2 == QStyle::SC_ScrollBarAddLine) forward2 = true; + if (sc2 == QStyle::SC_ScrollBarSubLine) back2 = true; + sc = sc2; + } + } + + QString upTop = (back1 ? "-moz-box" : "none"); + QString downTop = (forward1 ? "-moz-box" : "none"); + QString upBottom = (back2 ? "-moz-box" : "none"); + QString downBottom = (forward2 ? "-moz-box" : "none"); + + QString data; + data += "/* The following four lines were added by KDE */\n"; + data += "scrollbarbutton[sbattr=\"scrollbar-up-top\"] { display: " + upTop + " !important; }\n"; + data += "scrollbarbutton[sbattr=\"scrollbar-down-top\"] { display: " + downTop + " !important; }\n"; + data += "scrollbarbutton[sbattr=\"scrollbar-up-bottom\"] { display: " + upBottom + " !important; }\n"; + data += "scrollbarbutton[sbattr=\"scrollbar-down-bottom\"] { display: " + downBottom + " !important; }\n"; + + return data; +} + +void KcmGtk::writeFirefoxCSS(const QString& path, const QString& data) +{ + QString fileData; + QFile file(path); + if (file.open(IO_ReadOnly)) + { + QTextStream stream(&file); + for (;;) + { + QString line = stream.readLine(); + if (line.isNull()) + break; + + if ((line == "# The following four lines were added by KDE") || + (line == "/* The following four lines were added by KDE */")) + { + for (int i=0 ; i<4 ; i++) + stream.readLine(); + continue; + } + + fileData += line + "\n"; + } + file.close(); + } + + if (!file.open(IO_WriteOnly | IO_Truncate)) + { + KMessageBox::error(this, i18n("Could not write to %1").arg(path), i18n("Mozilla profile")); + return; + } + QTextStream stream(&file); + stream << fileData << data; + file.close(); + + return; +} + +void KcmGtk::emacsDetailsClicked() +{ + if (emacsDetailsDialog == NULL) + { + emacsDetailsDialog = new EmacsDetails(this); + emacsDetailsDialog->list->header()->setStretchEnabled(true, 1); + } + + emacsDetailsDialog->show(); +} + +void KcmGtk::searchPathsClicked() +{ + if (searchPathsDialog == NULL) + { + searchPathsDialog = new SearchPaths(this); + connect(searchPathsDialog->okButton, SIGNAL(clicked()), SLOT(searchPathsOk())); + connect(searchPathsDialog->pathBox, SIGNAL(textChanged(const QString&)), SLOT(searchPathsTextChanged(const QString&))); + connect(searchPathsDialog->pathList, SIGNAL(currentChanged(QListBoxItem*)), SLOT(searchPathsCurrentChanged(QListBoxItem*))); + connect(searchPathsDialog->addButton, SIGNAL(clicked()), SLOT(searchPathsAddClicked())); + connect(searchPathsDialog->removeButton, SIGNAL(clicked()), SLOT(searchPathsRemoveClicked())); + } + + searchPathsDialog->pathList->clear(); + for (QStringList::Iterator it = gtkSearchPaths.begin(); it != gtkSearchPaths.end(); ++it ) + new QListBoxText(searchPathsDialog->pathList, *it); + + searchPathsDialog->show(); +} + +void KcmGtk::searchPathsOk() +{ + gtkSearchPaths.clear(); + int i=0; + QListBoxItem* item = 0; + while ((item = searchPathsDialog->pathList->item(i++))) + gtkSearchPaths.append(item->text()); + + config->writeEntry("gtkSearchPaths", gtkSearchPaths); + getInstalledThemes(); +} + +void KcmGtk::searchPathsTextChanged(const QString& text) +{ + searchPathsDialog->addButton->setDisabled(text.isEmpty()); +} + +void KcmGtk::searchPathsCurrentChanged(QListBoxItem* item) +{ + searchPathsDialog->removeButton->setEnabled(item != NULL); +} + +void KcmGtk::searchPathsAddClicked() +{ + new QListBoxText(searchPathsDialog->pathList, searchPathsDialog->pathBox->text()); + searchPathsDialog->pathBox->clear(); +} + +void KcmGtk::searchPathsRemoveClicked() +{ + searchPathsDialog->pathList->removeItem(searchPathsDialog->pathList->currentItem()); +} + + +#include "kcmgtk.moc" diff --git a/kcm_gtk/kcmgtk.desktop b/kcm_gtk/kcmgtk.desktop new file mode 100644 index 0000000..78d52ca --- /dev/null +++ b/kcm_gtk/kcmgtk.desktop @@ -0,0 +1,28 @@ +[Desktop Entry] +Name=GTK Styles and Fonts +Comment=Control the style and fonts used by GTK applications +Exec=kcmshell kcmgtk +Terminal=false +Icon=gnome_apps.png +OnlyShowIn=KDE; + +Encoding=UTF-8 +X-Keywords=kcmgtk,gtk,style,font +X-KDE-FactoryName=kcmgtk +X-KDE-Library=kcmgtk +X-KDE-ModuleType=Library + +Name[de]=GTK-Stile und Schriftarten +Comment[de]=Einstellung der Stile und Schriftarten in GTK-Anwendungen +Name[fr]=Styles et Polices GTK +Comment[fr]=Détermine le style et les polices utilisés par les applications GTK +Name[it]=Stili e font GTK +Comment[it]=Configura gli stili e i font usati dalle applicazioni GTK +Name[tr]=GTK Stil ve Yazıtipleri +Comment[tr]=GTK uygulamalarının stil ve yazıtiplerini KDE görünümlü yapar +Name[ru]=Стили и шрифты GTK +Comment[ru]=Управление стилями и шрифтами GTK + +Type=Application +Categories=X-KDE-systemsettings-lookandfeel-appearance;X-KDE-settings-looknfeel; + diff --git a/kcm_gtk/kcmgtk.h b/kcm_gtk/kcmgtk.h new file mode 100644 index 0000000..2f132ab --- /dev/null +++ b/kcm_gtk/kcmgtk.h @@ -0,0 +1,104 @@ +/*************************************************************************** + * Copyright (C) 2004 by David Sansome * + * david@dave-linux * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#ifndef _KCMTEST_H_ +#define _KCMTEST_H_ + +#include +#include + +#include "kcmgtkwidget.h" +#include "emacsdetails.h" +#include "searchpaths.h" + +class GtkRcParser +{ +public: + GtkRcParser(); + ~GtkRcParser() {} + + void parse(QString fileName); + + QFont font; + QString style; + bool emacs; + +private: + QFont parseFont(QString fontString); +}; + +class KcmGtk: public KCModule +{ + Q_OBJECT + + // How to name the kde-specific gtk-rc-file + static const QString GTK_RC_FILE; + // Where to search for KDE's config files + static const QString KDE_RC_DIR; + // How to name qtk-qt-engines rc-file + static const QString GTK_QT_RC_FILE; + +public: + KcmGtk( QWidget *parent=0, const char *name=0, const QStringList& = QStringList() ); + ~KcmGtk(); + + virtual void load(); + virtual void save(); + virtual int buttons(); + virtual QString quickHelp() const; + virtual const KAboutData *aboutData()const + { return myAboutData; }; + +public slots: + void styleChanged(); + void fontChangeClicked(); + void itemChanged(); + void firefoxFixClicked(); + void emacsDetailsClicked(); + void searchPathsClicked(); + void searchPathsOk(); + void searchPathsAddClicked(); + void searchPathsRemoveClicked(); + void searchPathsTextChanged(const QString& text); + void searchPathsCurrentChanged(QListBoxItem* item); + +private: + void updateFontPreview(); + void getProfiles(const QString& basePath, int type); + void fixProfile(const QString& path); + QString scrollBarCSS(); + void writeFirefoxCSS(const QString& path, const QString& data); + void getInstalledThemes(); + + QString env(QString key); + + KcmGtkWidget* widget; + QMap themes; + GtkRcParser parser; + KAboutData *myAboutData; + QFont font; + QMap profiles; + EmacsDetails* emacsDetailsDialog; + QStringList gtkSearchPaths; + SearchPaths* searchPathsDialog; + KConfig* config; +}; + +#endif diff --git a/kcm_gtk/kcmgtkwidget.ui b/kcm_gtk/kcmgtkwidget.ui new file mode 100644 index 0000000..99107ed --- /dev/null +++ b/kcm_gtk/kcmgtkwidget.ui @@ -0,0 +1,645 @@ + +KcmGtkWidget + + + KcmGtkWidget + + + + 0 + 0 + 506 + 615 + + + + Form2 + + + + unnamed + + + 0 + + + + styleGroup + + + + 5 + 4 + 0 + 0 + + + + GTK Styles + + + + unnamed + + + + layout12 + + + + unnamed + + + + styleIcon + + + true + + + + + spacer3 + + + Vertical + + + Minimum + + + + 20 + 16 + + + + + + + + layout17 + + + + unnamed + + + + spacer8_2 + + + Horizontal + + + Expanding + + + + 150 + 21 + + + + + + layout16 + + + + unnamed + + + + warning3 + + + Change search paths... + + + + + spacer12 + + + Horizontal + + + Expanding + + + + 176 + 20 + + + + + + + + styleKde + + + &Use my KDE style in GTK applications + + + + + styleBox + + + + 7 + 0 + 0 + 0 + + + + false + + + + + styleOther + + + Use &another style: + + + false + + + + + warning1 + + + <b>Warning:</b> The Gtk-Qt theme engine is not installed. This means you will not be able to use your KDE style in GTK applications. + + + + + warning2 + + + Gtk-Qt theme engine homepage + + + http://gtk-qt.ecs.soton.ac.uk/ + + + + + + + + + fontGroup + + + + 5 + 4 + 0 + 0 + + + + GTK Fonts + + + + unnamed + + + + layout7_2 + + + + unnamed + + + + fontIcon + + + true + + + + + spacer3_2 + + + Vertical + + + Expanding + + + + 20 + 31 + + + + + + + + layout14 + + + + unnamed + + + + fontChange + + + Change... + + + + + spacer7 + + + Horizontal + + + Expanding + + + + 238 + 21 + + + + + + fontOther + + + Use another font: + + + + + layout10 + + + + unnamed + + + + spacer8_3 + + + Horizontal + + + Fixed + + + + 20 + 10 + + + + + + fontPreview2 + + + The Quick Brown Fox Jumped Over The Lazy Dog + + + + + + + fontKde + + + Use m&y KDE fonts in GTK applications + + + Alt+Y + + + + + layout13 + + + + unnamed + + + + spacer9 + + + Horizontal + + + Fixed + + + + 20 + 16 + + + + + + fontPreview + + + Preview line 1 + + + AlignVCenter + + + + + + + + + + + groupBox2 + + + GTK Keyboard Shortcuts + + + + unnamed + + + + layout10 + + + + unnamed + + + + keyboardIcon + + + + + + + + spacer10 + + + Vertical + + + Minimum + + + + 21 + 10 + + + + + + + + layout12 + + + + unnamed + + + + emacsBox + + + Use Emacs-like key&board shortcuts for text editing + + + Alt+B + + + + + layout11 + + + + unnamed + + + + emacsDetails + + + Details... + + + + + spacer11_2 + + + Horizontal + + + Expanding + + + + 141 + 21 + + + + + + + + + + + + groupBox1 + + + + 5 + 4 + 0 + 0 + + + + Firefox and Thunderbird + + + + unnamed + + + + layout7_2_2 + + + + unnamed + + + + firefoxIcon + + + true + + + + + spacer3_2_2 + + + Vertical + + + Expanding + + + + 20 + 31 + + + + + + + + layout12 + + + + unnamed + + + + textLabel1 + + + Scrollbar buttons may sometimes be displayed incorrectly in Firefox and Thunderbird. This can be fixed by installing some files into your Mozilla profile. + + + WordBreak|AlignVCenter + + + + + layout11 + + + + unnamed + + + + firefoxFix + + + I&nstall scrollbar fix... + + + + + spacer11 + + + Horizontal + + + Expanding + + + + 101 + 21 + + + + + + + + + + + + textLabel1_2 + + + Note that changes made here will only affect GTK applications when KDE is running. To change the styles and fonts used by applications in GNOME, use the GNOME configuration tools. + + + WordBreak|AlignVCenter + + + + + spacer2 + + + Vertical + + + Expanding + + + + 51 + 16 + + + + + + + styleKde + styleOther + styleBox + warning3 + warning2 + fontKde + fontOther + fontChange + emacsBox + emacsDetails + firefoxFix + + + + kurllabel.h + ksqueezedtextlabel.h + ksqueezedtextlabel.h + + diff --git a/kcm_gtk/mozillaprofile.ui b/kcm_gtk/mozillaprofile.ui new file mode 100644 index 0000000..0c56821 --- /dev/null +++ b/kcm_gtk/mozillaprofile.ui @@ -0,0 +1,74 @@ + +MozillaProfileWidget + + + MozillaProfileWidget + + + + 0 + 0 + 309 + 293 + + + + Form2 + + + + unnamed + + + 0 + + + + label + + + + 5 + 5 + 0 + 0 + + + + Please select the profiles that you want to fix: + + + + + + Profile + + + true + + + true + + + + profilesList + + + Multi + + + false + + + true + + + + + + + + + klistview.h + + diff --git a/kcm_gtk/searchpaths.ui b/kcm_gtk/searchpaths.ui new file mode 100644 index 0000000..3785983 --- /dev/null +++ b/kcm_gtk/searchpaths.ui @@ -0,0 +1,152 @@ + +SearchPaths + + + SearchPaths + + + + 0 + 0 + 447 + 312 + + + + Change search paths + + + + unnamed + + + + textLabel1 + + + The control center module could not find the GTK-Qt theme engine in its list of search paths. If you have installed it elsewhere, you will need to add the correct path to the list below. + + + WordBreak|AlignVCenter + + + + + pathList + + + + + layout31 + + + + unnamed + + + + pathBox + + + + + addButton + + + false + + + Add + + + true + + + + + removeButton + + + false + + + Remove + + + + + + + line1 + + + HLine + + + Sunken + + + Horizontal + + + + + layout33 + + + + unnamed + + + + spacer26 + + + Horizontal + + + Expanding + + + + 51 + 20 + + + + + + okButton + + + Ok + + + + + cancelButton + + + Cancel + + + + + + + + + okButton + clicked() + SearchPaths + accept() + + + cancelButton + clicked() + SearchPaths + reject() + + + + diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt new file mode 100644 index 0000000..c5fef00 --- /dev/null +++ b/po/CMakeLists.txt @@ -0,0 +1,45 @@ +# .po to .gmo stuff +FILE(GLOB _pofiles *.po) + +FOREACH(_file ${_pofiles}) + GET_FILENAME_COMPONENT(_file_we ${_file} NAME_WE) + SET(_out "${_file_we}.gmo") + SET(_in "${_file_we}.po") + + ADD_CUSTOM_COMMAND( + OUTPUT ${_out} + COMMAND ${MSGFMT_EXECUTABLE} -o ${_out} ${_in} + DEPENDS ${_in} + ) + + INSTALL( + FILES ${_out} + DESTINATION share/locale/${_file_we}/LC_MESSAGES/ + RENAME gtkqtengine.mo + ) + + SET(_outputs ${_outputs} ${_out}) +ENDFOREACH(_file) + +ADD_CUSTOM_TARGET( + pofiles ALL + DEPENDS ${_outputs} +) + + +# Stuff to generate the .pot +FILE(GLOB POT_UIFILES ../kcm_gtk/*.ui) +SET(POT_SOURCES ../kcm_gtk/kcmgtk.cpp) +SET(POT_OUTPUT gtkqtengine.pot) + +ADD_CUSTOM_COMMAND( + OUTPUT _${POT_OUTPUT} + COMMAND ${EXTRACTRC_PATH} ${POT_UIFILES} > rc.cpp + COMMAND ${XGETTEXT_PATH} --foreign-user -C -ci18n -ki18n -ktr2i18n -kI18N_NOOP -kI18N_NOOP2 -kaliasLocale -x "${KDE3_INCLUDE_DIR}/kde.pot" -o ${POT_OUTPUT} rc.cpp ${POT_SOURCES} + COMMAND rm rc.cpp +) + +ADD_CUSTOM_TARGET( + extract_messages + DEPENDS _${POT_OUTPUT} +) diff --git a/po/bg.po b/po/bg.po new file mode 100644 index 0000000..2bbbdcf --- /dev/null +++ b/po/bg.po @@ -0,0 +1,184 @@ +# translation of bg.po to Bulgarian +# This file is put in the public domain. +# +# Zlatko Popov , 2007. +msgid "" +msgstr "" +"Project-Id-Version: bg\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-10-16 17:27+0100\n" +"PO-Revision-Date: 2007-04-05 16:13+0000\n" +"Last-Translator: Zlatko Popov \n" +"Language-Team: Bulgarian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 16 +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/mozillaprofile.ui line 16 +#: rc.cpp:3 rc.cpp:54 +#, no-c-format +msgid "Form2" +msgstr "Form2" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 38 +#: rc.cpp:6 +#, no-c-format +msgid "GTK Styles" +msgstr "GTK стилове" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 109 +#: rc.cpp:9 +#, no-c-format +msgid "&Use my KDE style in GTK applications" +msgstr "&Използване стила на KDE в GTK приложенията" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 117 +#: rc.cpp:12 +#, no-c-format +msgid "Use another style:" +msgstr "Използване на друг стил:" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 128 +#: rc.cpp:15 +#, no-c-format +msgid "Gtk-Qt theme engine homepage" +msgstr "Интернет страница на Gtk-Qt theme engine" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 131 +#: rc.cpp:18 +#, no-c-format +msgid "http://gtk-qt.ecs.soton.ac.uk/" +msgstr "http://gtk-qt.ecs.soton.ac.uk/" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 139 +#: rc.cpp:21 +#, no-c-format +msgid "" +"Warning: The Gtk-Qt theme engine is not installed. This means you " +"will not be able to use your KDE style in GTK applications." +msgstr "" +"Предупреждение: Не е инсталиран Gtk-Qt theme engine. Това означава, " +"че не можете да използвате стила на KDE в GTK приложенията." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 175 +#: rc.cpp:24 +#, no-c-format +msgid "GTK Fonts" +msgstr "GTK шрифтове" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 229 +#: rc.cpp:27 +#, no-c-format +msgid "Change..." +msgstr "Промяна..." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 254 +#: rc.cpp:30 +#, no-c-format +msgid "Use another font:" +msgstr "Използване на друг шрифт:" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 287 +#: rc.cpp:33 +#, no-c-format +msgid "The Quick Brown Fox Jumped Over The Lazy Dog" +msgstr "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЬЮЯабвгдежзийклмнопрстуфхцчшщъьюя" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 297 +#: rc.cpp:36 +#, no-c-format +msgid "Use m&y KDE fonts in GTK applications" +msgstr "Използване шрифтовете на &KDE в GTK приложения" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 330 +#: rc.cpp:39 +#, no-c-format +msgid "Preview line 1" +msgstr "Предварителен преглед 1" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 355 +#: rc.cpp:42 +#, no-c-format +msgid "Firefox and Thunderbird" +msgstr "Firefox и Thunderbird" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 409 +#: rc.cpp:45 +#, no-c-format +msgid "" +"Scrollbar buttons may sometimes be displayed incorrectly in Firefox and " +"Thunderbird. This can be fixed by installing some files into your Mozilla " +"profile." +msgstr "" +"Възможно е бутоните в лентата за превъртане да не се показват правилно във " +"Firefox и Thunderbird. Този проблем може да се реши чрез инсталирането на " +"няколко файла в профила на Mozilla." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 428 +#: rc.cpp:48 +#, no-c-format +msgid "I&nstall scrollbar fix..." +msgstr "&Инсталиране на решението..." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 459 +#: rc.cpp:51 +#, no-c-format +msgid "" +"Note that changes made here will only affect GTK applications when KDE is " +"running. To change the styles and fonts used by applications in GNOME, use " +"the GNOME configuration tools." +msgstr "" +"Имайте предвид, че направените тук промени засягат GTK приложенията само " +"когато KDE е стартирано. За да промените стиловете и шрифтовете на GNOME, " +"използвайте съответните конфигурационни инструменти." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/mozillaprofile.ui line 38 +#: rc.cpp:57 +#, no-c-format +msgid "Please select the profiles that you want to fix:" +msgstr "Моля, изберете профила, който искате да поправите:" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/mozillaprofile.ui line 44 +#: rc.cpp:60 +#, no-c-format +msgid "Profile" +msgstr "Профил" + +#: ../kcm_gtk/kcmgtk.cpp:212 +msgid "%1 (size %2)" +msgstr "%1 (размер %2)" + +#: ../kcm_gtk/kcmgtk.cpp:413 +msgid "No Mozilla profiles found" +msgstr "Не са намерени профили на Mozilla" + +#: ../kcm_gtk/kcmgtk.cpp:413 +msgid "Could not load Mozilla profiles" +msgstr "Профилът на Mozilla не може да бъде зареден" + +#: ../kcm_gtk/kcmgtk.cpp:422 ../kcm_gtk/kcmgtk.cpp:455 +#: ../kcm_gtk/kcmgtk.cpp:576 +msgid "Mozilla profile" +msgstr "Профил на Mozilla" + +#: ../kcm_gtk/kcmgtk.cpp:455 +msgid "" +"Your Mozilla profile was updated sucessfully. You must close and restart " +"all Firefox and Thunderbird windows for the changes to take effect" +msgstr "" +"Профилът на Mozilla беше обновен успешно. За да се задействат промените " +"трябва да затворите и рестартирате Firefox и Thunderbird." + +#: ../kcm_gtk/kcmgtk.cpp:472 +msgid "Thunderbird" +msgstr "Thunderbird" + +#: ../kcm_gtk/kcmgtk.cpp:472 +msgid "Firefox" +msgstr "Firefox" + +#: ../kcm_gtk/kcmgtk.cpp:576 +msgid "Could not write to %1" +msgstr "Неуспешен запис в %1" diff --git a/po/de.po b/po/de.po new file mode 100644 index 0000000..d0e81b6 --- /dev/null +++ b/po/de.po @@ -0,0 +1,203 @@ +# translation of de.po to Deutsch +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Sebastian Roth , 2005. +# Jannick Kuhr , 2006. +msgid "" +msgstr "" +"Project-Id-Version: de\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-10-16 17:27+0100\n" +"PO-Revision-Date: 2006-07-07 17:07+0200\n" +"Last-Translator: Jannick Kuhr \n" +"Language-Team: Deutsch \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.2\n" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 16 +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/mozillaprofile.ui line 16 +#: rc.cpp:3 rc.cpp:54 +#, no-c-format +msgid "Form2" +msgstr "Form2" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 38 +#: rc.cpp:6 +#, no-c-format +msgid "GTK Styles" +msgstr "GTK-Stile" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 109 +#: rc.cpp:9 +#, no-c-format +msgid "&Use my KDE style in GTK applications" +msgstr "KDE-Stil in GTK-Anwendungen verwenden" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 117 +#: rc.cpp:12 +#, no-c-format +msgid "Use another style:" +msgstr "Anderen Stil verwenden:" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 128 +#: rc.cpp:15 +#, no-c-format +msgid "Gtk-Qt theme engine homepage" +msgstr "Homepage der Gtk-Qt-Theme-Engine" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 131 +#: rc.cpp:18 +#, no-c-format +msgid "http://gtk-qt.ecs.soton.ac.uk/" +msgstr "http://gtk-qt.ecs.soton.ac.uk/" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 139 +#: rc.cpp:21 +#, no-c-format +msgid "" +"Warning: The Gtk-Qt theme engine is not installed. This means you " +"will not be able to use your KDE style in GTK applications." +msgstr "" +"Warnung: Die Gtk-Qt-Theme-Engine ist nicht installiert. Das bedeutet ," +"dass Ihre KDE-Stile nicht in GTK-Anwendungen verwendet werden können." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 175 +#: rc.cpp:24 +#, no-c-format +msgid "GTK Fonts" +msgstr "GTK-Schriftarten" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 229 +#: rc.cpp:27 +#, no-c-format +msgid "Change..." +msgstr "Ändern ..." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 254 +#: rc.cpp:30 +#, no-c-format +msgid "Use another font:" +msgstr "Eine andere Schriftart verwenden:" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 287 +#: rc.cpp:33 +#, no-c-format +msgid "The Quick Brown Fox Jumped Over The Lazy Dog" +msgstr "Falsches Üben von Xylophonmusik quält jeden größeren Zwerg" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 297 +#: rc.cpp:36 +#, no-c-format +msgid "Use m&y KDE fonts in GTK applications" +msgstr "KDE-Schriftarten in GTK-Anwendungen verwenden" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 330 +#: rc.cpp:39 +#, no-c-format +msgid "Preview line 1" +msgstr "Vorschauzeile 1" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 355 +#: rc.cpp:42 +#, no-c-format +msgid "Firefox and Thunderbird" +msgstr "Firefox und Thunderbird" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 409 +#: rc.cpp:45 +#, no-c-format +msgid "" +"Scrollbar buttons may sometimes be displayed incorrectly in Firefox and " +"Thunderbird. This can be fixed by installing some files into your Mozilla " +"profile." +msgstr "" +"Die Knöpfe der Bildlaufleiste werden in Firefox und Thunderbird gelegentlich " +"falsch dargestellt. Dies kann durch das Installieren einiger Dateien in das " +"Mozilla-Profilverzeichnis behoben werden." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 428 +#: rc.cpp:48 +#, no-c-format +msgid "I&nstall scrollbar fix..." +msgstr "Korrektur für Bildlaufleiste installieren ..." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 459 +#: rc.cpp:51 +#, no-c-format +msgid "" +"Note that changes made here will only affect GTK applications when KDE is " +"running. To change the styles and fonts used by applications in GNOME, use " +"the GNOME configuration tools." +msgstr "" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/mozillaprofile.ui line 38 +#: rc.cpp:57 +#, no-c-format +msgid "Please select the profiles that you want to fix:" +msgstr "Bitte wählen Sie die zu korrigierenden Profile aus:" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/mozillaprofile.ui line 44 +#: rc.cpp:60 +#, no-c-format +msgid "Profile" +msgstr "Profil" + +#: ../kcm_gtk/kcmgtk.cpp:212 +msgid "%1 (size %2)" +msgstr "%1 (Größe %2)" + +#: ../kcm_gtk/kcmgtk.cpp:413 +msgid "No Mozilla profiles found" +msgstr "Keine Mozilla-Profile gefunden" + +#: ../kcm_gtk/kcmgtk.cpp:413 +msgid "Could not load Mozilla profiles" +msgstr "Die Mozilla-Profile konnten nicht geladen werden" + +#: ../kcm_gtk/kcmgtk.cpp:422 ../kcm_gtk/kcmgtk.cpp:455 +#: ../kcm_gtk/kcmgtk.cpp:576 +msgid "Mozilla profile" +msgstr "Mozilla-Profil" + +#: ../kcm_gtk/kcmgtk.cpp:455 +msgid "" +"Your Mozilla profile was updated sucessfully. You must close and restart " +"all Firefox and Thunderbird windows for the changes to take effect" +msgstr "" +"Das Mozilla-Profil wurde erfolgreich aktualisiert. Alle laufenden Firefox- " +"und Thunderbird-Fenster müssen geschlossen und neu geöffnet werden, um die " +"Änderungen zu übernehmen." + +#: ../kcm_gtk/kcmgtk.cpp:472 +msgid "Thunderbird" +msgstr "Thunderbird" + +#: ../kcm_gtk/kcmgtk.cpp:472 +msgid "Firefox" +msgstr "Firefox" + +#: ../kcm_gtk/kcmgtk.cpp:576 +msgid "Could not write to %1" +msgstr "%1 ließ sich nicht schreiben" + +#~ msgid "" +#~ "_: NAME OF TRANSLATORS\n" +#~ "Your names" +#~ msgstr "Sebastian Roth, Jannick Kuhr" + +#~ msgid "" +#~ "_: EMAIL OF TRANSLATORS\n" +#~ "Your emails" +#~ msgstr "sebastian.roth@frm2.tum.de, jannick.kuhr@kdemail.net" + +#~ msgid "Use &another style:" +#~ msgstr "Anderen Stil verwenden:" + +#~ msgid "GTK Keyboard Shortcuts" +#~ msgstr "GTK-Tastenkürzel" + +#~ msgid "Use Emacs-like key&board shortcuts for text editing" +#~ msgstr "Emacs-Tastenkürzel zum Editieren von Text verwenden" diff --git a/po/es.po b/po/es.po new file mode 100644 index 0000000..c812c34 --- /dev/null +++ b/po/es.po @@ -0,0 +1,197 @@ +# translation of es.po to +# This file is put in the public domain. +# Sergio Cambra García , 2005. +# +msgid "" +msgstr "" +"Project-Id-Version: es\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-10-16 17:27+0100\n" +"PO-Revision-Date: 2005-01-26 14:33+0100\n" +"Last-Translator: Sergio Cambra García \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.3.1\n" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 16 +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/mozillaprofile.ui line 16 +#: rc.cpp:3 rc.cpp:54 +#, no-c-format +msgid "Form2" +msgstr "Form2" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 38 +#: rc.cpp:6 +#, no-c-format +msgid "GTK Styles" +msgstr "Estilos de GTK" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 109 +#: rc.cpp:9 +#, fuzzy, no-c-format +msgid "&Use my KDE style in GTK applications" +msgstr "Usar mi estilo de KDE en las aplicaciones de GTK" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 117 +#: rc.cpp:12 +#, no-c-format +msgid "Use another style:" +msgstr "Usar otro estilo:" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 128 +#: rc.cpp:15 +#, no-c-format +msgid "Gtk-Qt theme engine homepage" +msgstr "Página principal de Gtk-Qt theme engine" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 131 +#: rc.cpp:18 +#, no-c-format +msgid "http://gtk-qt.ecs.soton.ac.uk/" +msgstr "http://gtk-qt.ecs.soton.ac.uk/" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 139 +#: rc.cpp:21 +#, no-c-format +msgid "" +"Warning: The Gtk-Qt theme engine is not installed. This means you " +"will not be able to use your KDE style in GTK applications." +msgstr "" +"Atención: El motor de temas Gtk-Qt theme engine no está instalado. " +"Esto significa que no podrás usar tu estilo de KDE en las aplicaciones de " +"GTK." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 175 +#: rc.cpp:24 +#, no-c-format +msgid "GTK Fonts" +msgstr "Fuentes de GTK" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 229 +#: rc.cpp:27 +#, no-c-format +msgid "Change..." +msgstr "Cambiar..." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 254 +#: rc.cpp:30 +#, no-c-format +msgid "Use another font:" +msgstr "Usar otra fuente:" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 287 +#: rc.cpp:33 +#, no-c-format +msgid "The Quick Brown Fox Jumped Over The Lazy Dog" +msgstr "Jovencito emponzoñado de whisky, ¡qué figurota exhibe!" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 297 +#: rc.cpp:36 +#, fuzzy, no-c-format +msgid "Use m&y KDE fonts in GTK applications" +msgstr "Usar mis fuentes de KDE en las aplicaciones de GTK" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 330 +#: rc.cpp:39 +#, no-c-format +msgid "Preview line 1" +msgstr "Línea 1 de previsualización" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 355 +#: rc.cpp:42 +#, no-c-format +msgid "Firefox and Thunderbird" +msgstr "Firefox y Thunderbird" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 409 +#: rc.cpp:45 +#, no-c-format +msgid "" +"Scrollbar buttons may sometimes be displayed incorrectly in Firefox and " +"Thunderbird. This can be fixed by installing some files into your Mozilla " +"profile." +msgstr "" +"Los botones de la barra de desplazamiento a veces se muestran " +"incorrectamente en Firefox y Thunderbird. Esto se puede arreglarinstalando " +"algunos archivos en tu perfil de Mozilla." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 428 +#: rc.cpp:48 +#, fuzzy, no-c-format +msgid "I&nstall scrollbar fix..." +msgstr "Corregir el problema..." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 459 +#: rc.cpp:51 +#, no-c-format +msgid "" +"Note that changes made here will only affect GTK applications when KDE is " +"running. To change the styles and fonts used by applications in GNOME, use " +"the GNOME configuration tools." +msgstr "" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/mozillaprofile.ui line 38 +#: rc.cpp:57 +#, fuzzy, no-c-format +msgid "Please select the profiles that you want to fix:" +msgstr "Por favor, elige el perfil de Mozilla que quieres reparar:" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/mozillaprofile.ui line 44 +#: rc.cpp:60 +#, no-c-format +msgid "Profile" +msgstr "" + +#: ../kcm_gtk/kcmgtk.cpp:212 +msgid "%1 (size %2)" +msgstr "%1 (tamaño %2)" + +#: ../kcm_gtk/kcmgtk.cpp:413 +msgid "No Mozilla profiles found" +msgstr "No se han encontrado perfiles de Mozilla" + +#: ../kcm_gtk/kcmgtk.cpp:413 +msgid "Could not load Mozilla profiles" +msgstr "No se pueden cargar los perfiles de Mozilla" + +#: ../kcm_gtk/kcmgtk.cpp:422 ../kcm_gtk/kcmgtk.cpp:455 +#: ../kcm_gtk/kcmgtk.cpp:576 +msgid "Mozilla profile" +msgstr "Perfil de Mozilla" + +#: ../kcm_gtk/kcmgtk.cpp:455 +msgid "" +"Your Mozilla profile was updated sucessfully. You must close and restart " +"all Firefox and Thunderbird windows for the changes to take effect" +msgstr "" +"Tu perfil de Mozilla se ha actualizado correctamente. Debes cerrar y " +"reiniciar todas las ventanas de Firefox y Thunderbird para que los cambios " +"tengan efecto." + +#: ../kcm_gtk/kcmgtk.cpp:472 +#, fuzzy +msgid "Thunderbird" +msgstr "Thunderbird" + +#: ../kcm_gtk/kcmgtk.cpp:472 +msgid "Firefox" +msgstr "Firefox" + +#: ../kcm_gtk/kcmgtk.cpp:576 +msgid "Could not write to %1" +msgstr "" + +#~ msgid "" +#~ "_: NAME OF TRANSLATORS\n" +#~ "Your names" +#~ msgstr "Sergio Cambra García" + +#~ msgid "" +#~ "_: EMAIL OF TRANSLATORS\n" +#~ "Your emails" +#~ msgstr "runico@users.berlios.de" + +#~ msgid "The file %1 could not be found" +#~ msgstr "No se puede encontrar el archivo %1" diff --git a/po/fr.po b/po/fr.po new file mode 100644 index 0000000..c223a6d --- /dev/null +++ b/po/fr.po @@ -0,0 +1,203 @@ +# translation of fr.po to +# translation of fr.po to +# This file is distributed under the same license as the PACKAGE package. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER. +# Pascal Billery-Schneider , 2005. +# +msgid "" +msgstr "" +"Project-Id-Version: fr\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-10-16 17:27+0100\n" +"PO-Revision-Date: 2005-01-23 10:38+0100\n" +"Last-Translator: Pascal Billery-Schneider \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"ch>\n" +"X-Generator: KBabel 1.9.1\n" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 16 +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/mozillaprofile.ui line 16 +#: rc.cpp:3 rc.cpp:54 +#, no-c-format +msgid "Form2" +msgstr "Form2" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 38 +#: rc.cpp:6 +#, no-c-format +msgid "GTK Styles" +msgstr "Styles GTK" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 109 +#: rc.cpp:9 +#, fuzzy, no-c-format +msgid "&Use my KDE style in GTK applications" +msgstr "Appliquer le style de KDE aux applications GTK" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 117 +#: rc.cpp:12 +#, no-c-format +msgid "Use another style:" +msgstr "Utiliser un autre style :" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 128 +#: rc.cpp:15 +#, no-c-format +msgid "Gtk-Qt theme engine homepage" +msgstr "Page d'accueil du moteur de thèmes Gtk-Qt Theme Engine" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 131 +#: rc.cpp:18 +#, no-c-format +msgid "http://gtk-qt.ecs.soton.ac.uk/" +msgstr "http://gtk-qt.ecs.soton.ac.uk/" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 139 +#: rc.cpp:21 +#, no-c-format +msgid "" +"Warning: The Gtk-Qt theme engine is not installed. This means you " +"will not be able to use your KDE style in GTK applications." +msgstr "" +"Attention : Le moteur de thèmes Gtk-Qt Theme Engine n'est pas " +"installé . Aussi, ne serez vous pas en mesure d'appliquer le style de KDE " +"aux applications GTK." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 175 +#: rc.cpp:24 +#, no-c-format +msgid "GTK Fonts" +msgstr "Polices GTK" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 229 +#: rc.cpp:27 +#, no-c-format +msgid "Change..." +msgstr "Choisir..." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 254 +#: rc.cpp:30 +#, no-c-format +msgid "Use another font:" +msgstr "Utiliser une autre police :" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 287 +#: rc.cpp:33 +#, no-c-format +msgid "The Quick Brown Fox Jumped Over The Lazy Dog" +msgstr "Portez ce vieux whisky au juge blond qui fume" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 297 +#: rc.cpp:36 +#, fuzzy, no-c-format +msgid "Use m&y KDE fonts in GTK applications" +msgstr "Utiliser les polices de KDE dans les applications GTK" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 330 +#: rc.cpp:39 +#, no-c-format +msgid "Preview line 1" +msgstr "Aperçu ligne 1" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 355 +#: rc.cpp:42 +#, no-c-format +msgid "Firefox and Thunderbird" +msgstr "Firefox et Thunderbird" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 409 +#: rc.cpp:45 +#, no-c-format +msgid "" +"Scrollbar buttons may sometimes be displayed incorrectly in Firefox and " +"Thunderbird. This can be fixed by installing some files into your Mozilla " +"profile." +msgstr "" +"Il se peut que les boutons de la barre de défilement soient parfois mal " +"affichés dans Firefox et Thunderbird. Cela peut être corrigé par " +"l'installation de quelques fichiers dans votre profil Mozilla." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 428 +#: rc.cpp:48 +#, fuzzy, no-c-format +msgid "I&nstall scrollbar fix..." +msgstr "Installer la correction de la barre de défilement..." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 459 +#: rc.cpp:51 +#, no-c-format +msgid "" +"Note that changes made here will only affect GTK applications when KDE is " +"running. To change the styles and fonts used by applications in GNOME, use " +"the GNOME configuration tools." +msgstr "" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/mozillaprofile.ui line 38 +#: rc.cpp:57 +#, fuzzy, no-c-format +msgid "Please select the profiles that you want to fix:" +msgstr "" +"Veuillez choisir le profil de Mozilla auquel vous voulez appliquer la " +"correction :" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/mozillaprofile.ui line 44 +#: rc.cpp:60 +#, no-c-format +msgid "Profile" +msgstr "" + +#: ../kcm_gtk/kcmgtk.cpp:212 +msgid "%1 (size %2)" +msgstr "%1 (taille %2)" + +#: ../kcm_gtk/kcmgtk.cpp:413 +msgid "No Mozilla profiles found" +msgstr "Aucun profil de Mozilla " + +#: ../kcm_gtk/kcmgtk.cpp:413 +msgid "Could not load Mozilla profiles" +msgstr "Impossible de charger le profil de Mozilla" + +#: ../kcm_gtk/kcmgtk.cpp:422 ../kcm_gtk/kcmgtk.cpp:455 +#: ../kcm_gtk/kcmgtk.cpp:576 +msgid "Mozilla profile" +msgstr "Profil Mozilla" + +#: ../kcm_gtk/kcmgtk.cpp:455 +msgid "" +"Your Mozilla profile was updated sucessfully. You must close and restart " +"all Firefox and Thunderbird windows for the changes to take effect" +msgstr "" +"Votre profil Mozilla a été mis-à-jour avec succès. Vous devez fermer toutes " +"les fenêtres de Firefox ou Thunderbird en cours puis redémarrer afin que les " +"changements puissent prendre effet." + +#: ../kcm_gtk/kcmgtk.cpp:472 +#, fuzzy +msgid "Thunderbird" +msgstr "Thunderbird" + +#: ../kcm_gtk/kcmgtk.cpp:472 +msgid "Firefox" +msgstr "Firefox" + +#: ../kcm_gtk/kcmgtk.cpp:576 +msgid "Could not write to %1" +msgstr "" + +#~ msgid "" +#~ "_: NAME OF TRANSLATORS\n" +#~ "Your names" +#~ msgstr "Pascal Billery-Schneider" + +#~ msgid "" +#~ "_: EMAIL OF TRANSLATORS\n" +#~ "Your emails" +#~ msgstr "Sagittarius@laposte.net" + +#~ msgid "The file %1 could not be found" +#~ msgstr "Le fichier %1 est introuvable" diff --git a/po/gtkqtengine.pot b/po/gtkqtengine.pot new file mode 100644 index 0000000..f78c9c7 --- /dev/null +++ b/po/gtkqtengine.pot @@ -0,0 +1,174 @@ +# SOME DESCRIPTIVE TITLE. +# This file is put in the public domain. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-10-16 17:27+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 16 +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/mozillaprofile.ui line 16 +#: rc.cpp:3 rc.cpp:54 +#, no-c-format +msgid "Form2" +msgstr "" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 38 +#: rc.cpp:6 +#, no-c-format +msgid "GTK Styles" +msgstr "" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 109 +#: rc.cpp:9 +#, no-c-format +msgid "&Use my KDE style in GTK applications" +msgstr "" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 117 +#: rc.cpp:12 +#, no-c-format +msgid "Use another style:" +msgstr "" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 128 +#: rc.cpp:15 +#, no-c-format +msgid "Gtk-Qt theme engine homepage" +msgstr "" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 131 +#: rc.cpp:18 +#, no-c-format +msgid "http://gtk-qt.ecs.soton.ac.uk/" +msgstr "" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 139 +#: rc.cpp:21 +#, no-c-format +msgid "" +"Warning: The Gtk-Qt theme engine is not installed. This means you " +"will not be able to use your KDE style in GTK applications." +msgstr "" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 175 +#: rc.cpp:24 +#, no-c-format +msgid "GTK Fonts" +msgstr "" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 229 +#: rc.cpp:27 +#, no-c-format +msgid "Change..." +msgstr "" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 254 +#: rc.cpp:30 +#, no-c-format +msgid "Use another font:" +msgstr "" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 287 +#: rc.cpp:33 +#, no-c-format +msgid "The Quick Brown Fox Jumped Over The Lazy Dog" +msgstr "" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 297 +#: rc.cpp:36 +#, no-c-format +msgid "Use m&y KDE fonts in GTK applications" +msgstr "" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 330 +#: rc.cpp:39 +#, no-c-format +msgid "Preview line 1" +msgstr "" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 355 +#: rc.cpp:42 +#, no-c-format +msgid "Firefox and Thunderbird" +msgstr "" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 409 +#: rc.cpp:45 +#, no-c-format +msgid "" +"Scrollbar buttons may sometimes be displayed incorrectly in Firefox and " +"Thunderbird. This can be fixed by installing some files into your Mozilla " +"profile." +msgstr "" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 428 +#: rc.cpp:48 +#, no-c-format +msgid "I&nstall scrollbar fix..." +msgstr "" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 459 +#: rc.cpp:51 +#, no-c-format +msgid "" +"Note that changes made here will only affect GTK applications when KDE is " +"running. To change the styles and fonts used by applications in GNOME, use " +"the GNOME configuration tools." +msgstr "" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/mozillaprofile.ui line 38 +#: rc.cpp:57 +#, no-c-format +msgid "Please select the profiles that you want to fix:" +msgstr "" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/mozillaprofile.ui line 44 +#: rc.cpp:60 +#, no-c-format +msgid "Profile" +msgstr "" + +#: ../kcm_gtk/kcmgtk.cpp:212 +msgid "%1 (size %2)" +msgstr "" + +#: ../kcm_gtk/kcmgtk.cpp:413 +msgid "No Mozilla profiles found" +msgstr "" + +#: ../kcm_gtk/kcmgtk.cpp:413 +msgid "Could not load Mozilla profiles" +msgstr "" + +#: ../kcm_gtk/kcmgtk.cpp:422 ../kcm_gtk/kcmgtk.cpp:455 +#: ../kcm_gtk/kcmgtk.cpp:576 +msgid "Mozilla profile" +msgstr "" + +#: ../kcm_gtk/kcmgtk.cpp:455 +msgid "" +"Your Mozilla profile was updated sucessfully. You must close and restart " +"all Firefox and Thunderbird windows for the changes to take effect" +msgstr "" + +#: ../kcm_gtk/kcmgtk.cpp:472 +msgid "Thunderbird" +msgstr "" + +#: ../kcm_gtk/kcmgtk.cpp:472 +msgid "Firefox" +msgstr "" + +#: ../kcm_gtk/kcmgtk.cpp:576 +msgid "Could not write to %1" +msgstr "" diff --git a/po/it.po b/po/it.po new file mode 100644 index 0000000..14c3f81 --- /dev/null +++ b/po/it.po @@ -0,0 +1,186 @@ +# Translation of it to Italian +# This file is put in the public domain. +# Davide Madrisan , 2007. +# +msgid "" +msgstr "" +"Project-Id-Version: it\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-10-16 17:27+0100\n" +"PO-Revision-Date: 2007-01-18 20:12+0100\n" +"Last-Translator: Davide Madrisan \n" +"Language-Team: Italian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 16 +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/mozillaprofile.ui line 16 +#: rc.cpp:3 rc.cpp:54 +#, no-c-format +msgid "Form2" +msgstr "" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 38 +#: rc.cpp:6 +#, no-c-format +msgid "GTK Styles" +msgstr "Stili GTK" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 109 +#: rc.cpp:9 +#, fuzzy, no-c-format +msgid "&Use my KDE style in GTK applications" +msgstr "Utilizza lo stile configurato in KDE nelle applicazioni GTK" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 117 +#: rc.cpp:12 +#, no-c-format +msgid "Use another style:" +msgstr "Utilizza un altro stile:" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 128 +#: rc.cpp:15 +#, no-c-format +msgid "Gtk-Qt theme engine homepage" +msgstr "Homepage del motore di temi Gtk-Qt" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 131 +#: rc.cpp:18 +#, no-c-format +msgid "http://gtk-qt.ecs.soton.ac.uk/" +msgstr "" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 139 +#: rc.cpp:21 +#, no-c-format +msgid "" +"Warning: The Gtk-Qt theme engine is not installed. This means you " +"will not be able to use your KDE style in GTK applications." +msgstr "" +"Warning: Il motore di temi Gtk-Qt non è installato. Non sarà " +"possibile applicare lo stile KDE alle applicazioni GTK." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 175 +#: rc.cpp:24 +#, no-c-format +msgid "GTK Fonts" +msgstr "Caratteri GTK" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 229 +#: rc.cpp:27 +#, no-c-format +msgid "Change..." +msgstr "Modifica..." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 254 +#: rc.cpp:30 +#, no-c-format +msgid "Use another font:" +msgstr "Utilizza un altro tipo di carattere:" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 287 +#: rc.cpp:33 +#, no-c-format +msgid "The Quick Brown Fox Jumped Over The Lazy Dog" +msgstr "Ma La Volpe Col Suo Balzo Ha Raggiunto Il Quieto Fido" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 297 +#: rc.cpp:36 +#, fuzzy, no-c-format +msgid "Use m&y KDE fonts in GTK applications" +msgstr "Utilizza i caratteri definiti in KDE nelle applicazioni GTK" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 330 +#: rc.cpp:39 +#, no-c-format +msgid "Preview line 1" +msgstr "Anteprima della linea 1" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 355 +#: rc.cpp:42 +#, no-c-format +msgid "Firefox and Thunderbird" +msgstr "Firefox e Thunderbird" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 409 +#: rc.cpp:45 +#, no-c-format +msgid "" +"Scrollbar buttons may sometimes be displayed incorrectly in Firefox and " +"Thunderbird. This can be fixed by installing some files into your Mozilla " +"profile." +msgstr "" +"I pulsanti della barra di scorrimento talvolta vengono visualizzati in modo " +"scorretto in Firefox e Thunderbird. Questo problema può essere corretto " +"installando alcuni file nel tuo profilo personale di Mozilla." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 428 +#: rc.cpp:48 +#, fuzzy, no-c-format +msgid "I&nstall scrollbar fix..." +msgstr "Installare la correzione della barra di scorrimento..." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 459 +#: rc.cpp:51 +#, no-c-format +msgid "" +"Note that changes made here will only affect GTK applications when KDE is " +"running. To change the styles and fonts used by applications in GNOME, use " +"the GNOME configuration tools." +msgstr "" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/mozillaprofile.ui line 38 +#: rc.cpp:57 +#, no-c-format +msgid "Please select the profiles that you want to fix:" +msgstr "Selezionare i profili che si desidera correggere:" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/mozillaprofile.ui line 44 +#: rc.cpp:60 +#, no-c-format +msgid "Profile" +msgstr "Profilo" + +#: ../kcm_gtk/kcmgtk.cpp:212 +msgid "%1 (size %2)" +msgstr "%1 (dimensione %2)" + +#: ../kcm_gtk/kcmgtk.cpp:413 +msgid "No Mozilla profiles found" +msgstr "Non è stato trovato alcun profilo di Mozilla" + +#: ../kcm_gtk/kcmgtk.cpp:413 +msgid "Could not load Mozilla profiles" +msgstr "Impossibile caricare i profili di Mozilla" + +#: ../kcm_gtk/kcmgtk.cpp:422 ../kcm_gtk/kcmgtk.cpp:455 +#: ../kcm_gtk/kcmgtk.cpp:576 +msgid "Mozilla profile" +msgstr "Profilo di Mozilla" + +#: ../kcm_gtk/kcmgtk.cpp:455 +msgid "" +"Your Mozilla profile was updated sucessfully. You must close and restart " +"all Firefox and Thunderbird windows for the changes to take effect" +msgstr "" +"Il profilo personale di Mozilla è stato aggiornato con successo. Occorre " +"chiudere tutte le finestre attive di Mozilla e Thunderbird. Le modifiche " +"avranno effetto dal prossimo avvio di questi applicativi." + +#: ../kcm_gtk/kcmgtk.cpp:472 +msgid "Thunderbird" +msgstr "Thunderbird" + +#: ../kcm_gtk/kcmgtk.cpp:472 +msgid "Firefox" +msgstr "Firefox" + +#: ../kcm_gtk/kcmgtk.cpp:576 +msgid "Could not write to %1" +msgstr "Impossibile scrivere in %1" + +#~ msgid "" +#~ "_: NAME OF TRANSLATORS\n" +#~ "Your names" +#~ msgstr "Davide Madrisan" diff --git a/po/nn.po b/po/nn.po new file mode 100644 index 0000000..c6a72ac --- /dev/null +++ b/po/nn.po @@ -0,0 +1,191 @@ +# Translation of nn to Norwegian Nynorsk +# This file is put in the public domain. +# Karl Ove Hufthammer , 2005. +# +msgid "" +msgstr "" +"Project-Id-Version: nn\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-10-16 17:27+0100\n" +"PO-Revision-Date: 2005-03-01 23:01+0100\n" +"Last-Translator: Karl Ove Hufthammer \n" +"Language-Team: Norwegian Nynorsk \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.9.1\n" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 16 +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/mozillaprofile.ui line 16 +#: rc.cpp:3 rc.cpp:54 +#, no-c-format +msgid "Form2" +msgstr "Form2" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 38 +#: rc.cpp:6 +#, no-c-format +msgid "GTK Styles" +msgstr "GTK-stilar" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 109 +#: rc.cpp:9 +#, fuzzy, no-c-format +msgid "&Use my KDE style in GTK applications" +msgstr "Bruk KDE-stil i GTK-program" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 117 +#: rc.cpp:12 +#, no-c-format +msgid "Use another style:" +msgstr "Bruk ein annan stil:" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 128 +#: rc.cpp:15 +#, no-c-format +msgid "Gtk-Qt theme engine homepage" +msgstr "Heimesida til Gtk-Qt" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 131 +#: rc.cpp:18 +#, no-c-format +msgid "http://gtk-qt.ecs.soton.ac.uk/" +msgstr "http://gtk-qt.ecs.soton.ac.uk/" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 139 +#: rc.cpp:21 +#, no-c-format +msgid "" +"Warning: The Gtk-Qt theme engine is not installed. This means you " +"will not be able to use your KDE style in GTK applications." +msgstr "" +"Åtvaring: Gtk-Qt er ikkje installert. Du kan derfor ikkje bruka KDE-" +"stilen i GTK-program." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 175 +#: rc.cpp:24 +#, no-c-format +msgid "GTK Fonts" +msgstr "GTK-skrifter" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 229 +#: rc.cpp:27 +#, no-c-format +msgid "Change..." +msgstr "Endra …" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 254 +#: rc.cpp:30 +#, no-c-format +msgid "Use another font:" +msgstr "Bruk ei anna skrift:" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 287 +#: rc.cpp:33 +#, no-c-format +msgid "The Quick Brown Fox Jumped Over The Lazy Dog" +msgstr "Då klokka klang, så fort vi sprang!" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 297 +#: rc.cpp:36 +#, fuzzy, no-c-format +msgid "Use m&y KDE fonts in GTK applications" +msgstr "Bruk KDE-skrifter i GTK-program" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 330 +#: rc.cpp:39 +#, no-c-format +msgid "Preview line 1" +msgstr "Førehandsvisingslinje 1" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 355 +#: rc.cpp:42 +#, no-c-format +msgid "Firefox and Thunderbird" +msgstr "Firefox og Thunderbird" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 409 +#: rc.cpp:45 +#, no-c-format +msgid "" +"Scrollbar buttons may sometimes be displayed incorrectly in Firefox and " +"Thunderbird. This can be fixed by installing some files into your Mozilla " +"profile." +msgstr "" +"Rullefeltknappane vert ikkje alltid vist rett i Firefox og Thunderbird. " +"Dette kan rettast opp i ved å installera nokre ekstra filer i Mozilla-" +"profilen din." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 428 +#: rc.cpp:48 +#, fuzzy, no-c-format +msgid "I&nstall scrollbar fix..." +msgstr "Installer rullefeltoppdatering …" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 459 +#: rc.cpp:51 +#, no-c-format +msgid "" +"Note that changes made here will only affect GTK applications when KDE is " +"running. To change the styles and fonts used by applications in GNOME, use " +"the GNOME configuration tools." +msgstr "" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/mozillaprofile.ui line 38 +#: rc.cpp:57 +#, no-c-format +msgid "Please select the profiles that you want to fix:" +msgstr "Vel profilane du vil retta:" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/mozillaprofile.ui line 44 +#: rc.cpp:60 +#, no-c-format +msgid "Profile" +msgstr "Profil" + +#: ../kcm_gtk/kcmgtk.cpp:212 +msgid "%1 (size %2)" +msgstr "%1 (storleik %2)" + +#: ../kcm_gtk/kcmgtk.cpp:413 +msgid "No Mozilla profiles found" +msgstr "Fann ikkje nokon Mozilla-profilar." + +#: ../kcm_gtk/kcmgtk.cpp:413 +msgid "Could not load Mozilla profiles" +msgstr "Klarte ikkje opna Mozilla-profilar" + +#: ../kcm_gtk/kcmgtk.cpp:422 ../kcm_gtk/kcmgtk.cpp:455 +#: ../kcm_gtk/kcmgtk.cpp:576 +msgid "Mozilla profile" +msgstr "Mozilla-profil" + +#: ../kcm_gtk/kcmgtk.cpp:455 +msgid "" +"Your Mozilla profile was updated sucessfully. You must close and restart " +"all Firefox and Thunderbird windows for the changes to take effect" +msgstr "" +"Mozilla-profilen er no oppdatert. Du må lukka og starta på nytt alle " +"Firefox- og Thunderbird-vindauge for at endringane skal trå i kraft." + +#: ../kcm_gtk/kcmgtk.cpp:472 +msgid "Thunderbird" +msgstr "Thunderbird" + +#: ../kcm_gtk/kcmgtk.cpp:472 +msgid "Firefox" +msgstr "Firefox" + +#: ../kcm_gtk/kcmgtk.cpp:576 +msgid "Could not write to %1" +msgstr "Klarte ikkje skriva til «%1»" + +#~ msgid "" +#~ "_: NAME OF TRANSLATORS\n" +#~ "Your names" +#~ msgstr "Karl Ove Hufthammer" + +#~ msgid "" +#~ "_: EMAIL OF TRANSLATORS\n" +#~ "Your emails" +#~ msgstr "karl@huftis.org" diff --git a/po/ru.po b/po/ru.po new file mode 100755 index 0000000..12bfced --- /dev/null +++ b/po/ru.po @@ -0,0 +1,197 @@ +# translation of ru.po to Русский +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Ponasenkov Viktor , 2007. +msgid "" +msgstr "" +"Project-Id-Version: ru\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-10-16 17:27+0100\n" +"PO-Revision-Date: 2007-04-05 21:57+0400\n" +"Last-Translator: Viktor \n" +"Language-Team: Русский \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 16 +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/mozillaprofile.ui line 16 +#: rc.cpp:3 rc.cpp:54 +#, no-c-format +msgid "Form2" +msgstr "Form2" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 38 +#: rc.cpp:6 +#, no-c-format +msgid "GTK Styles" +msgstr "Стили GTK" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 109 +#: rc.cpp:9 +#, fuzzy, no-c-format +msgid "&Use my KDE style in GTK applications" +msgstr "Использовать мой стиль KDE в GTK приложениях" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 117 +#: rc.cpp:12 +#, no-c-format +msgid "Use another style:" +msgstr "Использовать другой стиль:" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 128 +#: rc.cpp:15 +#, no-c-format +msgid "Gtk-Qt theme engine homepage" +msgstr "Домашняя страница Gtk-Qt Theme Engine" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 131 +#: rc.cpp:18 +#, no-c-format +msgid "http://gtk-qt.ecs.soton.ac.uk/" +msgstr "" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 139 +#: rc.cpp:21 +#, no-c-format +msgid "" +"Warning: The Gtk-Qt theme engine is not installed. This means you " +"will not be able to use your KDE style in GTK applications." +msgstr "" +"Внимание: Gtk-Qt Theme еngine не установлен. Вы не можете " +"использовать стили KDE в GTK приложениях." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 175 +#: rc.cpp:24 +#, no-c-format +msgid "GTK Fonts" +msgstr "Шрифты GTK" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 229 +#: rc.cpp:27 +#, no-c-format +msgid "Change..." +msgstr "Изменить..." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 254 +#: rc.cpp:30 +#, no-c-format +msgid "Use another font:" +msgstr "Использовать другой шрифт:" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 287 +#: rc.cpp:33 +#, no-c-format +msgid "The Quick Brown Fox Jumped Over The Lazy Dog" +msgstr "" +"Широкая электрификация южных губерний даст мощный толчок подъёму сельского " +"хозяйства" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 297 +#: rc.cpp:36 +#, fuzzy, no-c-format +msgid "Use m&y KDE fonts in GTK applications" +msgstr "Использовать мои шрифты KDE в GTK приложениях" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 330 +#: rc.cpp:39 +#, no-c-format +msgid "Preview line 1" +msgstr "Просмотр 1" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 355 +#: rc.cpp:42 +#, no-c-format +msgid "Firefox and Thunderbird" +msgstr "Firefox и Thunderbird" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 409 +#: rc.cpp:45 +#, no-c-format +msgid "" +"Scrollbar buttons may sometimes be displayed incorrectly in Firefox and " +"Thunderbird. This can be fixed by installing some files into your Mozilla " +"profile." +msgstr "" +"Кнопки скроллбара иногда могут отображаться некорректно в Firefox и " +"Thunderbird. Это может быть исправлено установкой нескольких файлов в ваш " +"профиль Mozilla." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 428 +#: rc.cpp:48 +#, fuzzy, no-c-format +msgid "I&nstall scrollbar fix..." +msgstr "Установить исправление..." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 459 +#: rc.cpp:51 +#, no-c-format +msgid "" +"Note that changes made here will only affect GTK applications when KDE is " +"running. To change the styles and fonts used by applications in GNOME, use " +"the GNOME configuration tools." +msgstr "" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/mozillaprofile.ui line 38 +#: rc.cpp:57 +#, no-c-format +msgid "Please select the profiles that you want to fix:" +msgstr "Выберите профиль, который вы хотите исправить:" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/mozillaprofile.ui line 44 +#: rc.cpp:60 +#, no-c-format +msgid "Profile" +msgstr "Профиль" + +#: ../kcm_gtk/kcmgtk.cpp:212 +msgid "%1 (size %2)" +msgstr "%1 (Размер %2)" + +#: ../kcm_gtk/kcmgtk.cpp:413 +msgid "No Mozilla profiles found" +msgstr "Не найдено ни одного профиля Mozilla" + +#: ../kcm_gtk/kcmgtk.cpp:413 +msgid "Could not load Mozilla profiles" +msgstr "Невозможно загрузить профили Mozilla" + +#: ../kcm_gtk/kcmgtk.cpp:422 ../kcm_gtk/kcmgtk.cpp:455 +#: ../kcm_gtk/kcmgtk.cpp:576 +msgid "Mozilla profile" +msgstr "Профиль Mozilla" + +#: ../kcm_gtk/kcmgtk.cpp:455 +msgid "" +"Your Mozilla profile was updated sucessfully. You must close and restart " +"all Firefox and Thunderbird windows for the changes to take effect" +msgstr "" +"Ваш профиль Mozilla успешно обновлён. Вы должны закрыть и перезапустить все " +"копии Firefox и Thunderbird чтобы изменения вступили в силу." + +#: ../kcm_gtk/kcmgtk.cpp:472 +msgid "Thunderbird" +msgstr "Thunderbird" + +#: ../kcm_gtk/kcmgtk.cpp:472 +msgid "Firefox" +msgstr "Firefox" + +#: ../kcm_gtk/kcmgtk.cpp:576 +msgid "Could not write to %1" +msgstr "Невозможно записать в %1" + +#~ msgid "" +#~ "_: NAME OF TRANSLATORS\n" +#~ "Your names" +#~ msgstr "Понасенков Виктор" + +#~ msgid "" +#~ "_: EMAIL OF TRANSLATORS\n" +#~ "Your emails" +#~ msgstr "vitecx@gmail.com" + +#~ msgid "http://www.freedesktop.org/wiki/Software_2fgtk_2dqt" +#~ msgstr "http://www.freedesktop.org/wiki/Software_2fgtk_2dqt" diff --git a/po/sv.po b/po/sv.po new file mode 100644 index 0000000..fe943be --- /dev/null +++ b/po/sv.po @@ -0,0 +1,194 @@ +# Swedish translation of gtk-qt-engine +# This file is distributed under the same license as the gtk-qt-engine package. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER. +# Daniel Nylander , 2006. +# +msgid "" +msgstr "" +"Project-Id-Version: gtk-qt-engine 0.7\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-10-16 17:27+0100\n" +"PO-Revision-Date: 2006-09-18 17:26+0100\n" +"Last-Translator: Daniel Nylander \n" +"Language-Team: Swedish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.9.1\n" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 16 +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/mozillaprofile.ui line 16 +#: rc.cpp:3 rc.cpp:54 +#, no-c-format +msgid "Form2" +msgstr "Form2" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 38 +#: rc.cpp:6 +#, no-c-format +msgid "GTK Styles" +msgstr "GTK-stilar" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 109 +#: rc.cpp:9 +#, fuzzy, no-c-format +msgid "&Use my KDE style in GTK applications" +msgstr "Använd min KDE-stil i GTK-program" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 117 +#: rc.cpp:12 +#, no-c-format +msgid "Use another style:" +msgstr "Använd en annan stil:" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 128 +#: rc.cpp:15 +#, no-c-format +msgid "Gtk-Qt theme engine homepage" +msgstr "Webbsidan för Gtk-Qt-temamotorn" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 131 +#: rc.cpp:18 +#, no-c-format +msgid "http://gtk-qt.ecs.soton.ac.uk/" +msgstr "http://gtk-qt.ecs.soton.ac.uk/" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 139 +#: rc.cpp:21 +#, no-c-format +msgid "" +"Warning: The Gtk-Qt theme engine is not installed. This means you " +"will not be able to use your KDE style in GTK applications." +msgstr "" +"Varning: Gtk-Qt-temamotorn är inte installerad. Det betyder att du " +"inte kan använda din KDE-stil i GTK-program." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 175 +#: rc.cpp:24 +#, no-c-format +msgid "GTK Fonts" +msgstr "GTK-typsnitt" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 229 +#: rc.cpp:27 +#, no-c-format +msgid "Change..." +msgstr "Ändra..." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 254 +#: rc.cpp:30 +#, no-c-format +msgid "Use another font:" +msgstr "Använd ett annat typsnitt:" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 287 +#: rc.cpp:33 +#, no-c-format +msgid "The Quick Brown Fox Jumped Over The Lazy Dog" +msgstr "Flygande bäckasiner söka strax hwila på mjuka tuvor" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 297 +#: rc.cpp:36 +#, fuzzy, no-c-format +msgid "Use m&y KDE fonts in GTK applications" +msgstr "Använd mina KDE-typsnitt i GTK-program" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 330 +#: rc.cpp:39 +#, no-c-format +msgid "Preview line 1" +msgstr "Förhandsgranska rad 1" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 355 +#: rc.cpp:42 +#, no-c-format +msgid "Firefox and Thunderbird" +msgstr "Firefox och Thunderbird" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 409 +#: rc.cpp:45 +#, no-c-format +msgid "" +"Scrollbar buttons may sometimes be displayed incorrectly in Firefox and " +"Thunderbird. This can be fixed by installing some files into your Mozilla " +"profile." +msgstr "" +"Rullistknappar kan ibland visas felaktigt i Firefox och Thunderbird. Det " +"här kan rättas till genom att installera några filer i din Mozilla-profil." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 428 +#: rc.cpp:48 +#, fuzzy, no-c-format +msgid "I&nstall scrollbar fix..." +msgstr "Installera rättning för rullista..." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 459 +#: rc.cpp:51 +#, no-c-format +msgid "" +"Note that changes made here will only affect GTK applications when KDE is " +"running. To change the styles and fonts used by applications in GNOME, use " +"the GNOME configuration tools." +msgstr "" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/mozillaprofile.ui line 38 +#: rc.cpp:57 +#, no-c-format +msgid "Please select the profiles that you want to fix:" +msgstr "Välj de profiler som du vill rätta till:" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/mozillaprofile.ui line 44 +#: rc.cpp:60 +#, no-c-format +msgid "Profile" +msgstr "Profil" + +#: ../kcm_gtk/kcmgtk.cpp:212 +msgid "%1 (size %2)" +msgstr "%1 (storlek %2)" + +#: ../kcm_gtk/kcmgtk.cpp:413 +msgid "No Mozilla profiles found" +msgstr "Inga Mozilla-profiler hittades" + +#: ../kcm_gtk/kcmgtk.cpp:413 +msgid "Could not load Mozilla profiles" +msgstr "Kunde inte läsa in Mozilla-profiler" + +#: ../kcm_gtk/kcmgtk.cpp:422 ../kcm_gtk/kcmgtk.cpp:455 +#: ../kcm_gtk/kcmgtk.cpp:576 +msgid "Mozilla profile" +msgstr "Mozilla-profil" + +#: ../kcm_gtk/kcmgtk.cpp:455 +msgid "" +"Your Mozilla profile was updated sucessfully. You must close and restart " +"all Firefox and Thunderbird windows for the changes to take effect" +msgstr "" +"Din Mozilla-profil blev uppdaterad. Du måste stänga och starta om alla " +"Firefox- och Thunderbird-fönster för att ändringarna ska gälla" + +#: ../kcm_gtk/kcmgtk.cpp:472 +msgid "Thunderbird" +msgstr "Thunderbird" + +#: ../kcm_gtk/kcmgtk.cpp:472 +msgid "Firefox" +msgstr "Firefox" + +#: ../kcm_gtk/kcmgtk.cpp:576 +msgid "Could not write to %1" +msgstr "Kunde inte skriva till %1" + +#~ msgid "" +#~ "_: NAME OF TRANSLATORS\n" +#~ "Your names" +#~ msgstr "Daniel Nylander" + +#~ msgid "" +#~ "_: EMAIL OF TRANSLATORS\n" +#~ "Your emails" +#~ msgstr "po@danielnylander.se" + +#~ msgid "The file %1 could not be found" +#~ msgstr "Le fichier %1 est introuvable" diff --git a/po/tr.po b/po/tr.po new file mode 100644 index 0000000..ebef097 --- /dev/null +++ b/po/tr.po @@ -0,0 +1,181 @@ +# This file is put in the public domain. +# +# S.Çağlar Onur , 2005. +msgid "" +msgstr "" +"Project-Id-Version: turkish\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-10-16 17:27+0100\n" +"PO-Revision-Date: 2005-12-19 01:43+0200\n" +"Last-Translator: S.Çağlar Onur \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 16 +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/mozillaprofile.ui line 16 +#: rc.cpp:3 rc.cpp:54 +#, no-c-format +msgid "Form2" +msgstr "" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 38 +#: rc.cpp:6 +#, no-c-format +msgid "GTK Styles" +msgstr "GTK Stilleri" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 109 +#: rc.cpp:9 +#, no-c-format +msgid "&Use my KDE style in GTK applications" +msgstr "GTK uygulamaları için KDE stilimi kullan " + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 117 +#: rc.cpp:12 +#, no-c-format +msgid "Use another style:" +msgstr "Başka bir sitil kullan:" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 128 +#: rc.cpp:15 +#, no-c-format +msgid "Gtk-Qt theme engine homepage" +msgstr "Gtk-Qt-Engine websitesi" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 131 +#: rc.cpp:18 +#, no-c-format +msgid "http://gtk-qt.ecs.soton.ac.uk/" +msgstr "" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 139 +#: rc.cpp:21 +#, no-c-format +msgid "" +"Warning: The Gtk-Qt theme engine is not installed. This means you " +"will not be able to use your KDE style in GTK applications." +msgstr "" +"Uyarı: Gtk-Qt-Engine kurulu değil. Bu GTK uygulamalarında KDE " +"stillerini kullanamayacaksınız anlamına geliyor." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 175 +#: rc.cpp:24 +#, no-c-format +msgid "GTK Fonts" +msgstr "GTK Fontları" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 229 +#: rc.cpp:27 +#, no-c-format +msgid "Change..." +msgstr "Değiştir..." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 254 +#: rc.cpp:30 +#, no-c-format +msgid "Use another font:" +msgstr "Başka bir yazıtipi kullan:" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 287 +#: rc.cpp:33 +#, no-c-format +msgid "The Quick Brown Fox Jumped Over The Lazy Dog" +msgstr "Dağ başını duman almış gümüş dere durmaz akar" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 297 +#: rc.cpp:36 +#, no-c-format +msgid "Use m&y KDE fonts in GTK applications" +msgstr "GTK uygulamalarında KDE yazıtiplerini kullan" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 330 +#: rc.cpp:39 +#, no-c-format +msgid "Preview line 1" +msgstr "Önizleme" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 355 +#: rc.cpp:42 +#, no-c-format +msgid "Firefox and Thunderbird" +msgstr "Firefox ve Thunderbird" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 409 +#: rc.cpp:45 +#, no-c-format +msgid "" +"Scrollbar buttons may sometimes be displayed incorrectly in Firefox and " +"Thunderbird. This can be fixed by installing some files into your Mozilla " +"profile." +msgstr "" +"Kaydırma çubuğu düğmeleri Firefox ve Thunderbird'de bazen yanlış " +"gösteriliyor. Bu seçenek ile Mozilla profilinize bası dosyalar eklenerek bu " +"sorun giderilebilir." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 428 +#: rc.cpp:48 +#, no-c-format +msgid "I&nstall scrollbar fix..." +msgstr "Kaydırma çubuğunu düzelt..." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/kcmgtkwidget.ui line 459 +#: rc.cpp:51 +#, no-c-format +msgid "" +"Note that changes made here will only affect GTK applications when KDE is " +"running. To change the styles and fonts used by applications in GNOME, use " +"the GNOME configuration tools." +msgstr "" +"Bu değişiklikler sadece KDE içinde çalışan GTK uygulamalarını etkilemektedir." + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/mozillaprofile.ui line 38 +#: rc.cpp:57 +#, no-c-format +msgid "Please select the profiles that you want to fix:" +msgstr "Lütfen düzeltmek istediğiniz profili seçin:" + +#. i18n: file /mnt/lvm/home/david/projects/cmakestuff/gtk-qt-engine/po/../kcm_gtk/mozillaprofile.ui line 44 +#: rc.cpp:60 +#, no-c-format +msgid "Profile" +msgstr "Profil" + +#: ../kcm_gtk/kcmgtk.cpp:212 +msgid "%1 (size %2)" +msgstr "%1 (boyut %2)" + +#: ../kcm_gtk/kcmgtk.cpp:413 +msgid "No Mozilla profiles found" +msgstr "Mozilla profili bulunamadı" + +#: ../kcm_gtk/kcmgtk.cpp:413 +msgid "Could not load Mozilla profiles" +msgstr "Mozilla profili yüklenemiyor" + +#: ../kcm_gtk/kcmgtk.cpp:422 ../kcm_gtk/kcmgtk.cpp:455 +#: ../kcm_gtk/kcmgtk.cpp:576 +msgid "Mozilla profile" +msgstr "Mozilla Profili" + +#: ../kcm_gtk/kcmgtk.cpp:455 +msgid "" +"Your Mozilla profile was updated sucessfully. You must close and restart " +"all Firefox and Thunderbird windows for the changes to take effect" +msgstr "" +"Mozilla profiliniz başarıyla güncellendi, Değişikliklerin etkin olması için " +"tüm açık Firefox ve Thunderbird pencerelerinizi kapatmalı ve yeniden " +"başlatmalısınız" + +#: ../kcm_gtk/kcmgtk.cpp:472 +msgid "Thunderbird" +msgstr "Thunderbird" + +#: ../kcm_gtk/kcmgtk.cpp:472 +msgid "Firefox" +msgstr "Firefox" + +#: ../kcm_gtk/kcmgtk.cpp:576 +msgid "Could not write to %1" +msgstr "%1'e yazılamıyor" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..0ca785e --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,28 @@ +# Sources +SET(GTK-QT-SOURCES + qt_main.c + qt_qt_wrapper.cpp + qt_rc_style.c + qt_theme_draw.c) + +ADD_LIBRARY(qtengine SHARED ${GTK-QT-SOURCES}) + +# Add GTK's cflags +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GTK_CFLAGS} ${BONOBO_CFLAGS}") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GTK_CFLAGS} ${BONOBO_CFLAGS}") + +TARGET_LINK_LIBRARIES(qtengine ${GTK_LINK_FLAGS} ${QT_LIBRARIES} ${BONOBO_LINK_FLAGS}) + +INSTALL( + TARGETS qtengine + DESTINATION ${INSTALL_PATH_GTK_ENGINES} + PERMISSIONS + OWNER_READ OWNER_WRITE OWNER_EXECUTE + GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE +) + +INSTALL( + FILES gtkrc + DESTINATION "${INSTALL_PATH_GTK_THEMES}/Qt/gtk-2.0" +) \ No newline at end of file diff --git a/src/gtkrc b/src/gtkrc new file mode 100644 index 0000000..ac44427 --- /dev/null +++ b/src/gtkrc @@ -0,0 +1,7 @@ +style "default" +{ + engine "qtengine" + { + } +} +class "GtkWidget" style "default" diff --git a/src/qt_main.c b/src/qt_main.c new file mode 100644 index 0000000..4e9eb1b --- /dev/null +++ b/src/qt_main.c @@ -0,0 +1,29 @@ +#include +#include +#include "qt_rc_style.h" +#include "qt_style.h" + +#include "qt_qt_wrapper.h" + +G_MODULE_EXPORT void theme_init (GTypeModule *module); +G_MODULE_EXPORT void theme_exit (void); +G_MODULE_EXPORT GtkRcStyle * theme_create_rc_style (void); + +G_MODULE_EXPORT void theme_init (GTypeModule *module) +{ + createQApp(); + qtengine_rc_style_register_type (module); + qtengine_style_register_type (module); +} + +G_MODULE_EXPORT void theme_exit (void) +{ + destroyQApp(); +} + +G_MODULE_EXPORT GtkRcStyle * theme_create_rc_style (void) +{ + void *ptr = GTK_RC_STYLE (g_object_new (QTENGINE_TYPE_RC_STYLE, NULL)); + return (GtkRcStyle *)ptr; +} + diff --git a/src/qt_qt_wrapper.cpp b/src/qt_qt_wrapper.cpp new file mode 100644 index 0000000..f520d18 --- /dev/null +++ b/src/qt_qt_wrapper.cpp @@ -0,0 +1,2216 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#ifdef USE_FREEBSD +#include +#include +#include +#include +#include +#include +#endif + +#ifdef USE_SOLARIS +#include +#endif + +#include + +#include "qt_qt_wrapper.h" +#include "qt_style.h" + +#define RC_CACHE_VERSION QString("1") + + +bool gtkQtEnable = false; +bool mozillaFix = false; +bool qAppOwner = false; + +QStringList appDirList; +typedef QMap IconMap; +IconMap iconMap[4]; +extern int errno; + +QScrollBar* scrollBar = 0; +QWidget* meepWidget = 0; +QWidget* meepWidgetP = 0; +QSlider* meepSlider = 0; +QTabBar* meepTabBar = 0; +GdkGC* altBackGC = 0; +QWidget* smw = 0; + +GtkRcStyle* gtkRcStyle = 0; + +QStringList kdeSearchPaths; +QString iconTheme; +QStringList iconThemeDirs; +QColor alternateBackgroundColour; +int showIconsOnButtons; +int toolbarStyle; + +const QPixmap* backgroundTile; +GdkPixmap* backgroundTileGdk; +QPixmap* menuBackgroundPixmap; +GdkPixmap* menuBackgroundPixmapGdk; + +QPixmap* fillPixmap; + +int scrollBarSpacingLeft = 0; +int scrollBarSpacingRight = 0; + +int isBaghira; +int isKeramik; +int isAlloy; +int isDomino; +int isPolyester; +int eclipseFix; +int openOfficeFix; +int gtkQtDebug; + +Atom kipcCommAtom; +Atom desktopWindowAtom; + +void setFillPixmap(GdkPixbuf* buf) +{ + if (!gtkQtEnable) + return; + + // This code isn't very robust. It doesn't handle depths other than 24 bits. + // It sure is fast though! + int depth = gdk_pixbuf_get_n_channels(buf) * gdk_pixbuf_get_bits_per_sample(buf); + int width = gdk_pixbuf_get_width(buf); + int height = gdk_pixbuf_get_height(buf); + int excess = gdk_pixbuf_get_rowstride(buf) - (width*3); + + if (depth != 24) + return; + + QImage fillImage(width, height, 32); + + uchar* source = gdk_pixbuf_get_pixels(buf); + uchar* dest = fillImage.bits(); + + for (int y=0 ; yconvertFromImage(fillImage); + return; +} + + +/* Now to get rid of a ton of un-needed new's across the board. `new' and `delete' are + * non-trivial operations. You normally just don't notice it; until you're painting a window + * with 50 widgets, with each paint operation requiring 3-4 news and 3-4 delete's. The cost + * of indirection is `not insubstantial'. */ + + +static int dummy_x_errhandler( Display *dpy, XErrorEvent *err ) +{ + return 0; +} +static int dummy_xio_errhandler( Display * ) +{ + return 0; +} + +void createQApp() +{ + int argc = 1; + char** argv; + // Supply it with fake data to keep KApplication happy + argv = (char**) malloc(sizeof(char*)); + argv[0] = (char*) malloc(sizeof(char) * 19); + strncpy(argv[0], "gtk-qt-application", 19); + + QString cmdLine; + +#ifdef USE_FREEBSD +/* + procfs(5) is deprecated on FreeBSD. + We use the kvm(3) library to get argv[0] of the current pid. +*/ + int cnt = 0; + int ret = 0; + kvm_t *kd; + struct kinfo_proc *pbase; + char ** arg; + const char *msg = ""; + + kd = kvm_open(NULL, _PATH_DEVNULL, NULL, O_RDONLY, "kvm_open"); + if (kd == NULL ) + { + msg = "kvm_open failed\n"; + ret = -1; + } + else + { + pbase = kvm_getprocs(kd, KERN_PROC_PID, getpid(), &cnt); + if (( pbase == NULL ) || ( cnt != 1 )) + { + msg = "kvm_getprocs failed\n"; + ret = -1; + } + else + { + arg = kvm_getargv(kd, pbase, 1024); + if (arg == NULL) + { + msg = "kvm_getargv failed\n"; + ret = -1; + } + else + { + cmdLine += arg[0]; + } + } + kvm_close(kd); + } + if (ret == -1) + { + printf("Gtk-Qt theme engine warning:\n"); + printf(msg); + printf(" This may cause problems for the GNOME window manager\n"); + } +#endif // USE_FREEBSD + +#ifdef USE_SOLARIS + int pid=getpid(); + char filen[256]; + psinfo_t pfi; + uintptr_t addr; + uintptr_t addr2; + int i,count,readl, ret=0; + const char *msg; + + sprintf(filen, "/proc/%d/psinfo",pid); + int fd=open(filen, O_RDONLY); + if (fd == -1) + { + msg = "Open of psinfo failed\n"; + ret = -1; + } + else + { + readl=read(fd, (void *)&pfi, sizeof(psinfo_t)); + if (readl < 0) + { + msg = "Read on as failed\n"; + close(fd); + ret = -1; + } + else + { + addr=pfi.pr_argv; + count=pfi.pr_argc; + } + close(fd); + } + /* if read of psinfo was success */ + if (!ret) + { + sprintf(filen, "/proc/%d/as",pid); + fd=open(filen, O_RDONLY); + if (fd == -1) + { + msg = "Open of as failed\n"; + ret = -1; + } + else + { + for (i=0;istyle().name()).lower() == "baghira"); + isKeramik = (QString(qApp->style().name()).lower() == "keramik"); + isAlloy = (QString(qApp->style().name()).lower() == "alloy"); + isDomino = (QString(qApp->style().name()).lower() == "domino"); + isPolyester = (QString(qApp->style().name()).lower() == "polyester"); + + if (isDomino) + { + QScrollBar sbar(NULL); + sbar.setOrientation(Qt::Horizontal); + sbar.setValue(1); + sbar.resize(200,25); + + QRect rect = qApp->style().querySubControlMetrics(QStyle::CC_ScrollBar, &sbar, QStyle::SC_ScrollBarGroove); + scrollBarSpacingLeft = rect.x(); + scrollBarSpacingRight = 200 - rect.x() - rect.width(); + } + + // Set Gtk fonts and icons + /*setGnomeFonts(); + setGnomeIcons();*/ + + if (!cmdLine.contains("xfce-mcs-manager")) + { + // Get KDE related atoms from the X server + kipcCommAtom = XInternAtom ( gdk_x11_get_default_xdisplay() , "KIPC_COMM_ATOM" , false ); + desktopWindowAtom = XInternAtom ( gdk_x11_get_default_xdisplay() , "KDE_DESKTOP_WINDOW" , false ); + + // Create a new window, and set the KDE_DESKTOP_WINDOW property on it + // This window will then receive events from KDE when the style changes + smw = new QWidget(0,0); + long data = 1; + XChangeProperty(gdk_x11_get_default_xdisplay(), smw->winId(), + desktopWindowAtom, desktopWindowAtom, + 32, PropModeReplace, (unsigned char *)&data, 1); + + // This filter will intercept those events + gdk_window_add_filter( NULL, gdkEventFilter, 0); + } + + meepWidgetP = new QWidget(0); + meepWidget = new QWidget(meepWidgetP); + meepSlider = new QSlider(meepWidget); + meepWidget->polish(); + + meepTabBar = new QTabBar(meepWidget); + + menuBackgroundPixmap = NULL; + backgroundTile = meepWidget->paletteBackgroundPixmap(); + if (backgroundTile != NULL) + backgroundTileGdk = gdk_pixmap_foreign_new(backgroundTile->handle()); +} + +void destroyQApp() +{ + if (!gtkQtEnable) + return; + delete meepWidget; + delete meepWidgetP; + delete menuBackgroundPixmap; + delete smw; + if (qAppOwner) + { + delete qApp; + qApp = 0; + } + if (altBackGC != 0) + gtk_gc_release(altBackGC); +} + +GdkFilterReturn gdkEventFilter(GdkXEvent *xevent, GdkEvent *gevent, gpointer data) +{ + XEvent* event = (XEvent*) xevent; + + // Is the event a KIPC message? + if ((event->type == ClientMessage) && (event->xclient.message_type == kipcCommAtom)) + { + // This data variable contains the type of KIPC message + // As defined in kdelibs/kdecore/kipc.h, 2 = StyleChanged + if (event->xclient.data.l[0] != 2) + return GDK_FILTER_REMOVE; + + if (gtkQtDebug) + printf("StyleChanged IPC message\n"); + + // Find out the new widget style + QString styleName = kdeConfigValue("General", "widgetStyle", ""); + QStyle* style = QStyleFactory::create(styleName); + if (!style) + return GDK_FILTER_REMOVE; + + // Tell the QApplication about this new style + qApp->setStyle(style); + + // Now we need to update GTK's properties + setRcProperties(gtkRcStyle, 1); // Rewrite our cache file + gtk_rc_reparse_all(); // Tell GTK to parse the cache file + + return GDK_FILTER_REMOVE; + } + return GDK_FILTER_CONTINUE; +} + +QString kdeConfigValue(const QString& section, const QString& name, const QString& def) +{ + for ( QStringList::Iterator it = kdeSearchPaths.begin(); it != kdeSearchPaths.end(); ++it ) + { + if (!QFile::exists((*it) + "/share/config/kdeglobals")) + continue; + + QFile file((*it) + "/share/config/kdeglobals"); + if (!file.open( IO_ReadOnly )) + continue; + + QTextStream stream( &file ); + QString line; + QString sec; + int i = 1; + while ( !stream.atEnd() ) + { + line = stream.readLine(); + if (line.startsWith("[")) + { + sec = line.mid(1, line.length() - 2); + continue; + } + if (sec != section) + continue; + QRegExp parser("([\\S]*)\\s*=\\s*([\\S]*)"); + if (parser.search(line) == -1) + continue; + if (parser.cap(1) == name) + return parser.cap(2); + } + file.close(); + } + return def; +} + +QString kdeFindDir(const QString& suffix, const QString& file1, const QString& file2) +{ + for ( QStringList::Iterator it = kdeSearchPaths.begin(); it != kdeSearchPaths.end(); ++it ) + { + if ((QFile::exists((*it) + suffix + file1)) || (QFile::exists((*it) + suffix + file2))) + return (*it) + suffix; + } + return QString::null; +} + +QString runCommand(const QString& command) +{ + FILE* p = popen(command.latin1(), "r"); + if ((p == NULL) || (p < 0)) + return QString::null; + + QString ret; + while (!feof(p)) + { + char buffer[256]; + int n = fread(buffer, 1, 255, p); + buffer[n] = '\0'; + ret += buffer; + } + pclose(p); + + return ret.stripWhiteSpace(); +} + +void initKdeSettings() +{ + kdeSearchPaths.clear(); + + QString kdeHome = getenv("KDEHOME"); + QString kdeDirs = getenv("KDEDIRS"); + QString kdeDir = getenv("KDEDIR"); + + if (!kdeHome.isEmpty()) + kdeSearchPaths.append(kdeHome); + kdeSearchPaths.append(runCommand("kde-config --localprefix")); + + if (!kdeDirs.isEmpty()) + kdeSearchPaths += QStringList::split(':', kdeDirs); + if (!kdeDir.isEmpty()) + kdeSearchPaths.append(kdeDir); + kdeSearchPaths.append(runCommand("kde-config --prefix")); + + iconTheme = kdeConfigValue("Icons", "Theme", "crystalsvg"); + QStringList back = QStringList::split(',', kdeConfigValue("General", "alternateBackground", "238,246,255")); + alternateBackgroundColour.setRgb(back[0].toInt(), back[1].toInt(), back[2].toInt()); + + showIconsOnButtons = (kdeConfigValue("KDE", "ShowIconsOnPushButtons", "true").lower() == "true"); + + + QString tmp = kdeConfigValue("Toolbar style", "IconText", "true").lower(); + if (tmp == "icononly") + toolbarStyle = 0; + else if (tmp == "icontextright") + toolbarStyle = 3; + else if (tmp == "textonly") + toolbarStyle = 1; + else if (tmp == "icontextbottom") + toolbarStyle = 2; + else // Should never happen, but just in case we fallback to KDE's default "icononly" + toolbarStyle = 0; +} + +QStyle::SFlags stateToSFlags(GtkStateType state) +{ + switch (state) + { + case GTK_STATE_ACTIVE: + return QStyle::Style_Enabled | QStyle::Style_Down; + case GTK_STATE_PRELIGHT: + return QStyle::Style_Enabled | QStyle::Style_MouseOver | QStyle::Style_Raised; + case GTK_STATE_SELECTED: + return QStyle::Style_Enabled | QStyle::Style_HasFocus | QStyle::Style_Raised; + case GTK_STATE_INSENSITIVE: + return QStyle::Style_Default | QStyle::Style_Raised; + default: + return QStyle::Style_Enabled | QStyle::Style_Raised; + } +} + +QColor gdkColorToQColor(GdkColor* c) +{ + return QColor(c->red / 256, c->green / 256, c->blue / 256); +} + + +// The drawing functions follow the same pattern: +// * Set the appropriate flags +// * Ask QT to paint the widget to a pixmap +// * Create a GdkPixmap that points to our QPixmap +// * Paint the pixmap on the window + + +void drawButton(GdkWindow* window, GtkStyle* style, GtkStateType state, int defaultButton, int x, int y, int w, int h) +{ + if (!gtkQtEnable) + return; + + if ((w < 1) || (h < 1)) + return; + + QPixmap pixmap(w, h); + QPainter painter(&pixmap); + QPushButton button(meepWidget); + button.setBackgroundOrigin(QWidget::ParentOrigin); + button.setGeometry(x, y, w, h); + if (style->rc_style->bg[GTK_STATE_NORMAL].pixel != 0) + button.setPaletteBackgroundColor(gdkColorToQColor(&style->rc_style->bg[GTK_STATE_NORMAL])); + QPoint p = button.backgroundOffset(); + QPoint pos = button.pos(); + + QStyle::SFlags sflags = stateToSFlags(state); + + if (defaultButton) + sflags |= QStyle::Style_ButtonDefault; + button.setDefault(defaultButton); + + painter.fillRect(0, 0, w, h, qApp->palette().active().background()); + + qApp->style().drawControl(QStyle::CE_PushButton, &painter, &button, + QRect(0,0,w,h), button.palette().active(), sflags); + + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle()); + gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h); + g_object_unref(pix); +} + +// Thanks Peter Hartshorn +void drawToolbar(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int y, int w, int h) +{ + if (!gtkQtEnable) + return; + + int w1, h1; + QStyle::SFlags sflags = stateToSFlags(state) | QStyle::Style_Raised; + + + // Keramik hack... + // Keramik only draws the toolbar border, and not the gradient + // so we also draw a separator, but make sure the line is off the + // widget + + if (w > h) + { + sflags |= QStyle::Style_Horizontal; + w1 = w * 3; + h1 = h; + } + else + { + w1 = h; + h1 = h * 3; + } + + if ((w1 < 1) || (h1 < 1) || + (w < 1) || (h < 1)) + return; + + QPixmap pixmap(w1, h1); + QPixmap p(w, h); + QPainter painter(&pixmap); + + if ((backgroundTile) && (!backgroundTile->isNull())) + painter.fillRect(0, 0, w1, h1, QBrush(QColor(255,255,255), *backgroundTile)); + else + painter.fillRect(0, 0, w1, h1, qApp->palette().active().brush(QColorGroup::Background)); + + qApp->style().drawPrimitive(QStyle::PE_PanelDockWindow, &painter, + QRect(0,0,w1,h1), qApp->palette().active(),sflags); + + if (isKeramik) + { + qApp->style().drawPrimitive(QStyle::PE_DockWindowSeparator, &painter, + QRect(0,0,w1,h1), qApp->palette().active(),sflags); + } + + bitBlt(&p, 0, 0, &pixmap, 0, 0, w, h); + + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle()); + gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h); + g_object_unref(pix); +} + +void drawMenubar(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int y, int w, int h) +{ + if (!gtkQtEnable) + return; + + int w1, h1; + QStyle::SFlags sflags = stateToSFlags(state); + + + // Keramik hack... + // Keramik only draws the toolbar border, and not the gradient + // so we also draw a separator, but make sure the line is off the + // widget + + if (w > h) + { + sflags |= QStyle::Style_Horizontal; + w1 = w * 3; + h1 = h; + } + else + { + w1 = h; + h1 = h * 3; + } + + if ((w1 < 1) || (h1 < 1) || + (w < 1) || (h < 1)) + return; + + QPixmap pixmap(w1, h1); + QPixmap p(w, h); + QPainter painter(&pixmap); + + if ((backgroundTile) && (!backgroundTile->isNull())) + painter.fillRect(0, 0, w1, h1, QBrush(QColor(255,255,255), *backgroundTile)); + else + painter.fillRect(0, 0, w1, h1, qApp->palette().active().brush(QColorGroup::Background)); + + qApp->style().drawPrimitive(QStyle::PE_PanelMenuBar, &painter, + QRect(0,0,w1,h1), qApp->palette().active(),sflags); + + bitBlt(&p, 0, 0, &pixmap, 0, 0, w, h); + + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle()); + gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h); + g_object_unref(pix); +} + +void drawTab(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int y, int w, int h) +{ + if (!gtkQtEnable) + return; + + if ((w < 1) || (h < 1)) + return; + + QPixmap pixmap(w,h); + QPainter painter(&pixmap); + + // GTK doesn't tell us if our tab is on the left, right, or middle of the tabbar + // So, let's always assume it's in the middle - it looks pretty + QTab* tab = new QTab; + meepTabBar->insertTab(tab,1); + + QStyle::SFlags sflags = stateToSFlags(state); + + if (state != GTK_STATE_ACTIVE) + sflags = QStyle::Style_Selected; + + painter.fillRect(0, 0, w, h, qApp->palette().active().brush(QColorGroup::Background)); + qApp->style().drawControl(QStyle::CE_TabBarTab, &painter, meepTabBar, QRect(0,0,w,h), qApp->palette().active(), sflags, QStyleOption(tab)); + + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle()); + gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h); + g_object_unref(pix); + + meepTabBar->removeTab(tab); +} + +void drawVLine(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int ySource, int yDest) +{ + if (!gtkQtEnable) + return; + + int width = style->xthickness; + int height = abs(ySource-yDest); + + if (width < 2) width = 2; + + if ((width < 1) || (height < 1)) + return; + + QPixmap pixmap(width, height); + QPainter painter(&pixmap); + + painter.fillRect(2, 0, width - 2, height, qApp->palette().active().brush(QColorGroup::Background)); + painter.setPen( qApp->palette().active().mid() ); + painter.drawLine( 0, 0, 0, height ); + painter.setPen( qApp->palette().active().light() ); + painter.drawLine( 1, 0, 1, height ); + + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle()); + gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, ySource, width, height); + g_object_unref(pix); +} + +void drawHLine(GdkWindow* window, GtkStyle* style, GtkStateType state, int y, int xSource, int xDest) +{ + if (!gtkQtEnable) + return; + + int width = abs(xSource-xDest); + int height = style->ythickness; + + if ((width < 1) || (height < 1)) + return; + + QPixmap pixmap(width, height); + QPainter painter(&pixmap); + + painter.fillRect(0, 2, width, height-2, qApp->palette().active().brush(QColorGroup::Background)); + painter.setPen(qApp->palette().active().mid() ); + painter.drawLine(0, 0, width, 0); + painter.setPen(qApp->palette().active().light()); + painter.drawLine(0, 1, width, 1); + + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle()); + gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, xSource, y, width, height); + g_object_unref(pix); +} + +void drawLineEdit(GdkWindow* window, GtkStyle* style, GtkStateType state, int hasFocus, int x, int y, int w, int h) +{ + if (!gtkQtEnable) + return; + + if ((w < 1) || (h < 1)) + return; + + QPixmap pixmap(w, h); + QPainter painter(&pixmap); + + QStyle::SFlags sflags = stateToSFlags(state); + if (hasFocus) + sflags |= QStyle::Style_HasFocus; + + painter.fillRect(0, 0, w, h, qApp->palette().active().base()); + qApp->style().drawPrimitive(QStyle::PE_PanelLineEdit, &painter, QRect(0, 0, w, h), qApp->palette().active(), sflags, QStyleOption(1,1)); + + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle()); + gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h); + g_object_unref(pix); +} + +void drawFrame(GdkWindow* window, GtkStyle* style, GtkStateType state, GtkShadowType shadow_type, int x, int y, int w, int h) +{ + if (!gtkQtEnable) + return; + + if ((w < 1) || (h < 1)) // Caused crash in gaim file transfers window + return; + + QPixmap pixmap(w, h); + QPainter painter(&pixmap); + + QStyle::SFlags sflags = stateToSFlags(state); + if ((shadow_type == GTK_SHADOW_IN) || (shadow_type == GTK_SHADOW_ETCHED_IN)) + sflags |= QStyle::Style_Sunken; + + if ((backgroundTile) && (!backgroundTile->isNull())) + painter.fillRect(0, 0, w, h, QBrush(QColor(255,255,255), *backgroundTile)); + else + painter.fillRect(0, 0, w, h, qApp->palette().active().brush(QColorGroup::Background)); + + qApp->style().drawPrimitive(QStyle::PE_Panel, &painter, QRect(0, 0, w, h), qApp->palette().active(), sflags, QStyleOption(2,2) ); + + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle()); + gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h); + g_object_unref(pix); +} + +void drawComboBox(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int y, int w, int h) +{ + if (!gtkQtEnable) + return; + + if ((w < 1) || (h < 1)) + return; + + QPixmap pixmap(w,h); + QPainter painter(&pixmap); + QComboBox cb(false, 0); + cb.resize(w,h); + + QStyle::SFlags sflags = stateToSFlags(state); + QStyle::SCFlags scflags = QStyle::SC_ComboBoxArrow | QStyle::SC_ComboBoxFrame | QStyle::SC_ComboBoxListBoxPopup; + QStyle::SCFlags activeflags = QStyle::SC_None; + + if (state == GTK_STATE_PRELIGHT) + activeflags = QStyle::Style_MouseOver; + + painter.fillRect(0,0, w, h, qApp->palette().active().brush(QColorGroup::Background)); + qApp->style().drawComplexControl(QStyle::CC_ComboBox, &painter, &cb, QRect(0, 0, w, h), qApp->palette().active(), sflags, scflags, activeflags); + + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle()); + gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h); + g_object_unref(pix); +} + +void drawCheckBox(GdkWindow* window, GtkStyle* style, GtkStateType state, int checked, int x, int y, int w, int h) +{ + if (!gtkQtEnable) + return; + + int realH = qApp->style().pixelMetric(QStyle::PM_IndicatorHeight); + int realW = qApp->style().pixelMetric(QStyle::PM_IndicatorWidth); + + if ((realW < 1) || (realH < 1)) + return; + + QPixmap pixmap(realW, realH); + QPainter painter(&pixmap); + QCheckBox checkbox(0); + + QStyle::SFlags sflags = stateToSFlags(state); + sflags |= (checked ? QStyle::Style_On : QStyle::Style_Off); + + painter.fillRect(0, 0, realW, realH, qApp->palette().active().brush(QColorGroup::Background)); + qApp->style().drawControl(QStyle::CE_CheckBox, &painter, &checkbox, QRect(0, 0, realW, realH), qApp->palette().active(), sflags); + + // Qt checkboxes are usually bigger than GTK wants. + // We cheat, and draw them over the expected area. + int xOffset = (realW - w) / 2; + int yOffset = (realH - h) / 2; + + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle()); + gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x - xOffset, y - yOffset, realW, realH); + g_object_unref(pix); +} + +void drawMenuCheck(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int y, int w, int h) +{ + if (!gtkQtEnable) + return; + + QCheckBox checkbox(0); + + /* A previous version of the function followed the sizehints exclusively + Now follow w and h provided by GTK, but if the checkmark is too big we might have to scale it */ + /* + int w1 = checkbox.sizeHint().width(); + int h1 = checkbox.sizeHint().height(); */ + + if ((w < 1) || (h < 1)) + return; + + QPixmap pixmap(w,h); + QPainter painter(&pixmap); + + QStyle::SFlags sflags = stateToSFlags(state); + sflags |= QStyle::Style_On; + + if (fillPixmap && (!fillPixmap->isNull())) + painter.fillRect(0, 0, w, h, QBrush(QColor(255,255,255), *fillPixmap)); + else if ((backgroundTile) && (!backgroundTile->isNull())) + painter.fillRect(0, 0, w, h, QBrush(QColor(255,255,255), *backgroundTile)); + else + painter.fillRect(0, 0, w, h, qApp->palette().active().brush(QColorGroup::Background)); + qApp->style().drawPrimitive(QStyle::PE_CheckMark, &painter, QRect(0, 0, w, h), qApp->palette().active(), sflags); + + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle()); + gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h); + g_object_unref(pix); +} + +void drawRadioButton(GdkWindow* window, GtkStyle* style, GtkStateType state, int checked, int x, int y, int w, int h) +{ + if (!gtkQtEnable) + return; + + int realH = qApp->style().pixelMetric(QStyle::PM_IndicatorHeight); + int realW = qApp->style().pixelMetric(QStyle::PM_IndicatorWidth); + + if ((realW < 1) || (realH < 1)) + return; + + QPixmap pixmap(realH, realW); + QPainter painter(&pixmap); + QRadioButton radio(0); + + QStyle::SFlags sflags = stateToSFlags(state); + sflags |= checked ? QStyle::Style_On : QStyle::Style_Off; + + if (fillPixmap && (!fillPixmap->isNull())) + painter.fillRect(0, 0, realW, realH, QBrush(QColor(255,255,255), *fillPixmap)); + else if ((backgroundTile) && (!backgroundTile->isNull())) + painter.fillRect(0, 0, realW, realH, QBrush(QColor(255,255,255), *backgroundTile)); + else + painter.fillRect(0, 0, realW, realH, qApp->palette().active().brush(QColorGroup::Background)); + + qApp->style().drawControl(QStyle::CE_RadioButton, &painter, &radio, QRect(0,0,realH,realW), qApp->palette().active(), sflags); + + // Qt checkboxes are usually bigger than GTK wants. + // We cheat, and draw them over the expected area. + int xOffset = (realW - w) / 2; + int yOffset = (realH - h) / 2; + + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle()); + gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x - xOffset, y - yOffset, realW, realH); + g_object_unref(pix); +} + + +void drawScrollBarSlider(GdkWindow* window, GtkStyle* style, GtkStateType state, int orientation, GtkAdjustment* adj, int x, int y, int w, int h, int offset, int totalExtent) +{ + if (!gtkQtEnable) + return; + + if ((w < 1) || (h < 1)) + return; + + int wCorrected = w; + int hCorrected = h; + if (isDomino) + { + if (orientation == GTK_ORIENTATION_HORIZONTAL) + wCorrected = w + 14; + else + hCorrected = h + 14; + } + QPixmap pixmap(wCorrected, hCorrected); + QPainter painter(&pixmap); + + QStyle::SFlags sflags = stateToSFlags(state); + if (orientation == GTK_ORIENTATION_HORIZONTAL) + sflags |= QStyle::Style_Horizontal; + + qApp->style().drawPrimitive(QStyle::PE_ScrollBarSlider, &painter, QRect(0,0,wCorrected,hCorrected), qApp->palette().active(), sflags); + + // The domino style doesn't draw the entire slider in PE_ScrollBarSlider + // We have to draw PE_ScrollBarAddPage and PE_ScrollBarSubPage and piece the bits together + if (isDomino && !mozillaFix && !eclipseFix) + { + QPixmap leftPix, rightPix; + QRect leftRect, rightRect; + if (orientation == GTK_ORIENTATION_HORIZONTAL) + { + leftRect = QRect(0, 0, offset-scrollBarSpacingLeft, h); + rightRect = QRect(6, 0, totalExtent-offset-w-scrollBarSpacingRight+2, h); + leftPix.resize(6 + leftRect.width(), h); + rightPix.resize(6 + rightRect.width(), h); + } + else + { + leftRect = QRect(0, 0, w, offset-scrollBarSpacingLeft); + rightRect = QRect(0, 6, w, totalExtent-offset-h-scrollBarSpacingRight+2); + leftPix.resize(w, 6 + leftRect.height()); + rightPix.resize(w, 6 + rightRect.height()); + } + + QPainter dominoPainter(&leftPix); + qApp->style().drawPrimitive(QStyle::PE_ScrollBarSubPage, &dominoPainter, leftRect, qApp->palette().active(), sflags); + + dominoPainter.end(); + dominoPainter.begin(&rightPix); + qApp->style().drawPrimitive(QStyle::PE_ScrollBarAddPage, &dominoPainter, rightRect, qApp->palette().active(), sflags); + + if (orientation == GTK_ORIENTATION_HORIZONTAL) + { + bitBlt(&pixmap, 1, 0, &leftPix, leftRect.width(), 0, 6, h, Qt::CopyROP, true); + bitBlt(&pixmap, w-7, 0, &rightPix, 0, 0, 7, h, Qt::CopyROP, true); + } + else + { + bitBlt(&pixmap, 0, 1, &leftPix, 0, leftRect.height(), w, 6, Qt::CopyROP, true); + bitBlt(&pixmap, 0, h-7, &rightPix, 0, 0, w, 7, Qt::CopyROP, true); + } + } + + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle()); + + if (isDomino) + { + int endsSkip = mozillaFix ? 7 : 1; + if (orientation == GTK_ORIENTATION_HORIZONTAL) + gdk_draw_drawable(window, style->bg_gc[state], pix, endsSkip, 0, x, y, w-1, h); + else + gdk_draw_drawable(window, style->bg_gc[state], pix, 0, endsSkip, x, y, w, h-1); + } + else + gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h); + g_object_unref(pix); +} + +void drawScrollBar(GdkWindow* window, GtkStyle* style, GtkStateType state, int orientation, GtkAdjustment* adj, int x, int y, int w, int h) +{ + if (!gtkQtEnable) + return; + + if ((w < 1) || (h < 1)) + return; + + if (scrollBar != 0) + delete scrollBar; + scrollBar = new QScrollBar(NULL); + + scrollBar->resize(w,h); + + // Patch from Chad Kitching + // Patch from Peter Hartshorn + + // another check for mozilla is step_increment and page_increment + // are set to zero for mozilla, and have values set by all other + // gtk applications I've tested this with. + + // Why oh why couldn't mozilla use native widgets instead of + // handling everything in cross platform. + + scrollBar->setOrientation(orientation ? Qt::Vertical : Qt::Horizontal); + + + QStyle::SFlags sflags = stateToSFlags(state); + if (sflags |= QStyle::Style_Down) sflags = QStyle::Style_Enabled; + if (orientation == GTK_ORIENTATION_HORIZONTAL) sflags |= QStyle::Style_Horizontal; + + QPixmap pixmap(w,h); + + scrollBar->setMinValue(0); + scrollBar->setMaxValue(65535); + scrollBar->setValue(32767); + scrollBar->setPageStep(1); + + int offset = 0; + int thumbSize = 0; + + + if (orientation == GTK_ORIENTATION_VERTICAL) { + QRect r; + r = qApp->style().querySubControlMetrics(QStyle::CC_ScrollBar, + scrollBar, QStyle::SC_ScrollBarSlider); + offset = r.y(); + thumbSize = r.height(); + if (thumbSize < 0) + thumbSize = -thumbSize; + + if (!r.isValid()) // Fix a crash bug in Eclipse where it was trying to draw tiny scrollbars. + return; + + QPixmap tmpPixmap(w, h + thumbSize); + QPainter painter2(&tmpPixmap); + scrollBar->resize(w, h + thumbSize); + + painter2.fillRect(0, 0, w, h + thumbSize, + qApp->palette().active().brush(QColorGroup::Background)); + qApp->style().drawComplexControl(QStyle::CC_ScrollBar, + &painter2, scrollBar, QRect(0, 0, w, h+thumbSize), + qApp->palette().active(), sflags); + + bitBlt(&pixmap, 0, 0, &tmpPixmap, 0, 0, w, offset, Qt::CopyROP); + bitBlt(&pixmap, 0, offset, &tmpPixmap, 0, offset + thumbSize, + w, h - offset, Qt::CopyROP); + } else { + QRect r; + r = qApp->style().querySubControlMetrics(QStyle::CC_ScrollBar, + scrollBar, QStyle::SC_ScrollBarSlider); + offset = r.x(); + thumbSize = r.width(); + if (thumbSize < 0) + thumbSize = -thumbSize; + + if (!r.isValid()) // Fix a crash bug in Eclipse when it was trying to draw tiny scrollbars. + return; + + QPixmap tmpPixmap(w + thumbSize, h); + QPainter painter2(&tmpPixmap); + scrollBar->resize(w + thumbSize, h); + + painter2.fillRect(0, 0, w + thumbSize, h, + qApp->palette().active().brush(QColorGroup::Background)); + qApp->style().drawComplexControl(QStyle::CC_ScrollBar, + &painter2, scrollBar, QRect(0, 0, w+thumbSize, h), + qApp->palette().active(), sflags); + + bitBlt(&pixmap, 0, 0, &tmpPixmap, 0, 0, offset, h, Qt::CopyROP); + bitBlt(&pixmap, offset, 0, &tmpPixmap, offset + thumbSize, 0, + w - offset, h, Qt::CopyROP); + } + + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle()); + gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h); + g_object_unref(pix); +} + +void drawToolButton(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int y, int w, int h) +{ + if (!gtkQtEnable) + return; + + if ((w < 1) || (h < 1)) + return; + + QToolButton button(NULL); + button.resize(w, h); + + /* + int realW = button.sizeHint().width(); + int realH = button.sizeHint().height(); */ + + QStyle::SFlags sflags = stateToSFlags(state); + QStyle::SCFlags activeflags = QStyle::SC_None; + if (state == GTK_STATE_ACTIVE) + { + sflags |= QStyle::Style_AutoRaise; + activeflags = QStyle::SC_ToolButton; + } + else + sflags |= QStyle::Style_AutoRaise | QStyle::Style_Raised; + + QPixmap pixmap(w,h); + QPainter painter(&pixmap); + + if ((backgroundTile) && (!backgroundTile->isNull())) + painter.fillRect(0, 0, w, h, QBrush(QColor(255,255,255), *backgroundTile)); + else + painter.fillRect(0, 0, w, h, qApp->palette().active().brush(QColorGroup::Background)); + qApp->style().drawComplexControl(QStyle::CC_ToolButton, &painter, &button, QRect(0, 0, w, h), qApp->palette().active(), sflags, QStyle::SC_ToolButton, activeflags); + + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle()); + gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h); + g_object_unref(pix); +} + +void drawMenuBarItem(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int y, int w, int h) +{ + if (!gtkQtEnable) + return; + + if ((w < 1) || (h < 1)) + return; + + QPixmap pixmap(w, h); + QPainter painter(&pixmap); + QMenuItem mi; + QMenuBar mb(0); + + QStyle::SFlags sflags = QStyle::Style_Down | QStyle::Style_Enabled | QStyle::Style_Active | QStyle::Style_HasFocus; + + qApp->style().drawControl(QStyle::CE_MenuBarItem, &painter, &mb, QRect(0, 0, w, h), qApp->palette().active(), sflags, QStyleOption(&mi)); + + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle()); + gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h); + g_object_unref(pix); +} + +void drawMenuItem(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int y, int w, int h) +{ + if (!gtkQtEnable) + return; + + if ((w < 1) || (h < 1)) + return; + + QPixmap pixmap(w,h); + QPainter painter(&pixmap); + QPopupMenu pm; + QMenuData md; + QMenuItem* mi = md.findItem(md.insertItem("")); + + QStyleOption opt(mi, 16, 16); + QStyle::SFlags sflags = QStyle::Style_Active | QStyle::Style_Enabled; + + painter.fillRect(0, 0, w, h, qApp->palette().active().brush(QColorGroup::Background)); + qApp->style().drawControl(QStyle::CE_PopupMenuItem, &painter, &pm, QRect(0,0,w,h), qApp->palette().active(), sflags, opt); + + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle()); + gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h); + g_object_unref(pix); +} + +void drawSplitter(GdkWindow* window, GtkStyle* style, GtkStateType state, int orientation, int x, int y, int w, int h) +{ + if (!gtkQtEnable) + return; + + if ((w < 1) || (h < 1)) + return; + + QPixmap pixmap(w,h); + QPainter painter(&pixmap); + + QStyle::SFlags sflags = stateToSFlags(state); + // No idea why this works... + if (orientation != GTK_ORIENTATION_HORIZONTAL) sflags |= QStyle::Style_Horizontal; + + painter.fillRect(0, 0, w, h, qApp->palette().active().brush(QColorGroup::Background)); + qApp->style().drawPrimitive(QStyle::PE_Splitter, &painter, QRect(0,0,w,h), qApp->palette().active(), sflags); + + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle()); + gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h); + g_object_unref(pix); +} + +void drawTabFrame(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int y, int w, int h, GtkPositionType pos) +{ + if (!gtkQtEnable) + return; + + if ((w < 1) || (h < 1)) + return; + + QStyle::SFlags sflags = stateToSFlags(state); + + QPixmap pixmap(w, h); + QPainter painter(&pixmap); + QStyleOption opt(2, 2); // line width + + if ((backgroundTile) && (!backgroundTile->isNull())) + painter.fillRect(0, 0, w, h, QBrush(QColor(255,255,255), *backgroundTile)); + else + painter.fillRect(0, 0, w, h, qApp->palette().active().brush(QColorGroup::Background)); + qApp->style().drawPrimitive(QStyle::PE_PanelTabWidget, &painter, QRect(0,0,w,h), qApp->palette().active(), sflags, opt); + + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle()); + gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h); + g_object_unref(pix); + + // Drawing tab base + int th = qApp->style().pixelMetric(QStyle::PM_TabBarBaseHeight, meepTabBar); + int tw = w; + + if ((tw < 1) || (th < 1)) + return; + + QPixmap pixmap1(tw,th); + QPainter painter1(&pixmap1); + if ((backgroundTile) && (!backgroundTile->isNull())) + painter1.fillRect(0, 0, tw, th, QBrush(QColor(255,255,255), *backgroundTile)); + else + painter1.fillRect(0, 0, tw, th, qApp->palette().active().brush(QColorGroup::Background)); + + + qApp->style().drawPrimitive(QStyle::PE_TabBarBase, &painter1, QRect(0, 0, tw, th), qApp->palette().active(), sflags, QStyleOption(1,1)); + if (pos == GTK_POS_BOTTOM) + { + QWMatrix m; + m.scale(1, -1); + pixmap1 = pixmap1.xForm(m); + + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap1.handle()); + gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y+h+qApp->style().pixelMetric(QStyle::PM_TabBarBaseOverlap, meepTabBar), tw, th); + g_object_unref(pix); + } + else + { + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap1.handle()); + gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y-qApp->style().pixelMetric(QStyle::PM_TabBarBaseOverlap, meepTabBar), tw, th); + g_object_unref(pix); + } +} + +void drawMenu(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int y, int w, int h) +{ + if (!gtkQtEnable) + return; + + if ((w < 1) || (h < 1)) + return; + + QPixmap pixmap(w, h); + QPainter painter(&pixmap); + QStyle::SFlags sflags = stateToSFlags(state); + + if ((backgroundTile) && (!backgroundTile->isNull())) + painter.fillRect(0, 0, w, h, QBrush(QColor(255,255,255), *backgroundTile)); + else + painter.fillRect(0, 0, w, h, qApp->palette().active().brush(QColorGroup::Background)); + qApp->style().drawPrimitive(QStyle::PE_PanelPopup, &painter, QRect(0,0,w,h), qApp->palette().active(), sflags); + + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle()); + gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h); + g_object_unref(pix); +} + +// Note: In GTK, the drawing of a progress bar is in two parts: +// First the progress "container" is drawn +// Second the actually percent bar is drawn +// Mozilla requires this to be done in two steps as it first +// asks gtk to draw an EMPTY progress bar, then it asks to draw +// the contents, or percent bar, over the empty progress bar. +// So, although this function is not required for any gtk application +// except mozilla based apps, doing it this way is following the gtk +// theme structure more. +// +// See also drawScrollbar/drawScrollbarSlider pair. +// +// Peter Hartshorn (peter@dimtech.com.au) + +void drawProgressChunk(GdkWindow * window, GtkStyle * style, GtkStateType state, int x, int y, int w, int h) +{ + // This is only for Mozilla/Firefox + if (!mozillaFix || !gtkQtEnable) + return; + + if ((w<=1) || (h<=1)) + return; // Trying to draw something that small caused a segfault + + // Dirty hack: When using the Alloy style, tweak the position and size of progress bar "filling" + int w2 = isAlloy ? w+4 : w; + int h2 = isAlloy ? h+4 : h; + + QProgressBar bar(100, NULL); + bar.resize(w2, h2); + bar.setProgress(100); + bar.setCenterIndicator(false); + bar.setPercentageVisible(false); + bar.setFrameStyle(QFrame::NoFrame); + + if ((w2 < 1) || (h2 < 1)) + return; + + QPixmap pixmap(w2, h2); + QPainter painter(&pixmap); + + QStyle::SFlags sflags = stateToSFlags(state); + + painter.fillRect(0, 0, w, h, qApp->palette().active().brush(QColorGroup::Background)); + + qApp->style().drawControl(QStyle::CE_ProgressBarContents, &painter, &bar, QRect(0,0,w2,h2), qApp->palette().active(), sflags); + + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle()); + if (isAlloy) + gdk_draw_drawable(window, style->bg_gc[state], pix, 4, 4, x+2, y+2, w-3, h-3); + else + gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h); + g_object_unref(pix); +} + +void drawProgressBar(GdkWindow * window, GtkStyle * style, GtkStateType state, GtkProgressBarOrientation orientation, gfloat percentage, int x, int y, int w, int h) +{ + if (!gtkQtEnable) + return; + + if ((w<=1) || (h<=1)) + return; // Trying to draw something that small caused a segdault + + QProgressBar bar(100, NULL); + if ((orientation == GTK_PROGRESS_BOTTOM_TO_TOP) || (orientation == GTK_PROGRESS_TOP_TO_BOTTOM)) + bar.resize(h, w); + else + bar.resize(w, h); + bar.setProgress((int)(percentage*100.0)); + bar.setCenterIndicator(false); + bar.setPercentageVisible(false); + + QPixmap pixmap = QPixmap::grabWidget(&bar); + + QWMatrix matrix; + switch (orientation) + { + case GTK_PROGRESS_RIGHT_TO_LEFT: matrix.rotate(180); break; + case GTK_PROGRESS_BOTTOM_TO_TOP: matrix.rotate(270); break; + case GTK_PROGRESS_TOP_TO_BOTTOM: matrix.rotate(90); break; + default: break; + } + + if (orientation != GTK_PROGRESS_LEFT_TO_RIGHT) + pixmap = pixmap.xForm(matrix); + + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle()); + gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h); + g_object_unref(pix); +} + +void drawSlider(GdkWindow * window, GtkStyle * style, GtkStateType state, GtkAdjustment *adj, int x, int y, int w, int h, GtkOrientation orientation, int inverted) +{ + if (!gtkQtEnable) + return; + + meepSlider->setBackgroundOrigin(QWidget::ParentOrigin); + + meepSlider->setOrientation((orientation == GTK_ORIENTATION_HORIZONTAL) ? Qt::Horizontal : Qt::Vertical); + meepSlider->setEnabled(state != GTK_STATE_INSENSITIVE); + + meepSlider->setGeometry(x, y, w, h); + meepSlider->setMinValue(0); + meepSlider->setMaxValue(100); + + if (!inverted) // Normal sliders + meepSlider->setValue((int)((adj->value-adj->lower)/(adj->upper-adj->lower)*100)); + else // Inverted sliders... where max is at the left/top and min is at the right/bottom + meepSlider->setValue(100-(int)((adj->value-adj->lower)/(adj->upper-adj->lower)*100)); + + QPixmap pixmap = QPixmap::grabWidget(meepSlider); + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle()); + gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h); + g_object_unref(pix); +} + +void drawSpinButton(GdkWindow * window, GtkStyle * style, GtkStateType state, int direction, int x, int y, int w, int h) +{ + if (!gtkQtEnable) + return; + + if ((w < 1) || (h < 1)) + return; + + QPixmap pixmap(w, h); + QPainter painter(&pixmap); + + QStyle::SFlags sflags = stateToSFlags(state); + + painter.fillRect(0, 0, w, h, qApp->palette().active().brush(QColorGroup::Background)); + qApp->style().drawPrimitive((direction ? QStyle::PE_SpinWidgetDown : QStyle::PE_SpinWidgetUp), &painter, QRect(0,0,w,h), qApp->palette().active(), sflags); + + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle()); + gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h); + g_object_unref(pix); +} + +void drawListHeader(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int y, int w, int h) +{ + if (!gtkQtEnable) + return; + + if ((w < 1) || (h < 1)) + return; + + QPixmap pixmap(w,h); + QPainter painter(&pixmap); + + QStyle::SFlags sflags = stateToSFlags(state) | QStyle::Style_Horizontal; + + painter.fillRect(0, 0, w, h, qApp->palette().active().brush(QColorGroup::Background)); + qApp->style().drawPrimitive(QStyle::PE_HeaderSection, &painter, QRect(0,0,w,h), qApp->palette().active(), sflags); + + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle()); + gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h); + g_object_unref(pix); +} + + +void drawListViewItem(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int y, int w, int h) +{ + if (!gtkQtEnable) + return; + + if ((w < 1) || (h < 1)) + return; + + QPixmap pixmap(w, h); + QPainter painter(&pixmap); + + /* Get the brush corresponding to highlight color */ + QBrush brush = qApp->palette().brush(QPalette::Active, QColorGroup::Highlight); + painter.setBrush(brush); + painter.setPen(Qt::NoPen); + painter.drawRect(0, 0, w, h); + + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle()); + gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h); + g_object_unref(pix); +} + +void drawSquareButton(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int y, int w, int h) +{ + if (!gtkQtEnable) + return; + + QPixmap pixmap(20, 20); + QPainter painter(&pixmap); + QPushButton button(0); + + QStyle::SFlags sflags = stateToSFlags(state); + if (fillPixmap && (!fillPixmap->isNull())) + painter.fillRect(0, 0, 20, 20, QBrush(QColor(255,255,255), *fillPixmap)); + else if ((backgroundTile) && (!backgroundTile->isNull())) + painter.fillRect(0, 0, 20, 20, QBrush(QColor(255,255,255), *backgroundTile)); + else + painter.fillRect(0, 0, 20, 20, qApp->palette().active().brush(QColorGroup::Background)); + + qApp->style().drawControl(QStyle::CE_PushButton, &painter, &button, + QRect(0,0,20,20), qApp->palette().active(), sflags); + + QImage image = pixmap.convertToImage().smoothScale(w,h); + + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle()); + gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h); + g_object_unref(pix); +} + +void initDrawTabNG(int count) +{ + if (!gtkQtEnable) + return; + + delete meepTabBar; + meepTabBar = 0; + meepTabBar = new QTabBar(meepWidget); + + for ( int i = 0; i < count; i++ ) + meepTabBar->addTab(new QTab); + + return; +} + +void drawTabNG(GdkWindow *window, GtkStyle* style, GtkStateType state, int x, int y, int w, int h, GtkNotebook *notebook) +{ + if (!gtkQtEnable) + return; + + GtkPositionType tpos = gtk_notebook_get_tab_pos(notebook); + + // Find tab position + int sdiff = 10000, pos = -1, diff = 1; + for ( int i = 0; i < g_list_length(notebook->children); i++ ) + { + GtkWidget *tab_label=gtk_notebook_get_tab_label(notebook,gtk_notebook_get_nth_page(notebook,i)); + if (tab_label) diff = tab_label->allocation.x - x; + if ((diff > 0) && (diff < sdiff)) + { + sdiff = diff; pos = i; + } + } + + QTab *tab = meepTabBar->tabAt(pos); + + if (!tab) + { + // This happens in Firefox. Just draw a normal tab instead + if (state == GTK_STATE_ACTIVE) + drawTab(window, style, state, x, y - 2, w, h + 2); + else + drawTab(window, style, state, x, y, w, h); + return; + } + + QStyle::SFlags sflags = stateToSFlags(state); + + if (state != GTK_STATE_ACTIVE) + { + sflags = QStyle::Style_Selected; + if (tpos == GTK_POS_TOP) + y += 3; + h -= 3; + } + + if ((w < 1) || (h < 1)) + return; + + QPixmap pixmap(w,h); + QPainter painter(&pixmap); + + if ((backgroundTile) && (!backgroundTile->isNull())) + painter.fillRect(0, 0, w, h, QBrush(QColor(255,255,255), *backgroundTile)); + else + + painter.fillRect(0, 0, w, h, qApp->palette().active().brush(QColorGroup::Background)); + qApp->style().drawControl(QStyle::CE_TabBarTab, &painter, (QTabBar *)meepTabBar, QRect(0,0,w,h), qApp->palette().active(), sflags, QStyleOption(tab)); + + painter.end(); // So the pixmap assignment below won't give an error + // Account for tab position -- if its in the bottom flip the image + if (tpos == GTK_POS_BOTTOM) + { + QWMatrix m; + m.scale(1, -1); + pixmap = pixmap.xForm(m); + } + + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle()); + gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h); + g_object_unref(pix); +} + +void drawArrow(GdkWindow* window, GtkStyle* style, GtkStateType state, GtkArrowType direction, int x, int y, int w, int h) +{ + if (!gtkQtEnable) + return; + + if ((w < 1) || (h < 1)) + return; + + QStyle::SFlags sflags = stateToSFlags(state); + if (state == GTK_STATE_INSENSITIVE) + sflags |= QStyle::Style_Off; + else if (state == GTK_STATE_PRELIGHT) + sflags |= QStyle::Style_On; + + QStyle::PrimitiveElement element; + switch(direction) + { + case GTK_ARROW_UP: element = QStyle::PE_ArrowUp; break; + case GTK_ARROW_DOWN: element = QStyle::PE_ArrowDown; break; + case GTK_ARROW_LEFT: element = QStyle::PE_ArrowLeft; break; + case GTK_ARROW_RIGHT: element = QStyle::PE_ArrowRight; break; + } + + + QPixmap pixmap(w,h); + QPainter painter(&pixmap); + + if (fillPixmap && (!fillPixmap->isNull())) + painter.fillRect(0, 0, w, h, QBrush(QColor(255,255,255), *fillPixmap)); + else if ((backgroundTile) && (!backgroundTile->isNull())) + painter.fillRect(0, 0, w, h, QBrush(QColor(255,255,255), *backgroundTile)); + else + painter.fillRect(0, 0, w, h, qApp->palette().active().brush(QColorGroup::Background)); + + qApp->style().drawPrimitive(element, &painter, QRect(0,0,w,h), qApp->palette().active(), sflags); + + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle()); + gdk_draw_drawable(window, style->bg_gc[state], pix, 0, 0, x, y, w, h); + g_object_unref(pix); +} + +void drawFocusRect(GdkWindow * window, GtkStyle * style, int x, int y, int w, int h) +{ + if (!gtkQtEnable) + return; + + if ((w < 1) || (h < 1)) + return; + + QPixmap pixmap(w,h); + QPainter painter(&pixmap); + QColor bg(qApp->palette().active().background()); + + painter.fillRect(0,0,w,h,bg); + qApp->style().drawPrimitive(QStyle::PE_FocusRect, &painter, QRect(0,0,w,h), qApp->palette().active(), QStyle::Style_Default, QStyleOption(bg)); + + GdkPixmap* pix = gdk_pixmap_foreign_new(pixmap.handle()); + gdk_draw_drawable(window, style->bg_gc[GTK_STATE_NORMAL], pix, 0, 0, x, y, w, h); + g_object_unref(pix); +} + +GdkGC* alternateBackgroundGc(GtkStyle* style) +{ + // Alternate background color for listviews + if (altBackGC != 0) + return altBackGC; + + GdkColor altBackColor; + altBackColor.red = alternateBackgroundColour.red() * 257; + altBackColor.green = alternateBackgroundColour.green() * 257; + altBackColor.blue = alternateBackgroundColour.blue() * 257; + + gdk_colormap_alloc_color(style->colormap, &altBackColor, FALSE, TRUE); + + GdkGCValues gc_values; + GdkGCValuesMask gc_values_mask; + gc_values_mask = GDK_GC_FOREGROUND; + gc_values.foreground = altBackColor; + + altBackGC = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask); + + return altBackGC; +} + + +// Thanks Martin Dvorak of metatheme +QString parse_rc_string(const QString& defs, const QString& pattern, bool widgetClass = true) +{ + static int dynamic_counter = 0; + ++dynamic_counter; + + return "style \"gtk-qt-dynamic-" + QString::number(dynamic_counter) + "\" { " + defs + " } " + (widgetClass ? "widget_class" : "widget") + " \"" + pattern + "\" style \"gtk-qt-dynamic-" + QString::number(dynamic_counter) + "\"\n"; +} + +QString doIconMapping(const QString& stockName, const QString& path, int sizes) +{ + QString fullPath; + bool has16 = false, has22 = false, has32 = false; + + for( QStringList::ConstIterator it = iconThemeDirs.begin(); + it != iconThemeDirs.end(); + ++it ) + { + fullPath = *it + "16x16/" + path; + if (access(fullPath.latin1(), R_OK) == 0) + has16 = true; + fullPath = *it + "22x22/" + path; + if (access(fullPath.latin1(), R_OK) == 0) + has22 = true; + fullPath = *it + "32x32/" + path; + if (access(fullPath.latin1(), R_OK) == 0) + has32 = true; + } + + if (!has16 && !has22 && !has32) return ""; + + // sizes is an addition of 1=16, 2=22 and 4=32 + QString ret = "stock[\"" + stockName + "\"]={\n"; + + if (has22) + ret += "\t{ \"22x22/" + path +"\", *, *, \"gtk-large-toolbar\" },\n"; + + if (has32) + { + ret += "\t{ \"32x32/" + path +"\", *, *, \"gtk-dnd\" },\n"; + ret += "\t{ \"32x32/" + path +"\", *, *, \"gtk-dialog\" },\n"; + } + + if (has16) + { + ret += "\t{ \"16x16/" + path +"\", *, *, \"gtk-button\" },\n"; + ret += "\t{ \"16x16/" + path +"\", *, *, \"gtk-menu\" },\n"; + ret += "\t{ \"16x16/" + path +"\", *, *, \"gtk-small-toolbar\" },\n"; + } + + if (has22) + ret += "\t{ \"22x22/" + path +"\" }\n"; + else if (has32) + ret += "\t{ \"32x32/" + path +"\" }\n"; + else + ret += "\t{ \"16x16/" + path +"\" }\n"; + + ret += "}\n"; + return ret; +} + +QString colorString(QColor color) +{ + QString ret = "{"; + ret += QString::number(color.red() * 257) + ", "; + ret += QString::number(color.green() * 257) + ", "; + ret += QString::number(color.blue() * 257) + "}"; + + return ret; +} + +void setColour(QString name, QColor color) +{ + gtk_rc_parse_string(parse_rc_string(name + " = " + colorString(color), "*").latin1()); +} + +static QStringList iconInheritsDirs( const QString& icondir ) +{ + QFile index; + index.setName( icondir + "index.theme" ); + if( !index.open( IO_ReadOnly )) + { + index.setName( icondir + "index.desktop" ); + if( !index.open( IO_ReadOnly )) + return QStringList(); + } + char buf[ 1024 ]; + QRegExp reg( "^\\s*Inherits=([^\\n]*)" ); + for(;;) + { + if( index.readLine( buf, 1023 ) <= 0 ) + break; + if( reg.search( buf, 0 ) >= 0 ) + return QStringList::split(",", reg.cap(1)); + } + return QStringList(); +} + +void setRcProperties(GtkRcStyle* rc_style, int forceRecreate) +{ + if (!gtkQtEnable) + return; + + if (gtkQtDebug) + printf("setRcProperties()\n"); + + gtkRcStyle = rc_style; + + // Set colors + // Normal + setColour("fg[NORMAL]", qApp->palette().active().text()); + setColour("bg[NORMAL]", qApp->palette().active().background()); + setColour("text[NORMAL]", qApp->palette().active().text()); + setColour("base[NORMAL]", qApp->palette().active().base()); + + // Active (on) + setColour("fg[ACTIVE]", qApp->palette().active().text()); + setColour("bg[ACTIVE]", qApp->palette().active().background()); + setColour("text[ACTIVE]", qApp->palette().active().text()); + setColour("base[ACTIVE]", qApp->palette().active().base()); + + // Mouseover + setColour("fg[PRELIGHT]", qApp->palette().active().text()); // menu items - change? + setColour("bg[PRELIGHT]", qApp->palette().active().highlight()); + setColour("text[PRELIGHT]", qApp->palette().active().text()); + setColour("base[PRELIGHT]", qApp->palette().active().base()); + + // Selected + setColour("fg[SELECTED]", qApp->palette().active().highlightedText()); + setColour("bg[SELECTED]", qApp->palette().active().highlight()); + setColour("text[SELECTED]", qApp->palette().active().highlightedText()); + setColour("base[SELECTED]", qApp->palette().active().highlight()); + + // Disabled + setColour("fg[INSENSITIVE]", qApp->palette().disabled().text()); + setColour("bg[INSENSITIVE]", qApp->palette().disabled().background()); + setColour("text[INSENSITIVE]", qApp->palette().disabled().text()); + setColour("base[INSENSITIVE]", qApp->palette().disabled().background()); + + gtk_rc_parse_string(("gtk-button-images = " + QString::number(showIconsOnButtons)).latin1()); + + gtk_rc_parse_string(("gtk-toolbar-style = " + QString::number(toolbarStyle)).latin1()); + + // This function takes quite a long time to execute, and is run at the start of every app. + // In order to speed it up, we can store the results in a file, along with the name of icon + // theme and style. This file can then be regenerated when the icon theme or style change. + + QString cacheFilePath = QDir::homeDirPath() + "/.gtk_qt_engine_rc"; + QFile cacheFile(cacheFilePath); + QTextStream stream; + + if (!forceRecreate && cacheFile.exists()) + { + cacheFile.open(IO_ReadOnly); + stream.setDevice(&cacheFile); + + if (stream.readLine() == "# " + iconTheme + ", " + qApp->style().name() + ", " + RC_CACHE_VERSION) + { + // This cache matches the current icon theme and style + // Let's load it and return + gtk_rc_add_default_file(cacheFilePath.latin1()); + return; + } + + stream.unsetDevice(); + cacheFile.close(); + } + + cacheFile.open(IO_WriteOnly | IO_Truncate); + stream.setDevice(&cacheFile); + + stream << "# " << iconTheme << ", " << qApp->style().name() << ", " << RC_CACHE_VERSION << "\n\n"; + stream << "# This file was generated by the Gtk Qt Theme Engine\n"; + stream << "# It will be recreated when you change your KDE icon theme or widget style\n\n"; + + QScrollBar sbar(NULL); + sbar.setOrientation(Qt::Horizontal); + sbar.setValue(1); + sbar.resize(200,25); + + // The following code determines how many buttons are on a scrollbar + // It works by looking at each pixel of the scrollbar's area not taken up by the groove, + // and asking the style which subcontrol is at that location. + QRect rect = qApp->style().querySubControlMetrics(QStyle::CC_ScrollBar, &sbar, QStyle::SC_ScrollBarGroove); + + bool back1 = false; + bool forward1 = false; + bool back2 = false; + bool forward2 = false; + + QStyle::SubControl sc = QStyle::SC_None; + for (QPoint pos(0,7) ; pos.x()style().querySubControl(QStyle::CC_ScrollBar, &sbar, pos); + if (sc != sc2) + { + if (sc2 == QStyle::SC_ScrollBarAddLine) forward1 = true; + if (sc2 == QStyle::SC_ScrollBarSubLine) back1 = true; + sc = sc2; + } + } + sc = QStyle::SC_None; + for (QPoint pos(rect.x()+rect.width(),7) ; pos.x()<200 ; pos.setX(pos.x()+1)) + { + QStyle::SubControl sc2 = qApp->style().querySubControl(QStyle::CC_ScrollBar, &sbar, pos); + if (sc != sc2) + { + if (sc2 == QStyle::SC_ScrollBarAddLine) forward2 = true; + if (sc2 == QStyle::SC_ScrollBarSubLine) back2 = true; + sc = sc2; + } + } + + stream << parse_rc_string(QString("GtkScrollbar::has-backward-stepper = ") + (back1 ? "1" : "0"), "*"); + stream << parse_rc_string(QString("GtkScrollbar::has-forward-stepper = ") + (forward2 ? "1" : "0"), "*"); + stream << parse_rc_string(QString("GtkScrollbar::has-secondary-forward-stepper = ") + (forward1 ? "1" : "0"), "*"); + stream << parse_rc_string(QString("GtkScrollbar::has-secondary-backward-stepper = ") + (back2 ? "1" : "0"), "*"); + + stream << parse_rc_string("GtkScrollbar::stepper-size = " + QString::number(qApp->style().querySubControlMetrics(QStyle::CC_ScrollBar, &sbar, QStyle::SC_ScrollBarSubLine).width() - 1), "*"); + + stream << parse_rc_string("GtkScrollbar::min-slider-length = " + QString::number(qApp->style().pixelMetric(QStyle::PM_ScrollBarSliderMin)), "*"); + stream << parse_rc_string("GtkScrollbar::slider-width = " + QString::number(qApp->style().pixelMetric(QStyle::PM_ScrollBarExtent)-2), "*"); + stream << parse_rc_string("GtkButton::child-displacement-x = " + QString::number(qApp->style().pixelMetric(QStyle::PM_ButtonShiftHorizontal)), "*"); + stream << parse_rc_string("GtkButton::child-displacement-y = " + QString::number(qApp->style().pixelMetric(QStyle::PM_ButtonShiftVertical)), "*"); + QSlider slider(NULL); // To keep BlueCurve happy + stream << parse_rc_string("GtkScale::slider-length = " + QString::number(qApp->style().pixelMetric(QStyle::PM_SliderLength, &slider)), "*"); + stream << parse_rc_string("GtkButton::default-border = { 0, 0, 0, 0 }", "*"); + + stream << parse_rc_string("xthickness = " + QString::number(qApp->style().pixelMetric(QStyle::PM_DefaultFrameWidth)), "*.GtkMenu"); + stream << parse_rc_string("ythickness = " + QString::number(qApp->style().pixelMetric(QStyle::PM_DefaultFrameWidth)), "*.GtkMenu"); + stream << parse_rc_string("xthickness = 5", "*.GtkMenu.Gtk*MenuItem"); + stream << parse_rc_string("xthickness = 3", "*.GtkNotebook"); + stream << parse_rc_string("ythickness = 3", "*.GtkNotebook"); + stream << parse_rc_string("ythickness = 1", "*.GtkButton"); + stream << parse_rc_string("fg[NORMAL] = {0, 0, 0}", "gtk-tooltips.GtkLabel", false); + + // This one may not work... + //insertIntProperty(rc_style, "GtkCheckButton", "indicator-size", qApp->style().pixelMetric(QStyle::PM_IndicatorHeight) ); + + // For icons + + // Build the list of icon theme directories. + // This function is recursive - it gets the directories of all the inherited themes as well + addIconThemeDir(iconTheme); + + if (iconThemeDirs.isEmpty()) + { + cacheFile.close(); + gtk_rc_add_default_file(cacheFilePath.latin1()); + return; + } + + stream << "\npixmap_path \"" + iconThemeDirs.join( ":" ) + "\"\n\n"; + + stream << "style \"KDE-icons\" {\n"; + stream << doIconMapping("gtk-about", "actions/gtk-about.png"); + stream << doIconMapping("gtk-add", "actions/gtk-add.png"); + stream << doIconMapping("gtk-apply", "actions/gtk-apply.png"); + stream << doIconMapping("gtk-bold", "actions/text_bold.png"); + stream << doIconMapping("gtk-cancel", "actions/button_cancel.png"); + stream << doIconMapping("gtk-cdrom", "devices/cdrom_unmount.png"); + stream << doIconMapping("gtk-clear", "actions/editclear.png"); + stream << doIconMapping("gtk-close", "actions/fileclose.png"); + stream << doIconMapping("gtk-color-picker", "actions/colorpicker.png", 3); + stream << doIconMapping("gtk-copy", "actions/editcopy.png"); + stream << doIconMapping("gtk-convert", "actions/gtk-convert.png"); + //stream << doIconMapping("gtk-connect", ??); + stream << doIconMapping("gtk-cut", "actions/editcut.png"); + stream << doIconMapping("gtk-delete", "actions/editdelete.png"); + stream << doIconMapping("gtk-dialog-authentication", "status/gtk-dialog-authentication"); + stream << doIconMapping("gtk-dialog-error", "actions/messagebox_critical.png", 4); + stream << doIconMapping("gtk-dialog-info", "actions/messagebox_info.png", 4); + stream << doIconMapping("gtk-dialog-question", "actions/help.png"); + stream << doIconMapping("gtk-dialog-warning", "actions/messagebox_warning.png", 4); + //stream << doIconMapping("gtk-directory", ??); + //stream << doIconMapping("gtk-disconnect", ??); + stream << doIconMapping("gtk-dnd", "mimetypes/empty.png"); + stream << doIconMapping("gtk-dnd-multiple", "mimetypes/kmultiple.png"); + stream << doIconMapping("gtk-edit", "actions/gtk-edit.png"); //2.6 + stream << doIconMapping("gtk-execute", "actions/exec.png"); + stream << doIconMapping("gtk-file", "mimetypes/gtk-file.png"); + stream << doIconMapping("gtk-find", "actions/find.png"); + stream << doIconMapping("gtk-find-and-replace", "actions/gtk-find-and-replace.png"); + stream << doIconMapping("gtk-floppy", "devices/3floppy_unmount.png"); + stream << doIconMapping("gtk-fullscreen", "actions/gtk-fullscreen.png"); + stream << doIconMapping("gtk-goto-bottom", "actions/bottom.png"); + stream << doIconMapping("gtk-goto-first", "actions/start.png"); + stream << doIconMapping("gtk-goto-last", "actions/finish.png"); + stream << doIconMapping("gtk-goto-top", "actions/top.png"); + stream << doIconMapping("gtk-go-back", "actions/back.png"); + stream << doIconMapping("gtk-go-down", "actions/down.png"); + stream << doIconMapping("gtk-go-forward", "actions/forward.png"); + stream << doIconMapping("gtk-go-up", "actions/up.png"); + stream << doIconMapping("gtk-harddisk", "devices/gtk-harddisk.png"); + stream << doIconMapping("gtk-help", "apps/khelpcenter.png"); + stream << doIconMapping("gtk-home", "filesystems/folder_home.png"); + stream << doIconMapping("gtk-indent", "actions/gtk-indent.png"); + stream << doIconMapping("gtk-index", "actions/contents.png"); + //stream << doIconMapping("gtk-info", "??"); + stream << doIconMapping("gtk-italic", "actions/text_italic.png"); + stream << doIconMapping("gtk-jump-to", "actions/goto.png"); + stream << doIconMapping("gtk-justify-center", "actions/text_center.png"); + stream << doIconMapping("gtk-justify-fill", "actions/text_block.png"); + stream << doIconMapping("gtk-justify-left", "actions/text_left.png"); + stream << doIconMapping("gtk-justify-right", "actions/text_right.png"); + stream << doIconMapping("gtk-leave-fullscreen", "actions/gtk-leave-fullscreen.png"); + stream << doIconMapping("gtk-media-forward", "actions/gtk-media-forward-ltr.png"); + stream << doIconMapping("gtk-media-next", "actions/gtk-media-next-ltr.png"); + stream << doIconMapping("gtk-media-pause", "actions/gtk-media-pause.png"); + stream << doIconMapping("gtk-media-previous", "actions/gtk-media-previous-ltr.png"); + stream << doIconMapping("gtk-media-record", "actions/gtk-media-record.png"); + stream << doIconMapping("gtk-media-rewind", "actions/gtk-media-rewind-ltr.png"); + stream << doIconMapping("gtk-media-stop", "actions/gtk-media-stop.png"); + stream << doIconMapping("gtk-missing-image", "mimetypes/unknown.png"); + stream << doIconMapping("gtk-network", "places/gtk_network.png"); + stream << doIconMapping("gtk-new", "actions/filenew.png"); + stream << doIconMapping("gtk-no", "actions/gtk-no.png"); + stream << doIconMapping("gtk-ok", "actions/button_ok.png"); + stream << doIconMapping("gtk-open", "actions/fileopen.png"); + //stream << doIconMapping("gtk-orientation-landscape", "??"); + //stream << doIconMapping("gtk-orientation-portrait", "??"); + //stream << doIconMapping("gtk-orientation-reverse-landscape", "??"); + //stream << doIconMapping("gtk-orientation-reverse-portrait", "??"); + stream << doIconMapping("gtk-paste", "actions/editpaste.png"); + stream << doIconMapping("gtk-preferences", "actions/configure.png"); + stream << doIconMapping("gtk-print", "actions/fileprint.png"); + stream << doIconMapping("gtk-print-preview", "actions/filequickprint.png"); + stream << doIconMapping("gtk-properties", "actions/configure.png"); + stream << doIconMapping("gtk-quit", "actions/exit.png"); + stream << doIconMapping("gtk-redo", "actions/redo.png"); + stream << doIconMapping("gtk-refresh", "actions/reload.png"); + stream << doIconMapping("gtk-remove", "actions/gtk-remove.png"); + stream << doIconMapping("gtk-revert-to-saved", "actions/revert.png"); + stream << doIconMapping("gtk-save", "actions/filesave.png"); + stream << doIconMapping("gtk-save-as", "actions/filesaveas.png"); + stream << doIconMapping("gtk-select-all", "actions/gtk-select-all.png"); + stream << doIconMapping("gtk-select-color", "actions/colorize.png"); + stream << doIconMapping("gtk-select-font", "mimetypes/font.png"); + //stream << doIconMapping("gtk-sort-ascending", "??"); + //stream << doIconMapping("gtk-sort-descending", "??"); + stream << doIconMapping("gtk-spell-check", "actions/spellcheck.png"); + stream << doIconMapping("gtk-stop", "actions/stop.png"); + stream << doIconMapping("gtk-strikethrough", "actions/text_strike.png", 3); + stream << doIconMapping("gtk-undelete", "actions/gtk-undelete.png"); + stream << doIconMapping("gtk-underline", "actions/text_under.png"); + stream << doIconMapping("gtk-undo", "actions/undo.png"); + stream << doIconMapping("gtk-unindent", "actions/gtk-unindent.png"); + stream << doIconMapping("gtk-yes", "actions/gtk-yes.png"); + stream << doIconMapping("gtk-zoom-100", "actions/viewmag1.png"); + stream << doIconMapping("gtk-zoom-fit", "actions/viewmagfit.png"); + stream << doIconMapping("gtk-zoom-in", "actions/viewmag+.png"); + stream << doIconMapping("gtk-zoom-out", "actions/viewmag-.png"); + stream << "} class \"*\" style \"KDE-icons\""; + + cacheFile.close(); + + gtk_rc_add_default_file(cacheFilePath.latin1()); +} + +void addIconThemeDir(const QString& theme) +{ + // Try to find this theme's directory + QString icondir = kdeFindDir("/share/icons/" + theme + "/", "index.theme", "index.desktop"); + if(icondir.isEmpty()) + return; + if (iconThemeDirs.contains(icondir)) + return; + + // Add this theme to the list + iconThemeDirs.append(icondir); + + // Do it again for any parent themes + QStringList parents = iconInheritsDirs(icondir); + for ( QStringList::Iterator it=parents.begin() ; it!=parents.end(); ++it) + addIconThemeDir((*it).stripWhiteSpace()); +} + +void setMenuBackground(GtkStyle* style) +{ + if (!gtkQtEnable) + return; + + if (menuBackgroundPixmap == NULL) + { + // Get the menu background image + menuBackgroundPixmap = new QPixmap(1024, 25); // Meh + QPainter painter(menuBackgroundPixmap); + QPopupMenu pm; + QMenuData md; + QMenuItem* mi = md.findItem(md.insertItem("")); + + qApp->style().polish(&pm); + + QStyleOption opt(mi, 16, 16); + QStyle::SFlags sflags = QStyle::Style_Default; + + if ((backgroundTile) && (!backgroundTile->isNull())) + painter.fillRect(0, 0, 1024, 25, QBrush(QColor(255,255,255), *backgroundTile)); + else + painter.fillRect(0, 0, 1024, 25, qApp->palette().active().brush(QColorGroup::Background)); + qApp->style().drawControl(QStyle::CE_PopupMenuItem, &painter, &pm, QRect(0,0,1024,25), qApp->palette().active(), sflags, opt); + + menuBackgroundPixmapGdk = gdk_pixmap_foreign_new(menuBackgroundPixmap->handle()); + } + + QTENGINE_STYLE(style)->menuBackground = menuBackgroundPixmapGdk; + g_object_ref(menuBackgroundPixmapGdk); +} + +// It has a 'u' damnit +void setColour(GdkColor* g, QColor q) +{ + g->red = q.red() * 257; + g->green = q.green() * 257; + g->blue = q.blue() * 257; +} + +void setColors(GtkStyle* style) +{ + if (!gtkQtEnable) + return; + + if (gtkQtDebug) + printf("setColors()\n"); + + /*gtkStyle = style;*/ + + bool useBg = ((backgroundTile) && (!backgroundTile->isNull())); + + if (useBg) + { + style->bg_pixmap[GTK_STATE_NORMAL] = backgroundTileGdk; + g_object_ref(backgroundTileGdk); + } + + setMenuBackground(style); +} + +void getTextColor(GdkColor *color, GtkStateType state_type) +{ + if (!gtkQtEnable) + return; + + if ((state_type == GTK_STATE_PRELIGHT) || (state_type == GTK_STATE_ACTIVE) || (state_type == GTK_STATE_SELECTED)) + setColour(color, qApp->palette().active().highlightedText()); + else if (state_type == GTK_STATE_NORMAL) + setColour(color, qApp->palette().active().text()); + else if (state_type == GTK_STATE_INSENSITIVE) + setColour(color, qApp->palette().disabled().text()); +} diff --git a/src/qt_qt_wrapper.h b/src/qt_qt_wrapper.h new file mode 100644 index 0000000..d07ff9d --- /dev/null +++ b/src/qt_qt_wrapper.h @@ -0,0 +1,79 @@ +#ifndef QTENGINE_QT_WRAPPER_H +#define QTENGINE_QT_WRAPPER_H + + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { + +void mapColour(GdkColor* g, QColor q); +void addIconThemeDir(const QString& theme); +QString doIconMapping(const QString& stockName, const QString& path, int sizes = 7); + +void initKdeSettings(); +QString kdeConfigValue(const QString& section, const QString& name, const QString& def); +QString kdeFindDir(const QString& suffix, const QString& file1, const QString& file2); + +GdkFilterReturn gdkEventFilter(GdkXEvent *xevent, GdkEvent *event, gpointer data); + +#endif + +void createQApp(); +void destroyQApp(); +void setColors(GtkStyle* style); +void setRcProperties(GtkRcStyle* rc_style, int forceRecreate); +void drawButton(GdkWindow * window, GtkStyle * style, GtkStateType state, int defaultButton, int x, int y, int w, int h); +void drawSquareButton(GdkWindow * window, GtkStyle * style, GtkStateType state, int x, int y, int w, int h); +int findCachedButton(GdkWindow * window, GtkStyle * style, GtkStateType state, int x, int y, int w, int h); +void drawToolButton(GdkWindow * window, GtkStyle * style, GtkStateType state, int x, int y, int w, int h); +void drawTab(GdkWindow * window, GtkStyle * style, GtkStateType state, int x, int y, int w, int h); +void initDrawTabNG(int count); +void drawTabNG(GdkWindow * window, GtkStyle * style, GtkStateType state, int x, int y, int width, int height, GtkNotebook *notebook); +void drawVLine(GdkWindow * window, GtkStyle * style, GtkStateType state, int x, int ySource, int yDest); +void drawHLine(GdkWindow * window, GtkStyle * style, GtkStateType state, int y, int xSource, int xDest); +void drawLineEdit(GdkWindow * window, GtkStyle * style, GtkStateType state, int hasFocus, int x, int y, int w, int h); +void drawComboBox(GdkWindow * window, GtkStyle * style, GtkStateType state, int x, int y, int w, int h); +void drawFrame(GdkWindow * window, GtkStyle * style, GtkStateType state, GtkShadowType shadow_type, int x, int y, int w, int h); +void drawToolbar(GdkWindow * window, GtkStyle * style, GtkStateType state, int x, int y, int w, int h); +void drawMenubar(GdkWindow* window, GtkStyle* style, GtkStateType state, int x, int y, int w, int h); +void drawCheckBox(GdkWindow * window, GtkStyle * style, GtkStateType state, int on, int x, int y, int w, int h); +void drawMenuCheck(GdkWindow * window, GtkStyle * style, GtkStateType state, int x, int y, int w, int h); +void drawRadioButton(GdkWindow * window, GtkStyle * style, GtkStateType state, int on, int x, int y, int w, int h); +void drawScrollBar(GdkWindow * window, GtkStyle * style, GtkStateType state, int orientation, GtkAdjustment* adj, int x, int y, int w, int h); +void drawScrollBarSlider(GdkWindow * window, GtkStyle * style, GtkStateType state, int orientation, GtkAdjustment* adj, int x, int y, int w, int h, int offset, int totalExtent); +void drawSplitter(GdkWindow * window, GtkStyle * style, GtkStateType state, int orientation, int x, int y, int w, int h); +void drawMenuBarItem(GdkWindow * window, GtkStyle * style, GtkStateType state, int x, int y, int w, int h); +void drawMenuItem(GdkWindow * window, GtkStyle * style, GtkStateType state, int x, int y, int w, int h); +void drawMenu(GdkWindow * window, GtkStyle * style, GtkStateType state, int x, int y, int w, int h); +void drawTabFrame(GdkWindow * window, GtkStyle * style, GtkStateType state, int x, int y, int w, int h, GtkPositionType pos); +void drawProgressBar(GdkWindow * window, GtkStyle * style, GtkStateType state, GtkProgressBarOrientation orientation, gfloat percentage, int x, int y, int w, int h); +void drawProgressChunk(GdkWindow * window, GtkStyle * style, GtkStateType state, int x, int y, int w, int h); +void drawSlider(GdkWindow * window, GtkStyle * style, GtkStateType state, GtkAdjustment* adj, int x, int y, int w, int h, GtkOrientation orientation, int inverted); +void drawSpinButton(GdkWindow * window, GtkStyle * style, GtkStateType state, int direction, int x, int y, int w, int h); +void drawArrow(GdkWindow * window, GtkStyle * style, GtkStateType state, GtkArrowType direction, int x, int y, int w, int h); +void drawListHeader(GdkWindow * window, GtkStyle * style, GtkStateType state, int x, int y, int w, int h); +void drawListViewItem(GdkWindow * window, GtkStyle * style, GtkStateType state, int x, int y, int w, int h); +void drawFocusRect(GdkWindow * window, GtkStyle * style, int x, int y, int w, int h); + +void getTextColor(GdkColor* g, GtkStateType state); + +void setFillPixmap(GdkPixbuf* buf); +GdkGC* alternateBackgroundGc(GtkStyle* style); + +extern int isBaghira; +extern int isKeramik; +extern int isAlloy; +extern int isDomino; +extern int isPolyester; +extern int openOfficeFix; +extern int gtkQtDebug; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/qt_rc_style.c b/src/qt_rc_style.c new file mode 100644 index 0000000..0a9947a --- /dev/null +++ b/src/qt_rc_style.c @@ -0,0 +1,101 @@ +#include "qt_rc_style.h" +#include "qt_style.h" +#include "qt_qt_wrapper.h" + + + +static void qtengine_rc_style_init (QtEngineRcStyle *style); +static void qtengine_rc_style_class_init (QtEngineRcStyleClass *klass); +static void qtengine_rc_style_finalize (GObject *object); +static guint qtengine_rc_style_parse (GtkRcStyle *rc_style, + GtkSettings *settings, + GScanner *scanner); +static void qtengine_rc_style_merge (GtkRcStyle *dest, + GtkRcStyle *src); + +static GtkStyle *qtengine_rc_style_create_style (GtkRcStyle *rc_style); + +static GtkRcStyleClass *parent_class; + +GType qtengine_type_rc_style = 0; + + +void qtengine_rc_style_register_type (GTypeModule *module) +{ + static const GTypeInfo object_info = + { + sizeof (QtEngineRcStyleClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) qtengine_rc_style_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (QtEngineRcStyle), + 0, /* n_preallocs */ + (GInstanceInitFunc) qtengine_rc_style_init, + }; + + qtengine_type_rc_style = g_type_module_register_type (module, GTK_TYPE_RC_STYLE, "QtEngineRcStyle", &object_info, 0); +} + +static void qtengine_rc_style_init (QtEngineRcStyle *style) +{ +} + +static void qtengine_rc_style_class_init (QtEngineRcStyleClass *klass) +{ + GtkRcStyleClass *rc_style_class = GTK_RC_STYLE_CLASS (klass); + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + parent_class = g_type_class_peek_parent (klass); + + rc_style_class->parse = qtengine_rc_style_parse; + rc_style_class->merge = qtengine_rc_style_merge; + rc_style_class->create_style = qtengine_rc_style_create_style; +} + + + + +static guint +qtengine_rc_style_parse (GtkRcStyle *rc_style, GtkSettings *settings, GScanner *scanner) +{ + static GQuark scope_id = 0; + guint old_scope; + guint token; + + /* Sets Rc properties from QT settings */ + setRcProperties(rc_style, 0); + + /* The rest of this keeps GTK happy - therefore I don't care what it does */ + if (!scope_id) + scope_id = g_quark_from_string("theme_engine"); + + old_scope = g_scanner_set_scope(scanner, scope_id); + + token = g_scanner_get_next_token(scanner); + while (token != G_TOKEN_RIGHT_CURLY) + { + token = g_scanner_get_next_token(scanner); + } + + g_scanner_set_scope(scanner, old_scope); + + return G_TOKEN_NONE; +} + +static void +qtengine_rc_style_merge (GtkRcStyle * dest, + GtkRcStyle * src) +{ + parent_class->merge(dest, src); +} + +/* Create an empty style suitable to this RC style + */ +static GtkStyle * +qtengine_rc_style_create_style (GtkRcStyle *rc_style) +{ + void *ptr = GTK_STYLE (g_object_new (QTENGINE_TYPE_STYLE, NULL)); + return (GtkStyle *)ptr; +} diff --git a/src/qt_rc_style.h b/src/qt_rc_style.h new file mode 100644 index 0000000..5235f09 --- /dev/null +++ b/src/qt_rc_style.h @@ -0,0 +1,27 @@ +#include + +typedef struct _QtEngineRcStyle QtEngineRcStyle; +typedef struct _QtEngineRcStyleClass QtEngineRcStyleClass; + +extern GType qtengine_type_rc_style; + +#define QTENGINE_TYPE_RC_STYLE qtengine_type_rc_style +#define QTENGINE_RC_STYLE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), QTENGINE_TYPE_RC_STYLE, QtEngineRcStyle)) +#define QTENGINE_RC_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), QTENGINE_TYPE_RC_STYLE, QtEngineRcStyleClass)) +#define QTENGINE_IS_RC_STYLE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), QTENGINE_TYPE_RC_STYLE)) +#define QTENGINE_IS_RC_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), QTENGINE_TYPE_RC_STYLE)) +#define QTENGINE_RC_STYLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), QTENGINE_TYPE_RC_STYLE, QtEngineRcStyleClass)) + +struct _QtEngineRcStyle +{ + GtkRcStyle parent_instance; +}; + +struct _QtEngineRcStyleClass +{ + GtkRcStyleClass parent_class; +}; + +void qtengine_rc_style_register_type (GTypeModule *module); + + diff --git a/src/qt_style.h b/src/qt_style.h new file mode 100644 index 0000000..4a4bc78 --- /dev/null +++ b/src/qt_style.h @@ -0,0 +1,29 @@ +#include + +typedef struct _QtEngineStyle QtEngineStyle; +typedef struct _QtEngineStyleClass QtEngineStyleClass; + +extern GType qtengine_type_style; + +#define QTENGINE_TYPE_STYLE qtengine_type_style +#define QTENGINE_STYLE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), QTENGINE_TYPE_STYLE, QtEngineStyle)) +#define QTENGINE_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), QTENGINE_TYPE_STYLE, QtEngineStyleClass)) +#define QTENGINE_IS_STYLE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), QTENGINE_TYPE_STYLE)) +#define QTENGINE_IS_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), QTENGINE_TYPE_STYLE)) +#define QTENGINE_STYLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), QTENGINE_TYPE_STYLE, QtEngineStyleClass)) + +struct _QtEngineStyle +{ + GtkStyle parent_instance; + + GdkPixmap* menuBackground; +}; + +struct _QtEngineStyleClass +{ + GtkStyleClass parent_class; +}; + +void qtengine_style_register_type (GTypeModule *module); + + diff --git a/src/qt_theme_draw.c b/src/qt_theme_draw.c new file mode 100644 index 0000000..c67016c --- /dev/null +++ b/src/qt_theme_draw.c @@ -0,0 +1,1918 @@ +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_BONOBO +#include +#include +#endif + +#include + +#include "qt_style.h" +#include "qt_rc_style.h" +#include "qt_qt_wrapper.h" + +#define DETAIL(xx) ((detail) && (!strcmp(xx, detail))) +#define DETAILHAS(xx) ((detail) && (strstr(detail, xx))) +#define PARENT(xx) ((parent) && (!strcmp(xx, gtk_widget_get_name(parent)))) +#ifndef max +#define max(x,y) ((x)>=(y)?(x):(y)) +#endif +#ifndef min +#define min(x,y) ((x)<=(y)?(x):(y)) +#endif + +static void qtengine_style_init (QtEngineStyle *style); +static void qtengine_style_class_init (QtEngineStyleClass *klass); + +static GtkNotebook *notebook = NULL; +static int nb_num_pages = 0; + +static GtkStyleClass *parent_class = NULL; + +static PangoLayout* +get_insensitive_layout (GdkDrawable *drawable, + PangoLayout *layout); + + +static GtkShadowType +get_shadow_type (GtkStyle* style, const char *detail, GtkShadowType requested) +{ + GtkShadowType retval = GTK_SHADOW_NONE; + + if (requested != GTK_SHADOW_NONE) { + retval = GTK_SHADOW_ETCHED_IN; + } + + if (DETAIL ("dockitem") || DETAIL ("handlebox_bin") || DETAIL ("spinbutton_up") || DETAIL ("spinbutton_down")) { + retval = GTK_SHADOW_NONE; + } else if (DETAIL ("button") || DETAIL ("togglebutton") || DETAIL ("notebook") || DETAIL ("optionmenu")) { + retval = requested; + } else if (DETAIL ("menu")) { + retval = GTK_SHADOW_ETCHED_IN; + } + + return retval; +} + +static void sanitize_size(GdkWindow* window, gint* width, gint* height) +{ + if ((*width == -1) && (*height == -1)) + gdk_window_get_size (window, width, height); + else if (*width == -1) + gdk_window_get_size (window, width, NULL); + else if (*height == -1) + gdk_window_get_size (window, NULL, height); +} + + +static void +draw_hline(GtkStyle* style, + GdkWindow* window, + GtkStateType state_type, + GdkRectangle* area, + GtkWidget* widget, + const gchar* detail, + gint x1, + gint x2, + gint y) +{ + if (gtkQtDebug) + printf("HLINE (%d,%d,%d) Widget: %s Detail: %s\n",x1,y1,y,gtk_widget_get_name(widget),detail); + + if (DETAIL("vscale")) + return; + + drawHLine(window,style,state_type,y,x1,x2); +} + + +static void +draw_vline(GtkStyle* style, + GdkWindow* window, + GtkStateType state_type, + GdkRectangle* area, + GtkWidget* widget, + const gchar* detail, + gint ySource, + gint yDest, + gint x) +{ + if (gtkQtDebug) + printf("VLINE (%d,%d,%d) Widget: %s Detail: %s\n",ySource ,yDest ,x,gtk_widget_get_name(widget),detail); + + + if (DETAIL("hscale")) + return; + drawVLine(window,style,state_type,x,ySource,yDest); +} + +static void +draw_shadow(GtkStyle *style, + GdkWindow *window, + GtkStateType state_type, + GtkShadowType shadow_type, + GdkRectangle *area, + GtkWidget *widget, + const gchar *detail, + gint x, + gint y, + gint width, + gint height) +{ + GdkGC *gc1 = NULL; /* Initialize to quiet GCC */ + GdkGC *gc2 = NULL; + GdkGC *gc3 = NULL; + GdkGC *gc4 = NULL; + + gint thickness_light; + gint thickness_dark; + gint i; + + sanitize_size(window, &width, &height); + + if (gtkQtDebug) + printf("Shadow (%d,%d,%d,%d) Widget: %s Detail: %s\n",x,y,width,height,gtk_widget_get_name(widget),detail); + + + if (DETAIL("menuitem")) + return; + if (DETAIL("menu")) + return; + if (DETAIL("entry")) + { + drawLineEdit(window,style,state_type,gtk_widget_is_focus(widget),x,y,width,height); + return; + } + if (DETAIL("frame") || DETAIL("trough") || DETAIL("viewport")) + { + if (!GTK_IS_SCALE(widget)) + { + /*printf("Frame (%d,%d) %dx%d %d %d\n", x,y,width,height,state_type, shadow_type);*/ + drawFrame(window,style,state_type,shadow_type,x,y,width,height); + return; + } + } + + /* The remainder of this function was borrowed from the "Metal" theme/ + I don't really want to use Qt to draw these frames as there are too + many of them (it would slow down the theme engine even more). + TODO: Make them use the Qt color palette */ + + switch (shadow_type) + { + case GTK_SHADOW_NONE: + case GTK_SHADOW_IN: + case GTK_SHADOW_ETCHED_IN: + gc1 = style->light_gc[state_type]; + gc2 = style->dark_gc[state_type]; + gc3 = style->black_gc; + gc4 = style->bg_gc[state_type]; + break; + case GTK_SHADOW_OUT: + case GTK_SHADOW_ETCHED_OUT: + gc1 = style->dark_gc[state_type]; + gc2 = style->light_gc[state_type]; + gc3 = style->black_gc; + gc4 = style->bg_gc[state_type]; + break; + } + + if (area) + { + gdk_gc_set_clip_rectangle (gc1, area); + gdk_gc_set_clip_rectangle (gc2, area); + gdk_gc_set_clip_rectangle (gc3, area); + gdk_gc_set_clip_rectangle (gc4, area); + } + + switch (shadow_type) + { + case GTK_SHADOW_NONE: + break; + case GTK_SHADOW_IN: + gdk_draw_line (window, gc1, + x, y + height - 1, x + width - 1, y + height - 1); + gdk_draw_line (window, gc1, + x + width - 1, y, x + width - 1, y + height - 1); + + gdk_draw_line (window, gc4, + x + 1, y + height - 2, x + width - 2, y + height - 2); + gdk_draw_line (window, gc4, + x + width - 2, y + 1, x + width - 2, y + height - 2); + + gdk_draw_line (window, gc3, + x + 1, y + 1, x + width - 2, y + 1); + gdk_draw_line (window, gc3, + x + 1, y + 1, x + 1, y + height - 2); + + gdk_draw_line (window, gc2, + x, y, x + width - 1, y); + gdk_draw_line (window, gc2, + x, y, x, y + height - 1); + break; + + case GTK_SHADOW_OUT: + gdk_draw_line (window, gc1, + x + 1, y + height - 2, x + width - 2, y + height - 2); + gdk_draw_line (window, gc1, + x + width - 2, y + 1, x + width - 2, y + height - 2); + + gdk_draw_line (window, gc2, + x, y, x + width - 1, y); + gdk_draw_line (window, gc2, + x, y, x, y + height - 1); + + gdk_draw_line (window, gc4, + x + 1, y + 1, x + width - 2, y + 1); + gdk_draw_line (window, gc4, + x + 1, y + 1, x + 1, y + height - 2); + + gdk_draw_line (window, gc3, + x, y + height - 1, x + width - 1, y + height - 1); + gdk_draw_line (window, gc3, + x + width - 1, y, x + width - 1, y + height - 1); + break; + case GTK_SHADOW_ETCHED_IN: + case GTK_SHADOW_ETCHED_OUT: + thickness_light = 1; + thickness_dark = 1; + + for (i = 0; i < thickness_dark; i++) + { + gdk_draw_line (window, gc1, + x + i, + y + height - i - 1, + x + width - i - 1, + y + height - i - 1); + gdk_draw_line (window, gc1, + x + width - i - 1, + y + i, + x + width - i - 1, + y + height - i - 1); + + gdk_draw_line (window, gc2, + x + i, + y + i, + x + width - i - 2, + y + i); + gdk_draw_line (window, gc2, + x + i, + y + i, + x + i, + y + height - i - 2); + } + + for (i = 0; i < thickness_light; i++) + { + gdk_draw_line (window, gc1, + x + thickness_dark + i, + y + thickness_dark + i, + x + width - thickness_dark - i - 1, + y + thickness_dark + i); + gdk_draw_line (window, gc1, + x + thickness_dark + i, + y + thickness_dark + i, + x + thickness_dark + i, + y + height - thickness_dark - i - 1); + + gdk_draw_line (window, gc2, + x + thickness_dark + i, + y + height - thickness_light - i - 1, + x + width - thickness_light - 1, + y + height - thickness_light - i - 1); + gdk_draw_line (window, gc2, + x + width - thickness_light - i - 1, + y + thickness_dark + i, + x + width - thickness_light - i - 1, + y + height - thickness_light - 1); + } + break; + } + + if (area) + { + gdk_gc_set_clip_rectangle (gc1, NULL); + gdk_gc_set_clip_rectangle (gc2, NULL); + gdk_gc_set_clip_rectangle (gc3, NULL); + gdk_gc_set_clip_rectangle (gc4, NULL); + } + + return; +} + +static void +draw_polygon(GtkStyle* style, + GdkWindow* window, + GtkStateType state_type, + GtkShadowType shadow_type, + GdkRectangle* area, + GtkWidget* widget, + const gchar* detail, + GdkPoint* points, + gint npoints, + gint fill) +{ +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif /* M_PI */ +#ifndef M_PI_4 +#define M_PI_4 0.78539816339744830962 +#endif /* M_PI_4 */ + + static const gdouble pi_over_4 = M_PI_4; + static const gdouble pi_3_over_4 = M_PI_4 * 3; + + GdkGC *gc1; + GdkGC *gc2; + GdkGC *gc3; + GdkGC *gc4; + gdouble angle; + gint xadjust; + gint yadjust; + gint i; + + g_return_if_fail(style != NULL); + g_return_if_fail(window != NULL); + g_return_if_fail(points != NULL); + + switch (shadow_type) + { + case GTK_SHADOW_IN: + gc1 = style->light_gc[state_type]; + gc2 = style->dark_gc[state_type]; + gc3 = style->light_gc[state_type]; + gc4 = style->dark_gc[state_type]; + break; + case GTK_SHADOW_ETCHED_IN: + gc1 = style->light_gc[state_type]; + gc2 = style->dark_gc[state_type]; + gc3 = style->dark_gc[state_type]; + gc4 = style->light_gc[state_type]; + break; + case GTK_SHADOW_OUT: + gc1 = style->dark_gc[state_type]; + gc2 = style->light_gc[state_type]; + gc3 = style->dark_gc[state_type]; + gc4 = style->light_gc[state_type]; + break; + case GTK_SHADOW_ETCHED_OUT: + gc1 = style->dark_gc[state_type]; + gc2 = style->light_gc[state_type]; + gc3 = style->light_gc[state_type]; + gc4 = style->dark_gc[state_type]; + break; + default: + return; + } + + if (area) + { + gdk_gc_set_clip_rectangle(gc1, area); + gdk_gc_set_clip_rectangle(gc2, area); + gdk_gc_set_clip_rectangle(gc3, area); + gdk_gc_set_clip_rectangle(gc4, area); + } + + if (fill) + gdk_draw_polygon(window, style->bg_gc[state_type], TRUE, points, npoints); + + npoints--; + + for (i = 0; i < npoints; i++) + { + if ((points[i].x == points[i + 1].x) && + (points[i].y == points[i + 1].y)) + { + angle = 0; + } + else + { + angle = atan2(points[i + 1].y - points[i].y, + points[i + 1].x - points[i].x); + } + + if ((angle > -pi_3_over_4) && (angle < pi_over_4)) + { + if (angle > -pi_over_4) + { + xadjust = 0; + yadjust = 1; + } + else + { + xadjust = 1; + yadjust = 0; + } + + gdk_draw_line(window, gc1, + points[i].x - xadjust, points[i].y - yadjust, + points[i + 1].x - xadjust, points[i + 1].y - yadjust); + gdk_draw_line(window, gc3, + points[i].x, points[i].y, + points[i + 1].x, points[i + 1].y); + } + else + { + if ((angle < -pi_3_over_4) || (angle > pi_3_over_4)) + { + xadjust = 0; + yadjust = 1; + } + else + { + xadjust = 1; + yadjust = 0; + } + + gdk_draw_line(window, gc4, + points[i].x + xadjust, points[i].y + yadjust, + points[i + 1].x + xadjust, points[i + 1].y + yadjust); + gdk_draw_line(window, gc2, + points[i].x, points[i].y, + points[i + 1].x, points[i + 1].y); + } + } + if (area) + { + gdk_gc_set_clip_rectangle(gc1, NULL); + gdk_gc_set_clip_rectangle(gc2, NULL); + gdk_gc_set_clip_rectangle(gc3, NULL); + gdk_gc_set_clip_rectangle(gc4, NULL); + } +} + +static void +draw_arrow(GtkStyle* style, + GdkWindow* window, + GtkStateType state_type, + GtkShadowType shadow_type, + GdkRectangle* area, + GtkWidget* widget, + const gchar *detail, + GtkArrowType arrow_type, + gint fill, gint x, gint y, gint width, gint height) +{ + sanitize_size(window, &width, &height); + + if (gtkQtDebug) + printf("Arrow (%d,%d,%d,%d) Widget: %s Detail: %s\n", x, y, width, height,gtk_widget_get_name(widget),detail); + + if (DETAIL("hscrollbar") || DETAIL("vscrollbar")) + return; + if (DETAIL("spinbutton")) + return; + if (DETAIL("notebook")) + { + drawArrow(window, style, state_type, arrow_type, x, y, width, height); + return; + } + if (DETAIL("arrow")) + { + GdkPixbuf *gpix; + GtkWidget* parent; + if (gdk_window_is_viewable(gtk_widget_get_parent_window(widget))) + { + gpix = gdk_pixbuf_get_from_drawable(NULL, gtk_widget_get_parent_window(widget),NULL, x, y, 0, 0, width, height); + setFillPixmap(gpix); + g_object_unref(gpix); + } + + parent = gtk_widget_get_parent(widget); + drawArrow(window,style, GTK_WIDGET_STATE(parent), arrow_type, x, y, width, height); + return; + } +/* if (DETAIL("menuitem")) + { + GdkGC *gc1; + GdkGC *gc2; + GdkGC *gc3; + GdkGC *gc4; + gint half_width; + gint half_height; + gint ax, ay, aw, ah; + + switch (shadow_type) + { + case GTK_SHADOW_IN: + gc1 = style->bg_gc[state_type]; + gc2 = style->dark_gc[state_type]; + gc3 = style->light_gc[state_type]; + gc4 = style->black_gc; + break; + case GTK_SHADOW_OUT: + gc1 = style->dark_gc[state_type]; + gc2 = style->light_gc[state_type]; + gc3 = style->black_gc; + gc4 = style->bg_gc[state_type]; + break; + case GTK_SHADOW_ETCHED_IN: + gc2 = style->light_gc[state_type]; + gc1 = style->dark_gc[state_type]; + gc3 = NULL; + gc4 = NULL; + break; + case GTK_SHADOW_ETCHED_OUT: + gc1 = style->dark_gc[state_type]; + gc2 = style->light_gc[state_type]; + gc3 = NULL; + gc4 = NULL; + break; + default: + return; + } + + sanitize_size(window, &width, &height); + ax = x; + ay = y; + aw = width; + ah = height; + calculate_arrow_geometry (arrow_type, &ax, &ay, &aw, &ah); + + half_width = width / 2; + half_height = height / 2; + + if (area) + { + gdk_gc_set_clip_rectangle(gc1, area); + gdk_gc_set_clip_rectangle(gc2, area); + if ((gc3) && (gc4)) + { + gdk_gc_set_clip_rectangle(gc3, area); + gdk_gc_set_clip_rectangle(gc4, area); + } + } + + if (state_type == GTK_STATE_INSENSITIVE) + draw_black_arrow (window, style->white_gc, area, arrow_type, ax + 1, ay + 1, aw, ah); + draw_black_arrow (window, style->fg_gc[state_type], area, arrow_type, ax, ay, aw, ah); + + if (area) + { + gdk_gc_set_clip_rectangle(gc1, NULL); + gdk_gc_set_clip_rectangle(gc2, NULL); + if (gc3) + { + gdk_gc_set_clip_rectangle(gc3, NULL); + gdk_gc_set_clip_rectangle(gc4, NULL); + } + } + }*/ + else + { + GdkPixbuf *gpix; + if (gdk_window_is_viewable(gtk_widget_get_parent_window(widget))) + { + gpix = gdk_pixbuf_get_from_drawable(NULL, gtk_widget_get_parent_window(widget),NULL, x, y, 0, 0, width, height); + setFillPixmap(gpix); + g_object_unref(gpix); + } + + drawArrow(window, style, state_type, arrow_type, x, y, width, height); + return; + } +} + + + +static void +draw_diamond(GtkStyle * style, + GdkWindow * window, + GtkStateType state_type, + GtkShadowType shadow_type, + GdkRectangle * area, + GtkWidget * widget, + const gchar *detail, + gint x, + gint y, + gint width, + gint height) +{ +} + + + +static void +draw_box(GtkStyle * style, + GdkWindow * window, + GtkStateType state_type, + GtkShadowType shadow_type, + GdkRectangle * area, + GtkWidget * widget, + const gchar *detail, + gint x, + gint y, + gint width, + gint height) +{ + GList *child1; + GtkWidget *child; + GtkNotebook *nb; + int nbpages; + sanitize_size(window, &width, &height); + + if (gtkQtDebug) + printf("Box (%d,%d,%d,%d) Widget: %s Detail: %s\n",x,y,width,height,gtk_widget_get_name(widget),detail); + + if (GTK_IS_SCROLLBAR(widget)) + { + if (DETAIL("trough")) + { + GtkAdjustment* adj = (GtkAdjustment*)gtk_range_get_adjustment(GTK_RANGE(widget)); + int orientation = ((width>height) ? GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL); + + drawScrollBar(window, style, state_type, orientation, adj, x, y, width, height); + } + return; + } + if (DETAIL("menuitem")) + { + /* Crude way of checking if it's a menu item, or a menubar item */ + if (x != 0) + drawMenuBarItem(window,style,state_type,x,y,width,height); + else + drawMenuItem(window,style,state_type,x,y,width,height); + return; + } + if (DETAIL("menubar")) + { + if (openOfficeFix == 1) + parent_class->draw_box (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height); + else + drawMenubar(window,style,state_type,x,y,width,height); + return; + } + if (DETAIL("menu")) + { + if (openOfficeFix == 1) + parent_class->draw_box (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height); + else + { + if ((x >= 0) && (y >= 0)) /* Work around weirdness in firefox */ + drawMenu(window,style,state_type,x,y,width,height); + } + return; + } + if (GTK_IS_PROGRESS(widget) && DETAIL("trough")) + { + double fraction = gtk_progress_bar_get_fraction(GTK_PROGRESS_BAR(widget)); + GtkProgressBarOrientation orientation = gtk_progress_bar_get_orientation(GTK_PROGRESS_BAR(widget)); + + drawProgressBar(window,style,state_type,orientation,fraction,x,y,width,height); + return; + } + if (GTK_IS_PROGRESS(widget) && DETAIL("bar")) + { + if (area) gdk_gc_set_clip_rectangle(style->bg_gc[state_type], area); + + drawProgressChunk(window,style,state_type,x,y,width,height); + + if (area) gdk_gc_set_clip_rectangle(style->bg_gc[state_type], NULL); + return; + } + if (GTK_IS_SCALE(widget) && DETAIL("trough")) + { + GtkAdjustment* adj; + int inverted; + GValue *val = (GValue*)g_malloc( sizeof(GValue) ); + if (gdk_window_is_viewable(gtk_widget_get_parent_window(widget))) + { + GdkPixbuf *gpix; + gpix = gdk_pixbuf_get_from_drawable(NULL, gtk_widget_get_parent_window(widget),NULL, x, y, 0, 0, width, height); + setFillPixmap(gpix); + g_object_unref(gpix); + } + + memset( val, 0, sizeof(GValue) ); + g_value_init( val, G_TYPE_BOOLEAN ); + g_object_get_property(widget, "inverted", val); + inverted = g_value_get_boolean(val); + g_value_unset(val); + g_free(val); + + adj = gtk_range_get_adjustment((GtkRange *) widget); + drawSlider(window,style,state_type,adj,x,y,width,height, (GTK_RANGE(widget))->orientation, inverted); + return; + } + if (DETAIL("button")) + { + GtkWidget *parent; + int toolbutton = 0; + parent = gtk_widget_get_parent(widget); + + if (parent && (GTK_IS_CLIST(parent) || GTK_IS_LIST(parent) || GTK_IS_TREE_VIEW(parent))) + { + drawListHeader(window,style,state_type,x,y,width,height); + return; + } + + /* this is a very very bad hack but there seems to be no way to find if a button is on a + * toolbar in gtk */ + while (1) + { + if (GTK_IS_WIDGET(parent)) + { +#ifdef HAVE_BONOBO + if (GTK_IS_TOOLBAR(parent) || BONOBO_IS_UI_TOOLBAR(parent)) +#else + if (GTK_IS_TOOLBAR(parent)) +#endif + { + toolbutton = 1; + break; + } + } + else + break; + parent = gtk_widget_get_parent(parent); + } + + parent = gtk_widget_get_parent(widget); + + if (toolbutton) + drawToolButton(window,style,state_type,x,y,width,height); + else + { + /* Baghira hack -- rounded buttons really ugly when they are small like + on a dropdown entry box -- eg. search/replace in gedit */ + /* Draw square buttons only if number of children in the hbox is 2 and + * the first child is a entry view (GtkEntry)*/ + int defaultButton = GTK_WIDGET_HAS_FOCUS(widget); + GtkWindow* toplevel; + + if (isBaghira && GTK_IS_BOX(parent) && (g_list_length(GTK_BOX(parent)->children) == 2)) + { + child1 = g_list_first((GTK_BOX(parent)->children)); + child = ((GtkBoxChild *)child1->data)->widget; + if (GTK_IS_ENTRY(child)) + { + drawSquareButton(window,style,state_type,x,y,width,height); + return; + } + + child1 = g_list_last((GTK_BOX(parent)->children)); + child = ((GtkBoxChild *)child1->data)->widget; + if (GTK_IS_ENTRY(child)) + { + drawSquareButton(window,style,state_type,x,y,width,height); + return; + } + + } + + toplevel = GTK_WINDOW(gtk_widget_get_toplevel(widget)); + if (toplevel && toplevel->default_widget == widget) + defaultButton = 1; + + drawButton(window,style,state_type,defaultButton,x,y,width,height); + } + return; + } + if (DETAIL("tab")) + { + if (GTK_IS_NOTEBOOK(widget)) + { + nb = (GtkNotebook *)widget; + nbpages = g_list_length(nb->children); + /* THIS IS WHAT WORKS NOW -- + Tabs and tabbarbase will be drawn properly according to the QT style + But the tabs won't be aligned according to QT. GTK+ does not have + an option for alignment of tabs. So if were to do this not only do we have to + calculate the x,y position of the tab ourselves, which is difficult in Qt unless + we are displaying the tab (can be done by subclassing QTabBar/QTabWidget) + but also have to position the tab bar label ourselves in gtk. + */ + + /* Check if we have seen this notebook before */ + if ((nb != notebook) || (nbpages != nb_num_pages)) + { + notebook = nb; + nb_num_pages = nbpages; + initDrawTabNG(nbpages); + } + + /* Now draw the tab -- tab position is also calculated in this function + checkout drawTabFrame() for drawing tabbarbase. */ + drawTabNG(window,style,state_type,x, y, width - 2, height, nb ); + } + else + drawTab(window,style,state_type,x,y,width-2,height); + return; + } + if (DETAIL("optionmenu")) + { + drawComboBox(window,style,state_type,x,y,width,height); + return; + } + if (DETAIL("toolbar")) + { + if (openOfficeFix == 1) + parent_class->draw_box (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height); + else + drawToolbar(window,style,state_type,x,y,width,height); + return; + } + if (DETAIL("spinbutton_up")) + { + drawSpinButton(window, style, state_type, 0, x, y, width, height); + return; + } + if (DETAIL("spinbutton_down")) + { + drawSpinButton(window, style, state_type, 1, x, y, width, height); + return; + } + if (DETAIL("spinbutton")) + return; + + if (DETAIL("optionmenutab") || DETAIL("buttondefault")) + return; + + drawFrame(window,style,state_type,shadow_type,x,y,width,height); +} + + + +static void +draw_flat_box(GtkStyle * style, + GdkWindow * window, + GtkStateType state_type, + GtkShadowType shadow_type, + GdkRectangle * area, + GtkWidget * widget, + const gchar *detail, + gint x, + gint y, + gint width, + gint height) +{ + sanitize_size(window, &width, &height); + + if (gtkQtDebug) + printf("Flat Box (%d,%d,%d,%d) Widget: %s Detail: %s %d %d\n",x,y,width,height,gtk_widget_get_name(widget),detail, state_type, GTK_STATE_SELECTED); + + if (DETAIL("tooltip")) + { + GdkColor tooltipColor; + GdkGCValues gc_values; + GdkGCValuesMask gc_values_mask; + GdkGC* tooltipGc; + tooltipColor.red = 255*257; + tooltipColor.green = 255*257; + tooltipColor.blue = 220*257; + gdk_colormap_alloc_color(style->colormap, &tooltipColor, FALSE, TRUE); + + gc_values_mask = GDK_GC_FOREGROUND; + gc_values.foreground = tooltipColor; + + tooltipGc = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask); + gdk_draw_rectangle(window, tooltipGc, TRUE, x, y, width, height); + gdk_draw_rectangle(window, style->black_gc, FALSE, x, y, width - 1, height - 1); + + gtk_gc_release(tooltipGc); + } + + if ((DETAILHAS("cell_even") || DETAILHAS("cell_odd")) && (state_type == GTK_STATE_SELECTED)) + { + drawListViewItem(window,style,state_type,x,y,width,height); + } + else if (DETAIL("listitem")) + { + drawListViewItem(window,style,state_type,x,y,width,height); + } + else if (DETAILHAS("cell_even")) + { + gdk_draw_rectangle(window, style->base_gc[GTK_STATE_NORMAL], TRUE, x, y, width, height); + } + else if (DETAILHAS("cell_odd")) + { + gdk_draw_rectangle(window, alternateBackgroundGc(style), TRUE, x, y, width, height); + } +} + + +static void +draw_check(GtkStyle * style, + GdkWindow * window, + GtkStateType state_type, + GtkShadowType shadow_type, + GdkRectangle * area, + GtkWidget * widget, + const gchar *detail, + gint x, + gint y, + gint width, + gint height) +{ + if (gtkQtDebug) + printf("Check (%d,%d,%d,%d) Widget: %s Detail: %s\n", x, y, width, height,gtk_widget_get_name(widget),detail); + + if (GTK_IS_MENU_ITEM(widget)) + { + if (shadow_type == GTK_SHADOW_IN) + { + if (gdk_window_is_viewable(gtk_widget_get_parent_window(widget))) + { + GdkPixbuf *gpix; + gpix = gdk_pixbuf_get_from_drawable(NULL, gtk_widget_get_parent_window(widget), NULL, x, y, 0, 0, width, height); + setFillPixmap(gpix); + g_object_unref(gpix); + } + + drawMenuCheck(window,style,state_type,x,y,width,height); + } + return; + } + drawCheckBox(window,style,state_type,(shadow_type==GTK_SHADOW_IN),x,y,width,height); +} + + +/* Thanks to Evan Lawrence */ +static void +draw_option(GtkStyle * style, + GdkWindow * window, + GtkStateType state_type, + GtkShadowType shadow_type, + GdkRectangle * area, + GtkWidget * widget, + const gchar *detail, + gint x, + gint y, + gint width, + gint height) +{ + if (gtkQtDebug) + printf("Option (%d,%d,%d,%d) Widget: %s Detail: %s\n", x, y, width, height,gtk_widget_get_name(widget),detail); + + if (gdk_window_is_viewable(gtk_widget_get_parent_window(widget))) + { + GdkPixbuf *gpix; + gpix = gdk_pixbuf_get_from_drawable(NULL, gtk_widget_get_parent_window(widget),NULL, x, y, 0, 0, width, height); + setFillPixmap(gpix); + g_object_unref(gpix); + } + + if (GTK_IS_MENU_ITEM(widget)) + { + if (shadow_type == GTK_SHADOW_IN) + drawMenuCheck(window,style,state_type,x,y,width,height); + return; + } + drawRadioButton(window,style,state_type,(shadow_type==GTK_SHADOW_IN),x,y,width,height); +} + + +static void +draw_tab(GtkStyle * style, + GdkWindow * window, + GtkStateType state_type, + GtkShadowType shadow_type, + GdkRectangle * area, + GtkWidget * widget, + const gchar *detail, + gint x, + gint y, + gint width, + gint height) +{ + if (gtkQtDebug) + printf("Tab (%d,%d,%d,%d) Widget: %s Detail: %s\n", x, y, width, height,gtk_widget_get_name(widget),detail); + + gtk_paint_box(style, window, state_type, shadow_type, area, widget, detail, x, y, width, height); +} + + + +static void +draw_shadow_gap(GtkStyle * style, + GdkWindow * window, + GtkStateType state_type, + GtkShadowType shadow_type, + GdkRectangle * area, + GtkWidget * widget, + const gchar *detail, + gint x, + gint y, + gint width, + gint height, + GtkPositionType gap_side, + gint gap_x, + gint gap_width) +{ + GdkGC *gc1 = NULL; + GdkGC *gc2 = NULL; + + g_return_if_fail (window != NULL); + + sanitize_size (window, &width, &height); + shadow_type = get_shadow_type (style, detail, shadow_type); + + if (gtkQtDebug) + printf("Shadow_Gap (%d,%d,%d,%d) Widget: %s Detail: %s\n",x,y,width,height,gtk_widget_get_name(widget),detail); + + switch (shadow_type) { + case GTK_SHADOW_NONE: + return; + case GTK_SHADOW_IN: + gc1 = style->dark_gc[state_type]; + gc2 = style->light_gc[state_type]; + break; + case GTK_SHADOW_OUT: + gc1 = style->light_gc[state_type]; + gc2 = style->dark_gc[state_type]; + break; + case GTK_SHADOW_ETCHED_IN: + case GTK_SHADOW_ETCHED_OUT: + gc1 = style->dark_gc[state_type]; + gc2 = style->dark_gc[state_type]; + } + + if (area) { + gdk_gc_set_clip_rectangle (gc1, area); + gdk_gc_set_clip_rectangle (gc2, area); + } + + switch (gap_side) { + case GTK_POS_TOP: + if (gap_x > 0) { + gdk_draw_line (window, gc1, + x, y, + x + gap_x, y); + } + if ((width - (gap_x + gap_width)) > 0) { + gdk_draw_line (window, gc1, + x + gap_x + gap_width - 1, y, + x + width - 1, y); + } + gdk_draw_line (window, gc1, + x, y, + x, y + height - 1); + gdk_draw_line (window, gc2, + x + width - 1, y, + x + width - 1, y + height - 1); + gdk_draw_line (window, gc2, + x, y + height - 1, + x + width - 1, y + height - 1); + break; + case GTK_POS_BOTTOM: + gdk_draw_line (window, gc1, + x, y, + x + width - 1, y); + gdk_draw_line (window, gc1, + x, y, + x, y + height - 1); + gdk_draw_line (window, gc2, + x + width - 1, y, + x + width - 1, y + height - 1); + + if (gap_x > 0) { + gdk_draw_line (window, gc2, + x, y + height - 1, + x + gap_x, y + height - 1); + } + if ((width - (gap_x + gap_width)) > 0) { + gdk_draw_line (window, gc2, + x + gap_x + gap_width - 1, y + height - 1, + x + width - 1, y + height - 1); + } + + break; + case GTK_POS_LEFT: + gdk_draw_line (window, gc1, + x, y, + x + width - 1, y); + if (gap_x > 0) { + gdk_draw_line (window, gc1, + x, y, + x, y + gap_x); + } + if ((height - (gap_x + gap_width)) > 0) { + gdk_draw_line (window, gc1, + x, y + gap_x + gap_width - 1, + x, y + height - 1); + } + gdk_draw_line (window, gc2, + x + width - 1, y, + x + width - 1, y + height - 1); + gdk_draw_line (window, gc2, + x, y + height - 1, + x + width - 1, y + height - 1); + break; + case GTK_POS_RIGHT: + gdk_draw_line (window, gc1, + x, y, + x + width - 1, y); + gdk_draw_line (window, gc1, + x, y, + x, y + height - 1); + + + if (gap_x > 0) { + gdk_draw_line (window, gc2, + x + width - 1, y, + x + width - 1, y + gap_x); + } + if ((height - (gap_x + gap_width)) > 0) { + gdk_draw_line (window, gc2, + x + width - 1, y + gap_x + gap_width - 1, + x + width - 1, y + height - 1); + } + gdk_draw_line (window, gc2, + x, y + height - 1, + x + width - 1, y + height - 1); + + } + + if (area) { + gdk_gc_set_clip_rectangle (gc1, NULL); + gdk_gc_set_clip_rectangle (gc2, NULL); + } +} + + +static void +draw_box_gap(GtkStyle* style, + GdkWindow* window, + GtkStateType state_type, + GtkShadowType shadow_type, + GdkRectangle* area, + GtkWidget* widget, + const gchar* detail, + gint x, + gint y, + gint width, + gint height, + GtkPositionType gap_side, + gint gap_x, + gint gap_width) +{ + sanitize_size (window, &width, &height); + + if (width<0 || height<0) return; /* Eclipse really can be this stupid! */ + + if (gtkQtDebug) + printf("Box_gap (%d,%d,%d,%d) Widget: %s Detail: %s\n", x, y, width, height,gtk_widget_get_name(widget),detail); + + if (DETAIL("notebook")) + drawTabFrame(window,style,state_type,x,y-2,width,height+2, gtk_notebook_get_tab_pos((GtkNotebook *)widget)); +} + + +static void +draw_extension(GtkStyle * style, + GdkWindow * window, + GtkStateType state_type, + GtkShadowType shadow_type, + GdkRectangle * area, + GtkWidget * widget, + const gchar *detail, + gint x, + gint y, + gint width, + gint height, + GtkPositionType gap_side) +{ + g_return_if_fail(style != NULL); + g_return_if_fail(window != NULL); + + sanitize_size (window, &width, &height); + + if (gtkQtDebug) + printf("Extension (%d,%d,%d,%d) Widget: %s Detail: %s\n", x, y, width, height,gtk_widget_get_name(widget),detail); + + gtk_paint_box(style, window, state_type, shadow_type, area, widget, detail, + x, y, width, height); +} + + +static void +draw_focus (GtkStyle *style, + GdkWindow *window, + GtkStateType state_type, + GdkRectangle *area, + GtkWidget *widget, + const gchar *detail, + gint x, + gint y, + gint width, + gint height) +{ + if (gtkQtDebug) + printf("Focus Rect (%d,%d,%d,%d) Widget: %s Detail: %s\n", x, y, width, height,gtk_widget_get_name(widget),detail); + + GtkWidget* parent = gtk_widget_get_parent(widget); + + if (GTK_IS_CHECK_BUTTON(widget) || + GTK_IS_RADIO_BUTTON(widget) || + (parent && (GTK_IS_CLIST(parent) || GTK_IS_LIST(parent) || GTK_IS_TREE_VIEW(parent)))) + { + drawFocusRect(window, style, x, y, width, height); + } + return; +} + +static void +draw_slider(GtkStyle * style, + GdkWindow * window, + GtkStateType state_type, + GtkShadowType shadow_type, + GdkRectangle * area, + GtkWidget * widget, + const gchar *detail, + gint x, + gint y, + gint width, + gint height, + GtkOrientation orientation) +{ + if (gtkQtDebug) + printf("Slider (%d,%d,%d,%d) Widget: %s Detail: %s\n", x, y, width, height,gtk_widget_get_name(widget),detail); + + if (DETAIL("slider")) + { + GtkAdjustment* adj = gtk_range_get_adjustment(GTK_RANGE(widget)); + int widgetX, widgetY; + + GtkWidget* parent = widget; + while (gtk_widget_get_parent(parent) != NULL) + parent = gtk_widget_get_parent(parent); + + gtk_widget_translate_coordinates(widget, parent, 0, 0, &widgetX, &widgetY); + + if (orientation == GTK_ORIENTATION_VERTICAL) + drawScrollBarSlider(window, style, state_type, orientation, adj, x-1, y, width+2, height, y-widgetY, widget->allocation.height); + else + drawScrollBarSlider(window, style, state_type, orientation, adj, x, y-1, width, height+2, x-widgetX, widget->allocation.width); + return; + } +} + +static void +draw_handle(GtkStyle * style, + GdkWindow * window, + GtkStateType state_type, + GtkShadowType shadow_type, + GdkRectangle * area, + GtkWidget * widget, + const gchar *detail, + gint x, + gint y, + gint width, + gint height, + GtkOrientation orientation) +{ + g_return_if_fail(style != NULL); + g_return_if_fail(window != NULL); + + sanitize_size(window, &width, &height); + + if (gtkQtDebug) + printf("Handle (%d,%d,%d,%d) Widget: %s Detail: %s \n",x,y,width,height,gtk_widget_get_name(widget),detail, state_type); + + drawSplitter(window,style,state_type,orientation,x,y,width,height); + return; +} + +static +void draw_layout (GtkStyle *style, + GdkWindow *window, + GtkStateType state_type, + gboolean use_text, + GdkRectangle *area, + GtkWidget *widget, + const gchar *detail, + gint x, + gint y, + PangoLayout *layout) +{ + + GdkColor color; + GdkGC *gc; + getTextColor(&color, state_type); + + if (gtkQtDebug) + printf("Layout (%d,%d) Widget: %s Detail: %s %d \n",x,y,gtk_widget_get_name(widget),detail, state_type); + + if (DETAIL("accellabel") || DETAIL("label") || DETAIL("cellrenderertext")) + { + + GtkWidget* parent = gtk_widget_get_parent(widget); + GtkWidget* parent1 = gtk_widget_get_parent(parent); + + /* printf("parent's names are %s->%s->%s\n", gtk_widget_get_name(widget), gtk_widget_get_name(parent), gtk_widget_get_name(parent1)); */ + + /* In baghira -- even highlight the menu bar items */ + if ((GTK_IS_MENU_ITEM(parent) && (!GTK_IS_MENU_BAR(parent1) || isBaghira || isPolyester)) || GTK_IS_TREE_VIEW(widget)) + { + PangoAttrList *layoutattr; + + const gchar *text; + gint text_length = 0; + gint text_bytelen = 0; + text = pango_layout_get_text (layout); + if (text != 0) + { + PangoAttribute *textcolorattr; + text_length = g_utf8_strlen (text, -1); + text_bytelen = strlen (text); + + textcolorattr = pango_attr_foreground_new(color.red, color.green, color.blue); + textcolorattr->start_index = 0; + textcolorattr->end_index = text_bytelen; + + layoutattr = pango_layout_get_attributes(layout); + + if (layoutattr == NULL) + { + layoutattr = pango_attr_list_new(); + pango_attr_list_insert(layoutattr, pango_attribute_copy(textcolorattr)); + pango_layout_set_attributes(layout,layoutattr); + pango_attr_list_unref(layoutattr); + } + else + { + pango_attr_list_change(layoutattr, pango_attribute_copy(textcolorattr)); + pango_layout_set_attributes(layout,layoutattr); + } + pango_attribute_destroy(textcolorattr); + } + + } + /* printf("Drawing an label -- with state %d at %d %d\n", state_type, x, y); */ + } + + g_return_if_fail (window != NULL); + + gc = use_text ? style->text_gc[state_type] : style->fg_gc[state_type]; + + if (area) + gdk_gc_set_clip_rectangle (gc, area); + + if (state_type == GTK_STATE_INSENSITIVE) + { + PangoLayout *ins; + ins = get_insensitive_layout (window, layout); + gdk_draw_layout (window, gc, x, y, ins); + g_object_unref (ins); + } + else + { + gdk_draw_layout (window, gc, x, y, layout); + } + + if (area) + gdk_gc_set_clip_rectangle (gc, NULL); +} + +typedef struct _ByteRange ByteRange; + +struct _ByteRange +{ + guint start; + guint end; +}; + +static ByteRange* +range_new (guint start, + guint end) +{ + ByteRange *br = g_new (ByteRange, 1); + + br->start = start; + br->end = end; + + return br; +} + +static PangoLayout* +get_insensitive_layout (GdkDrawable *drawable, + PangoLayout *layout) +{ + GSList *embossed_ranges = NULL; + GSList *stippled_ranges = NULL; + PangoLayoutIter *iter; + GSList *tmp_list = NULL; + PangoLayout *new_layout; + PangoAttrList *attrs; + GdkBitmap *stipple = NULL; + + iter = pango_layout_get_iter (layout); + + do + { + PangoLayoutRun *run; + PangoAttribute *attr; + gboolean need_stipple = FALSE; + ByteRange *br; + + run = pango_layout_iter_get_run (iter); + + if (run) + { + tmp_list = run->item->analysis.extra_attrs; + + while (tmp_list != NULL) + { + attr = tmp_list->data; + switch (attr->klass->type) + { + case PANGO_ATTR_FOREGROUND: + case PANGO_ATTR_BACKGROUND: + need_stipple = TRUE; + break; + + default: + break; + } + + if (need_stipple) + break; + + tmp_list = g_slist_next (tmp_list); + } + + br = range_new (run->item->offset, run->item->offset + run->item->length); + + if (need_stipple) + stippled_ranges = g_slist_prepend (stippled_ranges, br); + else + embossed_ranges = g_slist_prepend (embossed_ranges, br); + } + } + while (pango_layout_iter_next_run (iter)); + + pango_layout_iter_free (iter); + + new_layout = pango_layout_copy (layout); + + attrs = pango_layout_get_attributes (new_layout); + + if (attrs == NULL) + { + /* Create attr list if there wasn't one */ + attrs = pango_attr_list_new (); + pango_layout_set_attributes (new_layout, attrs); + pango_attr_list_unref (attrs); + } + + tmp_list = embossed_ranges; + while (tmp_list != NULL) + { + PangoAttribute *attr; + ByteRange *br = tmp_list->data; + + attr = gdk_pango_attr_embossed_new (TRUE); + + attr->start_index = br->start; + attr->end_index = br->end; + + pango_attr_list_change (attrs, attr); + + g_free (br); + + tmp_list = g_slist_next (tmp_list); + } + + g_slist_free (embossed_ranges); + + tmp_list = stippled_ranges; + while (tmp_list != NULL) + { + PangoAttribute *attr; + ByteRange *br = tmp_list->data; + + if (stipple == NULL) + { +#define gray50_width 2 +#define gray50_height 2 + static const char gray50_bits[] = { + 0x02, 0x01 + }; + + stipple = gdk_bitmap_create_from_data (drawable, + gray50_bits, gray50_width, + gray50_height); + } + + attr = gdk_pango_attr_stipple_new (stipple); + + attr->start_index = br->start; + attr->end_index = br->end; + + pango_attr_list_change (attrs, attr); + + g_free (br); + + tmp_list = g_slist_next (tmp_list); + } + + g_slist_free (stippled_ranges); + + if (stipple) + g_object_unref (stipple); + + return new_layout; +} + + +GType qtengine_type_style = 0; + +void +qtengine_style_register_type (GTypeModule *module) +{ + static const GTypeInfo object_info = + { + sizeof (QtEngineStyleClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) qtengine_style_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (QtEngineStyle), + 0, /* n_preallocs */ + (GInstanceInitFunc) qtengine_style_init, + }; + + qtengine_type_style = g_type_module_register_type (module, + GTK_TYPE_STYLE, + "QtEngineStyle", + &object_info, 0); +} + +static void +qtengine_style_init (QtEngineStyle *style) +{ +} + + +/* Copied these functions from gtkstyle.c + Evil, evil GTK... why isn't this stuff exported? */ + +#define LIGHTNESS_MULT 1.3 +#define DARKNESS_MULT 0.7 + +static void +rgb_to_hls (gdouble *r, + gdouble *g, + gdouble *b) +{ + gdouble min; + gdouble max; + gdouble red; + gdouble green; + gdouble blue; + gdouble h, l, s; + gdouble delta; + + red = *r; + green = *g; + blue = *b; + + if (red > green) + { + if (red > blue) + max = red; + else + max = blue; + + if (green < blue) + min = green; + else + min = blue; + } + else + { + if (green > blue) + max = green; + else + max = blue; + + if (red < blue) + min = red; + else + min = blue; + } + + l = (max + min) / 2; + s = 0; + h = 0; + + if (max != min) + { + if (l <= 0.5) + s = (max - min) / (max + min); + else + s = (max - min) / (2 - max - min); + + delta = max -min; + if (red == max) + h = (green - blue) / delta; + else if (green == max) + h = 2 + (blue - red) / delta; + else if (blue == max) + h = 4 + (red - green) / delta; + + h *= 60; + if (h < 0.0) + h += 360; + } + + *r = h; + *g = l; + *b = s; +} + +static void +hls_to_rgb (gdouble *h, + gdouble *l, + gdouble *s) +{ + gdouble hue; + gdouble lightness; + gdouble saturation; + gdouble m1, m2; + gdouble r, g, b; + + lightness = *l; + saturation = *s; + + if (lightness <= 0.5) + m2 = lightness * (1 + saturation); + else + m2 = lightness + saturation - lightness * saturation; + m1 = 2 * lightness - m2; + + if (saturation == 0) + { + *h = lightness; + *l = lightness; + *s = lightness; + } + else + { + hue = *h + 120; + while (hue > 360) + hue -= 360; + while (hue < 0) + hue += 360; + + if (hue < 60) + r = m1 + (m2 - m1) * hue / 60; + else if (hue < 180) + r = m2; + else if (hue < 240) + r = m1 + (m2 - m1) * (240 - hue) / 60; + else + r = m1; + + hue = *h; + while (hue > 360) + hue -= 360; + while (hue < 0) + hue += 360; + + if (hue < 60) + g = m1 + (m2 - m1) * hue / 60; + else if (hue < 180) + g = m2; + else if (hue < 240) + g = m1 + (m2 - m1) * (240 - hue) / 60; + else + g = m1; + + hue = *h - 120; + while (hue > 360) + hue -= 360; + while (hue < 0) + hue += 360; + + if (hue < 60) + b = m1 + (m2 - m1) * hue / 60; + else if (hue < 180) + b = m2; + else if (hue < 240) + b = m1 + (m2 - m1) * (240 - hue) / 60; + else + b = m1; + + *h = r; + *l = g; + *s = b; + } +} + +static void +gtk_style_shade (GdkColor *a, + GdkColor *b, + gdouble k) +{ + gdouble red; + gdouble green; + gdouble blue; + + red = (gdouble) a->red / 65535.0; + green = (gdouble) a->green / 65535.0; + blue = (gdouble) a->blue / 65535.0; + + rgb_to_hls (&red, &green, &blue); + + green *= k; + if (green > 1.0) + green = 1.0; + else if (green < 0.0) + green = 0.0; + + blue *= k; + if (blue > 1.0) + blue = 1.0; + else if (blue < 0.0) + blue = 0.0; + + hls_to_rgb (&red, &green, &blue); + + b->red = red * 65535.0; + b->green = green * 65535.0; + b->blue = blue * 65535.0; +} + +static void +gtk_style_real_realize (GtkStyle *style) +{ + GdkGCValues gc_values; + GdkGCValuesMask gc_values_mask; + + gint i; + + for (i = 0; i < 5; i++) + { + gtk_style_shade (&style->bg[i], &style->light[i], LIGHTNESS_MULT); + gtk_style_shade (&style->bg[i], &style->dark[i], DARKNESS_MULT); + + style->mid[i].red = (style->light[i].red + style->dark[i].red) / 2; + style->mid[i].green = (style->light[i].green + style->dark[i].green) / 2; + style->mid[i].blue = (style->light[i].blue + style->dark[i].blue) / 2; + + style->text_aa[i].red = (style->text[i].red + style->base[i].red) / 2; + style->text_aa[i].green = (style->text[i].green + style->base[i].green) / 2; + style->text_aa[i].blue = (style->text[i].blue + style->base[i].blue) / 2; + } + + style->black.red = 0x0000; + style->black.green = 0x0000; + style->black.blue = 0x0000; + gdk_colormap_alloc_color (style->colormap, &style->black, FALSE, TRUE); + + style->white.red = 0xffff; + style->white.green = 0xffff; + style->white.blue = 0xffff; + gdk_colormap_alloc_color (style->colormap, &style->white, FALSE, TRUE); + + gc_values_mask = GDK_GC_FOREGROUND; + + gc_values.foreground = style->black; + style->black_gc = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask); + + gc_values.foreground = style->white; + style->white_gc = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask); + + for (i = 0; i < 5; i++) + { + + if (!gdk_colormap_alloc_color (style->colormap, &style->fg[i], FALSE, TRUE)) + g_warning ("unable to allocate color: ( %d %d %d )", + style->fg[i].red, style->fg[i].green, style->fg[i].blue); + if (!gdk_colormap_alloc_color (style->colormap, &style->bg[i], FALSE, TRUE)) + g_warning ("unable to allocate color: ( %d %d %d )", + style->bg[i].red, style->bg[i].green, style->bg[i].blue); + if (!gdk_colormap_alloc_color (style->colormap, &style->light[i], FALSE, TRUE)) + g_warning ("unable to allocate color: ( %d %d %d )", + style->light[i].red, style->light[i].green, style->light[i].blue); + if (!gdk_colormap_alloc_color (style->colormap, &style->dark[i], FALSE, TRUE)) + g_warning ("unable to allocate color: ( %d %d %d )", + style->dark[i].red, style->dark[i].green, style->dark[i].blue); + if (!gdk_colormap_alloc_color (style->colormap, &style->mid[i], FALSE, TRUE)) + g_warning ("unable to allocate color: ( %d %d %d )", + style->mid[i].red, style->mid[i].green, style->mid[i].blue); + if (!gdk_colormap_alloc_color (style->colormap, &style->text[i], FALSE, TRUE)) + g_warning ("unable to allocate color: ( %d %d %d )", + style->text[i].red, style->text[i].green, style->text[i].blue); + if (!gdk_colormap_alloc_color (style->colormap, &style->base[i], FALSE, TRUE)) + g_warning ("unable to allocate color: ( %d %d %d )", + style->base[i].red, style->base[i].green, style->base[i].blue); + if (!gdk_colormap_alloc_color (style->colormap, &style->text_aa[i], FALSE, TRUE)) + g_warning ("unable to allocate color: ( %d %d %d )", + style->text_aa[i].red, style->text_aa[i].green, style->text_aa[i].blue); + + gc_values.foreground = style->fg[i]; + style->fg_gc[i] = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask); + + gc_values.foreground = style->bg[i]; + style->bg_gc[i] = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask); + + gc_values.foreground = style->light[i]; + style->light_gc[i] = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask); + + gc_values.foreground = style->dark[i]; + style->dark_gc[i] = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask); + + gc_values.foreground = style->mid[i]; + style->mid_gc[i] = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask); + + gc_values.foreground = style->text[i]; + style->text_gc[i] = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask); + + gc_values.foreground = style->base[i]; + style->base_gc[i] = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask); + + gc_values.foreground = style->text_aa[i]; + style->text_aa_gc[i] = (GdkGC*) gtk_gc_get (style->depth, style->colormap, &gc_values, gc_values_mask); + } +} + + +static void +realize (GtkStyle* style) +{ + setColors(style); + gtk_style_real_realize(style); +} + +static void +set_background (GtkStyle *style, GdkWindow *window, GtkStateType state_type) +{ + GdkPixmap *pixmap; + gint parent_relative; + GdkPixmap* pix_test; + + /* What kind of horrible person would store a pointer to a widget here... */ + void* parent = 0; + gdk_window_get_user_data(window, &parent); + if (GTK_IS_MENU((GtkWidget*) parent)) + { + pix_test = QTENGINE_STYLE(style)->menuBackground; + } + else + pix_test = style->bg_pixmap[state_type]; + + if (pix_test) + { + if (pix_test == (GdkPixmap*) GDK_PARENT_RELATIVE) + { + pixmap = NULL; + parent_relative = TRUE; + } + else + { + pixmap = pix_test; + parent_relative = FALSE; + gdk_drawable_set_colormap(pixmap, style->colormap); + } + + if (pixmap && !gdk_drawable_get_colormap (pixmap)) gdk_drawable_set_colormap (pixmap, gdk_drawable_get_colormap (window)); + gdk_window_set_back_pixmap (window, pixmap, parent_relative); + } + else + gdk_window_set_background (window, &style->bg[state_type]); +} + +static void +qtengine_style_class_init (QtEngineStyleClass *klass) +{ + GtkStyleClass *style_class = GTK_STYLE_CLASS (klass); + + parent_class = g_type_class_peek_parent (klass); + + style_class->draw_hline = draw_hline; + style_class->draw_vline = draw_vline; + style_class->draw_shadow = draw_shadow; + style_class->draw_polygon = draw_polygon; + style_class->draw_arrow = draw_arrow; + style_class->draw_diamond = draw_diamond; + /*style_class->draw_string = draw_string;*/ + style_class->draw_box = draw_box; + style_class->draw_flat_box = draw_flat_box; + style_class->draw_check = draw_check; + style_class->draw_option = draw_option; + style_class->draw_tab = draw_tab; + style_class->draw_shadow_gap = draw_shadow_gap; + + /* box around notebooks */ + style_class->draw_box_gap = draw_box_gap; + /* the tab */ + style_class->draw_extension = draw_extension; + + style_class->draw_focus = draw_focus; + style_class->draw_handle = draw_handle; + style_class->draw_layout = draw_layout; + style_class->draw_slider = draw_slider; + + style_class->realize = realize; + + /* style_class->set_background = set_background;*/ +} + + -- cgit v1.2.1