Go to the documentation of this file.
20 #include <gdk/gdkdrawable.h>
22 #include <cairo-xlib.h>
35 gdk_cairo_create (GdkDrawable *target)
40 cairo_surface_t *surface;
41 GdkDrawable *drawable = target;
44 if (GDK_IS_WINDOW(target)) {
46 GdkWindow *window = GDK_WINDOW(target);
47 gdk_window_get_internal_paint_info (window,
48 &drawable, &x_off, &y_off);
50 visual = gdk_drawable_get_visual (drawable);
54 surface = cairo_xlib_surface_create (GDK_DRAWABLE_XDISPLAY (drawable),
55 GDK_DRAWABLE_XID (drawable),
56 GDK_VISUAL_XVISUAL (visual),
58 }
else if (gdk_drawable_get_depth (drawable) == 1) {
59 surface = cairo_xlib_surface_create_for_bitmap
60 (GDK_PIXMAP_XDISPLAY (drawable),
61 GDK_PIXMAP_XID (drawable),
62 GDK_SCREEN_XSCREEN (gdk_drawable_get_screen (drawable)),
65 g_warning (
"Using Cairo rendering requires the drawable argument to\n"
66 "have a specified colormap. All windows have a colormap,\n"
67 "however, pixmaps only have colormap by default if they\n"
68 "were created with a non-NULL window argument. Otherwise\n"
69 "a colormap must be set on them with "
70 "gdk_drawable_set_colormap");
73 cairo_surface_set_device_offset (surface, -x_off, -y_off);
74 cr = cairo_create (surface);
75 cairo_surface_destroy (surface);
int verbosityLevel() const
Definition: rc.h:112
gnash_cursor_type
Enumerates mouse cursor types.
Definition: gui.h:81
@ GNASH_MOD_CONTROL
Definition: GnashKey.h:37
bool useActionDump() const
Definition: rc.h:74
std::shared_ptr< gnash::Renderer > gnash_canvas_get_renderer(GnashCanvas *canvas)
Get the Renderer for this canvas.
Definition: gtk_canvas.cpp:323
@ DOWN
Definition: GnashKey.h:207
std::shared_ptr< Renderer > _renderer
The handler which is called to update the client area of our window.
Definition: gui.h:506
void createHelpMenu(GtkWidget *obj)
Definition: gtk.cpp:1996
@ BACKSPACE
Definition: GnashKey.h:53
@ CURSOR_INPUT
Definition: gui.h:84
virtual ~GtkGui()
Definition: gtk.cpp:131
@ height
Definition: klash_part.cpp:329
void setInvalidatedRegions(const InvalidatedRanges &ranges)
Definition: gtk.cpp:883
virtual bool init(int argc, char **argv[])
GUI interface implementation.
Definition: gtk.cpp:153
virtual void quitUI()
End main rendering loop calling GUI-specific exit functions.
Definition: gtk.cpp:591
virtual void unsetFullscreen()
Definition: gtk.cpp:357
@ QUALITY_BEST
Definition: GnashEnums.h:39
bool updateFile(const std::string &filespec)
Writes a valid gnashrc file. If the file already exists, is is overwritten.
Definition: rc.cpp:730
virtual bool showMouse(bool show)
Sets whether the gui should show the system mouse pointer.
Definition: gtk.cpp:427
std::string & getHWAccelBackend()
Definition: RunResources.h:141
GtkWidget * versionText
Definition: gtk.cpp:969
void setStreamsTimeout(const double &x)
Set seconds of inactivity before timing out streams downloads.
Definition: rc.h:232
void log_debug(StringType msg, Args... args)
Definition: log.h:301
void setFlashSystemOS(const std::string &value)
Definition: rc.h:208
std::int32_t y
Definition: BitmapData_as.cpp:435
@ i
Definition: GnashKey.h:155
void setSOLReadOnly(bool x)
Definition: rc.h:279
@ stop
Definition: klash_part.cpp:330
virtual bool createMenu()
Definition: gtk.cpp:665
std::string & getRenderBackend()
Definition: RunResources.h:136
virtual double getScreenDPI() const
Definition: gtk.cpp:517
void setLocalConnection(bool x)
Definition: rc.h:283
#define _(String)
Definition: log.h:44
GtkWidget * streamsTimeoutScale
Definition: gtk.cpp:960
modifier
Definition: GnashKey.h:34
virtual void renderBuffer()
Definition: gtk.cpp:877
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
Parent class from which all GUI implementations will depend.
Definition: gui.h:88
@ DELETEKEY
Definition: GnashKey.h:177
@ CONTROL
Definition: GnashKey.h:62
@ CAPSLOCK
Definition: GnashKey.h:65
virtual void showMenu(bool show)
Sets whether the menus should be shown (for fscommand)
Definition: gtk.cpp:471
@ F1
Definition: GnashKey.h:190
virtual std::pair< int, int > screenResolution() const
Definition: gtk.cpp:511
void setMovieLibraryLimit(int value)
Definition: rc.h:96
@ m
Definition: GnashKey.h:159
bool popupMessages() const
Definition: rc.h:132
@ GNASH_MOD_NONE
Definition: GnashKey.h:35
GtkWidget * urlOpenerText
Definition: gtk.cpp:970
@ n
Definition: GnashKey.h:160
@ QUALITY_MEDIUM
Definition: GnashEnums.h:37
void setScriptsRecursionLimit(int x)
Definition: rc.h:355
bool createMenuBar()
Create a menu bar for the application, attach to our window.
Definition: gtk.cpp:649
T getMinX() const
Get min X ordinate.
Definition: Range2d.h:603
bool showMalformedSWFErrors() const
Definition: rc.h:89
GtkWidget * solSandbox
Definition: gtk.cpp:967
GtkWidget * lockScriptLimitsToggle
Definition: gtk.cpp:978
virtual void resizeWindow(int width, int height)
Definition: gtk.cpp:733
@ KP_0
Definition: GnashKey.h:179
void log_error(StringType msg, Args... args)
Definition: log.h:283
bool isNull() const
Returns true if this is the NULL Range2d.
Definition: Range2d.h:181
@ PGUP
Definition: GnashKey.h:213
RunResources & _runResources
Per-run resources.
Definition: gui.h:500
void setRenderer(std::shared_ptr< Renderer > r)
Definition: RunResources.h:108
@ LEFT
Definition: GnashKey.h:209
void saveLoadedMedia(bool value)
Definition: rc.h:302
bool _fullscreen
Definition: gui.h:513
@ RIGHT
Definition: GnashKey.h:208
virtual bool createMenuAlt()
Definition: gtk.cpp:707
void grabFocus()
Grab focus so to receive all key events.
Definition: gtk.cpp:585
Range2d< T > Intersection(const Range2d< T > &r1, const Range2d< T > &r2)
Return a rectangle being the intersetion of the two rectangles.
Definition: Range2d.h:762
const VGfloat color[4]
Definition: testr_gtk.cpp:82
bool isFinite() const
Returns true if this is a finite Range2d.
Definition: Range2d.h:210
GtkWidget * librarySize
Definition: gtk.cpp:971
@ r
Definition: GnashKey.h:164
bool useLocalDomain() const
Definition: rc.h:135
GtkWidget * localDomainToggle
Definition: gtk.cpp:961
virtual void setCursor(gnash_cursor_type newcursor)
Sets the current mouse cursor for the Gui window.
Definition: gtk.cpp:392
@ GNASH_MOD_SHIFT
Definition: GnashKey.h:36
GtkGui(unsigned long xid, float scale, bool loop, RunResources &r)
Definition: gtk.cpp:135
GtkWidget * startStoppedToggle
Definition: gtk.cpp:972
#define BRANCH_NICK
Definition: revno.h:2
#define COMMIT_ID
Definition: revno.h:3
@ INSERT
Definition: GnashKey.h:210
@ ALT
Definition: GnashKey.h:63
@ PGDN
Definition: GnashKey.h:214
@ END
Definition: GnashKey.h:212
GtkWidget * solLocalDomainToggle
Definition: gtk.cpp:964
code
Definition: GnashKey.h:44
T getMinY() const
Get min Y ordinate.
Definition: Range2d.h:623
@ ENTER
Definition: GnashKey.h:58
virtual void hideMenu()
Definition: gtk.cpp:381
@ play
Definition: klash_part.cpp:330
bool useSound() const
Definition: rc.h:124
int _width
Desired window width.
Definition: gui.h:494
T width() const
Return width this Range2d.
Definition: Range2d.h:374
@ TAB
Definition: GnashKey.h:54
static bool advance_movie(Gui *gui)
Convenience static wrapper around advanceMovie for callbacks happiness.
Definition: gui.h:272
@ CLEAR
Definition: GnashKey.h:57
@ INVALID
Definition: GnashKey.h:45
bool showMouse() const
Definition: rc.h:164
@ p
Definition: GnashKey.h:162
@ SHIFT
Definition: GnashKey.h:61
GtkWidget * insecureSSLToggle
Definition: gtk.cpp:966
bool useLocalHost() const
Whether to restrict access to the local host
Definition: rc.h:139
void saveStreamingMedia(bool value)
Definition: rc.h:298
@ UP
Definition: GnashKey.h:206
GtkWidget * scriptsRecursionLimit
Definition: gtk.cpp:977
@ HOME
Definition: GnashKey.h:211
virtual void error(const std::string &msg)
Handle error message from the core.
Definition: gtk.cpp:275
virtual bool createWindow(int width, int height)
Definition: gtk.cpp:857
void lockScriptLimits(bool x)
Definition: rc.h:357
Class to group together per-run and external resources for Gnash.
Definition: RunResources.h:54
bool useParserDump() const
Definition: rc.h:77
bool _mouseShown
Definition: gui.h:516
void createControlMenu(GtkWidget *obj)
Definition: gtk.cpp:2106
size_type size() const
Returns the number of ranges in the list.
Definition: snappingrange.h:320
void gnash_canvas_setup(GnashCanvas *canvas, std::string &hwaccel, std::string &renderer, int argc, char **argv[])
Select renderer and hwaccel, prep canvas for drawing.
Definition: gtk_canvas.cpp:200
void quit()
Always called on exit.
Definition: gui.cpp:215
@ CURSOR_HAND
Definition: gui.h:82
virtual void setClipboard(const std::string ©)
Definition: gtk.cpp:306
GtkWidget * gnash_canvas_new()
allocate memory for canvas to draw in
Definition: gtk_canvas.cpp:80
void createEditMenu(GtkWidget *obj)
Definition: gtk.cpp:1975
@ QUALITY_HIGH
Definition: GnashEnums.h:38
virtual bool run()
Start main rendering loop.
Definition: gtk.cpp:254
GtkWidget * localConnectionToggle
Definition: gtk.cpp:965
void gnash_canvas_before_rendering(GnashCanvas *canvas, gnash::movie_root *stage)
Definition: gtk_canvas.cpp:317
void setSOLSafeDir(const std::string &x)
Definition: rc.h:271
GtkWidget * logfileName
Definition: gtk.cpp:957
void createFileMenu(GtkWidget *obj)
Definition: gtk.cpp:1923
@ ESCAPE
Definition: GnashKey.h:72
bool isStopped() const
See stop(), play() and pause()
Definition: gui.h:343
static RcInitFile & getDefaultInstance()
Return the default instance of RC file.
Definition: rc.cpp:61
#define SPACE
Definition: aos4_gnash_prefs.cpp:29
GtkWidget * ASCodingErrorToggle
Definition: gtk.cpp:956
T height() const
Return height this Range2dangle.
Definition: Range2d.h:385
movie_root * getStage()
The root movie, or "Stage".
Definition: gui.h:407
virtual void beforeRendering()
Definition: gtk.cpp:871
unsigned long _xid
The X Window ID to attach to. If zero, we create a new window.
Definition: gui.h:486
@ c
Definition: GnashKey.h:149
GtkWidget * localHostToggle
Definition: gtk.cpp:962
void createViewMenu(GtkWidget *obj)
Definition: gtk.cpp:2015
@ QUALITY_LOW
Definition: GnashEnums.h:36
void setScriptsTimeout(int x)
Definition: rc.h:351
#define VERSION
Definition: gnashconfig.h:731
GtkWidget * writeLogToggle
Definition: gtk.cpp:958
Range2d< T > & setTo(T x, T y)
Set ourself to bound the given point.
Definition: Range2d.h:339
unsigned int _interval
Main loop interval: the time between successive advance_movie calls.
Definition: gui.h:503
void ignoreShowMenu(bool value)
Definition: rc.h:345
geometry::Range2d< int > _validbounds
Definition: gui.h:491
virtual void setInterval(unsigned int interval)
Set main loop delay in milliseconds.
Definition: gtk.cpp:630
bool startStopped() const
Return true if user is willing to start the gui in "stop" mode.
Definition: rc.h:103
@ GNASH_MOD_ALT
Definition: GnashKey.h:38
@ NOBREAKSPACE
Definition: GnashKey.h:227
GtkWidget * saveLoadedMediaToggle
Definition: gtk.cpp:975
GtkWidget * solReadOnlyToggle
Definition: gtk.cpp:963
bool insecureSSL() const
Definition: rc.h:106
void setURLOpenerFormat(const std::string &value)
Definition: rc.h:244
void setDebugLog(const std::string &x)
Definition: rc.h:115
bool checkX11Extension(const std::string &ext)
Definition: gtk.cpp:2193
void setFlashVersionString(const std::string &value)
Definition: rc.h:200
const RangeType & getRange(size_type index) const
Returns the range at the specified index.
Definition: snappingrange.h:326
GtkWidget * actionDumpToggle
Definition: gtk.cpp:953
GtkWidget * mediaDir
Definition: gtk.cpp:973
@ width
Definition: klash_part.cpp:329
GtkWidget * saveStreamingMediaToggle
Definition: gtk.cpp:974
@ HELP
Definition: GnashKey.h:325
bool useWriteLog() const
Definition: rc.h:80
std::int32_t x
Definition: BitmapData_as.cpp:434
GtkWidget * verbosityScale
Definition: gtk.cpp:959
bool showASCodingErrors() const
Definition: rc.h:86
virtual void setTimeout(unsigned int timeout)
Set the time in milliseconds after which the programme should exit.
Definition: gtk.cpp:268
virtual double getPixelAspectRatio() const
For System.capabilities information.
Definition: gtk.cpp:495
SimpleBuffer data
Definition: LocalConnection_as.cpp:151
@ e
Definition: GnashKey.h:151
void setMediaDir(const std::string &value)
Definition: rc.h:306
int _height
Desired window height.
Definition: gui.h:497
#define BRANCH_REVNO
Definition: revno.h:1
GtkWidget * parserDumpToggle
Definition: gtk.cpp:954
virtual bool setupEvents()
Set up callbacks for key, mouse and other GTK events.
Definition: gtk.cpp:541
GtkWidget * osText
Definition: gtk.cpp:968
virtual void setFullscreen()
Definition: gtk.cpp:314
GtkWidget * malformedSWFToggle
Definition: gtk.cpp:955
void setSOLLocalDomain(bool x)
Definition: rc.h:275
GtkWidget * scriptsTimeout
Definition: gtk.cpp:976
GtkWidget * soundToggle
Definition: gtk.cpp:952
@ NUM_LOCK
Definition: GnashKey.h:223
#define GNASH_CANVAS(object)
Definition: gtk_canvas.h:39