/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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 General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* This class implements window which serves as content window for decorated frames.
* Its purpose to provide correct events dispatching for the complex
* constructs such as decorated frames.
*
* It should always be located at (- left inset, - top inset) in the associated
* decorated window. So coordinates in it would be the same as java coordinates.
*/
private static PlatformLogger insLog = PlatformLogger.getLogger("sun.awt.X11.insets.XContentWindow");
// Fix for - set the location of the content window to the (-left inset, -top inset)
} else {
rec.x = 0;
rec.y = 0;
}
cw.xSetVisible(true);
return cw;
}
// A list of expose events that come when the parentFrame is iconified
this.parentFrame = parentFrame;
}
}
}
return "Content window";
}
switch (e.get_type()) {
// Override parentFrame to receive MouseEnter/Exit
case XConstants.EnterNotify:
case XConstants.LeaveNotify:
return false;
// We handle ConfigureNotify specifically in XDecoratedPeer
case XConstants.ConfigureNotify:
return true;
case XConstants.MapNotify:
case XConstants.UnmapNotify:
return true;
default:
}
}
// Coordinates are that of the shell
try {
// Bounds of content window are of the same size as bounds of Java window and with
// location as -(insets)
}
if (insLog.isLoggable(PlatformLogger.FINE)) insLog.fine("Setting content bounds {0}, old bounds {1}",
// Fix for 5023533:
// Change in the size of the content window means, well, change of the size
// Change in the location of the content window means change in insets
if (needHandleResize) {
}
} finally {
}
}
// NOTE: This method may be called by privileged threads.
// DO NOT INVOKE CLIENT CODE ON THIS THREAD!
}
// TODO: ?
// get rid of 'istanceof' by subclassing:
// XContentWindow -> XFrameContentWindow
// Expose event(s) that result from deiconification
// come before a deicinofication notification.
// We reorder these events by saving all expose events
// that come when the frame is iconified. Then we
// actually handle saved expose events on deiconification.
if (parentFrame instanceof XFramePeer &&
// Save expose events if the frame is iconified
// in order to handle them on deiconification.
} else {
// Normal case: [it is not a frame or] the frame is not iconified.
super.handleExposeEvent(target, x, y, w, h);
}
}
void purgeIconifiedExposeEvents() {
}
}
private static class SavedExposeEvent {
int x, y, w, h;
this.x = x;
this.y = y;
this.w = w;
this.h = h;
}
}
}
}