< prev index next >

modules/graphics/src/main/native-glass/gtk/glass_window.h

Print this page


   1 /*
   2  * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 350     int getEmbeddedX();
 351     int getEmbeddedY();
 352 
 353     void applyShapeMask(void*, uint width, uint height) {
 354         (void)width;
 355         (void)height;
 356     }
 357     GtkWindow *get_gtk_window(); // TODO, get window from parent
 358 
 359     WindowContextChild(jobject, void*, GtkWidget *parent_widget, WindowContextPlug *parent_context);
 360 private:
 361     WindowContextChild(WindowContextChild&);
 362     WindowContextChild& operator= (const WindowContextChild&);
 363 };
 364 
 365 class WindowContextTop: public WindowContextBase {
 366     jlong screen;
 367     WindowFrameType frame_type;
 368     struct WindowContext *owner;
 369     WindowGeometry geometry;
 370     int stale_config_notifications;
 371     struct _Resizable{// we can't use set/get gtk_window_resizable function
 372         _Resizable(): request(REQUEST_NONE), value(true), prev(false),
 373                 minw(-1), minh(-1), maxw(-1), maxh(-1){}
 374         request_type request; //request for future setResizable
 375         bool value; //actual value of resizable for a window
 376         bool prev; //former resizable value (used in setEnabled for parents of modal window)
 377         int minw, minh, maxw, maxh; //minimum and maximum window width/height;
 378     } resizable;
 379 
 380     bool frame_extents_initialized;
 381     bool map_received;
 382     bool location_assigned;
 383     bool size_assigned;
 384     bool on_top;
 385 public:
 386     WindowContextTop(jobject, WindowContext*, long, WindowFrameType, WindowType, GdkWMFunction);
 387     void process_map();
 388     void process_property_notify(GdkEventProperty*);
 389     void process_configure(GdkEventConfigure*);
 390     void process_destroy();


 410     void set_level(int);
 411     void set_visible(bool);
 412     void notify_on_top(bool);
 413 
 414     void enter_fullscreen();
 415     void exit_fullscreen();
 416 
 417     void set_owner(WindowContext*);
 418 
 419     GtkWindow *get_gtk_window();
 420     void detach_from_java();
 421 protected:
 422     void applyShapeMask(void*, uint width, uint height);
 423 private:
 424     bool get_frame_extents_property(int *, int *, int *, int *);
 425     void request_frame_extents();
 426     void activate_window();
 427     void initialize_frame_extents();
 428     void window_configure(XWindowChanges *, unsigned int);
 429     void update_window_constraints();
 430     void set_window_resizable(bool, bool);
 431     void update_ontop_tree(bool);
 432     bool on_top_inherited();
 433     bool effective_on_top();

 434     WindowContextTop(WindowContextTop&);
 435     WindowContextTop& operator= (const WindowContextTop&);
 436 };
 437 
 438 void destroy_and_delete_ctx(WindowContext* ctx);
 439 
 440 class EventsCounterHelper {
 441 private:
 442     WindowContext* ctx;
 443 public:
 444     explicit EventsCounterHelper(WindowContext* context) {
 445         ctx = context;
 446         ctx->increment_events_counter();
 447     }
 448     ~EventsCounterHelper() {
 449         ctx->decrement_events_counter();
 450         if (ctx->is_dead() && ctx->get_events_count() == 0) {
 451             delete ctx;
 452         }
 453         ctx = NULL;
   1 /*
   2  * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 350     int getEmbeddedX();
 351     int getEmbeddedY();
 352 
 353     void applyShapeMask(void*, uint width, uint height) {
 354         (void)width;
 355         (void)height;
 356     }
 357     GtkWindow *get_gtk_window(); // TODO, get window from parent
 358 
 359     WindowContextChild(jobject, void*, GtkWidget *parent_widget, WindowContextPlug *parent_context);
 360 private:
 361     WindowContextChild(WindowContextChild&);
 362     WindowContextChild& operator= (const WindowContextChild&);
 363 };
 364 
 365 class WindowContextTop: public WindowContextBase {
 366     jlong screen;
 367     WindowFrameType frame_type;
 368     struct WindowContext *owner;
 369     WindowGeometry geometry;

 370     struct _Resizable{// we can't use set/get gtk_window_resizable function
 371         _Resizable(): request(REQUEST_NONE), value(true), prev(false),
 372                 minw(-1), minh(-1), maxw(-1), maxh(-1){}
 373         request_type request; //request for future setResizable
 374         bool value; //actual value of resizable for a window
 375         bool prev; //former resizable value (used in setEnabled for parents of modal window)
 376         int minw, minh, maxw, maxh; //minimum and maximum window width/height;
 377     } resizable;
 378 
 379     bool frame_extents_initialized;
 380     bool map_received;
 381     bool location_assigned;
 382     bool size_assigned;
 383     bool on_top;
 384 public:
 385     WindowContextTop(jobject, WindowContext*, long, WindowFrameType, WindowType, GdkWMFunction);
 386     void process_map();
 387     void process_property_notify(GdkEventProperty*);
 388     void process_configure(GdkEventConfigure*);
 389     void process_destroy();


 409     void set_level(int);
 410     void set_visible(bool);
 411     void notify_on_top(bool);
 412 
 413     void enter_fullscreen();
 414     void exit_fullscreen();
 415 
 416     void set_owner(WindowContext*);
 417 
 418     GtkWindow *get_gtk_window();
 419     void detach_from_java();
 420 protected:
 421     void applyShapeMask(void*, uint width, uint height);
 422 private:
 423     bool get_frame_extents_property(int *, int *, int *, int *);
 424     void request_frame_extents();
 425     void activate_window();
 426     void initialize_frame_extents();
 427     void window_configure(XWindowChanges *, unsigned int);
 428     void update_window_constraints();
 429     void set_window_resizable(bool);
 430     void update_ontop_tree(bool);
 431     bool on_top_inherited();
 432     bool effective_on_top();
 433     void ensure_window_size();
 434     WindowContextTop(WindowContextTop&);
 435     WindowContextTop& operator= (const WindowContextTop&);
 436 };
 437 
 438 void destroy_and_delete_ctx(WindowContext* ctx);
 439 
 440 class EventsCounterHelper {
 441 private:
 442     WindowContext* ctx;
 443 public:
 444     explicit EventsCounterHelper(WindowContext* context) {
 445         ctx = context;
 446         ctx->increment_events_counter();
 447     }
 448     ~EventsCounterHelper() {
 449         ctx->decrement_events_counter();
 450         if (ctx->is_dead() && ctx->get_events_count() == 0) {
 451             delete ctx;
 452         }
 453         ctx = NULL;
< prev index next >