debug code looks nicer...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4580 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
1f0ca0978a
commit
3ecfa8e102
@ -39,9 +39,11 @@
|
||||
#define USE_VIEW_FILL_HACK
|
||||
|
||||
//#define DEBUG_DECORATOR
|
||||
|
||||
#ifdef DEBUG_DECORATOR
|
||||
#include <stdio.h>
|
||||
# include <stdio.h>
|
||||
# define STRACE(x) printf x
|
||||
#else
|
||||
# define STRACE(x) ;
|
||||
#endif
|
||||
|
||||
DefaultDecorator::DefaultDecorator(BRect rect, int32 wlook, int32 wfeel, int32 wflags)
|
||||
@ -68,18 +70,16 @@ DefaultDecorator::DefaultDecorator(BRect rect, int32 wlook, int32 wfeel, int32 w
|
||||
// This flag is used to determine whether or not we're moving the tab
|
||||
slidetab=false;
|
||||
|
||||
#ifdef DEBUG_DECORATOR
|
||||
printf("DefaultDecorator:\n");
|
||||
printf("\tFrame (%.1f,%.1f,%.1f,%.1f)\n",rect.left,rect.top,rect.right,rect.bottom);
|
||||
#endif
|
||||
// tab_highcol=_colors->window_tab;
|
||||
// tab_lowcol=_colors->window_tab;
|
||||
|
||||
STRACE(("DefaultDecorator:\n"));
|
||||
STRACE(("\tFrame (%.1f,%.1f,%.1f,%.1f)\n",rect.left,rect.top,rect.right,rect.bottom));
|
||||
}
|
||||
|
||||
DefaultDecorator::~DefaultDecorator(void)
|
||||
{
|
||||
#ifdef DEBUG_DECORATOR
|
||||
printf("DefaultDecorator: ~DefaultDecorator()\n");
|
||||
#endif
|
||||
|
||||
STRACE(("DefaultDecorator: ~DefaultDecorator()\n"));
|
||||
delete [] framecolors;
|
||||
}
|
||||
|
||||
@ -170,10 +170,7 @@ click_type DefaultDecorator::Clicked(BPoint pt, int32 buttons, int32 modifiers)
|
||||
|
||||
void DefaultDecorator::_DoLayout(void)
|
||||
{
|
||||
#ifdef DEBUG_DECORATOR
|
||||
printf("DefaultDecorator: Do Layout\n");
|
||||
#endif
|
||||
|
||||
STRACE(("DefaultDecorator: Do Layout\n"));
|
||||
// Here we determine the size of every rectangle that we use
|
||||
// internally when we are given the size of the client rectangle.
|
||||
|
||||
@ -281,10 +278,7 @@ void DefaultDecorator::MoveBy(float x, float y)
|
||||
|
||||
void DefaultDecorator::MoveBy(BPoint pt)
|
||||
{
|
||||
#ifdef DEBUG_DECORATOR
|
||||
printf("DefaultDecorator: Move By (%.1f, %.1f)\n",pt.x,pt.y);
|
||||
#endif
|
||||
|
||||
STRACE(("DefaultDecorator: Move By (%.1f, %.1f)\n",pt.x,pt.y));
|
||||
// Move all internal rectangles the appropriate amount
|
||||
_frame.OffsetBy(pt);
|
||||
_closerect.OffsetBy(pt);
|
||||
@ -301,10 +295,7 @@ void DefaultDecorator::MoveBy(BPoint pt)
|
||||
|
||||
BRegion * DefaultDecorator::GetFootprint(void)
|
||||
{
|
||||
#ifdef DEBUG_DECORATOR
|
||||
printf("DefaultDecorator: Get Footprint\n");
|
||||
#endif
|
||||
|
||||
STRACE(("DefaultDecorator: Get Footprint\n"));
|
||||
// This function calculates the decorator's footprint in coordinates
|
||||
// relative to the layer. This is most often used to set a WinBorder
|
||||
// object's visible region.
|
||||
@ -321,10 +312,7 @@ BRect DefaultDecorator::SlideTab(float dx, float dy=0){
|
||||
|
||||
void DefaultDecorator::_DrawTitle(BRect r)
|
||||
{
|
||||
#ifdef DEBUG_DECORATOR
|
||||
printf("_DrawTitle(%f,%f,%f,%f)\n", r.left, r.top, r.right, r.bottom);
|
||||
#endif
|
||||
|
||||
STRACE(("_DrawTitle(%f,%f,%f,%f)\n", r.left, r.top, r.right, r.bottom));
|
||||
// Designed simply to redraw the title when it has changed on
|
||||
// the client side.
|
||||
_layerdata.highcolor=_colors->window_tab_text;
|
||||
@ -373,9 +361,7 @@ void DefaultDecorator::_SetFocus(void)
|
||||
|
||||
void DefaultDecorator::Draw(BRect update)
|
||||
{
|
||||
#ifdef DEBUG_DECORATOR
|
||||
printf("DefaultDecorator: Draw(%.1f,%.1f,%.1f,%.1f)\n",update.left,update.top,update.right,update.bottom);
|
||||
#endif
|
||||
STRACE(("DefaultDecorator: Draw(%.1f,%.1f,%.1f,%.1f)\n",update.left,update.top,update.right,update.bottom));
|
||||
// We need to draw a few things: the tab, the resize thumb, the borders,
|
||||
// and the buttons
|
||||
|
||||
@ -394,10 +380,7 @@ void DefaultDecorator::Draw(void)
|
||||
|
||||
void DefaultDecorator::_DrawZoom(BRect r)
|
||||
{
|
||||
#ifdef DEBUG_DECORATOR
|
||||
printf("_DrawZoom(%f,%f,%f,%f)\n", r.left, r.top, r.right, r.bottom);
|
||||
#endif
|
||||
|
||||
STRACE(("_DrawZoom(%f,%f,%f,%f)\n", r.left, r.top, r.right, r.bottom));
|
||||
// If this has been implemented, then the decorator has a Zoom button
|
||||
// which should be drawn based on the state of the member zoomstate
|
||||
BRect zr( r );
|
||||
@ -414,20 +397,14 @@ void DefaultDecorator::_DrawZoom(BRect r)
|
||||
|
||||
void DefaultDecorator::_DrawClose(BRect r)
|
||||
{
|
||||
#ifdef DEBUG_DECORATOR
|
||||
printf("_DrawClose(%f,%f,%f,%f)\n", r.left, r.top, r.right, r.bottom);
|
||||
#endif
|
||||
|
||||
STRACE(("_DrawClose(%f,%f,%f,%f)\n", r.left, r.top, r.right, r.bottom));
|
||||
// Just like DrawZoom, but for a close button
|
||||
DrawBlendedRect( r, GetClose());
|
||||
}
|
||||
|
||||
void DefaultDecorator::_DrawTab(BRect r)
|
||||
{
|
||||
#ifdef DEBUG_DECORATOR
|
||||
printf("_DrawTab(%f,%f,%f,%f)\n", r.left, r.top, r.right, r.bottom);
|
||||
#endif
|
||||
|
||||
STRACE(("_DrawTab(%f,%f,%f,%f)\n", r.left, r.top, r.right, r.bottom));
|
||||
// If a window has a tab, this will draw it and any buttons which are
|
||||
// in it.
|
||||
if(_look==B_NO_BORDER_WINDOW_LOOK)
|
||||
@ -547,7 +524,8 @@ void DefaultDecorator::DrawBlendedRect(BRect r, bool down)
|
||||
|
||||
void DefaultDecorator::_DrawFrame(BRect invalid)
|
||||
{
|
||||
|
||||
STRACE(("_DrawFrame(%f,%f,%f,%f)\n", invalid.left, invalid.top,
|
||||
invalid.right, invalid.bottom));
|
||||
// We need to test each side to determine whether or not it needs drawn. Additionally,
|
||||
// we must clip the lines drawn by this function to the invalid rectangle we are given
|
||||
|
||||
|
@ -51,6 +51,12 @@
|
||||
#include "Utils.h"
|
||||
|
||||
//#define DEBUG_SERVERAPP
|
||||
#ifdef DEBUG_SERVERAPP
|
||||
# include <stdio.h>
|
||||
# define STRACE(x) printf x
|
||||
#else
|
||||
# define STRACE(x) ;
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\brief Constructor
|
||||
@ -94,19 +100,15 @@ ServerApp::ServerApp(port_id sendport, port_id rcvport, int32 handlerID, char *s
|
||||
_driver=GetGfxDriver(ActiveScreen());
|
||||
_cursorhidden=false;
|
||||
|
||||
#ifdef DEBUG_SERVERAPP
|
||||
printf("ServerApp %s:\n",_signature.String());
|
||||
printf("\tBApp port: %ld\n",_sender);
|
||||
printf("\tReceiver port: %ld\n",_receiver);
|
||||
#endif
|
||||
STRACE(("ServerApp %s:\n",_signature.String()));
|
||||
STRACE(("\tBApp port: %ld\n",_sender));
|
||||
STRACE(("\tReceiver port: %ld\n",_receiver));
|
||||
}
|
||||
|
||||
//! Does all necessary teardown for application
|
||||
ServerApp::~ServerApp(void)
|
||||
{
|
||||
#ifdef DEBUG_SERVERAPP
|
||||
printf("ServerApp %s:~ServerApp()\n",_signature.String());
|
||||
#endif
|
||||
STRACE(("ServerApp %s:~ServerApp()\n",_signature.String()));
|
||||
int32 i;
|
||||
|
||||
ServerWindow *tempwin;
|
||||
@ -235,9 +237,7 @@ int32 ServerApp::MonitorApp(void *data)
|
||||
switch (msgCode){
|
||||
case AS_QUIT_APP:
|
||||
{
|
||||
#ifdef DEBUG_SERVERAPP
|
||||
printf("ServerApp %s:Server shutdown notification received\n",app->_signature.String());
|
||||
#endif
|
||||
STRACE(("ServerApp %s:Server shutdown notification received\n",app->_signature.String()));
|
||||
// If we are using the real, accelerated version of the
|
||||
// DisplayDriver, we do NOT want the user to be able shut down
|
||||
// the server. The results would NOT be pretty
|
||||
@ -281,9 +281,7 @@ int32 ServerApp::MonitorApp(void *data)
|
||||
}
|
||||
default:
|
||||
{
|
||||
#ifdef DEBUG_SERVERAPP
|
||||
printf("ServerApp %s: Got a Message to dispatch\n",app->_signature.String());
|
||||
#endif
|
||||
STRACE(("ServerApp %s: Got a Message to dispatch\n",app->_signature.String()));
|
||||
app->_DispatchMessage(msgCode, NULL);
|
||||
break;
|
||||
}
|
||||
@ -352,9 +350,8 @@ void ServerApp::_DispatchMessage(int32 code, int8 *buffer)
|
||||
ses->ReadData( &sendPort, sizeof(port_id) );
|
||||
title = ses->ReadString();
|
||||
|
||||
#ifdef DEBUG_SERVERAPP
|
||||
printf("ServerApp %s: Got 'New Window' message, trying to do smething...\n");
|
||||
#endif
|
||||
STRACE(("ServerApp %s: Got 'New Window' message, trying to do smething...\n",
|
||||
_signature.String()));
|
||||
|
||||
// ServerWindow constructor will reply with port_id of a newly created port
|
||||
ServerWindow *newwin = new ServerWindow( frame, title,
|
||||
@ -363,10 +360,8 @@ void ServerApp::_DispatchMessage(int32 code, int8 *buffer)
|
||||
//AddWindowToDesktop( newwin, workspace, ActiveScreen() );
|
||||
|
||||
|
||||
#ifdef DEBUG_SERVERAPP
|
||||
printf("ServerApp %s: New Window %s (%.1f,%.1f,%.1f,%.1f)\n",
|
||||
_signature.String(),title,frame.left,frame.top,frame.right,frame.bottom);
|
||||
#endif
|
||||
STRACE(("ServerApp %s: New Window %s (%.1f,%.1f,%.1f,%.1f)\n",
|
||||
_signature.String(),title,frame.left,frame.top,frame.right,frame.bottom));
|
||||
|
||||
delete title;
|
||||
|
||||
@ -386,9 +381,7 @@ void ServerApp::_DispatchMessage(int32 code, int8 *buffer)
|
||||
w=(ServerWindow*)_winlist->ItemAt(i);
|
||||
if(w->_token==winid)
|
||||
{
|
||||
#ifdef DEBUG_SERVERAPP
|
||||
printf("ServerApp %s: Deleting window %s\n",_signature.String(),w->Title());
|
||||
#endif
|
||||
STRACE(("ServerApp %s: Deleting window %s\n",_signature.String(),w->Title()));
|
||||
_winlist->RemoveItem(w);
|
||||
delete w;
|
||||
break;
|
||||
@ -425,10 +418,10 @@ void ServerApp::_DispatchMessage(int32 code, int8 *buffer)
|
||||
s.id=*((int32*)index);
|
||||
|
||||
ServerBitmap *sbmp=bitmapmanager->CreateBitmap(r,cs,f,bpr,s);
|
||||
#ifdef DEBUG_SERVERAPP
|
||||
printf("ServerApp %s: Create Bitmap (%.1f,%.1f,%.1f,%.1f)\n",
|
||||
_signature.String(),r.left,r.top,r.right,r.bottom);
|
||||
#endif
|
||||
|
||||
STRACE(("ServerApp %s: Create Bitmap (%.1f,%.1f,%.1f,%.1f)\n",
|
||||
_signature.String(),r.left,r.top,r.right,r.bottom));
|
||||
|
||||
if(sbmp)
|
||||
{
|
||||
// list for doing faster lookups for a bitmap than what the BitmapManager
|
||||
@ -463,9 +456,8 @@ void ServerApp::_DispatchMessage(int32 code, int8 *buffer)
|
||||
ServerBitmap *sbmp=_FindBitmap(*((int32*)index));
|
||||
if(sbmp)
|
||||
{
|
||||
#ifdef DEBUG_SERVERAPP
|
||||
printf("ServerApp %s: Deleting Bitmap %ld\n",_signature.String(),*((int32*)index));
|
||||
#endif
|
||||
STRACE(("ServerApp %s: Deleting Bitmap %ld\n",_signature.String(),*((int32*)index)));
|
||||
|
||||
_bmplist->RemoveItem(sbmp);
|
||||
bitmapmanager->DeleteBitmap(sbmp);
|
||||
write_port(replyport,SERVER_TRUE,NULL,0);
|
||||
@ -478,33 +470,29 @@ void ServerApp::_DispatchMessage(int32 code, int8 *buffer)
|
||||
case AS_CREATE_PICTURE:
|
||||
{
|
||||
// TODO: Implement
|
||||
#ifdef DEBUG_SERVERAPP
|
||||
printf("ServerApp %s: Create Picture unimplemented\n",_signature.String());
|
||||
#endif
|
||||
STRACE(("ServerApp %s: Create Picture unimplemented\n",_signature.String()));
|
||||
|
||||
break;
|
||||
}
|
||||
case AS_DELETE_PICTURE:
|
||||
{
|
||||
// TODO: Implement
|
||||
#ifdef DEBUG_SERVERAPP
|
||||
printf("ServerApp %s: Delete Picture unimplemented\n",_signature.String());
|
||||
#endif
|
||||
STRACE(("ServerApp %s: Delete Picture unimplemented\n",_signature.String()));
|
||||
|
||||
break;
|
||||
}
|
||||
case AS_CLONE_PICTURE:
|
||||
{
|
||||
// TODO: Implement
|
||||
#ifdef DEBUG_SERVERAPP
|
||||
printf("ServerApp %s: Clone Picture unimplemented\n",_signature.String());
|
||||
#endif
|
||||
STRACE(("ServerApp %s: Clone Picture unimplemented\n",_signature.String()));
|
||||
|
||||
break;
|
||||
}
|
||||
case AS_DOWNLOAD_PICTURE:
|
||||
{
|
||||
// TODO; Implement
|
||||
#ifdef DEBUG_SERVERAPP
|
||||
printf("ServerApp %s: Download Picture unimplemented\n",_signature.String());
|
||||
#endif
|
||||
STRACE(("ServerApp %s: Download Picture unimplemented\n",_signature.String()));
|
||||
|
||||
break;
|
||||
}
|
||||
case AS_SET_SCREEN_MODE:
|
||||
@ -663,9 +651,8 @@ void ServerApp::_DispatchMessage(int32 code, int8 *buffer)
|
||||
}
|
||||
default:
|
||||
{
|
||||
#ifdef DEBUG_SERVERAPP
|
||||
printf("ServerApp %s received unhandled message code offset %lx\n",_signature.String(),MsgCodeToString(code));
|
||||
#endif
|
||||
STRACE(("ServerApp %s received unhandled message code offset %s\n",_signature.String(),MsgCodeToString(code)));
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -51,6 +51,13 @@
|
||||
#include "LayerData.h"
|
||||
#include "PNGDump.h"
|
||||
|
||||
#ifdef DEBUG_DRIVER_MODULE
|
||||
# include <stdio.h>
|
||||
# define STRACE(x) printf x
|
||||
#else
|
||||
# define STRACE(x) ;
|
||||
#endif
|
||||
|
||||
enum
|
||||
{
|
||||
VDWIN_CLEAR=100,
|
||||
@ -653,10 +660,8 @@ void ViewDriver::CopyBits(BRect src, BRect dest)
|
||||
|
||||
void ViewDriver::CopyRegion(BRegion *src, const BPoint &lefttop)
|
||||
{
|
||||
#ifdef DEBUG_DRIVER_MODULE
|
||||
printf("ViewDriver:: CopyRegion not completely tested\n");
|
||||
#endif
|
||||
|
||||
STRACE(("ViewDriver:: CopyRegion not completely tested\n"));
|
||||
|
||||
screenwin->Lock();
|
||||
framebuffer->Lock();
|
||||
|
||||
@ -748,9 +753,7 @@ printf("Overlap\n");
|
||||
|
||||
void ViewDriver::DrawBitmap(ServerBitmap *bitmap, BRect src, BRect dest)
|
||||
{
|
||||
#ifdef DEBUG_DRIVER_MODULE
|
||||
printf("ViewDriver:: DrawBitmap unimplemented()\n");
|
||||
#endif
|
||||
STRACE(("ViewDriver:: DrawBitmap unimplemented()\n"));
|
||||
}
|
||||
|
||||
void ViewDriver::DrawChar(char c, BPoint pt, LayerData *d)
|
||||
@ -763,9 +766,7 @@ void ViewDriver::DrawChar(char c, BPoint pt, LayerData *d)
|
||||
/*
|
||||
void ViewDriver::DrawString(const char *string, int32 length, BPoint pt, LayerData *d, escapement_delta *delta=NULL)
|
||||
{
|
||||
#ifdef DEBUG_DRIVER_MODULE
|
||||
printf("ViewDriver:: DrawString(\"%s\",%ld,BPoint(%f,%f))\n",string,length,pt.x,pt.y);
|
||||
#endif
|
||||
STRACE(("ViewDriver:: DrawString(\"%s\",%ld,BPoint(%f,%f))\n",string,length,pt.x,pt.y));
|
||||
if(!d)
|
||||
return;
|
||||
BRect r;
|
||||
|
Loading…
Reference in New Issue
Block a user