* rearranged header a bit
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26308 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+27
-17
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2001-2006, Haiku. All rights reserved.
|
* Copyright 2001-2008, Haiku. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -26,6 +26,7 @@ class Printer;
|
|||||||
// OpenTracker shared sources
|
// OpenTracker shared sources
|
||||||
#include "ObjectList.h"
|
#include "ObjectList.h"
|
||||||
|
|
||||||
|
|
||||||
class SpoolFolder : public Folder {
|
class SpoolFolder : public Folder {
|
||||||
protected:
|
protected:
|
||||||
void Notify(Job* job, int kind);
|
void Notify(Job* job, int kind);
|
||||||
@@ -34,6 +35,7 @@ public:
|
|||||||
SpoolFolder(BLocker* locker, BLooper* looper, const BDirectory& spoolDir);
|
SpoolFolder(BLocker* locker, BLooper* looper, const BDirectory& spoolDir);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
// Printer
|
// Printer
|
||||||
//
|
//
|
||||||
@@ -43,10 +45,14 @@ public:
|
|||||||
class Printer : public BHandler, public Object
|
class Printer : public BHandler, public Object
|
||||||
{
|
{
|
||||||
typedef BHandler Inherited;
|
typedef BHandler Inherited;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Printer(const BDirectory* node, Resource* res);
|
Printer(const BDirectory* node, Resource* res);
|
||||||
~Printer();
|
virtual ~Printer();
|
||||||
|
|
||||||
|
virtual void MessageReceived(BMessage* message);
|
||||||
|
virtual status_t GetSupportedSuites(BMessage* msg);
|
||||||
|
virtual BHandler* ResolveSpecifier(BMessage* msg, int32 index,
|
||||||
|
BMessage* spec, int32 form, const char* prop);
|
||||||
|
|
||||||
// Static helper functions
|
// Static helper functions
|
||||||
static Printer* Find(const BString& name);
|
static Printer* Find(const BString& name);
|
||||||
@@ -63,16 +69,12 @@ public:
|
|||||||
|
|
||||||
// Try to start processing of next spooled job
|
// Try to start processing of next spooled job
|
||||||
void HandleSpooledJob();
|
void HandleSpooledJob();
|
||||||
|
|
||||||
// Abort print_thread without processing spooled job
|
// Abort print_thread without processing spooled job
|
||||||
void AbortPrintThread();
|
void AbortPrintThread();
|
||||||
|
|
||||||
void MessageReceived(BMessage* msg);
|
|
||||||
|
|
||||||
// Scripting support, see Printer.Scripting.cpp
|
// Scripting support, see Printer.Scripting.cpp
|
||||||
status_t GetSupportedSuites(BMessage* msg);
|
|
||||||
void HandleScriptingCommand(BMessage* msg);
|
void HandleScriptingCommand(BMessage* msg);
|
||||||
BHandler* ResolveSpecifier(BMessage* msg, int32 index, BMessage* spec,
|
|
||||||
int32 form, const char* prop);
|
|
||||||
|
|
||||||
void GetName(BString& name);
|
void GetName(BString& name);
|
||||||
Resource* GetResource() { return fResource; }
|
Resource* GetResource() { return fResource; }
|
||||||
@@ -81,27 +83,35 @@ private:
|
|||||||
status_t LoadPrinterAddon(image_id& id);
|
status_t LoadPrinterAddon(image_id& id);
|
||||||
void AddCurrentPrinter(BMessage* m);
|
void AddCurrentPrinter(BMessage* m);
|
||||||
|
|
||||||
SpoolFolder fPrinter; // the printer spooling directory
|
|
||||||
Resource* fResource; // the resource required for processing a print job
|
|
||||||
bool fSinglePrintThread; // is printer add-on allowed to process multiple print job at once
|
|
||||||
Job* fJob; // the next job to process
|
|
||||||
vint32 fProcessing; // the current nmber of processing threads
|
|
||||||
bool fAbort; // stop processing
|
|
||||||
|
|
||||||
static BObjectList<Printer> sPrinters;
|
|
||||||
|
|
||||||
// Accessor
|
// Accessor
|
||||||
BDirectory* SpoolDir() { return fPrinter.GetSpoolDir(); }
|
BDirectory* SpoolDir() { return fPrinter.GetSpoolDir(); }
|
||||||
|
|
||||||
void ResetJobStatus();
|
void ResetJobStatus();
|
||||||
bool HasCurrentPrinter(BString& name);
|
bool HasCurrentPrinter(BString& name);
|
||||||
bool MoveJob(const BString& name);
|
bool MoveJob(const BString& name);
|
||||||
|
|
||||||
// Get next spooled job if any
|
// Get next spooled job if any
|
||||||
bool FindSpooledJob();
|
bool FindSpooledJob();
|
||||||
status_t PrintSpooledJob(BFile* spoolFile);
|
status_t PrintSpooledJob(BFile* spoolFile);
|
||||||
void PrintThread(Job* job);
|
void PrintThread(Job* job);
|
||||||
|
|
||||||
static status_t print_thread(void* data);
|
static status_t print_thread(void* data);
|
||||||
void StartPrintThread();
|
void StartPrintThread();
|
||||||
|
|
||||||
|
private:
|
||||||
|
// the printer spooling directory
|
||||||
|
SpoolFolder fPrinter;
|
||||||
|
// the resource required for processing a print job
|
||||||
|
Resource* fResource;
|
||||||
|
// is printer add-on allowed to process multiple print job at once
|
||||||
|
bool fSinglePrintThread;
|
||||||
|
// the next job to process
|
||||||
|
Job* fJob;
|
||||||
|
// the current nmber of processing threads
|
||||||
|
vint32 fProcessing;
|
||||||
|
// stop processing
|
||||||
|
bool fAbort;
|
||||||
|
static BObjectList<Printer> sPrinters;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user