shellactivate.c

Go to the documentation of this file.
00001 
00002 /*  $Id: shellactivate.c 355 2005-01-11 22:48:55Z andreradke $    */
00003 
00004 /******************************************************************************
00005 
00006     UserLand Frontier(tm) -- High performance Web content management,
00007     object database, system-level and Internet scripting environment,
00008     including source code editing and debugging.
00009 
00010     Copyright (C) 1992-2004 UserLand Software, Inc.
00011 
00012     This program is free software; you can redistribute it and/or modify
00013     it under the terms of the GNU General Public License as published by
00014     the Free Software Foundation; either version 2 of the License, or
00015     (at your option) any later version.
00016 
00017     This program is distributed in the hope that it will be useful,
00018     but WITHOUT ANY WARRANTY; without even the implied warranty of
00019     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020     GNU General Public License for more details.
00021 
00022     You should have received a copy of the GNU General Public License
00023     along with this program; if not, write to the Free Software
00024     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025 
00026 ******************************************************************************/
00027 
00028 #include "frontier.h"
00029 #include "standard.h"
00030 
00031 #include "quickdraw.h"
00032 #include "scrap.h"
00033 #include "scrollbar.h"
00034 #include "frontierwindows.h"
00035 #include "shell.h"
00036 #include "shellbuttons.h"
00037 #include "shellprivate.h"
00038 
00039 
00040 boolean shellactivatewindow (WindowPtr w, boolean flactivate) {
00041     
00042     /*
00043     activate or deactivate the indicated window.
00044     
00045     8/31/90 DW: we no longer set the globals at the end of the routine. 
00046     
00047     10/11/90 dmb: set superglobals up now
00048     
00049     3/30/93 dmb: make sure it's a shell window
00050     
00051     2.1a7 dmb: fixed shaging of display so newly-opened windows look good
00052     
00053     4.1b4 dmb: overload the config.fleraseonresize flag to avoid updating 
00054     iowa windows while activating
00055 
00056     5.0a10 dmb: dirty the window menu
00057     */
00058     
00059     register hdlwindowinfo hinfo;
00060     register hdlscrollbar vertbar, horizbar;
00061     //Code change by Timothy Paustian Saturday, April 29, 2000 11:03:12 PM
00062     //Changed to Opaque call for Carbon
00063     //moved r to outside, since need for carbon call below
00064     Rect r;
00065     
00066 #ifdef WIN95VERSION
00067     RECT winrect;
00068 #endif
00069     
00070     if (!isshellwindow (w)) /*chase the refcon field of the mac window*/
00071         return (false);
00072     
00073     shellwindowmenudirty ();
00074 
00075     shellsetsuperglobals (); /*do everyone a favor - make superglobals current right away*/
00076     
00077     if (!shellpushglobals (w)) /*install globals of newly active or de-active window*/
00078         return (false);
00079     
00080     hinfo = shellwindowinfo; /*copy into register*/
00081     
00082     (**hinfo).flwindowactive = bitboolean (flactivate);
00083 
00084 #ifdef MACVERSION
00085     #if ACCESSOR_CALLS_ARE_FUNCTIONS == 1
00086     {
00087     CGrafPtr    thePort;
00088     thePort = GetWindowPort(w);
00089     GetPortBounds(thePort, &r); 
00090     }
00091     #else
00092     r = w->portRect;
00093     #endif
00094     pushclip (r); /*make sure we can draw into whole window*/
00095 #endif
00096     
00097 #ifdef WIN95VERSION
00098     GetClientRect (w, &winrect);
00099     winrecttorect (&winrect, &r);
00100     pushclip (r);
00101 #endif
00102 
00103     shelldrawbuttons (); /*if window has an attached button list, draw it*/
00104     
00105     vertbar = (**hinfo).vertscrollbar;
00106     
00107     horizbar = (**hinfo).horizscrollbar;
00108     
00109     if (flactivate) {
00110     
00111         shellsetscrollbars (w);
00112         
00113         displayscrollbar (vertbar);
00114         
00115         displayscrollbar (horizbar);
00116         
00117         (**hinfo).selectioninfo.fldirty = true; /*dmb: force menu update*/
00118         }
00119     
00120     else {
00121 
00122         disablescrollbar (vertbar);
00123         
00124         disablescrollbar (horizbar);
00125     
00126     #if TARGET_API_MAC_CARBON != 1
00127     
00128         if (isdeskaccessorywindow (getfrontwindow ())) /*DA is being activated*/
00129 
00130     #endif  
00131     
00132     shellwritescrap (anyscraptype);
00133         
00134         }
00135     
00136     shelldrawgrowicon (hinfo);
00137     
00138     drawwindowmessage (w);
00139     
00140     popclip ();
00141     
00142     if ((*shellglobals.dataholder != NULL)) { // 4/8.97 dmb: window has conent
00143         
00144         pushclip ((**hinfo).contentrect); /*driver limited to drawing in content rect*/
00145         
00146         (*shellglobals.activateroutine) (bitboolean (flactivate));
00147         
00148         popclip ();
00149 
00150         #ifdef WIN95VERSION
00151             if (config.fleraseonresize)
00152                 shellupdatenow (w);
00153         #endif
00154         }
00155     
00156     shellpopglobals ();
00157     
00158     return (true);
00159     } /*shellactivatewindow*/
00160 
00161 
00162 
00163 

Generated on Wed May 31 18:20:01 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6