# event.h

Go to the documentation of this file.

    00001 /***************************************************************************
    00002  $RCSfile: event.h,v $
    00003                              -------------------
    00004     cvs         : $Id: event.h,v 1.1 2004/08/06 06:28:48 aquamaniac Exp $
    00005     begin       : Mon Feb 09 2004
    00006     copyright   : (C) 2004 by Martin Preuss
    00007     email       : martin@libchipcard.de
    00008
    00009  ***************************************************************************
    00010  *                                                                         *
    00011  *   This library is free software; you can redistribute it and/or         *
    00012  *   modify it under the terms of the GNU Lesser General Public            *
    00013  *   License as published by the Free Software Foundation; either          *
    00014  *   version 2.1 of the License, or (at your option) any later version.    *
    00015  *                                                                         *
    00016  *   This library is distributed in the hope that it will be useful,       *
    00017  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
    00018  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
    00019  *   Lesser General Public License for more details.                       *
    00020  *                                                                         *
    00021  *   You should have received a copy of the GNU Lesser General Public      *
    00022  *   License along with this library; if not, write to the Free Software   *
    00023  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,                 *
    00024  *   MA  02111-1307  USA                                                   *
    00025  *                                                                         *
    00026  ***************************************************************************/
    00027
    00028 #ifndef GWEN_UI_EVENT_H
    00029 #define GWEN_UI_EVENT_H
    00030
    00031 #include <gwenhywfar/misc.h>
    00032 #include <gwenhywfar/inherit.h>
    00033
    00034 typedef struct GWEN_EVENT GWEN_EVENT;
    00035
    00036
    00037 typedef enum {
    00038   GWEN_EventSetTextMode_Replace=0,
    00039   GWEN_EventSetTextMode_Append,
    00040   GWEN_EventSetTextMode_Insert
    00041 } GWEN_EVENT_SETTEXT_MODE;
    00042
    00043
    00044 typedef enum {
    00045   GWEN_EventFocusType_Got=0,
    00046   GWEN_EventFocusType_Lost
    00047 } GWEN_EVENT_FOCUS_TYPE;
    00048
    00049
    00050 typedef enum {
    00051   GWEN_EventClearMode_All=0,
    00052   GWEN_EventClearMode_ToEOL,
    00053   GWEN_EventClearMode_ToBottom
    00054 } GWEN_EVENT_CLEAR_MODE;
    00055
    00056
    00057 typedef enum {
    00058   GWEN_EventType_None=0,
    00059   GWEN_EventType_Key,
    00060   GWEN_EventType_SetText,
    00061   GWEN_EventType_Move,
    00062   GWEN_EventType_Draw,
    00063   GWEN_EventType_SetColour,
    00064   GWEN_EventType_Focus,
    00065   GWEN_EventType_Created,
    00066   GWEN_EventType_Destroy,
    00067   GWEN_EventType_Update,
    00068   GWEN_EventType_Refresh,
    00069   GWEN_EventType_Scroll,
    00070   GWEN_EventType_WriteAt,
    00071   GWEN_EventType_ChgAtts,
    00072   GWEN_EventType_Clear,
    00073   GWEN_EventType_Highlight,
    00074   GWEN_EventType_ContentChg,
    00075   GWEN_EventType_Command,
    00076   GWEN_EventType_Close,
    00077   GWEN_EventType_Closed,
    00078   GWEN_EventType_LastClosed,
    00079   GWEN_EventType_Selected,
    00080   GWEN_EventType_Chosen,
    00081   GWEN_EventType_Checked,
    00082   GWEN_EventType_Changed,
    00083   GWEN_EventType_Activated
    00084 } GWEN_EVENT_TYPE;
    00085
    00086
    00087 #include <gwenhywfar/ui/widget.h>
    00088
    00089
    00090 GWEN_LIST_FUNCTION_DEFS(GWEN_EVENT, GWEN_Event)
    00091 GWEN_INHERIT_FUNCTION_DEFS(GWEN_EVENT)
    00092
    00093
    00094
    00095 GWEN_EVENT_TYPE GWEN_Event_GetType(const GWEN_EVENT *e);
    00096 GWEN_WIDGET *GWEN_Event_GetSender(const GWEN_EVENT *e);
    00097 GWEN_WIDGET *GWEN_Event_GetRecipient(const GWEN_EVENT *e);
    00098 const char *GWEN_Event_GetEventTypeName(const GWEN_EVENT *e);
    00099
    00100 int GWEN_Event_DueToSubscription(const GWEN_EVENT *e);
    00101
    00102
    00103 GWEN_EVENT *GWEN_Event_new(GWEN_EVENT_TYPE t);
    00104
    00105 void GWEN_Event_free(GWEN_EVENT *e);
    00106
    00107 GWEN_EVENT_TYPE GWEN_Event_GetType(const GWEN_EVENT *e);
    00108 GWEN_WIDGET *GWEN_Event_GetSender(const GWEN_EVENT *e);
    00109
    00110
    00111 GWEN_EVENT *GWEN_EventSetText_new(const char *text,
    00112                                   GWEN_EVENT_SETTEXT_MODE m);
    00113 const char *GWEN_EventSetText_GetText(const GWEN_EVENT *e);
    00114 GWEN_EVENT_SETTEXT_MODE GWEN_EventSetText_GetMode(const GWEN_EVENT *e);
    00115
    00116
    00117 GWEN_EVENT *GWEN_EventWriteAt_new(int x, int y,
    00118                                   const char *text,
    00119                                   int len);
    00120 const char *GWEN_EventWriteAt_GetText(const GWEN_EVENT *e);
    00121 int GWEN_EventWriteAt_GetX(const GWEN_EVENT *e);
    00122 int GWEN_EventWriteAt_GetY(const GWEN_EVENT *e);
    00123 int GWEN_EventWriteAt_GetLen(const GWEN_EVENT *e);
    00124
    00125
    00126
    00127
    00128 GWEN_EVENT *GWEN_EventMove_new(int x, int y,
    00129                                int oldx, int oldy);
    00130 int GWEN_EventMove_GetX(const GWEN_EVENT *e);
    00131 int GWEN_EventMove_GetY(const GWEN_EVENT *e);
    00132 int GWEN_EventMove_GetOldX(const GWEN_EVENT *e);
    00133 int GWEN_EventMove_GetOldY(const GWEN_EVENT *e);
    00134
    00135
    00136
    00137 GWEN_EVENT *GWEN_EventDraw_new();
    00138
    00139
    00140 GWEN_EVENT *GWEN_EventCreated_new();
    00141
    00142
    00143 GWEN_EVENT *GWEN_EventDestroy_new();
    00144
    00145
    00146 GWEN_EVENT *GWEN_EventUpdate_new();
    00147
    00148
    00149 GWEN_EVENT *GWEN_EventRefresh_new();
    00150
    00151
    00152 GWEN_EVENT *GWEN_EventClose_new();
    00153
    00154 GWEN_EVENT *GWEN_EventClosed_new();
    00155
    00156
    00157 GWEN_EVENT *GWEN_EventLastClosed_new();
    00158
    00159
    00160 GWEN_EVENT *GWEN_EventLastClosed_new();
    00161
    00162
    00163 GWEN_EVENT *GWEN_EventKey_new(int key);
    00164 int GWEN_EventKey_GetKey(const GWEN_EVENT *e);
    00165
    00166
    00167
    00168 GWEN_EVENT *GWEN_EventChgAtts_new(GWEN_TYPE_UINT32 atts, int set);
    00169 GWEN_TYPE_UINT32 GWEN_EventChgAtts_GetAtts(const GWEN_EVENT *e);
    00170 int GWEN_EventChgAtts_GetSet(const GWEN_EVENT *e);
    00171
    00172
    00173
    00174 GWEN_EVENT *GWEN_EventSetColour_new(GWEN_WIDGET_COLOUR c);
    00175 GWEN_WIDGET_COLOUR GWEN_EventSetColour_GetColour(const GWEN_EVENT *e);
    00176
    00177
    00178
    00179
    00180 GWEN_EVENT *GWEN_EventFocus_new(GWEN_EVENT_FOCUS_TYPE ft);
    00181 GWEN_EVENT_FOCUS_TYPE GWEN_EventFocus_GetFocusEventType(const GWEN_EVENT *e);
    00182
    00183
    00184
    00185 GWEN_EVENT *GWEN_EventScroll_new(int xBy, int yBy, int todo);
    00186 int GWEN_EventScroll_GetXBy(GWEN_EVENT *e);
    00187 int GWEN_EventScroll_GetYBy(GWEN_EVENT *e);
    00188 int GWEN_EventScroll_GetTodo(GWEN_EVENT *e);
    00189
    00190
    00191
    00192 GWEN_EVENT *GWEN_EventClear_new(int x, int y, GWEN_EVENT_CLEAR_MODE m);
    00193 int GWEN_EventClear_GetX(const GWEN_EVENT *e);
    00194 int GWEN_EventClear_GetY(const GWEN_EVENT *e);
    00195 GWEN_EVENT_CLEAR_MODE GWEN_EventClear_GetMode(const GWEN_EVENT *e);
    00196
    00197
    00198 GWEN_EVENT *GWEN_EventHighlight_new(int x, int y,
    00199                                     int len,
    00200                                     GWEN_WIDGET_COLOUR hi);
    00201 const char *GWEN_EventHighlight_GetText(const GWEN_EVENT *e);
    00202 int GWEN_EventHighlight_GetX(const GWEN_EVENT *e);
    00203 int GWEN_EventHighlight_GetY(const GWEN_EVENT *e);
    00204 int GWEN_EventHighlight_GetLen(const GWEN_EVENT *e);
    00205 GWEN_WIDGET_COLOUR GWEN_EventHighlight_GetHi(const GWEN_EVENT *e);
    00206
    00207
    00208
    00209 GWEN_EVENT *GWEN_EventContentChg_new(int contentWidth, int contentHeight,
    00210                                      int width, int height);
    00211 int GWEN_EventContentChg_GetContentWidth(const GWEN_EVENT *e);
    00212 int GWEN_EventContentChg_GetContentHeight(const GWEN_EVENT *e);
    00213 int GWEN_EventContentChg_GetWidth(const GWEN_EVENT *e);
    00214 int GWEN_EventContentChg_GetHeight(const GWEN_EVENT *e);
    00215
    00216
    00217 GWEN_EVENT *GWEN_EventCommand_new(GWEN_TYPE_UINT32 commandId);
    00218 GWEN_TYPE_UINT32 GWEN_EventCommand_GetCommandId(const GWEN_EVENT *e);
    00219
    00220
    00221 GWEN_EVENT *GWEN_EventSelected_new(const char *text, int x, int y, int state);
    00222 const char *GWEN_EventSelected_GetText(const GWEN_EVENT *e);
    00223 int GWEN_EventSelected_GetX(const GWEN_EVENT *e);
    00224 int GWEN_EventSelected_GetY(const GWEN_EVENT *e);
    00225
    00226
    00227 GWEN_EVENT *GWEN_EventChosen_new(const char *text, int x, int y);
    00228 const char *GWEN_EventChosen_GetText(const GWEN_EVENT *e);
    00229 int GWEN_EventChosen_GetX(const GWEN_EVENT *e);
    00230 int GWEN_EventChosen_GetY(const GWEN_EVENT *e);
    00231
    00232
    00233 GWEN_EVENT *GWEN_EventChecked_new(int status);
    00234 int GWEN_EventChecked_GetStatus(const GWEN_EVENT *e);
    00235
    00236
    00237 GWEN_EVENT *GWEN_EventChanged_new();
    00238
    00239
    00240 GWEN_EVENT *GWEN_EventActivated_new(const char *text, int x, int y);
    00241 const char *GWEN_EventActivated_GetText(const GWEN_EVENT *e);
    00242 int GWEN_EventActivated_GetX(const GWEN_EVENT *e);
    00243 int GWEN_EventActivated_GetY(const GWEN_EVENT *e);
    00244
    00245
    00246
    00247 void GWEN_Event_Dump(const GWEN_EVENT *e);
    00248
    00249
    00250 #endif
    00251
    00252
    00253
    00254
    00255