/*************************************************************************** * main.h * * Fri Sep 24 02:59:44 2004 * Copyright 2004 imcintosh * ian_mcintosh@linuxadvocate.org ****************************************************************************/ /* * 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 Library 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _MAIN_H_ #define _MAIN_H_ #define PROGRAM_NAME "gRuler" #define PROGRAM_COPYRIGHT "Copyright (c) 2004 Ian McIntosh" #define PROGRAM_DESCRIPTION "A customizable screen ruler." #define RESIZE_FRAME_WIDTH (10) // not currently used #define BUMP_SMALL (1) // in pixels. how far to move window when keys are pressed #define BUMP_LARGE (10) // in pixels. " " when shift is used #define FONT_PICKER_PREVIEW_TEXT "0123456789" // not currently used but would make sense // These colors are used the first time the program is run (if changed, we'll get changed ones from gconf) #define DEFAULT_FOREGROUND_COLOR {0, 2000, 2000, 0} // zero,R,G,B #define DEFAULT_BACKGROUND_COLOR {0, 65535, 65535, 0} // zero,R,G,B // Same as colors (above) #define DEFAULT_RULER_LENGTH 600 #define DEFAULT_KEEP_ABOVE (TRUE) #define MOUSE_UPDATE_INTERVAL_MS 40 // 20 // how often to poll the mouse position #define GDK_ALT_MASK (GDK_MOD1_MASK) // this just makes the code more clear typedef enum { RulerOrientationHorizontal = 1, RulerOrientationVertical = 2 } RulerOrientation; #define TOGGLE_RULER_ORIENTATION(x) (((x) == RulerOrientationHorizontal) ? RulerOrientationVertical : RulerOrientationHorizontal) typedef enum { RulerMetricPixels = 0, // these constants should = indexes of items in metric combobox in preferences dialog RulerMetricCentimeters = 1, RulerMetricInches = 2, RulerMetricPicas = 3, RulerMetricPoints = 4, RulerMetricPercentage = 5 } ERulerMetric; #define PICAS_PER_INCH (6) #define POINTS_PER_PICA (12) // #define DEFAULT_RULER_METRIC (RulerMetricPixels) first one (value 0) is default #define min(a,b) ((a) < (b) ? (a) : (b)) #define max(a,b) ((a) > (b) ? (a) : (b)) // Ruler window keys (arbitrary names...) #define KEY_RULER_ORIENTATION ("ro") #define KEY_PIXMAP_POINTER ("pixmap") #define CM_PER_INCH (2.54) #define MM_PER_INCH (25.4) #define DEFAULT_DPI (96) #endif