/[svn]/gigedit/trunk/src/gigedit/global.h
ViewVC logotype

Annotation of /gigedit/trunk/src/gigedit/global.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2967 - (hide annotations) (download) (as text)
Mon Jul 18 11:22:38 2016 UTC (7 years, 9 months ago) by schoenebeck
File MIME type: text/x-c++hdr
File size: 2078 byte(s)
* Added option to main menu for performing "Save" operation with a
  tempoary file (may perform faster than directly modifying existing
  .gig file).
* Bumped version (2.0.0.svn19).

1 schoenebeck 1396 /* -*- c++ -*-
2 schoenebeck 2692 * Copyright (C) 2007-2015 Andreas Persson
3 schoenebeck 1396 *
4     * This program is free software; you can redistribute it and/or
5     * modify it under the terms of the GNU General Public License as
6     * published by the Free Software Foundation; either version 2, or (at
7     * your option) any later version.
8     *
9     * This program is distributed in the hope that it will be useful, but
10     * WITHOUT ANY WARRANTY; without even the implied warranty of
11     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12     * General Public License for more details.
13     *
14     * You should have received a copy of the GNU General Public License
15     * along with program; see the file COPYING. If not, write to the Free
16     * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
17     * 02110-1301 USA.
18     */
19    
20     #ifndef GIGEDIT_GLOBAL_H
21     #define GIGEDIT_GLOBAL_H
22    
23     #if HAVE_CONFIG_H
24     # include <config.h>
25     #endif
26    
27 schoenebeck 2967 #if !defined(WIN32)
28     # include <unistd.h>
29     # include <errno.h>
30     #endif
31    
32 persson 2442 #include <sstream>
33    
34 schoenebeck 2474 //FIXME: for some reason AC GETTEXT check fails on the Mac cross compiler?
35     #if (HAVE_GETTEXT || defined(__APPLE__))
36 schoenebeck 1396 # include <libintl.h>
37     # define _(String) gettext(String)
38     #else
39     # define _(String) String
40     #endif
41    
42     #if defined(WIN32) && !HAVE_CONFIG_H
43     # include "../../win32/libgigedit_private.h" // like config.h, automatically generated by Dev-C++
44     # define PACKAGE "gigedit"
45     # define VERSION VER_STRING // VER_STRING defined in libgig_private.h
46     #endif // WIN32
47    
48 schoenebeck 2692 #define UNICODE_RIGHT_ARROW Glib::ustring(1, gunichar(0x2192))
49     #define UNICODE_LEFT_ARROW Glib::ustring(1, gunichar(0x2190))
50    
51 persson 2442 template<class T> inline std::string ToString(T o) {
52     std::stringstream ss;
53     ss << o;
54     return ss.str();
55     }
56    
57 schoenebeck 2548 /// Find the number of bits required to hold the specified amount of zones.
58     inline int zoneCountToBits(int nZones) {
59 schoenebeck 2604 if (!nZones) return 0;
60 schoenebeck 2548 int iFinalBits = 0;
61     int zoneBits = nZones - 1;
62     for (; zoneBits > 1; iFinalBits += 2, zoneBits >>= 2);
63     iFinalBits += zoneBits;
64     return iFinalBits;
65     }
66    
67 schoenebeck 1396 #endif // GIGEDIT_GLOBAL_H

  ViewVC Help
Powered by ViewVC