;;;
;;; client.lisp
;;;
;;; Client State
;;;
;;; Copyright (C) 2005, Alastair Bridgewater
;;;

(in-package :clxs)

;;; FIXME: Too sparse, needs more documentation.
;;; FIXME: Skeletal interface, needs filling out.

(defclass client-state ()
  (network-client
   byte-order
   resource-id-base
   resource-id-mask
   request-number))

(defgeneric client-state-network-client (client-state))
(defgeneric client-state-byte-order (client-state))
(defgeneric client-state-resource-id-base (client-state))
(defgeneric client-state-resource-id-mask (client-state))
(defgeneric client-state-request-number (client-state))
(defgeneric (setf client-state-request-number) (request-number client-state))

(defmethod client-state-network-client ((client-state client-state))
  (slot-value client-state 'network-client))

(defmethod client-state-byte-order ((client-state client-state))
  (slot-value client-state 'byte-order))

(defmethod client-state-resource-id-base ((client-state client-state))
  (slot-value client-state 'resource-id-base))

(defmethod client-state-resource-id-mask ((client-state client-state))
  (slot-value client-state 'resource-id-mask))

(defmethod client-state-request-number ((client-state client-state))
  (slot-value client-state 'request-number))

(defmethod (setf client-state-request-number)
    (request-number (client-state client-state))
  (setf (slot-value client-state 'request-number) request-number))

;;; EOF
