[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[paragui-cvs] CVS: paragui/src/widgets pgwidget.cpp,1.9,1.10 pgwindow.cp
From: |
Alexander Pipelka <address@hidden> |
Subject: |
[paragui-cvs] CVS: paragui/src/widgets pgwidget.cpp,1.9,1.10 pgwindow.cpp,1.6,1.7 |
Date: |
Tue, 30 Apr 2002 10:51:16 -0400 |
Update of /cvsroot/paragui/paragui/src/widgets
In directory subversions:/tmp/cvs-serv311/src/widgets
Modified Files:
pgwidget.cpp pgwindow.cpp
Log Message:
inlined some often used functions (have to check if this works for windows)
Index: pgwidget.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgwidget.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** pgwidget.cpp 30 Apr 2002 06:37:04 -0000 1.9
--- pgwidget.cpp 30 Apr 2002 14:51:13 -0000 1.10
***************
*** 27,31 ****
*/
- //#include <iostream>
#include <cstring>
#include <stdarg.h>
--- 27,30 ----
***************
*** 55,63 ****
bool dirtyUpdate;
- PG_Widget* widgetParent;
PG_RectList* childList;
- //SDL_mutex* mutexProcess;
-
char* userdata;
int userdatasize;
--- 54,59 ----
***************
*** 70,74 ****
int fadeSteps;
bool haveTooltip;
- bool visible;
bool firstredraw;
Uint8 transparency;
--- 66,69 ----
***************
*** 118,122 ****
my_internaldata->dirtyUpdate = false;
! my_internaldata->widgetParent = parent;
my_internaldata->havesurface = bObjectSurface;
my_srfScreen = PG_Application::GetScreen();
--- 113,117 ----
my_internaldata->dirtyUpdate = false;
! my_parent = parent;
my_internaldata->havesurface = bObjectSurface;
my_srfScreen = PG_Application::GetScreen();
***************
*** 149,157 ****
my_colorBorder[1][1].b = 134;
- //my_internaldata->mutexProcess = SDL_CreateMutex();
my_internaldata->id = -1;
my_internaldata->transparency = 0;
my_internaldata->quitModalLoop = false;
! my_internaldata->visible = false;
my_internaldata->hidden = false;
my_internaldata->firstredraw = true;
--- 144,151 ----
my_colorBorder[1][1].b = 134;
my_internaldata->id = -1;
my_internaldata->transparency = 0;
my_internaldata->quitModalLoop = false;
! my_visible = false;
my_internaldata->hidden = false;
my_internaldata->firstredraw = true;
***************
*** 163,170 ****
my_text = "";
! if (my_internaldata->widgetParent != NULL) {
! my_xpos = my_internaldata->widgetParent->my_xpos + my_xpos;
! my_ypos = my_internaldata->widgetParent->my_ypos + my_ypos;
! my_internaldata->widgetParent->AddChild(this);
}
--- 157,164 ----
my_text = "";
! if (my_parent != NULL) {
! my_xpos = my_parent->my_xpos + my_xpos;
! my_ypos = my_parent->my_ypos + my_ypos;
! my_parent->AddChild(this);
}
***************
*** 222,228 ****
RemoveFromWidgetList();
- // unlock process mutex
- //SDL_DestroyMutex(my_internaldata->mutexProcess);
-
// remove childlist
delete my_internaldata->childList;
--- 216,219 ----
***************
*** 350,354 ****
}
! child->my_internaldata->widgetParent = this;
if (my_internaldata->childList == NULL) {
--- 341,345 ----
}
! child->my_parent = this;
if (my_internaldata->childList == NULL) {
***************
*** 503,509 ****
bool PG_Widget::ProcessEvent(const SDL_Event * event, bool bModal) {
- //SDL_mutexP(my_internaldata->mutexProcess);
-
bool processed = false;
// do i have a capturehook set ? (modal)
if(bModal) {
--- 494,499 ----
bool PG_Widget::ProcessEvent(const SDL_Event * event, bool bModal) {
bool processed = false;
+
// do i have a capturehook set ? (modal)
if(bModal) {
***************
*** 520,524 ****
if(processed) {
- //SDL_mutexV(my_internaldata->mutexProcess);
return processed;
}
--- 510,513 ----
***************
*** 528,537 ****
if(PG_MessageObject::ProcessEvent(event)) {
- //SDL_mutexV(my_internaldata->mutexProcess);
return true;
}
if(bModal) {
- //SDL_mutexV(my_internaldata->mutexProcess);
return processed;
}
--- 517,524 ----
***************
*** 541,551 ****
if(GetParent()) {
if(GetParent()->ProcessEvent(event)) {
- //SDL_mutexV(my_internaldata->mutexProcess);
return true;
}
}
- //SDL_mutexV(my_internaldata->mutexProcess);
-
return false;
}
--- 528,535 ----
***************
*** 614,621 ****
// Attempt to make object visible
if(visible) {
! if(my_internaldata->visible) { // Object
already visible
return;
} else { // Display
object
! my_internaldata->visible = visible;
if(my_internaldata->firstredraw) {
Redraw(false);
--- 598,605 ----
// Attempt to make object visible
if(visible) {
! if(my_visible) { // Object already
visible
return;
} else { // Display
object
! my_visible = visible;
if(my_internaldata->firstredraw) {
Redraw(false);
***************
*** 628,636 ****
// Attempt to make object invisible
if(!visible) {
! if(!my_internaldata->visible) { // Object is
already invisible
return;
} else { // Hide object
RestoreBackground();
! my_internaldata->visible = visible;
}
}
--- 612,620 ----
// Attempt to make object invisible
if(!visible) {
! if(!my_visible) { // Object is already
invisible
return;
} else { // Hide object
RestoreBackground();
! my_visible = visible;
}
}
***************
*** 757,761 ****
static PG_Rect dst;
! if(!my_internaldata->visible) {
return;
}
--- 741,745 ----
static PG_Rect dst;
! if(!my_visible) {
return;
}
***************
*** 803,807 ****
}
! if(!my_internaldata->visible) {
return;
}
--- 787,791 ----
}
! if(!my_visible) {
return;
}
***************
*** 1226,1231 ****
static PG_Rect pr;
! if (my_internaldata->widgetParent != NULL) {
! pr = *(my_internaldata->widgetParent->GetClipRect());
} else {
pr.SetRect(
--- 1210,1215 ----
static PG_Rect pr;
! if (my_parent != NULL) {
! pr = *(my_parent->GetClipRect());
} else {
pr.SetRect(
***************
*** 1510,1516 ****
my_internaldata->quitModalLoop = false;
- // unlock the mutex
- //SDL_mutexV(my_mutexReceiveMessage);
-
while(!my_internaldata->quitModalLoop) {
SDL_WaitEvent(&event);
--- 1494,1497 ----
***************
*** 1730,1744 ****
}
- bool PG_Widget::IsVisible() {
- return my_internaldata->visible;
- }
-
- PG_Widget* PG_Widget::GetParent() {
- if(my_internaldata == NULL) {
- return NULL;
- }
- return my_internaldata->widgetParent;
- }
-
int PG_Widget::GetID() {
if(my_internaldata == NULL) {
--- 1711,1714 ----
***************
*** 1783,1788 ****
void PG_Widget::SetName(const char *name) {
my_internaldata->name = name;
! if (my_internaldata->widgetParent) {
! my_internaldata->widgetParent->AddChildToCache(this, name);
}
}
--- 1753,1758 ----
void PG_Widget::SetName(const char *name) {
my_internaldata->name = name;
! if (my_parent) {
! my_parent->AddChildToCache(this, name);
}
}
***************
*** 1826,1831 ****
void PG_Widget::SetID(int id) {
my_internaldata->id = id;
! if (my_internaldata->widgetParent) {
! my_internaldata->widgetParent->AddChildToCache(this, id);
}
}
--- 1796,1801 ----
void PG_Widget::SetID(int id) {
my_internaldata->id = id;
! if (my_parent) {
! my_parent->AddChildToCache(this, id);
}
}
Index: pgwindow.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgwindow.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** pgwindow.cpp 28 Apr 2002 16:35:30 -0000 1.6
--- pgwindow.cpp 30 Apr 2002 14:51:13 -0000 1.7
***************
*** 30,34 ****
#include "pgapplication.h"
#include "pgtheme.h"
- #include <cstring>
PG_Window::PG_Window(PG_Widget* parent, const PG_Rect& r, const char*
windowtext, Uint32 flags, const char* style, int heightTitlebar) :
PG_ThemeWidget(parent, r) {
--- 30,33 ----
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [paragui-cvs] CVS: paragui/src/widgets pgwidget.cpp,1.9,1.10 pgwindow.cpp,1.6,1.7,
Alexander Pipelka <address@hidden> <=