~ubuntu-branches/ubuntu/precise/grass/precise

« back to all changes in this revision

Viewing changes to imagery/i.ortho.photo/photo.2target/title.c

  • Committer: Bazaar Package Importer
  • Author(s): Francesco Paolo Lovergine
  • Date: 2011-04-13 17:08:41 UTC
  • mfrom: (8.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20110413170841-ss1t9bic0d0uq0gz
Tags: 6.4.1-1
* New upstream version.
* Now build-dep on libjpeg-dev and current libreadline6-dev.
* Removed patch swig: obsolete.
* Policy bumped to 3.9.2, without changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include <grass/raster.h>
2
 
#include "globals.h"
3
 
#include "local_proto.h"
4
 
 
5
 
int display_title(View * view)
6
 
{
7
 
    View *title;
8
 
    char left[100], center[100];
9
 
    int size;
10
 
 
11
 
    *left = 0;
12
 
    *center = 0;
13
 
 
14
 
    if (view->cell.configured) {
15
 
        sprintf(center, "%s (mag %.1f)",
16
 
                view->cell.name, magnification(view));
17
 
    }
18
 
 
19
 
    if (view == VIEW_MAP1) {
20
 
        sprintf(left, "%s", G_location());
21
 
        title = VIEW_TITLE1;
22
 
    }
23
 
    else if (view == VIEW_MAP1_ZOOM) {
24
 
        title = VIEW_TITLE1_ZOOM;
25
 
    }
26
 
 
27
 
    if (view == VIEW_MAP2) {
28
 
        sprintf(left, "%s", G_location());
29
 
        title = VIEW_TITLE2;
30
 
    }
31
 
    else if (view == VIEW_MAP2_ZOOM) {
32
 
        title = VIEW_TITLE2_ZOOM;
33
 
    }
34
 
 
35
 
    Erase_view(title);
36
 
    R_standard_color(WHITE);
37
 
    size = title->nrows - 4;
38
 
    R_text_size(size, size);
39
 
    Text(left, title->top, title->bottom, title->left, title->right, 2);
40
 
    if (*center) {
41
 
        R_standard_color(YELLOW);
42
 
        Text(center, title->top, title->bottom,
43
 
             (title->left + title->right - Text_width(center)) / 2,
44
 
             title->right, 2);
45
 
    }
46
 
 
47
 
    return 0;
48
 
}