gui.h

00001 /***************************************************************************
00002                           gui.h  -  description
00003                              -------------------
00004     begin                : Wed Jan 28 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  #ifndef __GUI_H
00019  #define __GUI_H
00020 
00021 
00022  #ifdef __cplusplus
00023    extern "C"
00024    {
00025     #include "core/kasm.h"     
00026     #include "core/message.h"
00027     #include "core/kstdio.h"
00028     #include "gui/zorder.h"
00029     #include "core/ktime.h"
00030     #include "common/kconst.h"
00031     #include "common/ds/hashmap.h"
00032     #include "common/stdlib.h"
00033     #include "gui/gui_common.h"
00034    }
00035  #else
00036    #include "core/kasm.h" 
00037    #include "core/message.h"
00038    #include "core/kstdio.h"
00039    #include "gui/zorder.h"
00040    #include "common/kconst.h"
00041    #include "core/ktime.h"   
00042    #include "common/ds/hashmap.h"
00043    #include "common/stdlib.h"
00044    #include "gui/gui_common.h"
00045  #endif
00046 
00047   #define WM_DESTROY  0x1
00048   #define WM_CLICKED  0x2
00049   #define WM_KEYPRESS 0x3
00050 
00051  // Main Types
00052   #define CREATE  0x0
00053   #define ADD     0x1
00054   #define SHOW    0x2
00055   #define HIDE    0x3
00056   #define RESIZE  0x4
00057   #define ENABLE  0x5
00058   #define DISABLE 0x6
00059   #define DESTROY 0x7
00060   //Kernel & DD's
00061   #define ACTION  0x8
00062 
00063   //To send FINISHED message to the GUI Server after completing an event
00064   #define FINISHED 0x9
00065   
00066   //TEXT and TEXTAREA
00067   #define SET     0x10
00068   #define GET     0x11
00069   #define CUT     0x12
00070   #define COPY    0x13
00071   #define PASTE   0x14
00072 
00073  // SubType
00074   #define WINDOW      0x0
00075   #define BUTTON      0x1
00076   #define TEXT        0x2
00077   #define TEXTAREA    0x3
00078   #define LIST        0x4
00079   #define HSCROLLBAR  0x5
00080   #define VSCROLLBAR  0x6
00081   #define CHECKBOX    0x7
00082   #define RADIOBUTTON 0x8
00083   #define MENU        0x9
00084   #define TOOLBAR     0xA
00085   #define FRAME       0xB
00086   #define ICON        0xC
00087   #define LABEL       0xD
00088   #define FOLDERVIEW  0xE
00089   #define DIALOG      0xF
00090 
00091   #define MOUSE       0x10
00092   #define KBD         0x11
00093 
00094 
00095   #define ALIAS_MAX     WINDOW_MAX+FRAME_MAX+COMPONENT_MAX
00096 
00097   //Styles
00098   //Common to all
00099   #define HIDDEN   0x1
00100 
00101   //For Windows
00102 
00103   #define W_MINIMIZE  0x2
00104   #define W_MAXIMIZE  0x4
00105   #define W_DISABLED  0x8
00106   #define W_NORESIZE  0x10
00107 
00108   #define NO_TYPE   0
00109   #define WIND_TYPE 1
00110   #define FRM_TYPE  2
00111   #define COMP_TYPE 3
00112 
00113   #define MENU_TYPE     6
00114 //Structs for type-casting Buffer of msgs
00115   typedef struct
00116   {
00117     DD cntr_id;
00118     DW x, y;
00119     DW width, height;
00120     DD style;
00121     DW alias_id; //To send info to client
00122     char title[15];
00123   } CREATE_INFO;
00124 
00125   typedef struct
00126   {
00127     DD cntr_id;
00128     DW cnt_type;
00129     DW x, y;
00130     DW width, height;
00131     DD style;
00132     DW alias_id; //To send info to client
00133     char label[40];
00134   } COMP_CREATE_INFO;
00135 
00136 
00137   typedef struct
00138   {
00139     DW alias_id; //To send info to client
00140     DW x, y;
00141     DW width, height;
00142   } RESIZE_INFO;
00143 
00144  void runGUI();
00145 
00146  SDW processMessage(MSG *msg);
00147 
00148  SDW processCreate(MSG *msg);
00149  SDW processShow(MSG *msg);
00150  SDW processHide(MSG *msg);
00151  SDW processResize(MSG *msg);
00152 
00153  SDW processDestroy(MSG *msg);
00154 
00155  SDW processDisable(MSG *msg);
00156  SDW processEnable(MSG *msg);
00157  SDW processMouse(MSG *msg);
00158  SDW processKBD(MSG *msg);
00159  SDW processSet(MSG *msg);
00160  SDW processGet(MSG *msg);
00161  SDW processPaste(MSG *msg);
00162  SDW processCopy(MSG *msg);
00163  SDW processCut(MSG *msg);
00164  ENTITY findEntity(DW x,DW y);
00165 
00166 
00167  void repaint();
00168  void drawDesktop();
00169  void drawTaskbar();
00170  SDB processStartMenu(DW x,DW y);
00171  void draw_time(DB flush);
00172  void destroy_win(DW pid);
00173 
00174  void sys_init_info();
00175  
00176  #endif

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