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,2005 by Jeroen van der Zijp.   All Rights Reserved.        *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or                 *
9 * modify it under the terms of the GNU Lesser General Public                    *
10 * License as published by the Free Software Foundation; either                  *
11 * version 2.1 of the License, or (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 GNU             *
16 * Lesser General Public License for more details.                               *
17 *                                                                               *
18 * You should have received a copy of the GNU Lesser General Public              *
19 * License along with this library; if not, write to the Free Software           *
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.    *
21 *********************************************************************************
22 * $Id: FXMainWindow.cpp,v 1.28 2005/01/16 16:06:07 fox Exp $                    *
23 ********************************************************************************/
24 #include "xincs.h"
25 #include "fxver.h"
26 #include "fxdefs.h"
27 #include "FXThread.h"
28 #include "FXHash.h"
29 #include "FXStream.h"
30 #include "FXString.h"
31 #include "FXSize.h"
32 #include "FXPoint.h"
33 #include "FXRectangle.h"
34 #include "FXRegistry.h"
35 #include "FXAccelTable.h"
36 #include "FXApp.h"
37 #include "FXCursor.h"
38 #include "FXRootWindow.h"
39 #include "FXMainWindow.h"
40 
41 /*
42   Notes:
43   - allow resize option..
44   - Iconified/normal.
45   - Want unlimited number of main windows.
46   - Don't call X11/WIN32 unless xid and application is initialized.
47 */
48 
49 
50 #define DISPLAY(app) ((Display*)((app)->display))
51 
52 
53 using namespace FX;
54 
55 /*******************************************************************************/
56 
57 namespace FX {
58 
59 
60 // Object implementation
61 FXIMPLEMENT(FXMainWindow,FXTopWindow,NULL,0)
62 
63 
64 // 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)65 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):
66   FXTopWindow(a,name,ic,mi,opts,x,y,w,h,pl,pr,pt,pb,hs,vs){
67   }
68 
69 
70 // Create server-side resources
create()71 void FXMainWindow::create(){
72   FXTopWindow::create();
73   if(xid){
74     if(getApp()->isInitialized()){
75 #ifndef WIN32
76       // Set the WM_COMMAND hint on non-owned toplevel windows
77       XSetCommand(DISPLAY(getApp()),xid,(char**)getApp()->getArgv(),getApp()->getArgc());
78 #endif
79       }
80     }
81   }
82 
83 
84 // Destroy
~FXMainWindow()85 FXMainWindow::~FXMainWindow(){
86   }
87 
88 }
89