* use the screenshot app to take a screenshot

* remove libpng and libz dependency in case we build for Haiku



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27801 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Karsten Heimrich 2008-09-30 21:48:35 +00:00
parent 9ee4aec913
commit eb1466cf86
3 changed files with 37 additions and 11 deletions

View File

@ -20,12 +20,17 @@ if $(RUN_WITHOUT_APP_SERVER) != 0 {
UsePrivateHeaders [ FDirName kernel ] # For KMessage.h
UsePrivateHeaders syslog_daemon ; # For syslog.cpp
local pngDump ;
if $(TARGET_PLATFORM) != haiku {
pngDump = libpng.so libz.so ;
}
# Build our libbe.so
AddResources libbe.so : libbe_version.rdef ;
SharedLibrary libbe.so :
:
:
<libbe>app_kit.o
<libbe>interface_kit.o
<libbe>storage_kit.o
@ -35,7 +40,7 @@ SharedLibrary libbe.so :
libagg.a
libroot.so # make sure it links against our libroot.so
libpng.so libz.so # For dumping the screen to PNG in the Interface Kit
$(pngDump) # For dumping the screen to PNG in the Interface Kit on R5
$(TARGET_LIBSTDC++)
;
@ -71,7 +76,6 @@ SharedLibrary libbe_haiku.so :
libbeadapter.so
$(TARGET_NETWORK_LIBS)
libpng.so # For dumping the screen to PNG in the Interface Kit
$(TARGET_LIBSTDC++)
;

View File

@ -26,8 +26,14 @@ if ! $(TARGET_PLATFORM_HAIKU_COMPATIBLE) {
SetSubDirSupportedPlatforms haiku libbe_test ;
UsePrivateHeaders app input print interface shared tracker ;
UseLibraryHeaders icon png zlib ;
local pngDump ;
if $(TARGET_PLATFORM) = haiku {
UseLibraryHeaders icon ;
} else {
pngDump = PNGDump.cpp ;
UseLibraryHeaders icon png zlib ;
}
SEARCH_SOURCE += [ FDirName $(SUBDIR) textview_support ] ;
SEARCH_SOURCE += [ FDirName $(SUBDIR) layouter ] ;
@ -78,7 +84,6 @@ MergeObject <libbe>interface_kit.o :
PictureButton.cpp
PictureDataWriter.cpp
PicturePlayer.cpp
PNGDump.cpp
Point.cpp
Polygon.cpp
PopUpMenu.cpp
@ -126,6 +131,9 @@ MergeObject <libbe>interface_kit.o :
LayoutOptimizer.cpp
OneElementLayouter.cpp
SimpleLayouter.cpp
# required on R5
$(pngDump)
;
StaticLibrary libcolumnlistview.a :

View File

@ -44,8 +44,9 @@
#include <tracker_private.h>
#include <WindowPrivate.h>
#include "PNGDump.h"
#ifndef __HAIKU__
# include "PNGDump.h"
#endif
//#define DEBUG_WIN
#ifdef DEBUG_WIN
@ -2663,8 +2664,8 @@ BWindow::_DequeueAll()
a) it uses the _DetermineTarget() method to tell what the later target of
a message will be, if no explicit target is supplied.
b) it calls _UnpackMessage() and _SanitizeMessage() to duplicate the message
to all of its intended targets, and to add all fields the target would
expect in such a message.
to all of its intended targets, and to add all fields the target would
expect in such a message.
This is important because the app_server sends all input events to the
preferred handler, and expects them to be correctly distributed to their
@ -2876,7 +2877,7 @@ BWindow::_CreateTopView()
fTopView->_SetOwner(this);
// we can't use AddChild() because this is the top view
fTopView->_CreateSelf();
fTopView->_CreateSelf();
STRACE(("BuildTopView ended\n"));
}
@ -3296,6 +3297,19 @@ BWindow::_HandleKeyDown(BMessage* event)
// Check for Print Screen
int32 rawKey;
if (event->FindInt32("key", &rawKey) == B_OK && rawKey == B_PRINT_KEY) {
#ifdef __HAIKU__
BMessage message(B_REFS_RECEIVED);
message.AddBool("silent", true);
if ((modifiers & B_CONTROL_KEY) != 0)
message.AddBool("window", true);
if ((modifiers & B_SHIFT_KEY) != 0 || (modifiers & B_OPTION_KEY) != 0)
message.ReplaceBool("silent", false);
be_roster->Launch("application/x-vnd.haiku-screenshot", &message);
return true;
#elif
// Get filename
BPath homePath;
@ -3328,7 +3342,7 @@ BWindow::_HandleKeyDown(BMessage* event)
// Free the bitmap allocated by BScreen.GetBitmap
delete screenDump;
#endif
return true;
}
}