FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
processing4/core/src/processing/core/PSurface.java at main · processing/processing4 · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
processing
/
processing4
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
177
Star
474
Code
Issues
256
Pull requests
26
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
processing4
/
core
/
src
/
processing
/
core
/
PSurface.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
189 lines (134 loc) · 5.85 KB
Breadcrumbs
processing4
/
core
/
src
/
processing
/
core
/
PSurface.java
Copy path
File metadata and controls
189 lines (134 loc) · 5.85 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
Part of the Processing project - http://processing.org
Copyright (c) 2014-22 The Processing Foundation
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation, version 2.1.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General
Public License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
*/
package
processing
.
core
;
import
java
.
io
.
File
;
public
interface
PSurface
{
/**
* Minimum dimensions for the window holding a sketch. This varies between
* platforms, Mac OS X 10.3 (confirmed with 10.7 and Java 6) can do any
* height but requires at least 128 pixels width. Windows XP has another
* set of limitations. And for all I know, Linux probably allows window
* sizes to be negative numbers.
*/
static
public
final
int
MIN_WINDOW_WIDTH
=
128
;
static
public
final
int
MIN_WINDOW_HEIGHT
=
128
;
//public int displayDensity();
//public int displayDensity(int display);
//
// renderer that doesn't draw to the screen
public
void
initOffscreen
(
PApplet
sketch
);
// considering removal in favor of separate Component classes for appropriate renderers
// (i.e. for Java2D or a generic Image surface, but not PDF, debatable for GL or FX)
//public Component initComponent(PApplet sketch);
//public Frame initFrame(PApplet sketch, Color backgroundColor,
// public void initFrame(PApplet sketch, int backgroundColor,
// int deviceIndex, boolean fullScreen, boolean spanDisplays);
public
void
initFrame
(
PApplet
sketch
);
//
/**
* Get the native window object associated with this drawing surface.
* For Java2D, this will be an AWT Frame object. For OpenGL, the window.
* The data returned here is subject to the whims of the renderer,
* and using this method means you're willing to deal with underlying
* implementation changes and that you won't throw a fit like a toddler
* if your code breaks sometime in the future.
*/
public
Object
getNative
();
//
// Just call these on an AWT Frame object stored in PApplet.
// Silly, but prevents a lot of rewrite and extra methods for little benefit.
// However, maybe prevents us from having to document the 'frame' variable?
/** Set the window (and dock, or whatever necessary) title. */
public
void
setTitle
(
String
title
);
/** Show or hide the window. */
public
void
setVisible
(
boolean
visible
);
/** Set true if we want to resize things (default is not resizable) */
public
void
setResizable
(
boolean
resizable
);
/** Dumb name, but inherited from Frame and no better ideas. */
public
void
setAlwaysOnTop
(
boolean
always
);
public
void
setIcon
(
PImage
icon
);
//
// public void placeWindow(int[] location);
public
void
placeWindow
(
int
[]
location
,
int
[]
editorLocation
);
//public void placeFullScreen(boolean hideStop);
public
void
placePresent
(
int
stopColor
);
// Sketch is running from the PDE, set up messaging back to the PDE
//public void setupExternalMessages();
//
// sets displayWidth/Height inside PApplet
//public void checkDisplaySize();
public
void
setLocation
(
int
x
,
int
y
);
public
void
setSize
(
int
width
,
int
height
);
// /**
// * Called by {@link PApplet#createGraphics} to initialize the
// * {@link PGraphics#image} object with an image that's compatible with this
// * drawing surface/display/hardware.
// * @param gr PGraphics object whose image will be set
// * @param wide
// * @param high
// */
// create pixel buffer (pulled out for offscreen graphics)
//public void initImage(PGraphics gr, int wide, int high);
// create pixel buffer, called from allocate() to produce a compatible image for rendering efficiently
// public void initImage(PGraphics gr);
//public Component getComponent();
// /**
// * Sometimes smoothing must be set at the drawing surface level
// * not just inside the renderer itself.
// */
// public void setSmooth(int level);
public
void
setFrameRate
(
float
fps
);
// // called on the first frame so that the now-visible drawing surface can
// // receive key and mouse events
// public void requestFocus();
// // finish rendering to the screen (called by PApplet)
// public void blit();
//
public
void
setCursor
(
int
kind
);
public
void
setCursor
(
PImage
image
,
int
hotspotX
,
int
hotspotY
);
public
void
showCursor
();
public
void
hideCursor
();
//
public
PImage
loadImage
(
String
path
,
Object
...
args
);
/**
* @param url the link to open
* @return false if unable to find a viable way to open
*/
public
boolean
openLink
(
String
url
);
public
void
selectInput
(
String
prompt
,
String
callback
,
File
file
,
Object
callbackObject
);
public
void
selectOutput
(
String
prompt
,
String
callback
,
File
file
,
Object
callbackObject
);
public
void
selectFolder
(
String
prompt
,
String
callback
,
File
file
,
Object
callbackObject
);
//
/** Start the animation thread */
public
void
startThread
();
/**
* On the next trip through the animation thread, things should go sleepy-bye.
* Does not pause the thread immediately because that needs to happen on the
* animation thread itself, so fires on the next trip through draw().
*/
public
void
pauseThread
();
public
void
resumeThread
();
/**
* Stop the animation thread (set it null)
* @return false if already stopped
*/
public
boolean
stopThread
();
public
boolean
isStopped
();
}
Back
|
FazBrowse Home
|
New Git URL