Changeset 6c2a697e07ab35b23a0742386214d5c37bec6039

Show
Ignore:
Timestamp:
10/16/08 01:40:56 (5 years ago)
Author:
Armin Burgmeier <armin@…>
Parents:
86c32c8ba885e66218f79923a22d968a37125468
Children:
b19be5b08bba0d162c3b6dd1990bb180f7f3c20e
git-committer:
Armin Burgmeier <armin@arbur.net> / 2008-10-16T01:40:56Z+0200
Message:

Windows build fixes

2008-10-15 Armin Burgmeier <armin@…>

  • code/core/Makefile.am: Added appicondir and pixmapdir back, so that installed pixmaps can be found.
  • code/util/resolv.cpp: Set all fields in getaddrinfo hint, otherwise the Win32 implementation of getaddrinfo produces an error.
  • code/core/browser.cpp: Commented-out the device name to device index translation for %dev syntax on Windows. It won't be available for now.
  • code/core/iconmanager.cpp: Don't load save-all.svg since GTK+ on Win32 has no SVG loader by defualt. Also, locate pixbufs using the non-deprecated g_win32_get_package_installation_directory_of_module function.
  • code/core/statusbar.cpp: Added code that undefs ERROR, because this is used in an enum, and seems to be defined somewhere in a Windows header.
  • code/dialogs/preferencesdialog.cpp: Don't set current folder of host directory file chooser (which is not shown currently anyway), because this could produce an error message if the directory does not exist.
  • code/operations/operation-open.cpp:
  • code/operations/operation-save.cpp: Use the C g_iconv API instead of Glib::IConv::iconv, because iconv is a define to libiconv on Windows, but Glib::IConv::libiconv does not exist.
  • Makefile.am: Fixed linking order, link to stdc++ and ws2_32 on Windows.
  • win32/gobby.rc: Fixed path to gobby.res file.
Files:
12 modified

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r86c32c8 r6c2a697  
     12008-10-15  Armin Burgmeier  <armin@arbur.net> 
     2 
     3        * code/core/Makefile.am: Added appicondir and pixmapdir back, so that 
     4        installed pixmaps can be found. 
     5 
     6        * code/util/resolv.cpp: Set all fields in getaddrinfo hint, otherwise 
     7        the Win32 implementation of getaddrinfo produces an error. 
     8 
     9        * code/core/browser.cpp: Commented-out the device name to device index 
     10        translation for %dev syntax on Windows. It won't be available for now. 
     11 
     12        * code/core/iconmanager.cpp: Don't load save-all.svg since GTK+ on 
     13        Win32 has no SVG loader by defualt. Also, locate pixbufs using the 
     14        non-deprecated g_win32_get_package_installation_directory_of_module 
     15        function. 
     16 
     17        * code/core/statusbar.cpp: Added code that undefs ERROR, because this 
     18        is used in an enum, and seems to be defined somewhere in a Windows 
     19        header. 
     20 
     21        * code/dialogs/preferencesdialog.cpp: Don't set current folder of 
     22        host directory file chooser (which is not shown currently anyway), 
     23        because this could produce an error message if the directory does not 
     24        exist. 
     25 
     26        * code/operations/operation-open.cpp: 
     27        * code/operations/operation-save.cpp: Use the C g_iconv API instead of 
     28        Glib::IConv::iconv, because iconv is a define to libiconv on Windows, 
     29        but Glib::IConv::libiconv does not exist. 
     30 
     31        * Makefile.am: Fixed linking order, link to stdc++ and ws2_32 on 
     32        Windows. 
     33 
     34        * win32/gobby.rc: Fixed path to gobby.res file. 
     35 
    1362008-10-15  Armin Burgmeier  <armin@arbur.net> 
    237 
  • Makefile.am

    rbd34be3 r6c2a697  
    88bin_PROGRAMS = gobby-0.5 
    99 
    10 gobby_0_5_LDADD = $(gobby_LIBS) \ 
     10gobby_0_5_LDADD = \ 
    1111        code/libgobby.a \ 
    1212        code/commands/libgobby-commands.a \ 
     
    1414        code/dialogs/libgobby-dialogs.a \ 
    1515        code/core/libgobby-core.a \ 
    16         code/util/libgobby-util.a 
     16        code/util/libgobby-util.a \ 
     17        $(gobby_LIBS) 
    1718 
    1819if WIN32 
    19 gobby_0_5_LDADD += -lole32 -luuid 
     20# For some reason it does not link against libstdc++ on Windows. Perhaps 
     21# that's because we don't specify a source file here, so it guesses C. 
     22gobby_0_5_LDADD += -lws2_32 -lstdc++ 
    2023gobby_0_5_LDFLAGS = \ 
    2124        -Wl,--enable-runtime-pseudo-reloc \ 
  • README

    r6649d0a r6c2a697  
    3737     * Syntax highlighting, auto indentation, configurable tab 
    3838       width 
    39      * Multiple documnets in one session 
     39     * Multiple documents in one session 
    4040     * Document subscriptions 
    4141     * Zeroconf support (optional) 
  • code/core/Makefile.am

    r09f550a r6c2a697  
    3737        userlist.hpp 
    3838 
     39appicondir = $(datadir)/pixmaps 
     40pixmapdir = $(datadir)/pixmaps/gobby 
     41 
    3942libgobby_core_a_CPPFLAGS = $(gobby_CFLAGS) -I.. \ 
    4043                          -DAPPICON_DIR=\""$(appicondir)"\" \ 
  • code/core/browser.cpp

    rd759de2 r6c2a697  
    2626#include <gtkmm/image.h> 
    2727 
    28 #include <net/if.h> 
     28#ifndef G_OS_WIN32 
     29# include <net/if.h> 
     30#endif 
    2931 
    3032Gobby::Browser::Browser(Gtk::Window& parent, 
     
    194196                str.erase(pos); 
    195197 
     198#ifdef G_OS_WIN32 
     199                // TODO: Implement 
     200                device_index = 0; 
     201#else 
    196202                device_index = if_nametoindex(device_name.c_str()); 
    197203                if(device_index == 0) 
     
    203209                                        device_name), 5); 
    204210                } 
     211#endif 
    205212        } 
    206213 
  • code/core/iconmanager.cpp

    rcdda99c r6c2a697  
    2525namespace 
    2626{ 
    27         Glib::RefPtr<Gdk::Pixbuf> load_pixbuf(const char* dir, const char* file) 
     27        Glib::RefPtr<Gdk::Pixbuf> 
     28        load_pixbuf(const char* dir, const char* file) 
    2829        { 
    2930                try 
     
    4445                        else 
    4546                                subdir = "share/pixmaps/gobby"; 
    46                          
    47                         path = g_win32_get_package_installation_subdirectory( 
    48                                 subdir); 
    49                         std::string path_str = path; 
     47 
     48                        gchar* path = g_win32_get_package_installation_directory_of_module(NULL); 
     49 
     50                        std::string path_str = 
     51                                Glib::build_filename(path, subdir); 
    5052                        g_free(path); 
    5153 
     
    6769Gtk::StockID Gobby::IconManager::STOCK_SAVE_ALL("gobby-save-all"); 
    6870 
     71// TODO: The save-all icon does not match the save icon for toolbar 
     72// or menu sized items. It is not yet enabled therefore. 
    6973Gobby::IconManager::IconManager(): 
    7074        gobby(load_pixbuf(APPICON_DIR, "gobby.png") ), 
    7175        userlist(load_pixbuf(PIXMAPS_DIR, "userlist.png") ), 
    7276        doclist(load_pixbuf(PIXMAPS_DIR, "doclist.png") ), 
    73         save_all(load_pixbuf(PIXMAPS_DIR, "save-all.svg")), 
     77//      save_all(load_pixbuf(PIXMAPS_DIR, "save-all.svg")), 
    7478        m_is_userlist(userlist), 
    7579        m_is_doclist(doclist), 
    76         m_is_save_all(save_all), 
     80//      m_is_save_all(save_all), 
    7781        m_icon_factory(Gtk::IconFactory::create() ) 
    7882{ 
     
    8488 
    8589        Gtk::StockItem save_all_item(STOCK_SAVE_ALL, _("Save All")); 
    86         // TODO: The save-all icon does not match the save icon for toolbar 
    87         // or menu sized items. This is not yet enabled therefore. 
    8890        //m_icon_factory->add(STOCK_SAVE_ALL, m_is_save_all); 
    8991 
  • code/core/statusbar.hpp

    rbd34be3 r6c2a697  
    2626 
    2727#include <glibmm/ustring.h> 
     28 
     29/* ARGH!!! */ 
     30#ifdef G_OS_WIN32 
     31# ifdef ERROR 
     32#  undef ERROR 
     33# endif 
     34#endif 
    2835 
    2936namespace Gobby 
  • code/dialogs/preferencesdialog.cpp

    rbd34be3 r6c2a697  
    268268 
    269269        m_lbl_path_host_directory.show(); 
    270         m_btn_path_host_directory.set_current_folder( 
     270        // Don't call this as long as we are not showing the dialog, to 
     271        // prevent spurious error messages when the folder does not exist. 
     272        /*m_btn_path_host_directory.set_current_folder( 
    271273                static_cast<const std::string&>( 
    272                         preferences.user.host_directory)); 
     274                        preferences.user.host_directory));*/ 
    273275        m_btn_path_host_directory.show(); 
    274276        connect_path_option(m_btn_path_host_directory, 
  • code/operations/operation-open.cpp

    r6fbb20f r6c2a697  
    206206        gsize outbytes = CONVERT_BUFFER_SIZE; 
    207207 
    208         const std::size_t result = m_iconv->iconv( 
     208        /* iconv is defined as libiconv on Windows, or at least when using the 
     209         * binary packages from ftp.gnome.org. Therefore we can't propely 
     210         * call Glib::IConv::iconv. Therefore, we use the C API here. */ 
     211        const std::size_t result = g_iconv(m_iconv->gobj(), 
    209212                &inbuf, &inbytes, &outbuf, &outbytes); 
    210213        bool more_to_process = (inbytes != 0); 
  • code/operations/operation-save.cpp

    r6fbb20f r6c2a697  
    203203        gchar* preserve_inbuf = inbuf; 
    204204 
    205         std::size_t retval = m_iconv.iconv(&inbuf, &inlen, &outbuf, &outlen); 
     205        /* iconv is defined as libiconv on Windows, or at least when using the 
     206         * binary packages from ftp.gnome.org. Therefore we can't propely 
     207         * call Glib::IConv::iconv. Therefore, we use the C API here. */ 
     208        std::size_t retval = g_iconv( 
     209                m_iconv.gobj(), &inbuf, &inlen, &outbuf, &outlen); 
    206210 
    207211        if(retval == static_cast<std::size_t>(-1)) 
  • code/util/resolv.cpp

    rbd34be3 r6c2a697  
    2222#include <glibmm/thread.h> 
    2323 
    24 #include <sys/types.h> 
    25 #include <sys/socket.h> 
    26 #include <netdb.h> 
     24#ifdef G_OS_WIN32 
     25/* This is required to be able to use getaddrinfo with MinGW 
     26 * I believe this means that we require Windows XP here. */ 
     27# define _WIN32_WINNT 0x0501 
     28# include <ws2tcpip.h> 
     29#else 
     30# include <sys/types.h> 
     31# include <sys/socket.h> 
     32# include <netdb.h> 
     33#endif 
    2734 
    2835struct Gobby::ResolvHandle 
     
    6471        { 
    6572                addrinfo hint; 
     73#ifdef AI_ADDRCONFIG 
    6674                hint.ai_flags = AI_ADDRCONFIG; 
     75#else 
     76                hint.ai_flags = 0; 
     77#endif 
    6778                hint.ai_family = AF_UNSPEC; 
    6879                hint.ai_socktype = SOCK_STREAM; 
    6980                hint.ai_protocol = 0; 
     81                hint.ai_addrlen = 0; 
     82                hint.ai_canonname = NULL; 
     83                hint.ai_addr = NULL; 
     84                hint.ai_next = NULL; 
    7085 
    7186                addrinfo* res = NULL; 
  • win32/gobby.rc

    rbcfd4df r6c2a697  
    1 A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "win32/gobby.ico" 
     1A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "gobby.ico"