washerdryer: Use pkg-config for GTK build flags.
[dockapps.git] / wmcalendar / Src / wmCalendar.h
blob0c15c3bce1b17fcfbe5283d87c6ddaecb5c38916
1 /*
3 * wmCalendar (c)2003 Matthias Laabs mattlaabs@users.sourceforge.net
5 * A Dockapp Calendar
9 * This code is based on:
10 * wmCalClock-1.25 (C) 1998, 1999 Mike Henderson (mghenderson@lanl.gov)
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2, or (at your option)
17 * any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program (see the file COPYING); if not, write to the
26 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
27 * Boston, MA 02110-1301 USA
34 /* defines */
35 #ifndef _WMCALENDAR_H_
36 #define _WMCALENDAR_H_
38 #define _GNU_SOURCE
40 #define COUNTER 2000
42 #define ARROW_OPEN 3
43 #define ARROW_CLOSE 4
44 #define MOON 6
45 #define CALENDAR 8
46 #define APPLAUNCH 0
47 #define SETTINGS 5
48 #define MAXBUTTON 14
50 #define BT_BACK 20
51 #define BT_FORWARD 21
52 #define BT_OPENCLOSE 22
53 #define BT_MOON 23
54 #define BT_SETTINGS 24
55 #define BT_CALTYPE 25
56 #define BT_APP 26
58 #define DBLCLKTIME 400
60 #define GREGORIAN 0
61 #define PERSIAN 1
62 #define ISLAMIC 2
63 #define CALTYPES 3
67 /* includes */
68 #include "settings.h"
69 #include "calendar.h"
70 #include "dockapp.h"
71 #include "calendarfunc.h"
72 #include "wmCalendar_master.xpm"
73 #include "wmCalendar_master2.xpm"
77 /* functions */
78 void ParseCMDLine(int argc, char *argv[]);
79 void buttonPress(int btype, int bx, int by, long etime);
80 void print_usage();
81 void initValues();
82 void getTime();
84 void draw();
85 void blankScreen();
86 void drawMonthYear();
87 void drawDays();
88 void drawButtons();
89 int drawButton(int type, int xoff, int yoff);
90 void drawNumber(int number, int yoff, int dayOfWeek, int type, int today);
92 int processXEvents();
96 /* definitions of images for months, numbers and icons */
97 int xsMonth[6][12] = {{ 3, 27, 52, 77, 102, 130, 162, 188, 216, 241, 266, 293 },//greg. engl.
98 { 2, 24, 49, 74, 89, 115, 140, 168, 197, 223, 250, 275 },//pers. engl.(not yet)
99 { 3, 32, 53, 89, 128, 162, 200, 220, 257, 287, 322, 361},//,isl. eng.
100 { 2, 47, 86, 126, 166, 187, 223, 255, 289, 338, 374, 416 },//greg. farsi.
101 { 2, 42, 84, 123, 149, 188, 227, 258, 286, 311, 336, 371 },//pers. fars.
102 { 3, 32, 53, 89, 128, 162, 200, 220, 257, 287, 322, 361}};//isl. arab.(not yet)
104 int xeMonth[6][12] = {{ 23, 48, 74, 98, 126, 150, 177, 211, 237, 262, 289, 315 },//greg. engl.
105 { 20, 44, 70, 85, 111, 135, 164, 193, 218, 245, 270, 289 },//pers. engl.(not yet)
106 { 27, 49, 84, 123, 157, 195, 217, 253, 282, 317, 357, 394},//,isl. eng.
107 { 34, 76, 117, 155, 178, 214, 247, 276, 325, 362, 406, 451 },//greg. fars.
108 { 34, 72, 114, 138, 179, 223, 248, 274, 300, 326, 361, 393 },//pers. farsi.
109 { 27, 49, 84, 123, 157, 195, 217, 253, 282, 317, 357, 394}};//isl. arab.(not yet)
112 int xdMonth[6][12];
113 int yMonth[6] = {17, 32, 45, 63, 79, 45};
114 int ydMonth = 11;
116 int xeNumbers[2][10] = {{119, 123, 127, 131, 135, 139, 143, 147, 151, 155 },
117 {69, 73, 77, 81, 85, 89, 93, 97, 101, 105}};
118 int xdNumbers = 5;
119 int yNumbers = 2;
120 int ydNumbers = 7;
121 int xsYear[2][10] = {{ 3, 14, 23, 33, 43, 53, 63, 73, 83, 93},
122 { 103, 114, 123, 133, 143, 153, 163, 173, 183, 193}};
123 int xeYear[2][10] = {{ 9, 17, 29, 39, 49, 59, 69, 79, 89, 99},
124 { 109, 117, 129, 139, 149, 159, 169, 179, 189, 199}};
125 int xdYear[2][10];
126 int yYear = 4;
127 int ydYear = 9;
129 int xsButton[14] = {129, 138, 147, 162, 167, 156, 165, 174, 129, 138, 147, 156};
130 int xeButton[14] = {136, 145, 154, 165, 170, 160, 172, 181, 136, 145, 154, 163};
131 int yButton[14] = {80, 80, 80, 80, 80, 80, 70, 70, 88, 88, 88, 88};
132 int xdButton[14];
133 int ydButton = 7;
134 int xsMoon[4] = {128, 137, 146, 155};
135 int yMoon = 70;
136 int xdMoon = 8;
137 int ydMoon = 7;
139 int monthOffset; /* difference to actual month */
140 struct icaltimetype t, told, tgr, today, mark;
143 Pixmap bg[2];
144 Pixmap pixmap, mask;
145 XEvent event;
149 int calendartype = 0; /* defines calendar type 0:greg 1:persian 2:islamic */
150 int showmoon = 0; /* sets whether moonphase is shown (1) or not (0) */
151 int showbuttons = 1; /* sets wheter buttons on the bottom are visible */
153 int appDoubleClick = 0;/* this should be changed to gtk doubleclick asap*/
154 long appClickTime = 0;
158 #endif