Massive reconfiguring to fix link problems with all things needing app_server so
urces git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3963 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
#include <Point.h>
|
#include <Point.h>
|
||||||
#include <Font.h>
|
#include <Font.h>
|
||||||
#include "RGBColor.h"
|
#include "RGBColor.h"
|
||||||
#include "FontServer.h"
|
//#include "FontServer.h"
|
||||||
#include "ServerFont.h"
|
#include "ServerFont.h"
|
||||||
|
|
||||||
class ServerBitmap;
|
class ServerBitmap;
|
||||||
@@ -24,7 +24,8 @@ public:
|
|||||||
highcolor.SetColor(0,0,0,255);
|
highcolor.SetColor(0,0,0,255);
|
||||||
lowcolor.SetColor(255,255,255,255);
|
lowcolor.SetColor(255,255,255,255);
|
||||||
viewcolor.SetColor(255,255,255,255);
|
viewcolor.SetColor(255,255,255,255);
|
||||||
font=fontserver->GetSystemPlain();
|
// font=fontserver->GetSystemPlain();
|
||||||
|
font=NULL;
|
||||||
scale=1.0;
|
scale=1.0;
|
||||||
edelta.space=0;
|
edelta.space=0;
|
||||||
edelta.nonspace=0;
|
edelta.nonspace=0;
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
#ifndef _APPSERVER_CONFIG_H
|
||||||
|
#define _APPSERVER_CONFIG_H
|
||||||
|
|
||||||
|
// This is defined to place the server in test mode, which modifies certain things like
|
||||||
|
// system keyboard shortcuts. Note that it is possible, though senseless, to place it in
|
||||||
|
// regular mode and still use a display driver which depends on the R5 app_server
|
||||||
|
#define TEST_MODE
|
||||||
|
|
||||||
|
// The ViewDriver is a BView/BWindow combination. Plenty of functionality,
|
||||||
|
// but dog-slow.
|
||||||
|
#define VIEWDRIVER 0
|
||||||
|
|
||||||
|
// The ScreenDriver utilizes a BWindowScreen to directly access the video
|
||||||
|
// hardware.
|
||||||
|
#define SCREENDRIVER 1
|
||||||
|
|
||||||
|
// The SecondDriver allows the server to make use of a second video card while
|
||||||
|
// still running as a regular BeOS application. You could say it's training
|
||||||
|
// wheels for the HWDriver
|
||||||
|
#define SECONDDRIVER 2
|
||||||
|
|
||||||
|
// The HWDriver is the real thing - loads all the graphics hardware and
|
||||||
|
// literally takes over the system as the app_server is supposed to. This
|
||||||
|
// one can be used only when the app_server is running as *the* app_server
|
||||||
|
// and not in testing mode like the other drivers are for.
|
||||||
|
#define HWDRIVER 3
|
||||||
|
|
||||||
|
// Display driver to be used by the server.
|
||||||
|
#define DISPLAYDRIVER VIEWDRIVER
|
||||||
|
|
||||||
|
// Uncomment this if the DisplayDriver should only rely on drawing functions implemented
|
||||||
|
// in software even though hardware-accelerated functions are available
|
||||||
|
//#define DISABLE_HARDWARE_ACCELERATION
|
||||||
|
|
||||||
|
// Define this for a quick hack to test some of the drawing functions
|
||||||
|
//#define DISPLAYDRIVER_TEST_HACK
|
||||||
|
|
||||||
|
// Define this if you want the display driver to emulate the input server.
|
||||||
|
// Comment this out if DISPLAYDRIVER is defined as HWDRIVER.
|
||||||
|
#define ENABLE_INPUT_SERVER_EMULATION
|
||||||
|
|
||||||
|
// This is the application signature of our app_server when running as a
|
||||||
|
// regular application. When running as the app_server, this is not used.
|
||||||
|
#define SERVER_SIGNATURE "application/x-vnd.obe-OBAppServer"
|
||||||
|
|
||||||
|
// Directory for all app_server-related settings. Must include ending slash.
|
||||||
|
#define SERVER_SETTINGS_DIR "/boot/home/config/settings/app_server/"
|
||||||
|
|
||||||
|
// Flattened list of usable fonts maintained by the server. The file is a
|
||||||
|
// flattened BMessage which is used for caching the names when obtained
|
||||||
|
// by the various font functions.
|
||||||
|
#define SERVER_FONT_LIST "/boot/home/config/settings/app_server/fontlist"
|
||||||
|
|
||||||
|
// folder used to keep saved color sets for the UI - tab color, etc.
|
||||||
|
#define COLOR_SET_DIR "/boot/home/config/settings/color_sets/"
|
||||||
|
|
||||||
|
// name of the file containing the current UI color settings
|
||||||
|
#define COLOR_SETTINGS_NAME "system_colors"
|
||||||
|
|
||||||
|
// name of the file containing the config data for the desktop
|
||||||
|
#define WORKSPACE_SETTINGS_NAME "workspace_data"
|
||||||
|
|
||||||
|
// Folder for additional window decorators
|
||||||
|
#define DECORATORS_DIR "/boot/home/config/add-ons/decorators/"
|
||||||
|
|
||||||
|
// These definitions provide the server something to use for default
|
||||||
|
// system fonts.
|
||||||
|
#define DEFAULT_PLAIN_FONT_FAMILY "Swis721 BT"
|
||||||
|
#define DEFAULT_PLAIN_FONT_STYLE "Roman"
|
||||||
|
#define DEFAULT_PLAIN_FONT_SIZE 12
|
||||||
|
#define DEFAULT_BOLD_FONT_FAMILY "Swis721 BT"
|
||||||
|
#define DEFAULT_BOLD_FONT_STYLE "Bold"
|
||||||
|
#define DEFAULT_BOLD_FONT_SIZE 12
|
||||||
|
#define DEFAULT_FIXED_FONT_FAMILY "Courier10 BT"
|
||||||
|
#define DEFAULT_FIXED_FONT_STYLE "Roman"
|
||||||
|
#define DEFAULT_FIXED_FONT_SIZE 12
|
||||||
|
|
||||||
|
// This is the port capacity for all monitoring objects - ServerApps
|
||||||
|
// and ServerWindows
|
||||||
|
#define DEFAULT_MONITOR_PORT_SIZE 30
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// Copyright (c) 2001-2002, OpenBeOS
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
// copy of this software and associated documentation files (the "Software"),
|
||||||
|
// to deal in the Software without restriction, including without limitation
|
||||||
|
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
// and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
// Software is furnished to do so, subject to the following conditions:
|
||||||
|
//
|
||||||
|
// The above copyright notice and this permission notice shall be included in
|
||||||
|
// all copies or substantial portions of the Software.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
//
|
||||||
|
// File Name: SharedObject.h
|
||||||
|
// Author: DarkWyrm <[email protected]>
|
||||||
|
// Description: This class is used as a base class for other objects which
|
||||||
|
// must be shared. By using this, objects which depend on its
|
||||||
|
// existence can be somewhat sure that the shared object will
|
||||||
|
// not be deleted until nothing depends on it.
|
||||||
|
//
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
#ifndef SHAREDOBJ_H_
|
||||||
|
#define SHAREDOBJ_H_
|
||||||
|
|
||||||
|
#include <SupportDefs.h>
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\class SharedObject SharedObject.h
|
||||||
|
\brief Base class for shared objects
|
||||||
|
|
||||||
|
SharedObjects track dependencies upon a particular object. In this way, is is
|
||||||
|
possible to ensure that a shared resource is not deleted if something else
|
||||||
|
needs it. How the dependency tracking is done largely depends on the child class.
|
||||||
|
*/
|
||||||
|
class SharedObject
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SharedObject(void) { dependents=0; }
|
||||||
|
virtual ~SharedObject(void){}
|
||||||
|
virtual void AddDependent(void) { dependents++; }
|
||||||
|
virtual void RemoveDependent(void) { dependents--; }
|
||||||
|
virtual bool HasDependents(void) { return (dependents>0)?true:false; }
|
||||||
|
private:
|
||||||
|
uint32 dependents;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -38,6 +38,7 @@
|
|||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
|
||||||
#define RUN_UNDER_R5
|
#define RUN_UNDER_R5
|
||||||
|
|
||||||
#define CLIP_X(a) ( (a < 0) ? 0 : ((a > mDisplayMode.virtual_width-1) ? \
|
#define CLIP_X(a) ( (a < 0) ? 0 : ((a > mDisplayMode.virtual_width-1) ? \
|
||||||
|
|||||||
@@ -42,10 +42,10 @@
|
|||||||
#include <Accelerant.h>
|
#include <Accelerant.h>
|
||||||
#include "DisplayDriver.h"
|
#include "DisplayDriver.h"
|
||||||
#include "PatternHandler.h"
|
#include "PatternHandler.h"
|
||||||
#include <ft2build.h>
|
//#include <ft2build.h>
|
||||||
#include FT_FREETYPE_H
|
//#include FT_FREETYPE_H
|
||||||
#include FT_GLYPH_H
|
//#include FT_GLYPH_H
|
||||||
|
#include "FontServer.h"
|
||||||
#if 0
|
#if 0
|
||||||
class VDWindow;
|
class VDWindow;
|
||||||
class RGBColor;
|
class RGBColor;
|
||||||
|
|||||||
@@ -45,6 +45,7 @@
|
|||||||
#include "BitmapManager.h"
|
#include "BitmapManager.h"
|
||||||
#include "CursorManager.h"
|
#include "CursorManager.h"
|
||||||
#include "Utils.h"
|
#include "Utils.h"
|
||||||
|
#include "FontServer.h"
|
||||||
|
|
||||||
//#define DEBUG_KEYHANDLING
|
//#define DEBUG_KEYHANDLING
|
||||||
|
|
||||||
@@ -497,7 +498,7 @@ void AppServer::DispatchMessage(int32 code, int8 *buffer)
|
|||||||
|
|
||||||
PortLink *replylink=new PortLink(reply_port);
|
PortLink *replylink=new PortLink(reply_port);
|
||||||
replylink->SetOpCode(AS_SET_SERVER_PORT);
|
replylink->SetOpCode(AS_SET_SERVER_PORT);
|
||||||
replylink->Attach((int32)newapp->_receiver);
|
replylink->Attach<int32>(newapp->_receiver);
|
||||||
replylink->Flush();
|
replylink->Flush();
|
||||||
|
|
||||||
delete replylink;
|
delete replylink;
|
||||||
@@ -601,9 +602,9 @@ void AppServer::DispatchMessage(int32 code, int8 *buffer)
|
|||||||
|
|
||||||
PortLink *replylink=new PortLink(*((port_id*)index));
|
PortLink *replylink=new PortLink(*((port_id*)index));
|
||||||
replylink->SetOpCode(AS_GET_SCREEN_MODE);
|
replylink->SetOpCode(AS_GET_SCREEN_MODE);
|
||||||
replylink->Attach((int16)_driver->GetWidth());
|
replylink->Attach<int16>(_driver->GetWidth());
|
||||||
replylink->Attach((int16)_driver->GetHeight());
|
replylink->Attach<int16>(_driver->GetHeight());
|
||||||
replylink->Attach((int16)_driver->GetDepth());
|
replylink->Attach<int16>(_driver->GetDepth());
|
||||||
replylink->Flush();
|
replylink->Flush();
|
||||||
delete replylink;
|
delete replylink;
|
||||||
break;
|
break;
|
||||||
@@ -981,7 +982,6 @@ ServerApp *AppServer::FindApp(const char *sig)
|
|||||||
Decorator *new_decorator(BRect rect, const char *title, int32 wlook, int32 wfeel,
|
Decorator *new_decorator(BRect rect, const char *title, int32 wlook, int32 wfeel,
|
||||||
int32 wflags, DisplayDriver *ddriver)
|
int32 wflags, DisplayDriver *ddriver)
|
||||||
{
|
{
|
||||||
debugger("");
|
|
||||||
Decorator *dec=NULL;
|
Decorator *dec=NULL;
|
||||||
if(!app_server->make_decorator)
|
if(!app_server->make_decorator)
|
||||||
dec=new DefaultDecorator(rect,wlook,wfeel,wflags);
|
dec=new DefaultDecorator(rect,wlook,wfeel,wflags);
|
||||||
|
|||||||
@@ -38,9 +38,10 @@
|
|||||||
#include <Bitmap.h>
|
#include <Bitmap.h>
|
||||||
#include <OS.h>
|
#include <OS.h>
|
||||||
#include "DisplayDriver.h"
|
#include "DisplayDriver.h"
|
||||||
#include <ft2build.h>
|
//#include <ft2build.h>
|
||||||
#include FT_FREETYPE_H
|
//#include FT_FREETYPE_H
|
||||||
#include FT_GLYPH_H
|
//#include FT_GLYPH_H
|
||||||
|
#include "FontServer.h"
|
||||||
|
|
||||||
class ServerCursor;
|
class ServerCursor;
|
||||||
class ServerBitmap;
|
class ServerBitmap;
|
||||||
|
|||||||
@@ -1,210 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// Copyright (c) 2001-2002, OpenBeOS
|
|
||||||
//
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
||||||
// copy of this software and associated documentation files (the "Software"),
|
|
||||||
// to deal in the Software without restriction, including without limitation
|
|
||||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
||||||
// and/or sell copies of the Software, and to permit persons to whom the
|
|
||||||
// Software is furnished to do so, subject to the following conditions:
|
|
||||||
//
|
|
||||||
// The above copyright notice and this permission notice shall be included in
|
|
||||||
// all copies or substantial portions of the Software.
|
|
||||||
//
|
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
||||||
// DEALINGS IN THE SOFTWARE.
|
|
||||||
//
|
|
||||||
// File Name: ColorUtils.cc
|
|
||||||
// Author: DarkWyrm <[email protected]>
|
|
||||||
// Description: Miscellaneous useful functions for working with colors
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
#include "ColorUtils.h"
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\brief An approximation of 31/255, which is needed for converting from 32-bit
|
|
||||||
colors to 16-bit.
|
|
||||||
*/
|
|
||||||
#define RATIO_32_TO_16_BIT .121568627451
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\brief An approximation of 255/31, which is needed for converting from 16-bit
|
|
||||||
colors to 32-bit.
|
|
||||||
*/
|
|
||||||
#define RATIO_16_TO_32_BIT 8.225806451613
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\brief Function for easy assignment of values to rgb_color objects
|
|
||||||
\param Pointer to an rgb_color
|
|
||||||
\param red value
|
|
||||||
\param green value
|
|
||||||
\param blue value
|
|
||||||
\param alpha value, defaults to 255
|
|
||||||
|
|
||||||
This function will do nothing if given a NULL color pointer.
|
|
||||||
*/
|
|
||||||
void SetRGBColor(rgb_color *col,uint8 r, uint8 g, uint8 b, uint8 a)
|
|
||||||
{
|
|
||||||
if(col)
|
|
||||||
{
|
|
||||||
col->red=r;
|
|
||||||
col->green=g;
|
|
||||||
col->blue=b;
|
|
||||||
col->alpha=a;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\brief Function for easy conversion of 16-bit colors to 32-bit
|
|
||||||
\param Pointer to an rgb_color.
|
|
||||||
\param RGBA16 color
|
|
||||||
|
|
||||||
This function will do nothing if passed a NULL 32-bit color.
|
|
||||||
*/
|
|
||||||
void SetRGBColor(rgb_color *col,uint16 color)
|
|
||||||
{
|
|
||||||
if(!col)
|
|
||||||
return;
|
|
||||||
|
|
||||||
uint16 r16,g16,b16;
|
|
||||||
|
|
||||||
// alpha's the easy part
|
|
||||||
col->alpha=(color & 0x8000)?255:0;
|
|
||||||
|
|
||||||
r16= (color >> 15) & 31;
|
|
||||||
g16= (color >> 10) & 31;
|
|
||||||
b16= color & 31;
|
|
||||||
|
|
||||||
col->red=uint8(r16 * RATIO_16_TO_32_BIT);
|
|
||||||
col->green=uint8(g16 * RATIO_16_TO_32_BIT);
|
|
||||||
col->blue=uint8(b16 * RATIO_16_TO_32_BIT);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\brief Finds the index of the closest matching color in a rgb_color palette array
|
|
||||||
\param Array of 256 rgb_color objects
|
|
||||||
\param Color to match
|
|
||||||
\return Index of the closest matching color
|
|
||||||
|
|
||||||
Note that passing a NULL palette will always return 0 and passing an array of less
|
|
||||||
than 256 rgb_colors will cause a crash.
|
|
||||||
*/
|
|
||||||
uint8 FindClosestColor(rgb_color *palette, rgb_color color)
|
|
||||||
{
|
|
||||||
if(!palette)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
uint16 cindex=0,cdelta=765,delta=765;
|
|
||||||
rgb_color *c;
|
|
||||||
|
|
||||||
for(uint16 i=0;i<256;i++)
|
|
||||||
{
|
|
||||||
c=&(palette[i]);
|
|
||||||
delta=abs(c->red-color.red)+abs(c->green-color.green)+
|
|
||||||
abs(c->blue-color.blue);
|
|
||||||
|
|
||||||
if(delta==0)
|
|
||||||
{
|
|
||||||
cindex=i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(delta<cdelta)
|
|
||||||
{
|
|
||||||
cindex=i;
|
|
||||||
cdelta=delta;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return (uint8)cindex;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\brief Constructs a RGBA15 color which best matches a given 32-bit color
|
|
||||||
\param Color to match
|
|
||||||
\return The closest matching color's value
|
|
||||||
|
|
||||||
Format is ARGB, 1:5:5:5
|
|
||||||
*/
|
|
||||||
uint16 FindClosestColor16(rgb_color color)
|
|
||||||
{
|
|
||||||
uint16 r16,g16,b16;
|
|
||||||
uint16 color16;
|
|
||||||
|
|
||||||
r16=uint16(color.red * RATIO_32_TO_16_BIT);
|
|
||||||
g16=uint16(color.green * RATIO_32_TO_16_BIT);
|
|
||||||
b16=uint16(color.blue * RATIO_32_TO_16_BIT);
|
|
||||||
|
|
||||||
// start with alpha value
|
|
||||||
color16=(color.alpha>127)?0x8000:0;
|
|
||||||
|
|
||||||
color16 |= r16 << 15;
|
|
||||||
color16 |= g16 << 10;
|
|
||||||
color16 |= b16;
|
|
||||||
|
|
||||||
return color16;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Function which could be used to . Position is
|
|
||||||
// Any number outside
|
|
||||||
// this range will cause the function to fail and return the color (0,0,0,0)
|
|
||||||
// Alpha components are included in the calculations. 0 yields color #1
|
|
||||||
// and 1 yields color #2.
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\brief Function mostly for calculating gradient colors
|
|
||||||
\param Start color
|
|
||||||
\param End color
|
|
||||||
\param A floating point number such that 0.0 <= position <= 1.0. 0.0 results in the
|
|
||||||
start color and 1.0 results in the end color.
|
|
||||||
\return The blended color. If an invalid position was given, {0,0,0,0} is returned.
|
|
||||||
*/
|
|
||||||
rgb_color MakeBlendColor(rgb_color col, rgb_color col2, float position)
|
|
||||||
{
|
|
||||||
rgb_color newcol={0,0,0,0};
|
|
||||||
float mod=0;
|
|
||||||
int16 delta;
|
|
||||||
if(position<0 || position>1)
|
|
||||||
return newcol;
|
|
||||||
|
|
||||||
delta=int16(col2.red)-int16(col.red);
|
|
||||||
mod=col.red + (position * delta);
|
|
||||||
newcol.red=uint8(mod);
|
|
||||||
if(mod>255 )
|
|
||||||
newcol.red=255;
|
|
||||||
if(mod<0 )
|
|
||||||
newcol.red=0;
|
|
||||||
|
|
||||||
delta=int16(col2.green)-int16(col.green);
|
|
||||||
mod=col.green + (position * delta);
|
|
||||||
newcol.green=uint8(mod);
|
|
||||||
if(mod>255 )
|
|
||||||
newcol.green=255;
|
|
||||||
if(mod<0 )
|
|
||||||
newcol.green=0;
|
|
||||||
|
|
||||||
delta=int16(col2.blue)-int16(col.blue);
|
|
||||||
mod=col.blue + (position * delta);
|
|
||||||
newcol.blue=uint8(mod);
|
|
||||||
if(mod>255 )
|
|
||||||
newcol.blue=255;
|
|
||||||
if(mod<0 )
|
|
||||||
newcol.blue=0;
|
|
||||||
|
|
||||||
delta=int8(col2.alpha)-int8(col.alpha);
|
|
||||||
mod=col.alpha + (position * delta);
|
|
||||||
newcol.alpha=uint8(mod);
|
|
||||||
if(mod>255 )
|
|
||||||
newcol.alpha=255;
|
|
||||||
if(mod<0 )
|
|
||||||
newcol.alpha=0;
|
|
||||||
|
|
||||||
return newcol;
|
|
||||||
}
|
|
||||||
@@ -38,8 +38,8 @@ int8 default_cursor_data[] = {
|
|||||||
144,64, // *--*-----*------
|
144,64, // *--*-----*------
|
||||||
144,128, // *--*----*-------
|
144,128, // *--*----*-------
|
||||||
105,0, // -**-*--*--------
|
105,0, // -**-*--*--------
|
||||||
|
|
||||||
6,0, // -----**---------
|
6,0, // -----**---------
|
||||||
|
|
||||||
0,0, // ----------------
|
0,0, // ----------------
|
||||||
0,0, // ----------------
|
0,0, // ----------------
|
||||||
0,0, // ----------------
|
0,0, // ----------------
|
||||||
@@ -56,9 +56,9 @@ int8 default_cursor_data[] = {
|
|||||||
255,224,
|
255,224,
|
||||||
255,192,
|
255,192,
|
||||||
255,128,
|
255,128,
|
||||||
105,0,
|
111,0,
|
||||||
|
6,0,
|
||||||
|
|
||||||
0,0,
|
|
||||||
0,0,
|
0,0,
|
||||||
0,0,
|
0,0,
|
||||||
0,0
|
0,0
|
||||||
|
|||||||
@@ -28,7 +28,8 @@
|
|||||||
#include "ServerFont.h"
|
#include "ServerFont.h"
|
||||||
#include FT_CACHE_H
|
#include FT_CACHE_H
|
||||||
|
|
||||||
extern FTC_Manager ftmanager;
|
FTC_Manager ftmanager;
|
||||||
|
FT_Library ftlib;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Constructor
|
\brief Constructor
|
||||||
|
|||||||
@@ -27,18 +27,16 @@
|
|||||||
#include <String.h>
|
#include <String.h>
|
||||||
#include <Directory.h>
|
#include <Directory.h>
|
||||||
#include <Entry.h>
|
#include <Entry.h>
|
||||||
#include <Path.h>
|
#include <storage/Path.h> // specified to be able to build under Dano
|
||||||
#include <File.h>
|
#include <File.h>
|
||||||
#include <Message.h>
|
#include <Message.h>
|
||||||
#include <String.h>
|
#include <String.h>
|
||||||
|
|
||||||
#include "FontFamily.h"
|
|
||||||
#include "FontServer.h"
|
#include "FontServer.h"
|
||||||
|
#include "FontFamily.h"
|
||||||
#include "ServerFont.h"
|
#include "ServerFont.h"
|
||||||
#include "ServerConfig.h"
|
#include "ServerConfig.h"
|
||||||
|
|
||||||
FTC_Manager ftmanager;
|
|
||||||
FT_Library ftlib;
|
|
||||||
FontServer *fontserver;
|
FontServer *fontserver;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
@@ -3,9 +3,27 @@ SubDir OBOS_TOP src servers app server ;
|
|||||||
AddResources app_server : app_server.rsrc ;
|
AddResources app_server : app_server.rsrc ;
|
||||||
|
|
||||||
UseLibraryHeaders png zlib ;
|
UseLibraryHeaders png zlib ;
|
||||||
UsePrivateHeaders app interface ;
|
UsePrivateHeaders app interface [ FDirName servers app ] ;
|
||||||
UseFreeTypeHeaders ;
|
UseFreeTypeHeaders ;
|
||||||
|
|
||||||
|
SharedLibrary appserver :
|
||||||
|
ColorSet.cpp
|
||||||
|
Decorator.cpp
|
||||||
|
DisplayDriver.cpp
|
||||||
|
FontFamily.cpp
|
||||||
|
PatternHandler.cpp
|
||||||
|
RectUtils.cpp
|
||||||
|
RGBColor.cpp
|
||||||
|
ServerBitmap.cpp
|
||||||
|
ServerCursor.cpp
|
||||||
|
ServerFont.cpp
|
||||||
|
SystemPalette.cpp
|
||||||
|
;
|
||||||
|
|
||||||
|
LinkSharedOSLibs libappserver.so : root be
|
||||||
|
<boot!home!config!lib>libopenbeos.so
|
||||||
|
<boot!home!config!lib>libfreetype.so ;
|
||||||
|
|
||||||
Server app_server :
|
Server app_server :
|
||||||
# Misc. Sources
|
# Misc. Sources
|
||||||
areafunc.c
|
areafunc.c
|
||||||
@@ -13,14 +31,9 @@ Server app_server :
|
|||||||
bget.c
|
bget.c
|
||||||
CursorData.cpp
|
CursorData.cpp
|
||||||
TokenHandler.cpp
|
TokenHandler.cpp
|
||||||
PatternHandler.cpp
|
|
||||||
PicturePlayer.cpp
|
PicturePlayer.cpp
|
||||||
|
|
||||||
ColorSet.cpp
|
|
||||||
PNGDump.cpp
|
PNGDump.cpp
|
||||||
RectUtils.cpp
|
|
||||||
RGBColor.cpp
|
|
||||||
SystemPalette.cpp
|
|
||||||
Utils.cpp
|
Utils.cpp
|
||||||
|
|
||||||
# Manager Classes
|
# Manager Classes
|
||||||
@@ -33,21 +46,15 @@ Server app_server :
|
|||||||
ServerWindow.cpp
|
ServerWindow.cpp
|
||||||
|
|
||||||
# Font Classes
|
# Font Classes
|
||||||
FontFamily.cpp
|
|
||||||
FontServer.cpp
|
FontServer.cpp
|
||||||
ServerFont.cpp
|
|
||||||
|
|
||||||
# Display Classes
|
# Display Classes
|
||||||
AccelerantDriver.cpp
|
AccelerantDriver.cpp
|
||||||
Decorator.cpp
|
|
||||||
DefaultDecorator.cpp
|
DefaultDecorator.cpp
|
||||||
DesktopClasses.cpp
|
DesktopClasses.cpp
|
||||||
DisplayDriver.cpp
|
|
||||||
Layer.cpp
|
Layer.cpp
|
||||||
RootLayer.cpp
|
RootLayer.cpp
|
||||||
ScreenDriver.cpp
|
ScreenDriver.cpp
|
||||||
ServerBitmap.cpp
|
|
||||||
ServerCursor.cpp
|
|
||||||
ServerPicture.cpp
|
ServerPicture.cpp
|
||||||
ViewDriver.cpp
|
ViewDriver.cpp
|
||||||
WinBorder.cpp
|
WinBorder.cpp
|
||||||
@@ -56,7 +63,7 @@ Server app_server :
|
|||||||
LINKFLAGS on app_server ?= $(LINKFLAGS) ;
|
LINKFLAGS on app_server ?= $(LINKFLAGS) ;
|
||||||
LINKFLAGS on app_server += -lbe ;
|
LINKFLAGS on app_server += -lbe ;
|
||||||
|
|
||||||
LinkSharedOSLibs app_server : root game translation libz.so libpng.so
|
LinkSharedOSLibs app_server : root game translation libz.so libpng.so libappserver.so
|
||||||
<boot!home!config!lib>libopenbeos.so
|
<boot!home!config!lib>libopenbeos.so
|
||||||
<boot!home!config!lib>libfreetype.so ;
|
<boot!home!config!lib>libfreetype.so ;
|
||||||
|
|
||||||
|
|||||||
@@ -27,8 +27,9 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
#include "PicturePlayer.h"
|
#include "PicturePlayer.h"
|
||||||
#include <PictureProtocol.h>
|
#include "PictureProtocol.h"
|
||||||
#include "DisplayDriver.h"
|
#include "DisplayDriver.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
PicturePlayer::PicturePlayer(DisplayDriver *d,void *data, int32 size)
|
PicturePlayer::PicturePlayer(DisplayDriver *d,void *data, int32 size)
|
||||||
: fData(data, size)
|
: fData(data, size)
|
||||||
|
|||||||
@@ -1,5 +1,42 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// Copyright (c) 2001-2002, OpenBeOS
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
// copy of this software and associated documentation files (the "Software"),
|
||||||
|
// to deal in the Software without restriction, including without limitation
|
||||||
|
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
// and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
// Software is furnished to do so, subject to the following conditions:
|
||||||
|
//
|
||||||
|
// The above copyright notice and this permission notice shall be included in
|
||||||
|
// all copies or substantial portions of the Software.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
//
|
||||||
|
// File Name: RectUtils.cpp
|
||||||
|
// Author: DarkWyrm <[email protected]>
|
||||||
|
// Description: Utilities for work around R5 Interface Kit bugs
|
||||||
|
//
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
#include "RectUtils.h"
|
#include "RectUtils.h"
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Checks for the intersection of two rectangles. Works properly,
|
||||||
|
unlike BRect::Intersects
|
||||||
|
|
||||||
|
\param r First rectangle
|
||||||
|
\param r2 Second rectangle
|
||||||
|
\return True if they intersect, false if they don't.
|
||||||
|
|
||||||
|
The two rectangles intersect if they are equal, one contains the other,
|
||||||
|
or if any edge intersects any edge of the other rectangle.
|
||||||
|
*/
|
||||||
bool TestRectIntersection(const BRect &r,const BRect &r2)
|
bool TestRectIntersection(const BRect &r,const BRect &r2)
|
||||||
{
|
{
|
||||||
return TestLineIntersection(r, r2.left, r2.top, r2.left, r2.bottom) ||
|
return TestLineIntersection(r, r2.left, r2.top, r2.left, r2.bottom) ||
|
||||||
@@ -10,6 +47,16 @@ bool TestRectIntersection(const BRect &r,const BRect &r2)
|
|||||||
r2.Contains(r);
|
r2.Contains(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Checks to see if a region intersects with a particular rectangle
|
||||||
|
|
||||||
|
\param r Region
|
||||||
|
\param r2 Rectangle to check intersection with
|
||||||
|
\return True if they intersect, false if they don't.
|
||||||
|
|
||||||
|
The two intersect if they the rectangle intersects any one rectangle in the
|
||||||
|
region.
|
||||||
|
*/
|
||||||
bool TestRegionIntersection(BRegion *r,const BRect &r2)
|
bool TestRegionIntersection(BRegion *r,const BRect &r2)
|
||||||
{
|
{
|
||||||
for(int32 i=0; i<r->CountRects(); i++)
|
for(int32 i=0; i<r->CountRects(); i++)
|
||||||
@@ -18,6 +65,12 @@ bool TestRegionIntersection(BRegion *r,const BRect &r2)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Modifies the region to intersect with the rectangle given
|
||||||
|
|
||||||
|
\param r Region
|
||||||
|
\param r2 Rectangle to intersect with
|
||||||
|
*/
|
||||||
void IntersectRegionWith(BRegion *r,const BRect &r2)
|
void IntersectRegionWith(BRegion *r,const BRect &r2)
|
||||||
{
|
{
|
||||||
// We have three conditions:
|
// We have three conditions:
|
||||||
@@ -35,6 +88,17 @@ void IntersectRegionWith(BRegion *r,const BRect &r2)
|
|||||||
r->MakeEmpty();
|
r->MakeEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Checks for the intersection of a line with a rectangle
|
||||||
|
|
||||||
|
\param r Rectangle
|
||||||
|
\param x1 starting x of line
|
||||||
|
\param y1 starting y of line
|
||||||
|
\param x2 ending x of line
|
||||||
|
\param y2 ending y of line
|
||||||
|
\param vertical Test for vertical intersection
|
||||||
|
\return true if they intersect, false if not
|
||||||
|
*/
|
||||||
bool TestLineIntersection(const BRect& r, float x1, float y1, float x2, float y2,
|
bool TestLineIntersection(const BRect& r, float x1, float y1, float x2, float y2,
|
||||||
bool vertical)
|
bool vertical)
|
||||||
{
|
{
|
||||||
@@ -52,6 +116,10 @@ bool TestLineIntersection(const BRect& r, float x1, float y1, float x2, float y2
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Ensures that a BRect's IsValid() member returns true
|
||||||
|
\param rect BRect to validate
|
||||||
|
*/
|
||||||
void ValidateRect(BRect *rect)
|
void ValidateRect(BRect *rect)
|
||||||
{
|
{
|
||||||
float l,r,t,b;
|
float l,r,t,b;
|
||||||
|
|||||||
@@ -76,17 +76,19 @@ void RootLayer::RequestDraw(void)
|
|||||||
low.type64=0LL;
|
low.type64=0LL;
|
||||||
|
|
||||||
// Redraw the base
|
// Redraw the base
|
||||||
for(int32 i=0; _invalid->CountRects();i++)
|
if(_invalid)
|
||||||
{
|
{
|
||||||
if(_invalid->RectAt(i).IsValid())
|
for(int32 i=0; _invalid->CountRects();i++)
|
||||||
_driver->FillRect(_invalid->RectAt(i),_layerdata, (int8*)low.type8);
|
{
|
||||||
else
|
if(_invalid->RectAt(i).IsValid())
|
||||||
break;
|
_driver->FillRect(_invalid->RectAt(i),_layerdata, (int8*)low.type8);
|
||||||
}
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
delete _invalid;
|
delete _invalid;
|
||||||
_invalid=NULL;
|
_invalid=NULL;
|
||||||
_is_dirty=false;
|
}
|
||||||
|
|
||||||
// force redraw of all dirty windows
|
// force redraw of all dirty windows
|
||||||
for(Layer *lay=_topchild; lay!=NULL; lay=lay->_lowersibling)
|
for(Layer *lay=_topchild; lay!=NULL; lay=lay->_lowersibling)
|
||||||
@@ -95,6 +97,7 @@ void RootLayer::RequestDraw(void)
|
|||||||
lay->RequestDraw(lay->Bounds());
|
lay->RequestDraw(lay->Bounds());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_is_dirty=false;
|
||||||
#ifdef DISPLAYDRIVER_TEST_HACK
|
#ifdef DISPLAYDRIVER_TEST_HACK
|
||||||
int8 pattern[8];
|
int8 pattern[8];
|
||||||
int8 pattern2[8];
|
int8 pattern2[8];
|
||||||
|
|||||||
@@ -38,9 +38,10 @@
|
|||||||
#include <Region.h>
|
#include <Region.h>
|
||||||
#include <Font.h>
|
#include <Font.h>
|
||||||
#include "DisplayDriver.h"
|
#include "DisplayDriver.h"
|
||||||
#include <ft2build.h>
|
//#include <ft2build.h>
|
||||||
#include <WindowScreen.h>
|
#include <WindowScreen.h>
|
||||||
#include FT_FREETYPE_H
|
//#include FT_FREETYPE_H
|
||||||
|
#include "FontServer.h"
|
||||||
|
|
||||||
class BBitmap;
|
class BBitmap;
|
||||||
class PortLink;
|
class PortLink;
|
||||||
|
|||||||
@@ -370,8 +370,8 @@ void ServerApp::_DispatchMessage(int32 code, int8 *buffer)
|
|||||||
// ServerWindow's message port
|
// ServerWindow's message port
|
||||||
PortLink *replylink=new PortLink(reply_port);
|
PortLink *replylink=new PortLink(reply_port);
|
||||||
replylink->SetOpCode(AS_SET_SERVER_PORT);
|
replylink->SetOpCode(AS_SET_SERVER_PORT);
|
||||||
replylink->Attach((int32)newwin->_receiver);
|
replylink->Attach<int32>(newwin->_receiver);
|
||||||
replylink->Attach((int32)newwin->_token);
|
replylink->Attach<int32>(newwin->_token);
|
||||||
replylink->Flush();
|
replylink->Flush();
|
||||||
|
|
||||||
delete replylink;
|
delete replylink;
|
||||||
|
|||||||
@@ -285,8 +285,8 @@ void ServerWindow::WorkspaceActivated(int32 workspace, bool active)
|
|||||||
printf("ServerWindow %s: WorkspaceActivated(%ld,%s)\n",_title->String(),workspace,(active)?"active":"inactive");
|
printf("ServerWindow %s: WorkspaceActivated(%ld,%s)\n",_title->String(),workspace,(active)?"active":"inactive");
|
||||||
#endif
|
#endif
|
||||||
_winlink->SetOpCode(AS_WORKSPACE_ACTIVATED);
|
_winlink->SetOpCode(AS_WORKSPACE_ACTIVATED);
|
||||||
_winlink->Attach(workspace);
|
_winlink->Attach<int32>(workspace);
|
||||||
_winlink->Attach(active);
|
_winlink->Attach<bool>(active);
|
||||||
_winlink->Flush();
|
_winlink->Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -301,8 +301,8 @@ void ServerWindow::WorkspacesChanged(int32 oldone,int32 newone)
|
|||||||
printf("ServerWindow %s: WorkspacesChanged(%ld,%ld)\n",_title->String(),oldone,newone);
|
printf("ServerWindow %s: WorkspacesChanged(%ld,%ld)\n",_title->String(),oldone,newone);
|
||||||
#endif
|
#endif
|
||||||
_winlink->SetOpCode(AS_WORKSPACES_CHANGED);
|
_winlink->SetOpCode(AS_WORKSPACES_CHANGED);
|
||||||
_winlink->Attach(oldone);
|
_winlink->Attach<int32>(oldone);
|
||||||
_winlink->Attach(newone);
|
_winlink->Attach<int32>(newone);
|
||||||
_winlink->Flush();
|
_winlink->Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -316,7 +316,7 @@ void ServerWindow::WindowActivated(bool active)
|
|||||||
printf("ServerWindow %s: WindowActivated(%s)\n",_title->String(),(active)?"active":"inactive");
|
printf("ServerWindow %s: WindowActivated(%s)\n",_title->String(),(active)?"active":"inactive");
|
||||||
#endif
|
#endif
|
||||||
_winlink->SetOpCode(AS_WINDOW_ACTIVATED);
|
_winlink->SetOpCode(AS_WINDOW_ACTIVATED);
|
||||||
_winlink->Attach(active);
|
_winlink->Attach<bool>(active);
|
||||||
_winlink->Flush();
|
_winlink->Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -331,7 +331,7 @@ void ServerWindow::ScreenModeChanged(const BRect frame, const color_space cspace
|
|||||||
printf("ServerWindow %s: ScreenModeChanged\n",_title->String());
|
printf("ServerWindow %s: ScreenModeChanged\n",_title->String());
|
||||||
#endif
|
#endif
|
||||||
_winlink->SetOpCode(AS_SCREENMODE_CHANGED);
|
_winlink->SetOpCode(AS_SCREENMODE_CHANGED);
|
||||||
_winlink->Attach(frame);
|
_winlink->Attach<BRect>(frame);
|
||||||
_winlink->Attach(&cspace,sizeof(color_space));
|
_winlink->Attach(&cspace,sizeof(color_space));
|
||||||
_winlink->Flush();
|
_winlink->Flush();
|
||||||
}
|
}
|
||||||
@@ -1202,7 +1202,7 @@ int32 ServerWindow::MonitorWin(void *data)
|
|||||||
// Our BWindow sent us this message when it quit.
|
// Our BWindow sent us this message when it quit.
|
||||||
// We need to ask its ServerApp to delete our monitor
|
// We need to ask its ServerApp to delete our monitor
|
||||||
win->_applink->SetOpCode(AS_DELETE_WINDOW);
|
win->_applink->SetOpCode(AS_DELETE_WINDOW);
|
||||||
win->_applink->Attach((int32)win->_token);
|
win->_applink->Attach<int32>(win->_token);
|
||||||
win->_applink->Flush();
|
win->_applink->Flush();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1271,9 +1271,9 @@ void ServerWindow::HandleMouseEvent(PortMessage *msg)
|
|||||||
float x;
|
float x;
|
||||||
float y;
|
float y;
|
||||||
int64 dummy;
|
int64 dummy;
|
||||||
msg->Read(&dummy);
|
msg->Read<int64>(&dummy);
|
||||||
msg->Read(&x);
|
msg->Read<float>(&x);
|
||||||
msg->Read(&y);
|
msg->Read<float>(&y);
|
||||||
BPoint pt(x,y);
|
BPoint pt(x,y);
|
||||||
|
|
||||||
// If we have clicked on a window,
|
// If we have clicked on a window,
|
||||||
|
|||||||
@@ -37,8 +37,9 @@
|
|||||||
#include <Region.h>
|
#include <Region.h>
|
||||||
#include <Font.h>
|
#include <Font.h>
|
||||||
#include "DisplayDriver.h"
|
#include "DisplayDriver.h"
|
||||||
#include <ft2build.h>
|
//#include <ft2build.h>
|
||||||
#include FT_FREETYPE_H
|
//#include FT_FREETYPE_H
|
||||||
|
#include "FontServer.h"
|
||||||
|
|
||||||
class BBitmap;
|
class BBitmap;
|
||||||
class PortLink;
|
class PortLink;
|
||||||
|
|||||||
Reference in New Issue
Block a user