1 /*
2 * Copyright (c) 1996, 2013, 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
883 };
884
885 // DC management objects; these classes are used to track the list of
886 // DC's associated with a given Component. Then DC's can be released
887 // appropriately on demand or on window destruction to avoid resource
888 // leakage.
889 class DCItem {
890 public:
891 HDC hDC;
892 HWND hWnd;
893 DCItem *next;
894 };
895 class DCList {
896 DCItem *head;
897 CriticalSection listLock;
898 public:
899 DCList() { head = NULL; }
900
901 void AddDC(HDC hDC, HWND hWnd);
902 void AddDCItem(DCItem *newItem);
903 DCItem *RemoveDC(HDC hDC);
904 DCItem *RemoveAllDCs(HWND hWnd);
905 void RealizePalettes(int screen);
906 };
907
908 void ReleaseDCList(HWND hwnd, DCList &list);
909 void MoveDCToPassiveList(HDC hDC);
910
911 #include "ObjectList.h"
912
913 #endif /* AWT_COMPONENT_H */
|
1 /*
2 * Copyright (c) 1996, 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
883 };
884
885 // DC management objects; these classes are used to track the list of
886 // DC's associated with a given Component. Then DC's can be released
887 // appropriately on demand or on window destruction to avoid resource
888 // leakage.
889 class DCItem {
890 public:
891 HDC hDC;
892 HWND hWnd;
893 DCItem *next;
894 };
895 class DCList {
896 DCItem *head;
897 CriticalSection listLock;
898 public:
899 DCList() { head = NULL; }
900
901 void AddDC(HDC hDC, HWND hWnd);
902 void AddDCItem(DCItem *newItem);
903 DCItem *RemoveDC(HDC hDC, HWND hWnd);
904 DCItem *RemoveAllDCs(HWND hWnd);
905 void RealizePalettes(int screen);
906 };
907
908 void ReleaseDCList(HWND hwnd, DCList &list);
909 void MoveDCToPassiveList(HDC hDC, HWND hWnd);
910
911 #include "ObjectList.h"
912
913 #endif /* AWT_COMPONENT_H */
|