< prev index next >
modules/graphics/src/main/native-glass/gtk/GlassRobot.cpp
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 31,41 ****
#include <gdk/gdkx.h>
#include <com_sun_glass_ui_gtk_GtkRobot.h>
#include <com_sun_glass_events_MouseEvent.h>
#include "glass_general.h"
- #include "glass_gtkcompat.h"
#include "glass_key.h"
static void checkXTest(JNIEnv* env) {
int32_t major_opcode, first_event, first_error;
--- 31,40 ----
*** 245,256 ****
(void)obj;
GdkPixbuf *screenshot, *tmp;
GdkWindow *root_window = gdk_get_default_root_window();
! tmp = gdk_pixbuf_get_from_drawable (NULL, root_window, NULL,
! x, y, 0, 0, width, height);
screenshot = gdk_pixbuf_add_alpha(tmp, FALSE, 0, 0, 0);
g_object_unref(tmp);
jint *pixels = (jint *)convert_BGRA_to_RGBA((int*)gdk_pixbuf_get_pixels(screenshot), width * 4, height);
env->SetIntArrayRegion(data, 0, height * width, pixels);
--- 244,254 ----
(void)obj;
GdkPixbuf *screenshot, *tmp;
GdkWindow *root_window = gdk_get_default_root_window();
! tmp = glass_pixbuf_from_window(root_window, x, y, width, height);
screenshot = gdk_pixbuf_add_alpha(tmp, FALSE, 0, 0, 0);
g_object_unref(tmp);
jint *pixels = (jint *)convert_BGRA_to_RGBA((int*)gdk_pixbuf_get_pixels(screenshot), width * 4, height);
env->SetIntArrayRegion(data, 0, height * width, pixels);
< prev index next >