controllers

package
v0.0.0-...-c6fc0ca Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2014 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const GENERATED_DIR = "generated/"

Location where all generated images will be saved

Variables

This section is empty.

Functions

This section is empty.

Types

type Backgrounds

type Backgrounds struct {
	// contains filtered or unexported fields
}

Backgrounds contains a list of all potential background images

func (Backgrounds) GetActive

func (b Backgrounds) GetActive(image int) string

Get the active background(which one is the main image)

func (Backgrounds) GetImageList

func (b Backgrounds) GetImageList() []int

Get a list of all backgrounds

func (Backgrounds) GetImageMap

func (b Backgrounds) GetImageMap() map[int]string

Get a mapping of all backgrounds

type Device

type Device struct {
	Resolution Resolution `xml:"resolution"`
	Placement  Placement  `xml:"placement"`
}

A device screenshot representation, how big it is and where it should go

type Dimensions

type Dimensions struct {
	// contains filtered or unexported fields
}

The dimensions of a screenshot to be placed

type JPGImage

type JPGImage []byte

type representing image as can be returned to user in browser

func (JPGImage) Apply

func (r JPGImage) Apply(req *revel.Request, resp *revel.Response)

Set HTTP header types for returning image(not html page)

type Placement

type Placement struct {
	Top_left_x     string `xml:"top_left_x"`
	Top_left_y     string `xml:"top_left_y"`
	Top_right_x    string `xml:"top_right_x"`
	Top_right_y    string `xml:"top_right_y"`
	Bottom_left_x  string `xml:"bottom_left_x"`
	Bottom_left_y  string `xml:"bottom_left_y"`
	Bottom_right_x string `xml:"bottom_right_x"`
	Bottom_right_y string `xml:"bottom_right_y"`
}

The placement of a screenshot image onto a background image

type Resolution

type Resolution struct {
	Width  string `xml:"width"`
	Height string `xml:"height"`
}

The resolution of a background image

type Result

type Result struct {
	XMLName  xml.Name `xml:"background"`
	Location string   `xml:"location"`
	Device   Device   `xml:"device"`
}

The overall resukting image information. The background image and all of the information for the screenshot image to be placed

type Snappshot

type Snappshot struct {
	*revel.Controller
}

Snappshot Controller

func (Snappshot) FAQ

func (c Snappshot) FAQ() revel.Result

Show FAQs page

func (Snappshot) Image

func (c Snappshot) Image(image_id string) revel.Result

For returning the image itself, read saved image from generated path

func (Snappshot) Index

func (c Snappshot) Index() revel.Result

Main page - show first background image

func (Snappshot) Screenshot

func (c Snappshot) Screenshot(res string) revel.Result

func (Snappshot) Upload

func (c Snappshot) Upload(image_id int) revel.Result

Basic page showing a background and gives user option to upload screenshot

func (Snappshot) Uploaded

func (c Snappshot) Uploaded(image_id int, file_input []byte) revel.Result

User has uploaded screenshot - place onto background image

func (Snappshot) UploadedGet

func (c Snappshot) UploadedGet(image_id int) revel.Result

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL