| 1 |
/************************************************************************* |
| 2 |
* Copyright (c) 2011 AT&T Intellectual Property |
| 3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
| 6 |
* https://www.eclipse.org/legal/epl-v10.html |
| 7 |
* |
| 8 |
* Contributors: Details at https://graphviz.org |
| 9 |
*************************************************************************/ |
| 10 |
|
| 11 |
#include "config.h" |
| 12 |
|
| 13 |
#include "viewportcamera.h" |
| 14 |
#include "gui/gui.h" |
| 15 |
#include <math.h> |
| 16 |
#include <glcomp/glcompbutton.h> |
| 17 |
#include <glcomp/glcomplabel.h> |
| 18 |
#include <glcomp/glcomppanel.h> |
| 19 |
#include <util/alloc.h> |
| 20 |
|
| 21 |
static viewport_camera *new_viewport_camera(void) { |
| 22 |
return gv_alloc(sizeof(viewport_camera)); |
| 23 |
} |
| 24 |
|
| 25 |
static viewport_camera *add_camera_to_viewport(ViewInfo *vi) { |
| 26 |
vi->cameras = gv_recalloc(vi->cameras, vi->camera_count, |
| 27 |
vi->camera_count + 1, |
| 28 |
sizeof(viewport_camera*)); |
| 29 |
vi->camera_count++; |
| 30 |
vi->cameras[vi->camera_count - 1] = new_viewport_camera(); |
| 31 |
vi->active_camera = vi->camera_count - 1; |
| 32 |
return vi->cameras[vi->camera_count - 1]; |
| 33 |
} |
| 34 |
|
| 35 |
void menu_click_add_camera(void) |
| 36 |
{ |
| 37 |
viewport_camera *c; |
| 38 |
/*add test cameras */ |
| 39 |
c = add_camera_to_viewport(view); |
| 40 |
c->targetx = view->panx; |
| 41 |
c->targety = view->pany; |
| 42 |
|
| 43 |
c->r = view->zoom * -1; |
| 44 |
} |