1. Changed license year
[apps/home/mobileprint.git] / mobileprint / previewgen / include / paper_size.h
1 /*
2 *  Mobileprint
3 *
4 * Copyright 2012  Samsung Electronics Co., Ltd
5
6 * Licensed under the Flora License, Version 1.1 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9
10 * http://floralicense.org/license/
11
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 */
19
20 #ifndef _PAPER_SIZE_H_INCLUDED_
21 #define _PAPER_SIZE_H_INCLUDED_
22
23 //#include <previewgen.h>
24
25 struct size_px {
26         int x;
27         int y;
28 };
29
30 struct size_pts {
31         double x;
32         double y;
33 };
34
35 struct paper_size_pts {
36         char *name;
37         struct size_pts s;
38 };
39
40 void switch_size_pts_coords(struct size_pts *s);
41 void switch_size_px_coords(struct size_px *s);
42 void add_size_pts(const struct size_pts *from, struct size_pts *to);
43 void neg_size_pts(struct size_pts *s);
44
45 int get_paper_size_pts(const char *name, struct paper_size_pts *s);
46 int pts_size2px(const struct size_pts *s_pts,
47                                 const struct size_px *border_s_px,
48                                 struct size_px *px);
49
50 #endif /* _PAPER_SIZE_H_INCLUDED_ */
51