Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

Window.h

Go to the documentation of this file.
00001 /*
00002  *    gui - [gega user interface] the flexible solution for user interface problems
00003  *    Copyright (C) 2002  Gergely Gati
00004  *
00005  *    This program is free software; you can redistribute it and/or modify
00006  *    it under the terms of the GNU General Public License as published by
00007  *    the Free Software Foundation; version 2 of the License.
00008  *
00009  *    This program is distributed in the hope that it will be useful,
00010  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *    GNU General Public License for more details.
00013  *
00014  *    You should have received a copy of the GNU General Public License
00015  *    along with this program; if not, write to the Free Software
00016  *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  *
00018  *    Gergely Gati
00019  *      email:           g.gati@freemail.hu
00020  *      AIM screenname:  GatiGergely
00021  *      ICQ number:      93131690
00022  *
00023  */
00024 #ifndef __WINDOW_H
00025 #define __WINDOW_H
00026 
00027 #include "Bases.h"
00028 #include "Tag.h"
00029 #include "Gadget.h"
00030 #include "Bitmap.h"
00031 
00032 
00033 struct Window_s
00034 {
00035   u32 handle;
00036   char *name;
00037   Gadget_t *gadgetroot;
00038   Gadget_t *gadgetapp;
00039   int (*event_handler)(gui_App_t *app, Window_t *win, u32 gadget_id, int event, u32 event_data);
00040   List_t *timerlist;
00041   gui_App_t *app;
00042   Node_t *node;
00043   Gadget_t *focused_gadget;
00044   int sleep;
00045   Gadget_t *active_gadget;
00046   Window_t *parent;
00047   u32 parentdata;
00048   u32 flags;
00049   u32 userdata;
00050   Gadget_t *over;
00051   char *title;
00052   Bitmap_t *mask;
00053 };
00054 
00055 
00056 //flags
00057 #define WIN_FLAGS_SLEEPPARENT   (1L<<0)
00058 #define WIN_FLAGS_NOBORDER      (1L<<1)
00059 
00060 
00061 #define TAG_WIN_TITLE           ((TAG_USER+1)|TAGT_STRING)
00062 #define TAG_WIN_MIN_WIDTH       (TAG_USER+2)      // sizes in percent of screen dimensions
00063 #define TAG_WIN_MAX_WIDTH       (TAG_USER+3)
00064 #define TAG_WIN_MIN_HEIGHT      (TAG_USER+4)
00065 #define TAG_WIN_MAX_HEIGHT      (TAG_USER+5)
00066 #define TAG_WIN_INIT_WIDTH      (TAG_USER+6)
00067 #define TAG_WIN_INIT_HEIGHT     (TAG_USER+7)
00068 #define TAG_WIN_FONTNAME        ((TAG_USER+8)|TAGT_STRING)
00069 #define TAG_WIN_FONTSIZE        (TAG_USER+9)
00070 #define TAG_WIN_FONTSTYLE       (TAG_USER+10)
00071 #define TAG_WIN_FONTWEIGHT      (TAG_USER+11)
00072 #define TAG_WIN_FONTDECORATION  (TAG_USER+12)
00073 #define TAG_WIN_CHECKLIST       (TAG_USER+13)
00074 #define TAG_WIN_PARENTWINDOW    ((TAG_USER+14)|TAGT_STRING)
00075 #define TAG_WIN_SLEEP_PARENT    (TAG_USER+15)
00076 #define TAG_WIN_USERDATA        (TAG_USER+16)
00077 #define TAG_WIN_TOP            (TAG_USER+17)
00078 #define TAG_WIN_BOTTOM         (TAG_USER+18)
00079 #define TAG_WIN_LEFT           (TAG_USER+19)
00080 #define TAG_WIN_RIGHT          (TAG_USER+20)
00081 #define TAG_WIN_PXTOP          (TAG_USER+21)
00082 #define TAG_WIN_PXLEFT         (TAG_USER+22)
00083 #define TAG_WIN_PXWIDTH        (TAG_USER+23)
00084 #define TAG_WIN_PXHEIGHT       (TAG_USER+24)
00085 #define TAG_WIN_BITMAP         (TAG_USER+25)
00086 #define TAG_WIN_GUI_FILE       ((TAG_USER+26)|TAGT_STRING)
00087 #define TAG_WIN_OBJECT         (TAG_USER+27)
00088 #define TAG_WIN_GADGET         (TAG_USER+28)
00089 #define TAG_WIN_APP            (TAG_USER+29)
00090 #define TAG_WIN_NAME           ((TAG_USER+30)|TAGT_STRING)
00091 #define TAG_WIN_EVENT_HANDLER  (TAG_USER+31)
00092 #define TAG_WIN_FLAGS          (TAG_USER+32)
00093 #define TAG_WIN_PARENT         (TAG_USER+33)
00094 #define TAG_WIN_PARENTDATA     (TAG_USER+34)
00095 #define TAG_WIN_WINFLAGS       (TAG_USER+35)
00096 #define TAG_WIN_SKINNAME       ((TAG_USER+36)|TAGT_STRING)
00097 #define TAG_WIN_PIXELS         (TAG_USER+37)
00098 #define TAG_WIN_RECT           (TAG_USER+38)
00099 #define TAG_WIN_X              (TAG_USER+39)
00100 #define TAG_WIN_Y              (TAG_USER+40)
00101 
00102 
00103 u32 window_Call(int function, u32 firsttag, ...);
00104 u32 window_CallTL(int function, tag *taglist);
00105 
00106 
00107 //Prototypes BEGIN
00108 u32 window_RefreshWindow(u32 firsttag, ...);
00109 u32 window_RefreshWindowTL(tag *taglist);
00110 u32 window_GetFocusedGadget(u32 firsttag, ...);
00111 u32 window_GetFocusedGadgetTL(tag *taglist);
00112 u32 window_SetFocusedGadget(u32 firsttag, ...);
00113 u32 window_SetFocusedGadgetTL(tag *taglist);
00114 u32 window_CloseWindow(u32 firsttag, ...);
00115 u32 window_CloseWindowTL(tag *taglist);
00116 u32 window_OpenWindow(u32 firsttag, ...);
00117 u32 window_OpenWindowTL(tag *taglist);
00118 u32 window_SetActive(u32 firsttag, ...);
00119 u32 window_SetActiveTL(tag *taglist);
00120 u32 window_GetActive(u32 firsttag, ...);
00121 u32 window_GetActiveTL(tag *taglist);
00122 u32 window_GetUserdata(u32 firsttag, ...);
00123 u32 window_GetUserdataTL(tag *taglist);
00124 u32 window_ChangeSkin(u32 firsttag, ...);
00125 u32 window_ChangeSkinTL(tag *taglist);
00126 u32 window_AddMask(u32 firsttag, ...);
00127 u32 window_AddMaskTL(tag *taglist);
00128 //Prototypes END
00129 
00130 //Enum for calling BEGIN
00131 enum window_functions
00132 {
00133   WINDOW_REFRESHWINDOW=WINDOW_FUNCBASE,
00134   WINDOW_GETFOCUSEDGADGET,
00135   WINDOW_SETFOCUSEDGADGET,
00136   WINDOW_CLOSEWINDOW,
00137   WINDOW_OPENWINDOW,
00138   WINDOW_SETACTIVE,
00139   WINDOW_GETACTIVE,
00140   WINDOW_GETUSERDATA,
00141   WINDOW_CHANGESKIN,
00142   WINDOW_ADDMASK,
00143   WINDOW_FUNC_DONE
00144 };
00145 //Enum for calling END
00146 
00147 
00148 //system only
00149 int window_Init(void);
00150 void window_CleanUp(void);
00151 int window_WindowEvent(Window_t *window, u32 gadget_id, int event, u32 event_data);
00152 void window_CloseAllWindows(gui_App_t *app);
00153 int window_DamageWindow(Window_t *win, Rect_t *rect);
00154 
00155 int window_IsSleep(Window_t *win);
00156 
00157 Skin_t *window_GetSkin(Window_t *win);
00158 gui_App_t *window_GetApp(Window_t *win);
00159 Bitmap_t *window_GetMask(Window_t *win);
00160 u32 window_GetConnection(Window_t *win);
00161 Gadget_t *window_GetRootGadget(Window_t *win);
00162 List_t *window_GetTimerList(Window_t *win);
00163 
00164 
00165 #endif

Generated on Tue Jan 7 12:11:24 2003 for THEGUI by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002