1 /********************************************************************************
2 * *
3 * M a i n W i n d o w O b j e c t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1998,2020 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as published by *
10 * the Free Software Foundation; either version 3 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/> *
20 ********************************************************************************/
21 #include "xincs.h"
22 #include "fxver.h"
23 #include "fxdefs.h"
24 #include "fxmath.h"
25 #include "FXMutex.h"
26 #include "FXArray.h"
27 #include "FXHash.h"
28 #include "FXStream.h"
29 #include "FXString.h"
30 #include "FXSize.h"
31 #include "FXPoint.h"
32 #include "FXRectangle.h"
33 #include "FXStringDictionary.h"
34 #include "FXSettings.h"
35 #include "FXRegistry.h"
36 #include "FXAccelTable.h"
37 #include "FXCursor.h"
38 #include "FXEvent.h"
39 #include "FXWindow.h"
40 #include "FXApp.h"
41 #include "FXRootWindow.h"
42 #include "FXMainWindow.h"
43
44 /*
45 Notes:
46 - allow resize option..
47 - Iconified/normal.
48 - Want unlimited number of main windows.
49 - Don't call X11/WIN32 unless xid and application is initialized.
50 */
51
52
53 #define DISPLAY(app) ((Display*)((app)->display))
54
55
56 using namespace FX;
57
58 /*******************************************************************************/
59
60 namespace FX {
61
62
63 // Object implementation
64 FXIMPLEMENT(FXMainWindow,FXTopWindow,NULL,0)
65
66
67 // Make main window
FXMainWindow(FXApp * a,const FXString & name,FXIcon * ic,FXIcon * mi,FXuint opts,FXint x,FXint y,FXint w,FXint h,FXint pl,FXint pr,FXint pt,FXint pb,FXint hs,FXint vs)68 FXMainWindow::FXMainWindow(FXApp* a,const FXString& name,FXIcon *ic,FXIcon *mi,FXuint opts,FXint x,FXint y,FXint w,FXint h,FXint pl,FXint pr,FXint pt,FXint pb,FXint hs,FXint vs):FXTopWindow(a,name,ic,mi,opts,x,y,w,h,pl,pr,pt,pb,hs,vs){
69 }
70
71
72 // Create server-side resources
create()73 void FXMainWindow::create(){
74 FXTopWindow::create();
75 if(xid){
76 if(getApp()->isInitialized()){
77 #ifndef WIN32
78 // Set the WM_COMMAND hint on non-owned toplevel windows
79 XSetCommand(DISPLAY(getApp()),xid,(char**)getApp()->getArgv(),getApp()->getArgc());
80 #endif
81 }
82 }
83 }
84
85
86 // Destroy
~FXMainWindow()87 FXMainWindow::~FXMainWindow(){
88 }
89
90 }
91