<commit_before>/* aosd -- OSD with transparency and cairo.
 *
 * Copyright (C) 2008 <NAME> <<EMAIL>>
 */

#ifndef __AOSD_TYPES_H__
#define __AOSD_TYPES_H__

#include <pthread.h>

#include <X11/Xlib.h>
#include <X11/extensions/Xrender.h>

#include "aosd.h"

typedef struct
{
  AosdRenderer render_cb;
  void* data;
} RenderCallback;

typedef struct
{
  AosdMouseEventCb mouse_event_cb;
  void* data;
} MouseEventCallback;

typedef struct
{
  Pixmap pixmap;
  Bool set;
} AosdBackground;

typedef struct
{
  pthread_mutex_t mutex;
  pthread_cond_t cond;
} LockPair;

struct _Aosd
{
  Display* display;
  int screen_num;
  unsigned int depth;
  Window root_win;
  Window win;
  int x, y, width, height;
  Colormap colormap;
  XRenderPictFormat* xrformat;

  AosdBackground background;
  RenderCallback renderer;
  AosdTransparency mode;
  MouseEventCallback mouse_processor;

  pthread_t main_thread;
  LockPair lock_main;
  LockPair lock_update;
  int pipe[2];

  Bool mouse_hide;
  Bool shown;
};

#endif

/* vim: set ts=2 sw=2 et : */<commit_msg>Added update and time fields.<commit_after>/* aosd -- OSD with transparency and cairo.
 *
 * Copyright (C) 2008 <NAME> <<EMAIL>>
 */

#ifndef __AOSD_TYPES_H__
#define __AOSD_TYPES_H__

#include <pthread.h>

#include <X11/Xlib.h>
#include <X11/extensions/Xrender.h>

#include "aosd.h"

typedef struct
{
  AosdRenderer render_cb;
  void* data;
} RenderCallback;

typedef struct
{
  AosdMouseEventCb mouse_event_cb;
  void* data;
} MouseEventCallback;

typedef struct
{
  Pixmap pixmap;
  Bool set;
} AosdBackground;

typedef struct
{
  pthread_mutex_t mutex;
  pthread_cond_t cond;
} LockPair;

#define UMODE(mode) (1 << mode)

typedef enum
{
  UP_NONE = 0,
  UP_HIDE,
  UP_SHOW,
  UP_SIZE,
  UP_POS,
  UP_REND,
  UP_TIME
} UpdateMode;

struct _Aosd
{
  Display* display;
  int screen_num;
  unsigned int depth;
  Window root_win;
  Window win;
  int x, y, width, height;
  Colormap colormap;
  XRenderPictFormat* xrformat;

  unsigned short update;

  AosdBackground background;
  RenderCallback renderer;
  AosdTransparency mode;
  MouseEventCallback mouse_processor;

  pthread_t main_thread;
  LockPair lock_main;
  LockPair lock_update;
  int pipe[2];

  struct timeval timeout_start;
  unsigned int delta_time;

  Bool mouse_hide;
  Bool shown;
};

#endif

/* vim: set ts=2 sw=2 et : */
{'fraction_non_alphanumeric': 0.09460616438356165, 'fraction_numerical': 0.010273972602739725, 'mean_word_length': 4.125, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5680996', 'n_tokens_mistral': 956, 'n_tokens_neox': 908, 'n_words': 228}