GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — shape_combine definition is invalid - TypeError: Missing required argument destination_window · Issue #262 · python-xlib/python-xlib

shape_combine definition is invalid - TypeError: Missing required argument destination_window #262

New issue
Copy link
New issue
Copy link
Open
Open
shape_combine definition is invalid - TypeError: Missing required argument destination_window#262
Copy link

Description

@acidkewpie
acidkewpie
opened on Mar 15, 2023
Issue body actions

I thought I was missing something, but it's looking like no one has EVER used shape_combine, but the definition of the function does not attempt to create the object with the required destination_window parameter:

class Combine(rq.Request):

    _request = rq.Struct(
        rq.Card8('opcode'),
        rq.Opcode(3),
        rq.RequestLength(),
        OP('operation'),
        KIND('destination_kind'),
        KIND('source_kind'),
        rq.Pad(1),
        rq.Window('destination_window'),
        rq.Int16('x_offset'),
        rq.Int16('y_offset'),
        rq.Window('source_window'),
    )
[...]
def combine(self, operation, destination_kind, source_kind, x_offset, y_offset):
    Combine(
        display=self.display,
        opcode=self.display.get_extension_major(extname),
        source_window=self,
        operation=operation,
        destination_kind=destination_kind,
        source_kind=source_kind,
        x_offset=x_offset,
        y_offset=y_offset,
    )

shape_mask is, in believe, only different from shape_combine in that it takes in a window of varying colour depth, instead of a binary bitmap. As such the parameters should be identical except the source_bitmap parameter in shape_mask should instead be the source_kind option (present) and source_window (missing!) in shape_combine. mask is defined as:

def mask(self, operation, destination_kind, x_offset, y_offset, source_bitmap):
    Mask(
        display=self.display,
        opcode=self.display.get_extension_major(extname),
        destination_window=self,
        operation=operation,
        destination_kind=destination_kind,
        x_offset=x_offset,
        y_offset=y_offset,
        source_bitmap=source_bitmap,
    )

so combine should actually be defined as:

def combine(self, operation, destination_kind, source_kind, x_offset, y_offset):
    Combine(
        display=self.display,
        opcode=self.display.get_extension_major(extname),
        source_window=source_window
        destination_window=self,
        operation=operation,
        destination_kind=destination_kind,
        source_kind=source_kind,
        x_offset=x_offset,
        y_offset=y_offset,
        source_window=source_window
    )

Indeed it seems that parameters for source and destination windows have in fact been... wait for it... combined!

#263

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.