utility.cpp

00001 /***************************************************************************
00002                           utility.cpp  -  description
00003                              -------------------
00004     begin                : Sat Mar 6 2004
00005     copyright            : (C) 2004 by Dynacube Team
00006     email                : 
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018  #include "gui/utility.h"
00019  
00020  POINT getAbsLoc(component *comp)
00021  {
00022     POINT pt;
00023     window *win_ptr;
00024     frame *frm_ptr;
00025     DW _x,_y,_width,_height;
00026 
00027     pt.x = 0;
00028     pt.y = 0;
00029 
00030     switch(comp->cnt_type)
00031     {
00032       case WIND_TYPE :
00033                       win_ptr = (window *) comp->cnt_ptr;
00034                       if(win_ptr->style & W_MAXIMIZE)
00035                        {
00036                          _x = BORDER_WIDTH;
00037                          _y = TITLE_HEIGHT + BORDER_HEIGHT + ((win_ptr->hasMenu) ? MENUBAR_HEIGHT : 0);
00038                          _width  = SCREEN_WIDTH;
00039                          _height = SCREEN_HEIGHT;
00040                        }
00041                       else
00042                        {
00043                          _x = win_ptr->x + BORDER_WIDTH;
00044                          _y = win_ptr->y + TITLE_HEIGHT + BORDER_HEIGHT + ((win_ptr->hasMenu) ? MENUBAR_HEIGHT : 0);
00045                          _width = win_ptr->width;
00046                          _height = win_ptr->height;
00047                        }
00048 
00049                       if((comp->x + comp->width < _width) && (comp->y + comp->height < _height))
00050                       {
00051                          pt.x = comp->x+_x;
00052                          pt.y = comp->y+_y;
00053                       }
00054                       break;
00055     }
00056 
00057 
00058     return pt;
00059 
00060  }

Generated on Thu Jul 27 23:52:28 2006 for Dynacube by  doxygen 1.4.7