about summary refs log tree commit diff stats
path: root/client.c
Commit message (Collapse)AuthorAgeFilesLines
* made status bar drawing more robust, implemented togglemax and togglemode, ↵arg@10ksloc.org2006-07-201-15/+38
| | | | works quite well
* cleaned up codearg@10ksloc.org2006-07-201-6/+10
|
* removed c->f{x,y,w,h} and c->t{x,y,w,h} in favor for the new rule handling ↵arg@10ksloc.org2006-07-201-76/+52
| | | | remembering two kinds of geometries is unnecessary, removed the randomized (x,y) setting on dofloat startup, was kind too random und unpredictable
* implemented regexp matching for rulesarg@10ksloc.org2006-07-191-2/+3
|
* applied Jukka's patch with s/ModKeyMask/MODKEY/garg@10ksloc.org2006-07-191-3/+3
|
* fixed the bug mentioned by Sanderarg@10ksloc.org2006-07-191-3/+7
|
* refactored Sanders code somewhatarg@10ksloc.org2006-07-191-2/+2
|
* implemented fallback for too many clients in stacked modearg@10ksloc.org2006-07-191-2/+3
|
* and another fix...arg@10ksloc.org2006-07-191-1/+1
|
* yet another typo fixarg@10ksloc.org2006-07-191-2/+2
|
* fixed a typoarg@10ksloc.org2006-07-191-1/+1
|
* floating clients get random (x,y) offsets nowarg@10ksloc.org2006-07-191-0/+7
|
* applied Sanders resize patch, fixed lower bugarg@10ksloc.org2006-07-191-2/+8
|
* implemened distinguishing float/managed geometries of clients (works quite well)Anselm R. Garbe2006-07-181-48/+68
|
* pop on heretagAnselm R. Garbe2006-07-181-7/+14
|
* added heretag command which allows to tag a client of a foreign tag with ↵Anselm R. Garbe2006-07-181-4/+4
| | | | current tag
* another XSyncAnselm R. Garbe2006-07-161-0/+1
|
* several additions in mouse handling ;)Anselm R. Garbe2006-07-161-6/+7
|
* fixed XSync handling and finished man pageAnselm R. Garbe2006-07-151-4/+3
|
* sanitized other stuffAnselm R. Garbe2006-07-151-2/+2
|
* proceeded with cleaning up, sorting functions, etcAnselm R. Garbe2006-07-151-205/+206
|
* rearranged several stuffAnselm R. Garbe2006-07-151-58/+87
|
* sanitized namesAnselm R. Garbe2006-07-141-14/+14
|
* rearrangedAnselm R. Garbe2006-07-141-227/+3
|
* bar shows if currently is tiled (Mod1-space) or floating (Mod1-Shift-space) modeAnselm R. Garbe2006-07-141-0/+2
|
* fixed crash on zoom if only 1 client existsAnselm R. Garbe2006-07-141-3/+9
|
* removed a bunch of lines through swap removalAnselm R. Garbe2006-07-141-2/+2
|
* searching for a better way to discard enter notifiesAnselm R. Garbe2006-07-141-13/+11
|
* focus on view change as wellAnselm R. Garbe2006-07-141-0/+3
|
* made stdin reader more robustAnselm R. Garbe2006-07-141-4/+9
|
* implemented bar for dwm (I miss status text), I plan that status text is ↵Anselm R. Garbe2006-07-141-12/+18
| | | | read from stdin in dwm
* continued with man pageAnselm R. Garbe2006-07-141-1/+1
|
* except improvements to the mouse handling this is already nearly feature ↵Anselm R. Garbe2006-07-131-0/+5
| | | | complete
* added mini stuffAnselm R. Garbe2006-07-131-20/+31
|
* fixed several things, nearly feature completeAnselm R. Garbe2006-07-131-25/+30
|
* new stuffAnselm R. Garbe2006-07-131-44/+78
|
* several other additions/fixes, dwm is quite usable alreadyAnselm R. Garbe2006-07-131-95/+140
|
* implemented tagging a clientAnselm R. Garbe2006-07-131-57/+113
|
* added xlock command (I need it regularly)Anselm R. Garbe2006-07-131-20/+10
|
* added pointer warps on kb-driven/manage-driven focusAnselm R. Garbe2006-07-131-0/+3
|
* changed back to urxvt, dwm has no problems with it, because it doesn't use ↵Anselm R. Garbe2006-07-131-1/+1
| | | | frame windows ;)
* changed default colorsAnselm R. Garbe2006-07-131-7/+8
|
* added logo+descriptionAnselm R. Garbe2006-07-131-22/+33
|
* new stuff (some warning elimination)Anselm R. Garbe2006-07-131-3/+3
|
* removed unnecessary crapAnselm R. Garbe2006-07-131-20/+14
|
* before leaning things upAnselm R. Garbe2006-07-131-9/+52
|
* new stuff, fixed several issuesAnselm R. Garbe2006-07-121-2/+2
|
* added gravity stuffAnselm R. Garbe2006-07-121-5/+67
|
* added maxAnselm R. Garbe2006-07-121-0/+12
|
* added grid mode on Mod1Mask gAnselm R. Garbe2006-07-121-1/+69
|
{ color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
// So far instructions can only contain linear lists of properties. Now we add
// support for more complex trees of properties in dilated reagents. This will
// come in handy later for expressing complex types, like "a dictionary from
// (address to array of charaters) to (list of numbers)".
//
// Type trees aren't as general as s-expressions even if they look like them:
// the first element of a type tree is always an atom, and it can never be
// dotted (right->right->right->...->right is always NULL).
//
// For now you can't use the simpler 'colon-based' representation inside type
// trees. Once you start typing parens, keep on typing parens.

void test_dilated_reagent_with_nested_brackets() {
  load(
      "def main [\n"
      "  {1: number, foo: (bar (baz quux))} <- copy 34\n"
      "]\n"
  );
  CHECK_TRACE_CONTENTS(
      "parse:   product: {1: \"number\", \"foo\": (\"bar\" (\"baz\" \"quux\"))}\n"
  );
}

:(before "End Parsing Dilated Reagent Property(value)")
value = parse_string_tree(value);
:(before "End Parsing Dilated Reagent Type Property(type_names)")
type_names = parse_string_tree(type_names);

:(code)
string_tree* parse_string_tree(string_tree* s) {
  assert(s->atom);
  if (!starts_with(s->value, "(")) return s;
  string_tree* result = parse_string_tree(s->value);
  delete s;
  return result;
}

string_tree* parse_string_tree(const string& s) {
  istringstream in(s);
  in >> std::noskipws;
  return parse_string_tree(in);
}

string_tree* parse_string_tree(istream& in) {
  skip_whitespace_but_not_newline(in);
  if (!has_data(in)) return NULL;
  if (in.peek() == ')') {
    in.get();
    return NULL;
  }
  if (in.peek() != '(') {
    string s = next_word(in);
    if (s.empty()) {
      assert(!has_data(in));
      raise << "incomplete string tree at end of file (0)\n" << end();
      return NULL;
    }
    string_tree* result = new string_tree(s);
    return result;
  }
  in.get();  // skip '('
  string_tree* result = NULL;
  string_tree** curr = &result;
  while (true) {
    skip_whitespace_but_not_newline(in);
    assert(has_data(in));
    if (in.peek() == ')') break;
    *curr = new string_tree(NULL, NULL);
    if (in.peek() == '(') {
      (*curr)->left = parse_string_tree(in);
    }
    else {
      string s = next_word(in);
      if (s.empty()) {
        assert(!has_data(in));
        raise << "incomplete string tree at end of file (1)\n" << end();
        return NULL;
      }
      (*curr)->left = new string_tree(s);
    }
    curr = &(*curr)->right;
  }
  in.get();  // skip ')'
  assert(*curr == NULL);
  return result;
}

void test_dilated_reagent_with_type_tree() {
  Hide_errors = true;  // 'map' isn't defined yet
  load(
      "def main [\n"
      "  {1: (foo (address array character) (bar number))} <- copy 34\n"
      "]\n"
      "container foo [\n"
      "]\n"
      "container bar [\n"
      "]\n"
  );
  CHECK_TRACE_CONTENTS(
      "parse:   product: {1: (\"foo\" (\"address\" \"array\" \"character\") (\"bar\" \"number\"))}\n"
  );
}

void test_dilated_empty_tree() {
  load(
      "def main [\n"
      "  {1: number, foo: ()} <- copy 34\n"
      "]\n"
  );
  CHECK_TRACE_CONTENTS(
      "parse:   product: {1: \"number\", \"foo\": ()}\n"
  );
}

void test_dilated_singleton_tree() {
  load(
      "def main [\n"
      "  {1: number, foo: (bar)} <- copy 34\n"
      "]\n"
  );
  CHECK_TRACE_CONTENTS(
      "parse:   product: {1: \"number\", \"foo\": (\"bar\")}\n"
  );
}