[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[paragui-cvs] CVS: paragui/src/core Makefile.am,1.1,1.2 pgapplication.cp
From: |
Alexander Pipelka <address@hidden> |
Subject: |
[paragui-cvs] CVS: paragui/src/core Makefile.am,1.1,1.2 pgapplication.cpp,1.2,1.3 pgmessageobject.cpp,1.1,1.2 pgeventobject.cpp,1.1,NONE pgmsgmap.cpp,1.1,NONE pgmsgmap.h,1.1,NONE |
Date: |
Sat, 27 Apr 2002 07:57:26 -0400 |
Update of /cvsroot/paragui/paragui/src/core
In directory subversions:/tmp/cvs-serv16543/src/core
Modified Files:
Makefile.am pgapplication.cpp pgmessageobject.cpp
Removed Files:
pgeventobject.cpp pgmsgmap.cpp pgmsgmap.h
Log Message:
Here we go :))
This is the first version with libsigc++ support.
All internal callback handling mechanisms have been removed.
See include/pgsignals.h for details (BEWARE! Class templates are my friends).
Index: Makefile.am
===================================================================
RCS file: /cvsroot/paragui/paragui/src/core/Makefile.am,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** Makefile.am 15 Apr 2002 14:53:56 -0000 1.1
--- Makefile.am 27 Apr 2002 11:57:22 -0000 1.2
***************
*** 5,9 ****
pgapplication.cpp \
pgcolors.cpp \
- pgeventobject.cpp \
pgfilearchive.cpp \
pgfile.cpp \
--- 5,8 ----
***************
*** 11,15 ****
pgmain.cpp \
pgmessageobject.cpp \
- pgmsgmap.cpp \
pgnavigator.cpp \
pgrectlist.cpp \
--- 10,13 ----
***************
*** 18,25 ****
libpgcore_la_LIBADD =
- EXTRA_DIST = \
- pgmsgmap.h
-
INCLUDES = \
$(SDL_CFLAGS) \
-I$(top_srcdir)/src/physfs \
--- 16,21 ----
libpgcore_la_LIBADD =
INCLUDES = \
+ $(SIGC_CFLAGS) \
$(SDL_CFLAGS) \
-I$(top_srcdir)/src/physfs \
Index: pgapplication.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/core/pgapplication.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** pgapplication.cpp 26 Apr 2002 12:43:22 -0000 1.2
--- pgapplication.cpp 27 Apr 2002 11:57:22 -0000 1.3
***************
*** 244,248 ****
}
void PG_Application::Quit() {
! SendMessage(this, MSG_QUIT, PG_IDAPPLICATION, 0);
}
--- 244,249 ----
}
void PG_Application::Quit() {
! eventQuit(PG_IDAPPLICATION, this, 0);
! sigAppQuit(this);
}
***************
*** 281,285 ****
PG_Widget::UpdateRect(PG_Rect(0,0,event->w,event->h));
SDL_UpdateRect(screen,0,0,event->w,event->h);
! SendMessage(NULL, MSG_VIDEORESIZE, 0, 0);
return true;
--- 282,286 ----
PG_Widget::UpdateRect(PG_Rect(0,0,event->w,event->h));
SDL_UpdateRect(screen,0,0,event->w,event->h);
! sigVideoResize(event);
return true;
Index: pgmessageobject.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/core/pgmessageobject.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** pgmessageobject.cpp 15 Apr 2002 14:53:56 -0000 1.1
--- pgmessageobject.cpp 27 Apr 2002 11:57:22 -0000 1.2
***************
*** 30,34 ****
#include "pgmessageobject.h"
#include "pgwidget.h"
- #include "pgmsgmap.h"
#include "pglog.h"
#include <algorithm>
--- 30,33 ----
***************
*** 71,76 ****
RemoveObject(this);
- PG_UnregisterEventObject(this);
-
if (inputFocusObject == this)
inputFocusObject = NULL;
--- 70,73 ----
***************
*** 89,93 ****
bool PG_MessageObject::ProcessEvent(const SDL_Event* event) {
- MSG_MESSAGE* msg = NULL;
SDL_Event e;
--- 86,89 ----
***************
*** 155,168 ****
break;
- case SDL_USEREVENT:
- msg = (MSG_MESSAGE*)(event->user.data1);
-
- if(msg->to != NULL) {
- return msg->to->eventMessage(msg);
- }
-
- rc = eventMessage(msg);
- break;
-
default:
rc = false;
--- 151,154 ----
***************
*** 178,181 ****
--- 164,171 ----
/** virtual message handlers */
+ bool PG_MessageObject::eventResize(const SDL_ResizeEvent* event) {
+ return false;
+ }
+
bool PG_MessageObject::eventActive(const SDL_ActiveEvent* active) {
return false;
***************
*** 221,262 ****
}
-
- bool PG_MessageObject::eventResize(const SDL_ResizeEvent* event) {
- return false;
- }
-
bool PG_MessageObject::AcceptEvent(const SDL_Event* event) {
return true; // PG_MessageObject accepts all
events
}
-
- bool PG_MessageObject::eventMessage(MSG_MESSAGE* msg) {
- bool rc = false;
-
- if (!msg) {
- return false;
- }
-
- if((msg->to != this) && (msg->to != NULL)) {
- return false;
- }
-
- // dispatch user message
- switch(msg->type) {
- case MSG_QUIT:
- rc = eventQuit(msg->widget_id,
(PG_MessageObject*)(msg->from), msg->data);
- break;
-
- case MSG_MODALQUIT:
- rc = eventQuitModal(msg->widget_id,
(PG_MessageObject*)(msg->from), msg->data);
-
- default:
- rc = false;
- break;
- }
-
- return rc;
- }
-
/** capture handling (an object can capture all messages) */
--- 211,218 ----
***************
*** 374,382 ****
}
- // delete user message
- if(event->type == SDL_USEREVENT) {
- delete (MSG_MESSAGE*)(event->user.data1);
- }
-
return processed;
}
--- 330,333 ----
***************
*** 384,388 ****
void PG_MessageObject::eventIdle() {
! SendMessage(this, MSG_APPIDLE, (long)0, (long)0);
SDL_Delay(1);
}
--- 335,339 ----
void PG_MessageObject::eventIdle() {
! sigAppIdle(this);
SDL_Delay(1);
}
***************
*** 422,479 ****
return true;
- }
-
- /** */
- bool PG_MessageObject::SendMessage(PG_MessageObject* target, PG_MSG_TYPE
type, MSG_ID id, MSG_DATA data) {
- bool rc = false;
-
- if(SDL_mutexP(my_mutexSendMessage) == -1)
- return false;
-
- // check if there is a callback function
- PG_EVENTHANDLERDATA* cbdata = PG_FindEventHandler(type, this);
-
- if(cbdata != NULL) {
-
- // callback function
- if(cbdata->cbfunc != NULL) {
- rc = cbdata->cbfunc(id, (PG_Widget*)this, data,
cbdata->data);
- }
-
- // object to call
- if(cbdata->calledobj != NULL) {
- rc = ((cbdata->calledobj)->*(cbdata->obj_cbfunc))(id,
(PG_Widget*)this, data, cbdata->data);
- }
- }
-
- if(!rc) {
- MSG_MESSAGE* msg = new MSG_MESSAGE;
- msg->to = target;
- msg->from = this;
- msg->type = type;
- msg->widget_id = id;
- msg->data = data;
-
- SDL_Event event;
- event.type = SDL_USEREVENT;
// USEREVENT
- event.user.code = 0;
// RESERVED
- event.user.data1 = (void*)msg;
// OUR MESSAGE OBJECT
- event.user.data2 = NULL;
// RESERVED;
-
- rc = (SDL_PushEvent(&event) == 0);
- }
-
- SDL_mutexV(my_mutexSendMessage);
-
- return rc;
- }
-
-
- void PG_MessageObject::SetEventCallback(PG_MSG_TYPE type, MSG_CALLBACK
cbfunc, void *clientdata) {
- PG_RegisterEventHandler(type, this, cbfunc, clientdata);
- }
-
- void PG_MessageObject::SetEventObject(PG_MSG_TYPE type, PG_EventObject*
calledobj, MSG_CALLBACK_OBJ cbfunc, void *clientdata) {
- PG_RegisterEventHandlerObj(type, this, calledobj, cbfunc, clientdata);
}
--- 373,376 ----
--- pgeventobject.cpp DELETED ---
--- pgmsgmap.cpp DELETED ---
--- pgmsgmap.h DELETED ---
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [paragui-cvs] CVS: paragui/src/core Makefile.am,1.1,1.2 pgapplication.cpp,1.2,1.3 pgmessageobject.cpp,1.1,1.2 pgeventobject.cpp,1.1,NONE pgmsgmap.cpp,1.1,NONE pgmsgmap.h,1.1,NONE,
Alexander Pipelka <address@hidden> <=
- Prev by Date:
[paragui-cvs] CVS: paragui configure.in,1.3,1.4
- Next by Date:
[paragui-cvs] CVS: paragui/test animation.cpp,1.1,1.2 dblbuffer.cpp,1.1.1.1,1.2 paratest.cpp,1.2,1.3
- Previous by thread:
[paragui-cvs] CVS: paragui configure.in,1.3,1.4
- Next by thread:
[paragui-cvs] CVS: paragui/test animation.cpp,1.1,1.2 dblbuffer.cpp,1.1.1.1,1.2 paratest.cpp,1.2,1.3
- Index(es):