]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - ppdc/ppdc.h
Import CUPS v1.7.1
[thirdparty/cups.git] / ppdc / ppdc.h
index 31519404f78bd9a103d4b5220a6e4117fa2229ac..0aad12558bd9ea8a658e4babfbc537cbd44c4aea 100644 (file)
@@ -1,9 +1,9 @@
 //
-// "$Id$"
+// "$Id: ppdc.h 3755 2012-03-30 05:59:14Z msweet $"
 //
 //   Definitions for the CUPS PPD Compiler.
 //
-//   Copyright 2007-2008 by Apple Inc.
+//   Copyright 2007-2009 by Apple Inc.
 //   Copyright 2002-2007 by Easy Software Products.
 //
 //   These coded instructions, statements, and computer programs are the
 // Include necessary headers...
 //
 
-#  include <cups/string.h>
-
 #  include <cups/file.h>
 #  include <stdlib.h>
-#  include <errno.h>
+
+
+//
+// Macros...
+//
+
+#  define PPDC_NAME(s) const char *class_name() { return (s); }
 
 
 //
@@ -96,8 +100,10 @@ class ppdcShared                    //// Shared Data Value
   ppdcShared();
   virtual ~ppdcShared();
 
-  void         get(void);
-  void         release(void);
+  virtual const char *class_name() = 0;
+
+  void         retain();
+  void         release();
 };
 
 class ppdcArray                                //// Shared Array
@@ -113,6 +119,8 @@ class ppdcArray                             //// Shared Array
   ppdcArray(ppdcArray *a = 0);
   ~ppdcArray();
 
+  PPDC_NAME("ppdcArray")
+
   void         add(ppdcShared *d);
   ppdcShared   *first();
   ppdcShared   *next();
@@ -128,6 +136,8 @@ class ppdcString                    //// Shared String
 
   ppdcString(const char *v);
   ~ppdcString();
+
+  PPDC_NAME("ppdcString")
 };
 
 class ppdcInteger                      //// Shared integer
@@ -138,6 +148,8 @@ class ppdcInteger                   //// Shared integer
   int          *value;                 // Integer value
 
   ppdcInteger(int *v) { value = v; }
+
+  PPDC_NAME("ppdcInteger")
 };
 
 class ppdcMessage                      //// Translation message
@@ -150,6 +162,8 @@ class ppdcMessage                   //// Translation message
 
   ppdcMessage(const char *i, const char *s);
   ~ppdcMessage();
+
+  PPDC_NAME("ppdcMessage")
 };
 
 class ppdcCatalog                      //// Translation catalog
@@ -164,6 +178,8 @@ class ppdcCatalog                   //// Translation catalog
   ppdcCatalog(const char *l, const char *f = 0);
   ~ppdcCatalog();
 
+  PPDC_NAME("ppdcCatalog")
+
   void         add_message(const char *id, const char *string = NULL);
   const char   *find_message(const char *id);
   int          load_messages(const char *f);
@@ -184,6 +200,8 @@ class ppdcAttr                              //// Attribute
   ppdcAttr(const char *n, const char *s, const char *t, const char *v,
            bool loc = false);
   ~ppdcAttr();
+
+  PPDC_NAME("ppdcAttr")
 };
 
 class ppdcFont                         //// Shared Font
@@ -200,6 +218,8 @@ class ppdcFont                              //// Shared Font
   ppdcFont(const char *n, const char *e, const char *v, const char *c,
            ppdcFontStatus s);
   ~ppdcFont();
+
+  PPDC_NAME("ppdcFont")
 };
 
 class ppdcChoice                       //// Option Choice
@@ -213,6 +233,8 @@ class ppdcChoice                    //// Option Choice
 
   ppdcChoice(const char *n, const char *t, const char *c);
   ~ppdcChoice();
+
+  PPDC_NAME("ppdcChoice")
 };
 
 class ppdcOption                       //// Option
@@ -233,6 +255,8 @@ class ppdcOption                    //// Option
   ppdcOption(ppdcOption *o);
   ~ppdcOption();
 
+  PPDC_NAME("ppdcOption")
+
   void         add_choice(ppdcChoice *c) { choices->add(c); }
   ppdcChoice   *find_choice(const char *n);
   void         set_defchoice(ppdcChoice *c);
@@ -251,6 +275,8 @@ class ppdcGroup                     //// Group of Options
   ppdcGroup(ppdcGroup *g);
   ~ppdcGroup();
 
+  PPDC_NAME("ppdcGroup")
+
   void         add_option(ppdcOption *o) { options->add(o); }
   ppdcOption   *find_option(const char *n);
 };
@@ -268,6 +294,8 @@ class ppdcConstraint                        //// Constraint
   ppdcConstraint(const char *o1, const char *c1, const char *o2,
                 const char *c2);
   ~ppdcConstraint();
+
+  PPDC_NAME("ppdcConstraint")
 };
 
 class ppdcFilter                       //// Filter Program
@@ -281,6 +309,8 @@ class ppdcFilter                    //// Filter Program
 
   ppdcFilter(const char *t, const char *p, int c);
   ~ppdcFilter();
+
+  PPDC_NAME("ppdcFilter")
 };
 
 class ppdcMediaSize                    //// Media Size
@@ -303,6 +333,8 @@ class ppdcMediaSize                 //// Media Size
                 float lm, float bm, float rm, float tm,
                const char *sc = 0, const char *rc = 0);
   ~ppdcMediaSize();
+
+  PPDC_NAME("ppdcMediaSize")
 };
 
 class ppdcProfile                      //// Color Profile
@@ -318,6 +350,8 @@ class ppdcProfile                   //// Color Profile
 
   ppdcProfile(const char *r, const char *m, float d, float g, const float *p);
   ~ppdcProfile();
+
+  PPDC_NAME("ppdcProfile")
 };
 
 class ppdcSource;
@@ -361,6 +395,8 @@ class ppdcDriver                    //// Printer Driver Data
   ppdcDriver(ppdcDriver *d = 0);
   ~ppdcDriver();
 
+  PPDC_NAME("ppdcDriver")
+
   void         add_attr(ppdcAttr *a) { attrs->add(a); }
   void         add_constraint(ppdcConstraint *c) { constraints->add(c); }
   void         add_copyright(const char *c) {
@@ -375,6 +411,7 @@ class ppdcDriver                    //// Printer Driver Data
   ppdcAttr     *find_attr(const char *k, const char *s);
   ppdcGroup    *find_group(const char *n);
   ppdcOption   *find_option(const char *n);
+  ppdcOption   *find_option_group(const char *n, ppdcGroup **mg);
 
   void         set_custom_size_code(const char *c);
   void         set_default_font(ppdcFont *f);
@@ -401,6 +438,8 @@ class ppdcVariable                  //// Variable Definition
   ppdcVariable(const char *n, const char *v);
   ~ppdcVariable();
 
+  PPDC_NAME("ppdcVariable")
+
   void         set_value(const char *v);
 };
 
@@ -408,6 +447,7 @@ class ppdcFile                              //// File
 {
   public:
 
+  bool         close_on_delete;        // Close file on delete?
   cups_file_t  *fp;                    // File pointer
   const char   *filename;              // Filename
   int          line;                   // Line in file
@@ -441,6 +481,8 @@ class ppdcSource                    //// Source File
   ppdcSource(const char *f = 0, cups_file_t *ffp = (cups_file_t *)0);
   ~ppdcSource();
 
+  PPDC_NAME("ppdcSource")
+
   static void  add_include(const char *d);
   ppdcDriver   *find_driver(const char *f);
   static char  *find_include(const char *f, const char *base, char *n,
@@ -487,5 +529,5 @@ class ppdcSource                    //// Source File
 #endif // !_PPDC_H_
 
 //
-// End of "$Id$".
+// End of "$Id: ppdc.h 3755 2012-03-30 05:59:14Z msweet $".
 //