stjerm-0.16/0000775000175000017500000000000012002351334012675 5ustar kwilsonkwilsonstjerm-0.16/src/0000775000175000017500000000000012002351334013464 5ustar kwilsonkwilsonstjerm-0.16/src/config.c0000664000175000017500000005541112002351334015103 0ustar kwilsonkwilson/* * config.c * This file is part of Stjerm * * Copyright (C) 2007-2010 - Kristopher Wilson, Stjepan Glavina and Markus Groß * * Stjerm is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Stjerm is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Stjerm; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include "stjerm.h" extern int sargc; extern char **sargv; extern GtkWidget *mainwindow; static char _font[200]; static float _opacity; static GdkColor _bg; static GdkColor _fg; static int _border; static unsigned int _mod; static KeySym _key; static int _width; static int _height; static int _width_percent; static int _height_percent; static int _pos; static int _posx; static int _posy; static int _fixedx; static int _fixedy; static int _scrollpos; static char _shell[200]; static char _emulation[200]; static int _lines; static int _showtab; static char _termname[200]; static GtkPositionType _tabpos; static GdkColor _palette[16]; static int read_colors; static gboolean _tabfill; static gboolean _allowbold; static GdkModifierType _keymod; static gboolean _autohide; static char _bgimage[200]; static gboolean _scrolloutput; static gboolean _allowreorder; static gboolean _cursor_blink; static VteTerminalCursorShape _cursor_shape; static GdkColor _cursor_color; static void set_border(char*); static void set_mod(char*); static void set_key(char*); static void set_pos(char *v); static GtkPositionType read_pos(char *v); static gboolean parse_hex_color(char *value, GdkColor *color); static gboolean parse_bool_str(char *value, gboolean def); static GdkModifierType parse_mod(char *value); static pid_t get_stjerm_pid(void); void conf_parse_size(char*, int*, int*); void read_value(char *name, char *value); void init_default_values(void); void conf_init(void); void conf_find_position(void); char* conf_get_font(void); float conf_get_opacity(void); GdkColor conf_get_bg(void); GdkColor conf_get_fg(void); int conf_get_border(void); unsigned int conf_get_mod(void); KeySym conf_get_key(void); int conf_get_width(void); int conf_get_height(void); void conf_get_position(int*, int*); int conf_get_scrollbar(void); char* conf_get_shell(void); char* conf_get_emulation(void); int conf_get_lines(void); int conf_get_show_tab(void); char* conf_get_term_name(void); GtkPositionType conf_get_tab_pos(void); GdkColor* conf_get_color_palette(void); gboolean conf_get_tab_fill(void); gboolean conf_get_allow_bold(void); GdkModifierType conf_get_key_mod(void); gboolean conf_get_auto_hide(void); char* conf_get_bg_image(void); gboolean conf_get_scroll_on_output(void); gboolean conf_get_allow_reorder(void); gboolean conf_get_cursor_blink(void); GdkColor conf_get_cursor_color(void); VteTerminalCursorShape conf_get_cursor_shape(void); Option options[OPTION_COUNT] = { {"key", "-k", "KEY", "Shortcut key (eg: f12)."}, {"mod", "-m", "MODIFIER", "meta modifier key: shift, control, alt, windows, none."}, {"keymod", "-km", "MODIFIER", "Modifier for keyboard shortcuts. Can be a combination (with +) of modifiers (eg: shift+control)."}, {"autohide", "-ah", "BOOLEAN", "Whether or not to hide stjerm when it looses focus. Default: true."}, {"font", "-fn", "FONT", "Terminal font and size (eg: Sans 10). Default: Bistream Vera Sans 10."}, {"background", "-bg", "COLOR", "Background color. Default: Black."}, {"foreground", "-fg", "COLOR", "Foreground color. Default: White."}, {"allowbold", "-ab", "BOOLEAN", "Allow bold fonts or not. Default: true."}, {"border", "-b", "TYPE", "Border type: thin, thick, none. Default: none."}, {"opacity", "-o", "NUMBER", "Opacity (range: 10 - 100). Default: 100."}, {"bgimage", "-bgimg", "FILE", "Background image to use on terminal."}, {"width", "-w", "NUMBER", "Window width, either as an integer or a percentage (eg, 50%). Default: 800."}, {"height", "-h", "NUMBER", "Window height, either as an integer or a percentage (eg, 50%).. Default: 400."}, {"position", "-p", "POSITION", "Window position: top, bottom, left, right. Default: top."}, {"scrollbar", "-s", "POSITION", "Scrollbar position: left, right, none. Default: none."}, {"shell", "-sh", "STRING", "Terminal Shell. Default: the user's default shell."}, {"emulation", "-e", "STRING", "Terminal Emulation. Default: xterm"}, {"lines", "-l", "NUMBER", "Scrollback lines. 0 to disable scrollback. Default: 1000."}, {"showtab", "-st", "VALUE", "Tabbar visibility (one: only visible when > 1 tabs): never, one, always."}, {"tabpos", "-tp", "POSITION", "Tabbar position: top, bottom, left, right. Default: bottom."}, {"tablabel", "-tl", "STRING", "Label of the tabs. Default: term."}, {"tabfill", "-tf", "BOOLEAN", "Whether tabs fill whole tabbar space. Default: true."}, {"scroll", "-sc", "BOOLEAN", "Whether to scroll the terminal on output. Default: true."}, {"fixedx", "-fx", "NUMBER", "Overrides any calculated horizontal position."}, {"fixedy", "-fy", "NUMBER", "Overrides any calculated vertical position."}, {"allowreorder", "-ar", "BOOLEAN", "Allow reordering of terminal tabs."}, {"colorX", "-cX", "COLOR", "Specify color X of the terminals color palette"}, {"cursorBlink", "-ub", "BOOLEAN", "Should the cursor blink? Default: true"}, {"cursorColor", "-uc", "COLOR", "The color of the cursor. Default: white"}, {"cursorShape", "-us", "STRING", "Cursor shape, one of [block,ibeam,underline]. Default: block"} }; pid_t get_stjerm_pid(void) { char buffer[100]; char **list; int i = 0; FILE *p = popen("pidof stjerm", "r"); if(p == NULL) { fprintf(stderr, "error: unable to get stjerm pid\n"); exit(1); } if(fgets(buffer, sizeof(buffer), p) == NULL) { fprintf(stderr, "error: unable to read stjerm pid\n"); exit(1); } pclose(p); list = g_strsplit_set(buffer, " ", -1); while (list[i] != NULL) i++; pid_t pid = (pid_t) atoi(list[i - 1]); g_strfreev(list); return pid; } void set_border(char *v) { if(!strcmp(v, "thin")) _border = BORDER_THIN; else if(!strcmp(v, "thick")) _border = BORDER_THICK; else _border = BORDER_NONE; } void set_mod(char *v) { v[0] = tolower(v[0]); if(!strcmp(v, "shift")) _mod = ShiftMask; else if(!strcmp(v, "control")) _mod = ControlMask; else if(!strcmp(v, "ctrl")) _mod = ControlMask; else if(!strcmp(v, "alt")) _mod = Mod1Mask; else if(!strcmp(v, "mod1")) _mod = Mod1Mask; else if(!strcmp(v, "windows")) _mod = Mod4Mask; else if(!strcmp(v, "win")) _mod = Mod4Mask; else _mod = ControlMask; } void set_key(char *v) { _key = 0; v[0] = tolower(v[0]); _key = XStringToKeysym(v); if(!_key) { v[0] = toupper(v[0]); _key = XStringToKeysym(v); } } void set_pos(char *v) { if(!strcmp(v, "top")) _pos = POS_TOP; else if(!strcmp(v, "bottom")) _pos = POS_BOTTOM; else if(!strcmp(v, "left")) _pos = POS_LEFT; else if(!strcmp(v, "right")) _pos = POS_RIGHT; else if(!strcmp(v, "topleft")) _pos = POS_TOPLEFT; else if(!strcmp(v, "topright")) _pos = POS_TOPRIGHT; else if(!strcmp(v, "bottomleft")) _pos = POS_BOTTOMLEFT; else if(!strcmp(v, "bottomright")) _pos = POS_BOTTOMRIGHT; } GtkPositionType read_pos(char *v) { if(!strcmp(v, "top")) return GTK_POS_TOP; else if(!strcmp(v, "left")) return GTK_POS_LEFT; else if(!strcmp(v, "right")) return GTK_POS_RIGHT; else return GTK_POS_BOTTOM; } gboolean parse_hex_color(char *value, GdkColor *color) { if(!gdk_color_parse(value, color)) { char *value2 = g_strconcat("#", value, NULL); gboolean res = gdk_color_parse(value2, color); free(value2); return res; } else return TRUE; } gboolean parse_bool_str(char *value, gboolean def) { gboolean res = def; g_strstrip(value); if(!strcasecmp("false", value) || !strcasecmp("0", value) || !strcasecmp("no", value)) res = FALSE; if(!strcasecmp("true", value) || !strcasecmp("1", value) || !strcasecmp("yes", value)) res = TRUE; return res; } GdkModifierType parse_mod(char *value) { g_strstrip(value); if(!strcasecmp("control", value) || !strcasecmp("ctrl", value)) return GDK_CONTROL_MASK; else if(!strcasecmp("alt", value)) return GDK_MOD1_MASK; else if(!strcasecmp("shift", value)) return GDK_SHIFT_MASK; else if(!strcasecmp("windows", value)) return GDK_SUPER_MASK; else return 0; } void init_default_values(void) { strcpy(_font, "Bitstream Vera Sans Mono 10"); gdk_color_parse("black", &_bg); gdk_color_parse("white", &_fg); _scrollpos = -1; _border = BORDER_NONE; _opacity = 100.0f; strcpy(_bgimage, ""); _width = 800; _height = 400; _width_percent = -1; _height_percent = -1; _pos = POS_TOP; _mod = 0; _key = 0; strcpy(_shell, getpwuid(getuid())->pw_shell); strcpy(_emulation, "xterm"); _lines = 1000; _showtab = TABS_ONE; _tabpos = GTK_POS_BOTTOM; strcpy(_termname, "term"); read_colors = 0; _tabfill = FALSE; _allowbold = TRUE; _keymod = GDK_CONTROL_MASK | GDK_SHIFT_MASK; _autohide = TRUE; _scrolloutput = TRUE; _fixedx = -1; _fixedy = -1; _allowreorder = TRUE; _cursor_blink = TRUE; gdk_color_parse("white", &_cursor_color); _cursor_shape = VTE_CURSOR_SHAPE_BLOCK; } void read_value(char *name, char *value) { if(name != NULL && value != NULL) { if (name[0] == '#') return; g_strstrip(name); g_strstrip(value); if(!strcmp("font", name) || !strcmp("-fn", name)) strcpy(_font, value); else if(!strcmp("background", name) || !strcmp("-bg", name)) { if(!parse_hex_color(value, &_bg)) gdk_color_parse("black", &_bg); } else if(!strcmp("foreground", name) || !strcmp("-fg", name)) { if(!parse_hex_color(value, &_fg)) gdk_color_parse("white", &_fg); } else if(!strcmp("scrollbar", name) || !strcmp("-s", name)) { if(!strcmp(value, "true")) _scrollpos = POS_RIGHT; else if(!strcmp(value, "left")) _scrollpos = POS_LEFT; else if(!strcmp(value, "right")) _scrollpos = POS_RIGHT; else _scrollpos = -1; } else if(!strcmp("border", name) || !strcmp("-b", name)) set_border(value); else if(!strcmp("opacity", name) || !strcmp("-o", name)) _opacity = atof(value); else if(!strcmp("bgimage", name) || !strcmp("-bgimg", name)) strcpy(_bgimage, value); else if(!strcmp("width", name) || !strcmp("-w", name)) conf_parse_size(value, &_width, &_width_percent); else if(!strcmp("height", name) || !strcmp("-h", name)) conf_parse_size(value, &_height, &_height_percent); else if(!strcmp("position", name) || !strcmp("-p", name)) set_pos(value); else if(!strcmp("fixedx", name) || !strcmp("-fx", name)) _fixedx = atoi(value); else if(!strcmp("fixedy", name) || !strcmp("-fy", name)) _fixedy = atoi(value); else if(!strcmp("mod", name) || !strcmp("-m", name)) set_mod(value); else if(!strcmp("key", name) || !strcmp("-k", name)) set_key(value); else if(!strcmp("shell", name) || !strcmp("-sh", name)) strcpy(_shell, value); else if(!strcmp("emulation", name) || !strcmp("-e", name)) strcpy(_emulation, value); else if(!strcmp("lines", name) || !strcmp("-bl", name)) _lines = atoi(value); else if(!strcmp("showtab", name) || !strcmp("-st", name)) { if(!strcasecmp(value, "always")) _showtab = TABS_ALWAYS; else if(!strcasecmp(value, "never")) _showtab = TABS_NEVER; } else if(!strcmp("tabpos", name) || !strcmp("-tp", name)) _tabpos = read_pos(value); else if(!strcmp("tablabel", name) || !strcmp("-tl", name)) strcpy(_termname, value); else if(g_str_has_prefix(name, "color") || g_str_has_prefix(name, "-c")) { g_strcanon(name, "0123456789", ' '); g_strchug(name); parse_hex_color(value, &_palette[atoi(name)]); read_colors++; } else if(!strcmp("tabfill", name) || !strcmp("-tf", name)) _tabfill = parse_bool_str(value, _tabfill); else if(!strcmp("allowbold", name) || !strcmp("-ab", name)) _allowbold = parse_bool_str(value, _allowbold); else if(!strcmp("keymod", name) || !strcmp("-km", name)) { char **list; GdkModifierType tmp = 0; int i = 0; list = g_strsplit_set(value, "+", -1); while(list[i] != NULL) tmp = tmp | parse_mod(list[i++]); g_strfreev(list); if(tmp != 0) _keymod = tmp; } else if(!strcmp("autohide", name) || !strcmp("-ah", name)) _autohide = parse_bool_str(value, _autohide); else if(!strcmp("scroll", name) || !strcmp("-sc", name)) _scrolloutput = parse_bool_str(value, _scrolloutput); else if(!strcmp("allowreorder", name) || !strcmp("-ar", name)) _allowreorder = parse_bool_str(value, _allowreorder); else if(!strcmp("cursorBlink", name) || !strcmp("-ub", name)) _cursor_blink = parse_bool_str(value, _cursor_blink); else if(!strcmp("cursorColor", name) || !strcmp("-uc", name)) { if(!parse_hex_color(value, &_cursor_color)) gdk_color_parse("white", &_cursor_color); } else if (!strcmp("cursorShape", name) || !strcmp("-us", name)) { if (!strcmp("block", name)) { _cursor_shape = VTE_CURSOR_SHAPE_BLOCK; } else if (!strcmp("ibeam", name)) { _cursor_shape = VTE_CURSOR_SHAPE_IBEAM; } else if (!strcmp("underline", name)) { _cursor_shape = VTE_CURSOR_SHAPE_UNDERLINE; } } } } void conf_parse_size(char *value, int *fixed, int *percentage) { if(strchr(value, '%') != NULL) { char tmp[(strlen(value) - 1) * sizeof(char)]; strncpy(tmp, value, (strlen(value) - 1) * sizeof(char)); tmp[strlen(value) - 1] = '\0'; *percentage = atoi(tmp); } else *fixed = atoi(value); } void conf_init(void) { gboolean keyoption = FALSE; Display *dpy; char basename[12] = "/.Xdefaults"; char *filename; char *op; int i; Option o; char color[8]; init_default_values(); dpy = gdk_x11_display_get_xdisplay(gdk_display_get_default()); XrmInitialize(); filename = strcat(getpwuid(getuid())->pw_dir, basename); XrmSetDatabase(dpy, XrmGetFileDatabase(filename)); for(i = 0; i < OPTION_COUNT - 1; i++) { o = options[i]; if((op = XGetDefault(dpy, "stjerm", o.long_name))) read_value(o.long_name, op); } for(i = 0; i < 16; i++) { sprintf(color, "color%d", i); if((op = XGetDefault(dpy, "stjerm", color))) read_value(color, op); } for(i = 1; i < sargc; i++) { if(sargv != NULL) { if(!strcmp(sargv[i], "--help")) { print_help(); exit(1); } else if(!strcmp(sargv[i], "--info")) { print_info(); exit(1); } else if(!strcmp(sargv[i], "--version")) { print_version(); exit(1); } else if(!strcmp("--toggle", sargv[i])) { kill(get_stjerm_pid(), SIGUSR1); exit(1); } } if(i + 1>= sargc) break; read_value(sargv[i], sargv[i + 1]); } if(keyoption == FALSE && _key == 0) { printf("hint: you started stjerm without specifying a shortcut key\n" " to show/hide stjerm run stjerm with the toggle option\n" " like this: stjerm --toggle"); } struct stat st; if(stat(_shell, &st) != 0) { fprintf(stderr, "error: the shell '%s' can't be opened\n", _shell); exit(1); } if(_lines < 0) { fprintf(stderr, "error: a scrollback line count < 0 is not allowed\n"); exit(1); } if(keyoption == TRUE && _key == 0) { fprintf(stderr, "error: wrong shortcut key is defined\n"); exit(1); } if(read_colors > 0 && read_colors < 16) { fprintf(stderr, "error: read only %d colors, not 16\n" "specify a complete color palette\n", read_colors); exit(1); } signal(SIGUSR1, (__sighandler_t) mainwindow_toggle); conf_find_position(); } void conf_find_position(void) { int scrw = gdk_screen_get_width(gdk_screen_get_default()); int scrh = gdk_screen_get_height(gdk_screen_get_default()); int offset_x = 0; int offset_y = 0; GdkDisplay *gdk_dpy = gdk_display_get_default(); Display *dpy = gdk_x11_display_get_xdisplay(gdk_dpy); /* Xinerama base event code and base error code */ int xr_event_basep, xr_error_basep; if(XineramaQueryExtension(dpy, &xr_event_basep, &xr_error_basep) && XineramaIsActive(dpy)) { /* Calculate offsets to add to get correct values on Xinerama screens */ XineramaScreenInfo *xsi; int screens; int cur_x; int cur_y; int i; /* Get data about Xinerama screens */ xsi = XineramaQueryScreens(dpy, &screens); /* Get cursor position */ gdk_display_get_pointer(gdk_dpy, NULL, &cur_x, &cur_y, NULL); /* "Default" case: if the cursor is in a blackout zone, do as if it were on the first screen */ scrw = xsi[0].width; scrh = xsi[0].height; offset_x = xsi[0].x_org; offset_y = xsi[0].y_org; /* Now the other cases, beginning from the 2nd screen */ for(i=1; i < screens; i++) { /* Coords of this screen */ int min_x = xsi[i].x_org; int max_x = min_x + xsi[i].width; int min_y = xsi[i].y_org; int max_y = min_y + xsi[i].height; /* Is the cursor on this screen? */ if((min_x <= cur_x) && (cur_x <= max_x) && (min_y <= cur_y) && (cur_y <= max_y)) { /* Set the offsets and dimensions */ scrw = xsi[i].width; scrh = xsi[i].height; offset_x = xsi[i].x_org; offset_y = xsi[i].y_org; break; } } /* Cleanup */ XFree(xsi); } /* Recalculate window width and height if needed */ if(_width_percent > 0) _width = (_width_percent * scrw)/100; if(_height_percent > 0) _height = (_height_percent * scrh)/100; if(_pos == POS_TOP) { _posx = (scrw - _width) / 2; _posy = 0; } else if(_pos == POS_BOTTOM) { _posx = (scrw - _width) / 2; _posy = scrh - _height; } else if(_pos == POS_LEFT) { _posx = 0; _posy = (scrh - _height) / 2; } else if(_pos == POS_RIGHT) { _posx = scrw - _width; _posy = (scrh - _height) / 2; } else if (_pos == POS_TOPLEFT) { _posx = 0; _posy = 0; } else if(_pos == POS_TOPRIGHT) { _posx = scrw - _width; _posy = 0; } else if(_pos == POS_BOTTOMLEFT) { _posx = 0; _posy = scrh - _height; } else if(_pos == POS_BOTTOMRIGHT) { _posx = scrw - _width; _posy = scrh - _height; } _posx += offset_x; _posy += offset_y; if(_fixedx > -1) _posx = _fixedx; if(_fixedy > -1) _posy = _fixedy; } char* conf_get_font(void) { return _font; } float conf_get_opacity(void) { return _opacity; } GdkColor conf_get_bg(void) { return _bg; } GdkColor conf_get_fg(void) { return _fg; } int conf_get_border(void) { return _border; } unsigned int conf_get_mod(void) { return _mod; } KeySym conf_get_key(void) { return _key; } int conf_get_width(void) { return _width; } int conf_get_height(void) { return _height; } void conf_get_position(int *x, int *y) { conf_find_position(); *x = _posx; *y = _posy; } int conf_get_scrollbar(void) { return _scrollpos; } char* conf_get_shell(void) { return _shell; } char* conf_get_emulation(void) { return _emulation; } int conf_get_lines(void) { return _lines; } int conf_get_show_tab(void) { return _showtab; } char* conf_get_term_name(void) { return _termname; } GtkPositionType conf_get_tab_pos(void) { return _tabpos; } GdkColor* conf_get_color_palette(void) { if(read_colors <= 0) return NULL; else return _palette; } gboolean conf_get_tab_fill(void) { return _tabfill; } gboolean conf_get_allow_bold(void) { return _allowbold; } GdkModifierType conf_get_key_mod(void) { return _keymod; } gboolean conf_get_auto_hide(void) { return _autohide; } char* conf_get_bg_image(void) { if(!strcmp(_bgimage, "")) return NULL; else return _bgimage; } gboolean conf_get_scroll_on_output(void) { return _scrolloutput; } gboolean conf_get_allow_reorder(void) { return _allowreorder; } gboolean conf_get_cursor_blink(void) { return _cursor_blink; } VteTerminalCursorShape conf_get_cursor_shape(void) { return _cursor_shape; } GdkColor conf_get_cursor_color(void) { return _cursor_color; } stjerm-0.16/src/stjerm.h0000664000175000017500000001142212002351334015141 0ustar kwilsonkwilson/* * stjerm.h * This file is part of Stjerm * * Copyright (C) 2007-2010 - Kristopher Wilson, Stjepan Glavina and Markus Groß * * Stjerm is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Stjerm is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Stjerm; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA */ #ifndef __STJERM_H__ #define __STJERM_H__ #include #include #include #define TERM_ICONIFY_WINDOW 0 #define TERM_DEICONIFY_WINDOW 1 #define TERM_RAISE_WINDOW 2 #define TERM_LOWER_WINDOW 3 #define TERM_MAXIMIZE_WINDOW 4 #define TERM_RESTORE_WINDOW 5 #define TERM_REFRESH_WINDOW 6 #define TERM_RESIZE_WINDOW 7 #define TERM_MOVE_WINDOW 8 #define BORDER_THIN 0 #define BORDER_THICK 1 #define BORDER_NONE 2 #define POS_TOP 0 #define POS_BOTTOM 1 #define POS_LEFT 2 #define POS_RIGHT 3 #define POS_TOPLEFT 4 #define POS_TOPRIGHT 5 #define POS_BOTTOMLEFT 6 #define POS_BOTTOMRIGHT 7 #define TABS_NEVER 0 #define TABS_ONE 1 #define TABS_ALWAYS 2 #define OPTION_COUNT 30 // The following defines borrowed from gnome-terminal: #define USERCHARS "-[:alnum:]" #define USERCHARS_CLASS "[" USERCHARS "]" #define PASSCHARS_CLASS "[-[:alnum:]\\Q,?;.:/!%$^*&~\"#'\\E]" #define HOSTCHARS_CLASS "[-[:alnum:]]" #define HOST HOSTCHARS_CLASS "+(\\." HOSTCHARS_CLASS "+)*" #define PORT "(?:\\:[[:digit:]]{1,5})?" #define PATHCHARS_CLASS "[-[:alnum:]\\Q_$.+!*,;@&=?/~#%\\E]" #define PATHTERM_CLASS "[^\\Q]'.}>) \t\r\n,\"\\E]" #define SCHEME "(?:news:|telnet:|nntp:|file:\\/|https?:|ftps?:|sftp:|webcal:)" #define USERPASS USERCHARS_CLASS "+(?:" PASSCHARS_CLASS "+)?" #define URLPATH "(?:(/"PATHCHARS_CLASS"+(?:[(]"PATHCHARS_CLASS"*[)])*"PATHCHARS_CLASS"*)*"PATHTERM_CLASS")?" typedef struct { char long_name[18]; char short_name[12]; char var_type[12]; char desc[150]; } Option; typedef enum { URL_TYPE_HTTP, URL_TYPE_EMAIL, URL_TYPE_NEWS } UrlTypes; typedef struct { const char *pattern; UrlTypes url_type; GRegexCompileFlags flags; } RegExPattern; typedef struct { int tag; char *text; } CursorMatch; // The following patterns borrowed from gnome-terminal: static const RegExPattern uri_patterns[] = { {"news:[[:alnum:]\\Q^_{|}~!\"#$%&'()*+,./;:=?`\\E]+", URL_TYPE_NEWS, G_REGEX_CASELESS }, {SCHEME "//(?:" USERPASS "\\@)?" HOST PORT URLPATH, URL_TYPE_HTTP, G_REGEX_CASELESS}, {"(?:www|ftp)" HOSTCHARS_CLASS "*\\." HOST PORT URLPATH , URL_TYPE_HTTP, G_REGEX_CASELESS}, {"(?:mailto:)?" USERCHARS_CLASS "[" USERCHARS ".]*\\@" HOSTCHARS_CLASS "+\\." HOST, URL_TYPE_EMAIL, G_REGEX_CASELESS}, }; extern void print_help(void); extern void print_info(void); extern void print_version(void); extern void build_mainwindow(void); extern GtkWidget* build_term(void); extern void build_popupmenu(void); extern void mainwindow_toggle(int sig); extern void mainwindow_create_tab(void); extern void mainwindow_close_tab(GtkWidget *); extern void mainwindow_toggle_fullscreen(void); extern void init_key(void); extern void grab_key(void); extern void wait_key(void); extern void buildprefswindow(void); extern void conf_init(void); extern char* conf_get_font(void); extern float conf_get_opacity(void); extern GdkColor conf_get_bg(void); extern GdkColor conf_get_fg(void); extern int conf_get_border(void); extern unsigned int conf_get_mod(void); extern KeySym conf_get_key(void); extern int conf_get_width(void); extern int conf_get_height(void); extern void conf_get_position(int*, int*); extern int conf_get_scrollbar(void); extern char* conf_get_shell(void); extern char* conf_get_emulation(void); extern int conf_get_lines(void); extern int conf_get_show_tab(void); extern char* conf_get_term_name(void); extern GtkPositionType conf_get_tab_pos(void); extern GdkColor* conf_get_color_palette(void); extern gboolean conf_get_tab_fill(void); extern gboolean conf_get_allow_bold(void); extern GdkModifierType conf_get_key_mod(void); extern gboolean conf_get_auto_hide(void); extern char* conf_get_bg_image(void); extern gboolean conf_get_allow_reorder(void); extern gboolean conf_get_scroll_on_output(); extern gboolean conf_get_cursor_blink(void); extern GdkColor conf_get_cursor_color(void); extern VteTerminalCursorShape conf_get_cursor_shape(void); #endif /* __STJERM_H__ */ stjerm-0.16/src/popupmenu.c0000664000175000017500000000657512002351334015675 0ustar kwilsonkwilson/* * popupmenu.c * This file is part of Stjerm * * Copyright (C) 2007-2012 - Kristopher Wilson, Stjepan Glavina and Markus Groß * * Stjerm is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Stjerm is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Stjerm; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA */ #include #include #include #include "stjerm.h" extern GtkWidget *mainwindow; extern int activetab; extern GArray* tabs; GtkWidget *popupmenu= NULL; gboolean popupmenu_shown; GtkWidget *close_tab; void build_popupmenu(void); static void popupmenu_activate(gchar*); static void popupmenu_deactivate(GtkMenuShell*, gpointer); void build_popupmenu(void) { popupmenu = gtk_menu_new(); popupmenu_shown = FALSE; GtkWidget *menuitem; GtkWidget *img; gchar *labels[] = {"New Tab", "Close Tab", "Copy", "Paste", "Toggle Fullscreen", "Quit"}; gchar *stocks[] = {GTK_STOCK_ADD, GTK_STOCK_CLOSE, GTK_STOCK_COPY, GTK_STOCK_PASTE, GTK_STOCK_FULLSCREEN, GTK_STOCK_QUIT}; int i; for(i = 0; i < 6; i++) { if(i == 2 || i == 4 || i == 5) { menuitem = gtk_separator_menu_item_new(); gtk_menu_shell_append(GTK_MENU_SHELL(popupmenu), menuitem); gtk_widget_show(GTK_WIDGET(menuitem)); } menuitem = gtk_image_menu_item_new_with_label(labels[i]); img = gtk_image_new_from_stock(stocks[i], GTK_ICON_SIZE_MENU); if(i == 1) { close_tab = menuitem; gtk_widget_set_sensitive(menuitem, FALSE); } gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), GTK_WIDGET(img)); g_signal_connect_swapped(G_OBJECT(menuitem), "activate", G_CALLBACK(popupmenu_activate), (gpointer)labels[i]); gtk_menu_shell_append(GTK_MENU_SHELL(popupmenu), menuitem); gtk_widget_show(GTK_WIDGET(menuitem)); } g_signal_connect_swapped(G_OBJECT(popupmenu), "deactivate", G_CALLBACK(popupmenu_deactivate), NULL); } static void popupmenu_activate(gchar *label) { if(!strcmp(label, "New Tab")) { mainwindow_create_tab(); } else if(!strcmp(label, "Close Tab")) { mainwindow_close_tab(NULL); } else if(!strcmp(label, "Copy")) { vte_terminal_copy_clipboard(g_array_index(tabs, VteTerminal*, activetab)); } else if(!strcmp(label, "Paste")) { vte_terminal_paste_clipboard(g_array_index(tabs, VteTerminal*, activetab)); } else if(!strcmp(label, "Toggle Fullscreen")) { mainwindow_toggle_fullscreen(); } else if(!strcmp(label, "Quit")) { gtk_widget_destroy(GTK_WIDGET(mainwindow)); } popupmenu_shown = FALSE; } static void popupmenu_deactivate(GtkMenuShell *menushell, gpointer userdata) { popupmenu_shown = FALSE; } stjerm-0.16/src/mainwindow.c0000664000175000017500000004734512002351334016021 0ustar kwilsonkwilson/* * mainwindow.c * This file is part of Stjerm * * Copyright (C) 2007-2010 - Kristopher Wilson, Stjepan Glavina and Markus Groß * * Stjerm is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Stjerm is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Stjerm; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include "stjerm.h" extern GtkWidget *popupmenu; extern GtkWidget *close_tab; extern gboolean popupmenu_shown; GtkWidget *mainwindow; int activetab; int tabcount; GArray* tabs; GtkNotebook* tabbar; Window mw_xwin; static Display *dpy = 0; Atom opacityatom; gboolean screen_is_composited; gboolean fullscreen; gboolean toggled; void build_mainwindow(void); void mainwindow_toggle(int sig); void mainwindow_create_tab(void); void mainwindow_close_tab(GtkWidget *term); void mainwindow_toggle_fullscreen(void); int handle_x_error(Display *dpy, XErrorEvent *evt); static GRegex **uri_regex; static guint uri_regex_count; static void mainwindow_reset_position(void); static void mainwindow_focus_terminal(void); static void mainwindow_show(GtkWidget*, gpointer); static void mainwindow_focus_out_event(GtkWindow*, GdkEventFocus*, gpointer); static gboolean mainwindow_expose_event(GtkWidget*, GdkEventExpose*, gpointer); static void mainwindow_destroy(GtkWidget*, gpointer); static void mainwindow_window_title_changed(VteTerminal *vteterminal, gpointer user_data); static void mainwindow_switch_tab(GtkNotebook *notebook, GtkNotebookPage *page, guint page_num, gpointer user_data); static void mainwindow_goto_tab(gint i); static void mainwindow_next_tab(GtkWidget *widget, gpointer user_data); static void mainwindow_prev_tab(GtkWidget *widget, gpointer user_data); static void mainwindow_new_tab(GtkWidget *widget, gpointer user_data); static void mainwindow_delete_tab(GtkWidget *widget, gpointer user_data); static gint mainwindow_copy(GtkWidget *widget, gpointer user_data); static gint mainwindow_paste(GtkWidget *widget, gpointer user_data); static gint mainwindow_tab_at_xy(GtkNotebook *notebook, gint abs_x, gint abs_y); static void mainwindow_notebook_clicked(GtkWidget *widget, GdkEventButton *event, gpointer func_data); static void mainwindow_tab_moved(GtkWidget *notebook, GtkWidget *page, guint page_num, gpointer user_data); void build_mainwindow(void) { guint ic; uri_regex_count = G_N_ELEMENTS(uri_patterns); uri_regex = g_new0(GRegex*, uri_regex_count); for(ic = 0; ic < uri_regex_count; ++ic) { GError *error = NULL; uri_regex[ic] = g_regex_new(uri_patterns[ic].pattern, uri_patterns[ic].flags | G_REGEX_OPTIMIZE, 0, &error); if(error) { g_message("%s", error->message); g_error_free (error); } } mainwindow = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_widget_set_app_paintable(mainwindow, TRUE); gtk_widget_set_size_request(mainwindow, conf_get_width(), conf_get_height()); gtk_window_set_decorated(GTK_WINDOW(mainwindow), FALSE); gtk_window_set_skip_taskbar_hint(GTK_WINDOW(mainwindow), TRUE); gtk_window_set_skip_pager_hint(GTK_WINDOW(mainwindow), TRUE); gtk_window_set_resizable(GTK_WINDOW(mainwindow), TRUE); mainwindow_reset_position(); fullscreen = FALSE; toggled = FALSE; GtkAccelGroup* accel_group; GClosure *new_tab, *delete_tab, *next_tab, *prev_tab, *delete_all, *maximize, *copy, *paste; GClosure *goto_tab_closure[10]; long i; accel_group = gtk_accel_group_new(); gtk_window_add_accel_group(GTK_WINDOW(mainwindow), accel_group); maximize = g_cclosure_new_swap(G_CALLBACK(mainwindow_toggle_fullscreen), NULL, NULL); gtk_accel_group_connect(accel_group, GDK_F11, 0, GTK_ACCEL_VISIBLE, maximize); new_tab = g_cclosure_new_swap(G_CALLBACK(mainwindow_new_tab), NULL, NULL); gtk_accel_group_connect(accel_group, 't', conf_get_key_mod(), GTK_ACCEL_VISIBLE, new_tab); delete_tab = g_cclosure_new_swap(G_CALLBACK(mainwindow_delete_tab), NULL, NULL); gtk_accel_group_connect(accel_group, 'w', conf_get_key_mod(), GTK_ACCEL_VISIBLE, delete_tab); next_tab = g_cclosure_new_swap(G_CALLBACK(mainwindow_next_tab), NULL, NULL); gtk_accel_group_connect(accel_group, GDK_Page_Up, conf_get_key_mod(), GTK_ACCEL_VISIBLE, next_tab); prev_tab = g_cclosure_new_swap(G_CALLBACK(mainwindow_prev_tab), NULL, NULL); gtk_accel_group_connect(accel_group, GDK_Page_Down, conf_get_key_mod(), GTK_ACCEL_VISIBLE, prev_tab); delete_all = g_cclosure_new_swap(G_CALLBACK(mainwindow_destroy), NULL, NULL); gtk_accel_group_connect(accel_group, 'q', conf_get_key_mod(), GTK_ACCEL_VISIBLE, delete_all); /* tab hotkeys, inspired by Tilda -- thanks to castorinop for the patch */ for(i = 0; i < 10; i++) { goto_tab_closure[i] = g_cclosure_new_swap(G_CALLBACK(mainwindow_goto_tab), (gpointer) i, NULL); gtk_accel_group_connect(accel_group, '0' + ((i+1)%10), GDK_MOD1_MASK, GTK_ACCEL_VISIBLE, goto_tab_closure[i]); } copy = g_cclosure_new_swap(G_CALLBACK(mainwindow_copy), NULL, NULL); gtk_accel_group_connect(accel_group, 'c', conf_get_key_mod(), GTK_ACCEL_VISIBLE, copy); paste = g_cclosure_new_swap(G_CALLBACK(mainwindow_paste), NULL, NULL); gtk_accel_group_connect(accel_group, 'v', conf_get_key_mod(), GTK_ACCEL_VISIBLE, paste); activetab = -1; tabs = g_array_new(TRUE, FALSE, sizeof(VteTerminal*)); tabcount = 0; GtkVBox* mainbox = GTK_VBOX(gtk_vbox_new(FALSE, 0)); tabbar = GTK_NOTEBOOK(gtk_notebook_new()); g_signal_connect(G_OBJECT(tabbar), "switch-page", G_CALLBACK(mainwindow_switch_tab), NULL); g_signal_connect(G_OBJECT(tabbar), "page-reordered", G_CALLBACK(mainwindow_tab_moved), NULL); if(conf_get_opacity() < 100) { GdkScreen *screen = gdk_screen_get_default(); GdkColormap *colormap = gdk_screen_get_rgba_colormap(screen); screen_is_composited = (colormap != NULL && gdk_screen_is_composited(screen)); if(screen_is_composited) { gtk_widget_set_colormap(GTK_WIDGET(mainwindow), colormap); gdk_screen_set_default_colormap(screen, colormap); } } gtk_box_pack_start(GTK_BOX(mainbox), GTK_WIDGET(tabbar), TRUE, TRUE, 0); mainwindow_create_tab(); gtk_widget_show_all(GTK_WIDGET(mainbox)); gtk_container_add(GTK_CONTAINER(mainwindow), GTK_WIDGET(mainbox)); int border = conf_get_border(); if(border == BORDER_THIN) gtk_container_set_border_width(GTK_CONTAINER(mainwindow), 1); else if(border == BORDER_THICK) gtk_container_set_border_width(GTK_CONTAINER(mainwindow), 5); if(border != BORDER_NONE) g_signal_connect(G_OBJECT(mainwindow), "expose-event", G_CALLBACK(mainwindow_expose_event), NULL); if(conf_get_auto_hide()) g_signal_connect(G_OBJECT(mainwindow), "focus-out-event", G_CALLBACK(mainwindow_focus_out_event), NULL); g_signal_connect(G_OBJECT(mainwindow), "show", G_CALLBACK(mainwindow_show), NULL); g_signal_connect(G_OBJECT(mainwindow), "destroy", G_CALLBACK(mainwindow_destroy), NULL); g_signal_connect_after(G_OBJECT(tabbar), "button_press_event", G_CALLBACK(mainwindow_notebook_clicked), NULL); gtk_notebook_set_show_border(tabbar, FALSE); gtk_notebook_set_scrollable(tabbar, TRUE); if (conf_get_show_tab() == TABS_ONE|| conf_get_show_tab() == TABS_NEVER) gtk_notebook_set_show_tabs(tabbar, FALSE); gtk_notebook_set_tab_pos(tabbar, conf_get_tab_pos()); gtk_notebook_set_homogeneous_tabs(tabbar, FALSE); XSetErrorHandler(handle_x_error); init_key(); grab_key(); g_thread_create((GThreadFunc)wait_key, NULL, FALSE, NULL); } void mainwindow_notebook_clicked(GtkWidget *widget, GdkEventButton *event, gpointer func_data) { gint tabclicked = mainwindow_tab_at_xy(GTK_NOTEBOOK(widget), event->x, event->y); if(tabclicked > -1) gtk_notebook_set_current_page(GTK_NOTEBOOK(widget), tabclicked); else if(event->type == GDK_2BUTTON_PRESS) mainwindow_create_tab(); if(event->button == 3) { popupmenu_shown = TRUE; gtk_menu_popup(GTK_MENU(popupmenu), NULL, NULL, NULL, NULL, event->button, event->time); } } /* This code adapted from gnome-terminal */ static gint mainwindow_tab_at_xy(GtkNotebook *notebook, gint x, gint y) { GtkPositionType tab_pos; int page_num = 0; GtkWidget *page; tab_pos = gtk_notebook_get_tab_pos(notebook); if(notebook->first_tab == NULL) return -1; while((page = gtk_notebook_get_nth_page(notebook, page_num))) { GtkWidget *screen; gint max_x, max_y; screen = gtk_notebook_get_tab_label(notebook, page); g_return_val_if_fail(screen != NULL, -1); if(!GTK_WIDGET_MAPPED(GTK_WIDGET(screen))) { page_num++; continue; } max_x = screen->allocation.x + screen->allocation.width; max_y = screen->allocation.y + screen->allocation.height; if(((tab_pos == GTK_POS_TOP) || (tab_pos == GTK_POS_BOTTOM)) && (x <= max_x)) return page_num; else if(((tab_pos == GTK_POS_LEFT) || (tab_pos == GTK_POS_RIGHT)) && (y <= max_y)) return page_num; page_num++; } return -1; } void mainwindow_create_tab(void) { GtkWidget* tmp_term = build_term(); GtkVScrollbar *sbar= NULL; GtkHBox *tmp_box = GTK_HBOX(gtk_hbox_new(FALSE, 0)); if(conf_get_scrollbar() == -1) gtk_box_pack_start(GTK_BOX(tmp_box), tmp_term, TRUE, TRUE, 0); else if(conf_get_scrollbar() == POS_LEFT) { sbar = GTK_VSCROLLBAR(gtk_vscrollbar_new(vte_terminal_get_adjustment( VTE_TERMINAL(tmp_term)))); gtk_box_pack_start(GTK_BOX(tmp_box), GTK_WIDGET(sbar), FALSE, FALSE, 0); gtk_box_pack_end(GTK_BOX(tmp_box), GTK_WIDGET(tmp_term), TRUE, TRUE, 0); } else // (conf_get_scrollbar() == POS_RIGHT) { sbar = GTK_VSCROLLBAR(gtk_vscrollbar_new(vte_terminal_get_adjustment( VTE_TERMINAL(tmp_term)))); gtk_box_pack_start(GTK_BOX(tmp_box), GTK_WIDGET(tmp_term), TRUE, TRUE, 0); gtk_box_pack_end(GTK_BOX(tmp_box), GTK_WIDGET(sbar), FALSE, FALSE, 0); } char buffer [100]; sprintf(buffer, "%s %d", conf_get_term_name(), activetab + 1); GtkLabel* tmp_label = GTK_LABEL(gtk_label_new(buffer)); if(conf_get_opacity() < 100) { if(screen_is_composited) { vte_terminal_set_background_transparent(VTE_TERMINAL(tmp_term), FALSE); vte_terminal_set_opacity(VTE_TERMINAL(tmp_term), conf_get_opacity()/100 * 0xffff); } else { vte_terminal_set_background_saturation(VTE_TERMINAL(tmp_term), 1.0 - conf_get_opacity()/100); if(conf_get_bg_image() == NULL) vte_terminal_set_background_transparent(VTE_TERMINAL(tmp_term), TRUE); } } if(conf_get_opacity() < 100 && screen_is_composited) { vte_terminal_set_background_transparent(VTE_TERMINAL(tmp_term), FALSE); vte_terminal_set_opacity(VTE_TERMINAL(tmp_term), conf_get_opacity()/100 * 0xffff); } g_signal_connect(G_OBJECT(tmp_term), "window-title-changed", G_CALLBACK(mainwindow_window_title_changed), tmp_label); g_array_append_val(tabs, tmp_term); tabcount++; gtk_widget_show_all(GTK_WIDGET(tmp_box)); gtk_notebook_append_page(tabbar, GTK_WIDGET(tmp_box), GTK_WIDGET(tmp_label)); if(conf_get_tab_fill()) gtk_container_child_set(GTK_CONTAINER(tabbar), GTK_WIDGET(tmp_box), "tab-expand", TRUE, "tab-fill", TRUE, NULL); if(conf_get_show_tab() == TABS_ONE&& tabcount > 1) gtk_notebook_set_show_tabs(tabbar, TRUE); activetab = tabcount - 1; gtk_notebook_set_current_page(tabbar, activetab); if(conf_get_allow_reorder()) gtk_notebook_set_tab_reorderable(tabbar, GTK_WIDGET(tmp_box), TRUE); guint i; for(i = 0; i < uri_regex_count; ++i) { int tag = vte_terminal_match_add_gregex(VTE_TERMINAL(tmp_term), uri_regex[i], 0); vte_terminal_match_set_cursor_type(VTE_TERMINAL(tmp_term), tag, GDK_HAND2); } if(tabcount > 1) gtk_widget_set_sensitive(close_tab, TRUE); } void mainwindow_close_tab(GtkWidget *term) { // Look for the right tab... int thetab = activetab; if(term != NULL) { int i; for(i = 0; i < tabs->len; i++) { if(g_array_index(tabs, GtkWidget *, i) == term) { thetab = i; break; } } } g_array_remove_index(tabs, thetab); tabcount--; gtk_notebook_remove_page(tabbar, thetab); activetab = gtk_notebook_get_current_page(tabbar); if(tabcount == 1 && conf_get_show_tab() == TABS_ONE) gtk_notebook_set_show_tabs(tabbar, FALSE); if (tabcount == 0) mainwindow_create_tab(); if(tabcount == 1) gtk_widget_set_sensitive(GTK_WIDGET(close_tab), FALSE); } void mainwindow_toggle(int sig) { if((!sig && GTK_WIDGET_VISIBLE(mainwindow)) || (sig && toggled)) { gdk_threads_enter(); gtk_widget_hide(GTK_WIDGET(mainwindow)); gdk_flush(); gdk_threads_leave(); toggled = FALSE; return; } toggled = TRUE; gdk_threads_enter(); /* reset the window position before displaying it to avoid flickering if the windos is moved */ mainwindow_reset_position(); if(gtk_window_is_active(GTK_WINDOW(mainwindow)) == FALSE) gtk_window_present(GTK_WINDOW(mainwindow)); else gtk_widget_show(mainwindow); gtk_window_stick(GTK_WINDOW(mainwindow)); gtk_window_set_keep_above(GTK_WINDOW(mainwindow), TRUE); gdk_window_focus(mainwindow->window, gtk_get_current_event_time()); gdk_flush(); gdk_threads_leave(); } void mainwindow_toggle_fullscreen(void) { if(fullscreen) { gtk_window_unfullscreen(GTK_WINDOW(mainwindow)); mainwindow_reset_position(); } else gtk_window_fullscreen(GTK_WINDOW(mainwindow)); fullscreen = !fullscreen; mainwindow_focus_terminal(); } static void mainwindow_reset_position(void) { int x, y; conf_get_position(&x, &y); gtk_window_move(GTK_WINDOW(mainwindow), x, y); gtk_window_resize(GTK_WINDOW(mainwindow), conf_get_width(), conf_get_height()); } static void mainwindow_show(GtkWidget *widget, gpointer userdata) { if(dpy != NULL) return; mw_xwin = GDK_WINDOW_XWINDOW(GTK_WIDGET(mainwindow)->window); dpy = GDK_DISPLAY_XDISPLAY(gdk_display_get_default()); } static void mainwindow_focus_out_event(GtkWindow* window, GdkEventFocus* event, gpointer userdata) { int revert; Window w; XGetInputFocus(dpy, &w, &revert); if (w == mw_xwin) return; // focus wasn't lost just by pressing the shortcut key if(popupmenu_shown == TRUE) return; // focus wasn't lost by popping up popupmenu gtk_widget_hide(GTK_WIDGET(mainwindow)); } static gboolean mainwindow_expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer user_data) { gint winw, winh; gtk_window_get_size(GTK_WINDOW(widget), &winw, &winh); gdk_draw_rectangle(widget->window, widget->style->black_gc, FALSE, 0, 0, winw-1, winh-1); if(conf_get_border() == BORDER_THIN) return FALSE; gdk_draw_rectangle(widget->window, widget->style->bg_gc[GTK_STATE_SELECTED], TRUE, 1, 1, winw -2, winh -2); gdk_draw_rectangle(widget->window, widget->style->bg_gc[GTK_STATE_NORMAL], TRUE, 5, 5, winw-10, winh-10); return FALSE; } static void mainwindow_destroy(GtkWidget *widget, gpointer user_data) { g_array_free(tabs, TRUE); gtk_main_quit(); } static void mainwindow_window_title_changed(VteTerminal *vteterminal, gpointer user_data) { if(vteterminal != NULL && user_data != NULL) gtk_label_set_label(GTK_LABEL(user_data), vte_terminal_get_window_title(vteterminal)); } static void mainwindow_switch_tab(GtkNotebook *notebook, GtkNotebookPage *page, guint page_num, gpointer user_data) { activetab = page_num; } static void mainwindow_goto_tab(gint i) { gtk_notebook_set_current_page(tabbar, i); activetab = gtk_notebook_get_current_page(tabbar); mainwindow_focus_terminal(); } static void mainwindow_next_tab(GtkWidget *widget, gpointer user_data) { if(gtk_notebook_get_current_page(tabbar) == (tabcount - 1)) gtk_notebook_set_current_page(tabbar, 0); else gtk_notebook_next_page(tabbar); activetab = gtk_notebook_get_current_page(tabbar); mainwindow_focus_terminal(); } static void mainwindow_prev_tab(GtkWidget *widget, gpointer user_data) { if(gtk_notebook_get_current_page(tabbar) == (0)) gtk_notebook_set_current_page(tabbar, (tabcount - 1)); else gtk_notebook_prev_page(tabbar); activetab = gtk_notebook_get_current_page(tabbar); mainwindow_focus_terminal(); } static void mainwindow_new_tab(GtkWidget *widget, gpointer user_data) { mainwindow_create_tab(); mainwindow_focus_terminal(); } static void mainwindow_delete_tab(GtkWidget *widget, gpointer user_data) { mainwindow_close_tab(NULL); if(tabcount > 0) mainwindow_focus_terminal(); } int handle_x_error(Display *dpy, XErrorEvent *evt) { if(evt->error_code == BadAccess|| evt->error_code == BadValue || evt->error_code == BadWindow) { fprintf(stderr, "error: unable to grab key, is stjerm is already running with the same key?\n"); exit(1); } return 0; } static void mainwindow_tab_moved(GtkWidget *notebook, GtkWidget *page, guint page_num, gpointer user_data) { GList *children = gtk_container_get_children(GTK_CONTAINER(page)); GtkWidget *term = GTK_WIDGET(children->data); GArray *newtabs = g_array_new(TRUE, FALSE, sizeof(VteTerminal*)); int i; for(i = 0; i < tabcount; i++) { GtkWidget *element = g_array_index(tabs, GtkWidget *, i); if(i == page_num) { g_array_append_val(newtabs, term); g_array_append_val(newtabs, element); } else if(element == term) continue; else g_array_append_val(newtabs, element); } g_array_free(tabs, TRUE); tabs = newtabs; activetab = page_num; } static void mainwindow_focus_terminal(void) { if (activetab >= 0) gtk_window_set_focus(GTK_WINDOW(mainwindow), GTK_WIDGET(g_array_index(tabs, VteTerminal*, activetab))); } static gint mainwindow_copy(GtkWidget *widget, gpointer user_data) { vte_terminal_copy_clipboard (g_array_index(tabs, VteTerminal*, activetab)); return TRUE; } static gint mainwindow_paste(GtkWidget *widget, gpointer user_data) { vte_terminal_paste_clipboard (g_array_index(tabs, VteTerminal*, activetab)); return TRUE; } static void mainwindow_set_terminal_opacity(int value) { } stjerm-0.16/src/.svn/0000775000175000017500000000000012002351334014350 5ustar kwilsonkwilsonstjerm-0.16/src/.svn/text-base/0000775000175000017500000000000012002351334016244 5ustar kwilsonkwilsonstjerm-0.16/src/.svn/text-base/popupmenu.c.svn-base0000444000175000017500000000657512002351334022166 0ustar kwilsonkwilson/* * popupmenu.c * This file is part of Stjerm * * Copyright (C) 2007-2012 - Kristopher Wilson, Stjepan Glavina and Markus Groß * * Stjerm is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Stjerm is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Stjerm; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA */ #include #include #include #include "stjerm.h" extern GtkWidget *mainwindow; extern int activetab; extern GArray* tabs; GtkWidget *popupmenu= NULL; gboolean popupmenu_shown; GtkWidget *close_tab; void build_popupmenu(void); static void popupmenu_activate(gchar*); static void popupmenu_deactivate(GtkMenuShell*, gpointer); void build_popupmenu(void) { popupmenu = gtk_menu_new(); popupmenu_shown = FALSE; GtkWidget *menuitem; GtkWidget *img; gchar *labels[] = {"New Tab", "Close Tab", "Copy", "Paste", "Toggle Fullscreen", "Quit"}; gchar *stocks[] = {GTK_STOCK_ADD, GTK_STOCK_CLOSE, GTK_STOCK_COPY, GTK_STOCK_PASTE, GTK_STOCK_FULLSCREEN, GTK_STOCK_QUIT}; int i; for(i = 0; i < 6; i++) { if(i == 2 || i == 4 || i == 5) { menuitem = gtk_separator_menu_item_new(); gtk_menu_shell_append(GTK_MENU_SHELL(popupmenu), menuitem); gtk_widget_show(GTK_WIDGET(menuitem)); } menuitem = gtk_image_menu_item_new_with_label(labels[i]); img = gtk_image_new_from_stock(stocks[i], GTK_ICON_SIZE_MENU); if(i == 1) { close_tab = menuitem; gtk_widget_set_sensitive(menuitem, FALSE); } gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), GTK_WIDGET(img)); g_signal_connect_swapped(G_OBJECT(menuitem), "activate", G_CALLBACK(popupmenu_activate), (gpointer)labels[i]); gtk_menu_shell_append(GTK_MENU_SHELL(popupmenu), menuitem); gtk_widget_show(GTK_WIDGET(menuitem)); } g_signal_connect_swapped(G_OBJECT(popupmenu), "deactivate", G_CALLBACK(popupmenu_deactivate), NULL); } static void popupmenu_activate(gchar *label) { if(!strcmp(label, "New Tab")) { mainwindow_create_tab(); } else if(!strcmp(label, "Close Tab")) { mainwindow_close_tab(NULL); } else if(!strcmp(label, "Copy")) { vte_terminal_copy_clipboard(g_array_index(tabs, VteTerminal*, activetab)); } else if(!strcmp(label, "Paste")) { vte_terminal_paste_clipboard(g_array_index(tabs, VteTerminal*, activetab)); } else if(!strcmp(label, "Toggle Fullscreen")) { mainwindow_toggle_fullscreen(); } else if(!strcmp(label, "Quit")) { gtk_widget_destroy(GTK_WIDGET(mainwindow)); } popupmenu_shown = FALSE; } static void popupmenu_deactivate(GtkMenuShell *menushell, gpointer userdata) { popupmenu_shown = FALSE; } stjerm-0.16/src/.svn/text-base/shortcut.c.svn-base0000444000175000017500000000512112002351334021773 0ustar kwilsonkwilson/* * shortcut.c * This file is part of Stjerm * * Copyright (C) 2007-2010 - Kristopher Wilson, Stjepan Glavina and Markus Groß * * Stjerm is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Stjerm is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Stjerm; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA */ #include #include #include #include #include "stjerm.h" static Display *dpy; Window root; int screen; KeySym opt_key; unsigned int modmask; unsigned int numlockmask; void init_key(void); void grab_key(void); void wait_key(void); void init_key(void) { if(!(dpy = XOpenDisplay(NULL))) { fprintf(stderr, "error: can not open display %s", XDisplayName(NULL)); exit(1); } screen = DefaultScreen(dpy); root = RootWindow(dpy, screen); opt_key = conf_get_key(); modmask = conf_get_mod(); int i, j; XModifierKeymap *modmap = XGetModifierMapping(dpy); for(i = 0; i < 8; i++) { for(j = 0; j < modmap->max_keypermod; j++) { if(modmap->modifiermap[i * modmap->max_keypermod + j] == XKeysymToKeycode(dpy, XK_Num_Lock)) numlockmask = (1 << i); } } XFreeModifiermap(modmap); } void grab_key(void) { XGrabKey(dpy, XKeysymToKeycode(dpy, opt_key), modmask, root, True, GrabModeAsync, GrabModeAsync); XGrabKey(dpy, XKeysymToKeycode(dpy, opt_key), LockMask|modmask, root, True, GrabModeAsync, GrabModeAsync); if(numlockmask) { XGrabKey(dpy, XKeysymToKeycode(dpy, opt_key), numlockmask|modmask, root, True, GrabModeAsync, GrabModeAsync); XGrabKey(dpy, XKeysymToKeycode(dpy, opt_key), numlockmask|LockMask |modmask, root, True, GrabModeAsync, GrabModeAsync); } } void wait_key(void) { XEvent event; while(1) { XNextEvent(dpy, &event); if(event.type == KeyPress) { if(XKeycodeToKeysym(dpy, event.xkey.keycode, 0) == opt_key) mainwindow_toggle(0); } } } stjerm-0.16/src/.svn/text-base/term.c.svn-base0000444000175000017500000002110712002351334021071 0ustar kwilsonkwilson/* * term.c * This file is part of Stjerm * * Copyright (C) 2007-2010 - Kristopher Wilson, Stjepan Glavina and Markus Groß * * Stjerm is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Stjerm is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Stjerm; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA */ #include #include #include "stjerm.h" extern GtkWidget *mainwindow; extern GtkNotebook* tabbar; extern GtkWidget *popupmenu; extern gboolean popupmenu_shown; GtkWidget* build_term(void); static void term_connect_signals(GtkWidget*); static gboolean term_button_press(GtkWidget*, GdkEventButton*, gpointer); static void term_eof_or_child_exited(VteTerminal*, gpointer); static void term_app_request(VteTerminal*, gpointer); //static void term_app_request_resize_move(VteTerminal*, guint, guint, gpointer); static void term_fork_command(VteTerminal*, char*); GtkWidget* build_term(void) { if(!popupmenu) build_popupmenu(); GtkWidget* term = vte_terminal_new(); term_fork_command(VTE_TERMINAL(term), conf_get_shell()); if (conf_get_bg_image() != NULL) vte_terminal_set_background_image_file(VTE_TERMINAL(term), conf_get_bg_image()); GdkColor fore, back; fore = conf_get_fg(); back = conf_get_bg(); GdkColor *palette = conf_get_color_palette(); if(palette == NULL) vte_terminal_set_colors(VTE_TERMINAL(term), &fore, &back, NULL, 0); else vte_terminal_set_colors(VTE_TERMINAL(term), &fore, &back, palette, 16); #if VTE_CHECK_VERSION(0,25,0) vte_pty_set_term(vte_terminal_get_pty_object(VTE_TERMINAL(term)), conf_get_emulation()); #endif vte_terminal_set_background_tint_color(VTE_TERMINAL(term), &back); vte_terminal_set_allow_bold(VTE_TERMINAL(term), conf_get_allow_bold()); vte_terminal_set_scroll_on_output(VTE_TERMINAL(term), conf_get_scroll_on_output()); vte_terminal_set_scroll_on_keystroke(VTE_TERMINAL(term), TRUE); vte_terminal_set_font_from_string(VTE_TERMINAL(term), conf_get_font()); vte_terminal_set_scrollback_lines(VTE_TERMINAL(term), conf_get_lines()); vte_terminal_set_backspace_binding(VTE_TERMINAL(term), VTE_ERASE_ASCII_DELETE); vte_terminal_set_word_chars(VTE_TERMINAL(term), "-A-Za-z0-9_$.+!*(),;:@&=?/~#%"); GdkColor cursor = conf_get_cursor_color(); vte_terminal_set_cursor_blink_mode(VTE_TERMINAL(term), conf_get_cursor_blink() ? VTE_CURSOR_BLINK_ON : VTE_CURSOR_BLINK_OFF); vte_terminal_set_cursor_shape(VTE_TERMINAL(term), conf_get_cursor_shape()); vte_terminal_set_color_cursor(VTE_TERMINAL(term), &cursor); term_connect_signals(term); return term; } static void term_connect_signals(GtkWidget *term) { g_signal_connect_swapped(G_OBJECT(term), "button-press-event", G_CALLBACK(term_button_press), NULL); g_signal_connect (G_OBJECT(term), "eof", G_CALLBACK(term_eof_or_child_exited), NULL); g_signal_connect (G_OBJECT(term), "child-exited", G_CALLBACK(term_eof_or_child_exited), NULL); g_signal_connect(G_OBJECT(term), "iconify-window", G_CALLBACK(term_app_request), (gpointer)TERM_ICONIFY_WINDOW); g_signal_connect(G_OBJECT(term), "deiconify-window", G_CALLBACK(term_app_request), (gpointer)TERM_DEICONIFY_WINDOW); g_signal_connect(G_OBJECT(term), "raise-window", G_CALLBACK(term_app_request), (gpointer)TERM_RAISE_WINDOW); g_signal_connect(G_OBJECT(term), "lower-window", G_CALLBACK(term_app_request), (gpointer)TERM_LOWER_WINDOW); g_signal_connect(G_OBJECT(term), "maximize-window", G_CALLBACK(term_app_request), (gpointer)TERM_MAXIMIZE_WINDOW); g_signal_connect(G_OBJECT(term), "restore-window", G_CALLBACK(term_app_request), (gpointer)TERM_RESTORE_WINDOW); g_signal_connect(G_OBJECT(term), "refresh-window", G_CALLBACK(term_app_request), (gpointer)TERM_REFRESH_WINDOW); /*g_signal_connect(G_OBJECT(term), "resize-window", G_CALLBACK(term_app_request_resize_move), (gpointer)TERM_RESIZE_WINDOW); g_signal_connect(G_OBJECT(term), "move-window", G_CALLBACK(term_app_request_resize_move), (gpointer)TERM_MOVE_WINDOW);*/ } static CursorMatch term_cursor_match_pattern(GdkEventButton* event) { int tag = -1; gint page = gtk_notebook_get_current_page(GTK_NOTEBOOK(tabbar)); GList *children = gtk_container_get_children(GTK_CONTAINER(gtk_notebook_get_nth_page(GTK_NOTEBOOK(tabbar), page))); GtkWidget *vte = GTK_WIDGET(children->data); glong column = ((glong) (event->x) / vte_terminal_get_char_width(VTE_TERMINAL(vte))); glong row = ((glong) (event->y) / vte_terminal_get_char_height(VTE_TERMINAL(vte))); char* current_match = vte_terminal_match_check(VTE_TERMINAL(vte), column, row, &tag); CursorMatch match; match.tag = tag; match.text = current_match; return match; } static gboolean term_button_press(GtkWidget *widget, GdkEventButton *event, gpointer user_data) { if(event->type == GDK_BUTTON_PRESS && event->button == 3) { popupmenu_shown = TRUE; gtk_menu_popup(GTK_MENU(popupmenu), NULL, NULL, NULL, NULL, event->button, event->time); } else if (event->button == 1) { GError *error = NULL; CursorMatch match = term_cursor_match_pattern(event); if(match.tag >= 0) { gtk_show_uri(NULL, match.text, event->time, &error); } } return FALSE; } static void term_eof_or_child_exited(VteTerminal *term, gpointer user_data) { if(vte_terminal_get_child_exit_status(term) != 0) { /* restart the terminal if it crashed */ vte_terminal_reset(VTE_TERMINAL(term), FALSE, TRUE); term_fork_command(VTE_TERMINAL(term), conf_get_shell()); } else { /* else close the tab */ mainwindow_close_tab(GTK_WIDGET(term)); } } static void term_app_request(VteTerminal *term, gpointer user_data) { int event = GPOINTER_TO_INT(user_data); if(event == TERM_ICONIFY_WINDOW) gdk_window_iconify(GTK_WIDGET(mainwindow)->window); if(event == TERM_DEICONIFY_WINDOW) gdk_window_deiconify(GTK_WIDGET(mainwindow)->window); if(event == TERM_RAISE_WINDOW) gdk_window_raise(GTK_WIDGET(mainwindow)->window); if(event == TERM_LOWER_WINDOW) gdk_window_lower(GTK_WIDGET(mainwindow)->window); if(event == TERM_MAXIMIZE_WINDOW) gdk_window_maximize(GTK_WIDGET(mainwindow)->window); if(event == TERM_RESTORE_WINDOW) gdk_window_unmaximize(GTK_WIDGET(mainwindow)->window); if(event == TERM_REFRESH_WINDOW) { GdkRectangle rect; rect.x = rect.y = 0; rect.width = mainwindow->allocation.width; rect.height = mainwindow->allocation.height; gdk_window_invalidate_rect(GTK_WIDGET(mainwindow)->window, &rect, TRUE); } } /*static void term_app_request_resize_move(VteTerminal *term, guint x, guint y, gpointer user_data) { // FIXME I can't get this function to call. It may be unused? int event = GPOINTER_TO_INT(user_data); if(event == TERM_RESIZE_WINDOW) { gint owidth, oheight, xpad, ypad; gtk_window_get_size(GTK_WINDOW(mainwindow), &owidth, &oheight); owidth -= term->char_width * term->column_count; oheight -= term->char_height * term->row_count; vte_terminal_get_padding(term, &xpad, &ypad);= owidth -= xpad; oheight -= ypad; gtk_window_resize(GTK_WINDOW(mainwindow), x+owidth, y+oheight); } if(event == TERM_MOVE_WINDOW) gdk_window_move(GTK_WIDGET(mainwindow)->window, x, y); }*/ static void term_fork_command(VteTerminal *term, char *cmd) { #if VTE_CHECK_VERSION(0,25,0) char **argv = NULL; g_shell_parse_argv(cmd, NULL, &argv, NULL); vte_terminal_fork_command_full(term, VTE_PTY_DEFAULT, NULL, argv, NULL, G_SPAWN_CHILD_INHERITS_STDIN|G_SPAWN_SEARCH_PATH|G_SPAWN_FILE_AND_ARGV_ZERO, NULL, NULL, NULL, NULL); #else vte_terminal_fork_command(term, cmd, NULL, NULL, "", TRUE, TRUE, TRUE); #endif } stjerm-0.16/src/.svn/text-base/config.c.svn-base0000444000175000017500000005541112002351334021374 0ustar kwilsonkwilson/* * config.c * This file is part of Stjerm * * Copyright (C) 2007-2010 - Kristopher Wilson, Stjepan Glavina and Markus Groß * * Stjerm is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Stjerm is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Stjerm; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include "stjerm.h" extern int sargc; extern char **sargv; extern GtkWidget *mainwindow; static char _font[200]; static float _opacity; static GdkColor _bg; static GdkColor _fg; static int _border; static unsigned int _mod; static KeySym _key; static int _width; static int _height; static int _width_percent; static int _height_percent; static int _pos; static int _posx; static int _posy; static int _fixedx; static int _fixedy; static int _scrollpos; static char _shell[200]; static char _emulation[200]; static int _lines; static int _showtab; static char _termname[200]; static GtkPositionType _tabpos; static GdkColor _palette[16]; static int read_colors; static gboolean _tabfill; static gboolean _allowbold; static GdkModifierType _keymod; static gboolean _autohide; static char _bgimage[200]; static gboolean _scrolloutput; static gboolean _allowreorder; static gboolean _cursor_blink; static VteTerminalCursorShape _cursor_shape; static GdkColor _cursor_color; static void set_border(char*); static void set_mod(char*); static void set_key(char*); static void set_pos(char *v); static GtkPositionType read_pos(char *v); static gboolean parse_hex_color(char *value, GdkColor *color); static gboolean parse_bool_str(char *value, gboolean def); static GdkModifierType parse_mod(char *value); static pid_t get_stjerm_pid(void); void conf_parse_size(char*, int*, int*); void read_value(char *name, char *value); void init_default_values(void); void conf_init(void); void conf_find_position(void); char* conf_get_font(void); float conf_get_opacity(void); GdkColor conf_get_bg(void); GdkColor conf_get_fg(void); int conf_get_border(void); unsigned int conf_get_mod(void); KeySym conf_get_key(void); int conf_get_width(void); int conf_get_height(void); void conf_get_position(int*, int*); int conf_get_scrollbar(void); char* conf_get_shell(void); char* conf_get_emulation(void); int conf_get_lines(void); int conf_get_show_tab(void); char* conf_get_term_name(void); GtkPositionType conf_get_tab_pos(void); GdkColor* conf_get_color_palette(void); gboolean conf_get_tab_fill(void); gboolean conf_get_allow_bold(void); GdkModifierType conf_get_key_mod(void); gboolean conf_get_auto_hide(void); char* conf_get_bg_image(void); gboolean conf_get_scroll_on_output(void); gboolean conf_get_allow_reorder(void); gboolean conf_get_cursor_blink(void); GdkColor conf_get_cursor_color(void); VteTerminalCursorShape conf_get_cursor_shape(void); Option options[OPTION_COUNT] = { {"key", "-k", "KEY", "Shortcut key (eg: f12)."}, {"mod", "-m", "MODIFIER", "meta modifier key: shift, control, alt, windows, none."}, {"keymod", "-km", "MODIFIER", "Modifier for keyboard shortcuts. Can be a combination (with +) of modifiers (eg: shift+control)."}, {"autohide", "-ah", "BOOLEAN", "Whether or not to hide stjerm when it looses focus. Default: true."}, {"font", "-fn", "FONT", "Terminal font and size (eg: Sans 10). Default: Bistream Vera Sans 10."}, {"background", "-bg", "COLOR", "Background color. Default: Black."}, {"foreground", "-fg", "COLOR", "Foreground color. Default: White."}, {"allowbold", "-ab", "BOOLEAN", "Allow bold fonts or not. Default: true."}, {"border", "-b", "TYPE", "Border type: thin, thick, none. Default: none."}, {"opacity", "-o", "NUMBER", "Opacity (range: 10 - 100). Default: 100."}, {"bgimage", "-bgimg", "FILE", "Background image to use on terminal."}, {"width", "-w", "NUMBER", "Window width, either as an integer or a percentage (eg, 50%). Default: 800."}, {"height", "-h", "NUMBER", "Window height, either as an integer or a percentage (eg, 50%).. Default: 400."}, {"position", "-p", "POSITION", "Window position: top, bottom, left, right. Default: top."}, {"scrollbar", "-s", "POSITION", "Scrollbar position: left, right, none. Default: none."}, {"shell", "-sh", "STRING", "Terminal Shell. Default: the user's default shell."}, {"emulation", "-e", "STRING", "Terminal Emulation. Default: xterm"}, {"lines", "-l", "NUMBER", "Scrollback lines. 0 to disable scrollback. Default: 1000."}, {"showtab", "-st", "VALUE", "Tabbar visibility (one: only visible when > 1 tabs): never, one, always."}, {"tabpos", "-tp", "POSITION", "Tabbar position: top, bottom, left, right. Default: bottom."}, {"tablabel", "-tl", "STRING", "Label of the tabs. Default: term."}, {"tabfill", "-tf", "BOOLEAN", "Whether tabs fill whole tabbar space. Default: true."}, {"scroll", "-sc", "BOOLEAN", "Whether to scroll the terminal on output. Default: true."}, {"fixedx", "-fx", "NUMBER", "Overrides any calculated horizontal position."}, {"fixedy", "-fy", "NUMBER", "Overrides any calculated vertical position."}, {"allowreorder", "-ar", "BOOLEAN", "Allow reordering of terminal tabs."}, {"colorX", "-cX", "COLOR", "Specify color X of the terminals color palette"}, {"cursorBlink", "-ub", "BOOLEAN", "Should the cursor blink? Default: true"}, {"cursorColor", "-uc", "COLOR", "The color of the cursor. Default: white"}, {"cursorShape", "-us", "STRING", "Cursor shape, one of [block,ibeam,underline]. Default: block"} }; pid_t get_stjerm_pid(void) { char buffer[100]; char **list; int i = 0; FILE *p = popen("pidof stjerm", "r"); if(p == NULL) { fprintf(stderr, "error: unable to get stjerm pid\n"); exit(1); } if(fgets(buffer, sizeof(buffer), p) == NULL) { fprintf(stderr, "error: unable to read stjerm pid\n"); exit(1); } pclose(p); list = g_strsplit_set(buffer, " ", -1); while (list[i] != NULL) i++; pid_t pid = (pid_t) atoi(list[i - 1]); g_strfreev(list); return pid; } void set_border(char *v) { if(!strcmp(v, "thin")) _border = BORDER_THIN; else if(!strcmp(v, "thick")) _border = BORDER_THICK; else _border = BORDER_NONE; } void set_mod(char *v) { v[0] = tolower(v[0]); if(!strcmp(v, "shift")) _mod = ShiftMask; else if(!strcmp(v, "control")) _mod = ControlMask; else if(!strcmp(v, "ctrl")) _mod = ControlMask; else if(!strcmp(v, "alt")) _mod = Mod1Mask; else if(!strcmp(v, "mod1")) _mod = Mod1Mask; else if(!strcmp(v, "windows")) _mod = Mod4Mask; else if(!strcmp(v, "win")) _mod = Mod4Mask; else _mod = ControlMask; } void set_key(char *v) { _key = 0; v[0] = tolower(v[0]); _key = XStringToKeysym(v); if(!_key) { v[0] = toupper(v[0]); _key = XStringToKeysym(v); } } void set_pos(char *v) { if(!strcmp(v, "top")) _pos = POS_TOP; else if(!strcmp(v, "bottom")) _pos = POS_BOTTOM; else if(!strcmp(v, "left")) _pos = POS_LEFT; else if(!strcmp(v, "right")) _pos = POS_RIGHT; else if(!strcmp(v, "topleft")) _pos = POS_TOPLEFT; else if(!strcmp(v, "topright")) _pos = POS_TOPRIGHT; else if(!strcmp(v, "bottomleft")) _pos = POS_BOTTOMLEFT; else if(!strcmp(v, "bottomright")) _pos = POS_BOTTOMRIGHT; } GtkPositionType read_pos(char *v) { if(!strcmp(v, "top")) return GTK_POS_TOP; else if(!strcmp(v, "left")) return GTK_POS_LEFT; else if(!strcmp(v, "right")) return GTK_POS_RIGHT; else return GTK_POS_BOTTOM; } gboolean parse_hex_color(char *value, GdkColor *color) { if(!gdk_color_parse(value, color)) { char *value2 = g_strconcat("#", value, NULL); gboolean res = gdk_color_parse(value2, color); free(value2); return res; } else return TRUE; } gboolean parse_bool_str(char *value, gboolean def) { gboolean res = def; g_strstrip(value); if(!strcasecmp("false", value) || !strcasecmp("0", value) || !strcasecmp("no", value)) res = FALSE; if(!strcasecmp("true", value) || !strcasecmp("1", value) || !strcasecmp("yes", value)) res = TRUE; return res; } GdkModifierType parse_mod(char *value) { g_strstrip(value); if(!strcasecmp("control", value) || !strcasecmp("ctrl", value)) return GDK_CONTROL_MASK; else if(!strcasecmp("alt", value)) return GDK_MOD1_MASK; else if(!strcasecmp("shift", value)) return GDK_SHIFT_MASK; else if(!strcasecmp("windows", value)) return GDK_SUPER_MASK; else return 0; } void init_default_values(void) { strcpy(_font, "Bitstream Vera Sans Mono 10"); gdk_color_parse("black", &_bg); gdk_color_parse("white", &_fg); _scrollpos = -1; _border = BORDER_NONE; _opacity = 100.0f; strcpy(_bgimage, ""); _width = 800; _height = 400; _width_percent = -1; _height_percent = -1; _pos = POS_TOP; _mod = 0; _key = 0; strcpy(_shell, getpwuid(getuid())->pw_shell); strcpy(_emulation, "xterm"); _lines = 1000; _showtab = TABS_ONE; _tabpos = GTK_POS_BOTTOM; strcpy(_termname, "term"); read_colors = 0; _tabfill = FALSE; _allowbold = TRUE; _keymod = GDK_CONTROL_MASK | GDK_SHIFT_MASK; _autohide = TRUE; _scrolloutput = TRUE; _fixedx = -1; _fixedy = -1; _allowreorder = TRUE; _cursor_blink = TRUE; gdk_color_parse("white", &_cursor_color); _cursor_shape = VTE_CURSOR_SHAPE_BLOCK; } void read_value(char *name, char *value) { if(name != NULL && value != NULL) { if (name[0] == '#') return; g_strstrip(name); g_strstrip(value); if(!strcmp("font", name) || !strcmp("-fn", name)) strcpy(_font, value); else if(!strcmp("background", name) || !strcmp("-bg", name)) { if(!parse_hex_color(value, &_bg)) gdk_color_parse("black", &_bg); } else if(!strcmp("foreground", name) || !strcmp("-fg", name)) { if(!parse_hex_color(value, &_fg)) gdk_color_parse("white", &_fg); } else if(!strcmp("scrollbar", name) || !strcmp("-s", name)) { if(!strcmp(value, "true")) _scrollpos = POS_RIGHT; else if(!strcmp(value, "left")) _scrollpos = POS_LEFT; else if(!strcmp(value, "right")) _scrollpos = POS_RIGHT; else _scrollpos = -1; } else if(!strcmp("border", name) || !strcmp("-b", name)) set_border(value); else if(!strcmp("opacity", name) || !strcmp("-o", name)) _opacity = atof(value); else if(!strcmp("bgimage", name) || !strcmp("-bgimg", name)) strcpy(_bgimage, value); else if(!strcmp("width", name) || !strcmp("-w", name)) conf_parse_size(value, &_width, &_width_percent); else if(!strcmp("height", name) || !strcmp("-h", name)) conf_parse_size(value, &_height, &_height_percent); else if(!strcmp("position", name) || !strcmp("-p", name)) set_pos(value); else if(!strcmp("fixedx", name) || !strcmp("-fx", name)) _fixedx = atoi(value); else if(!strcmp("fixedy", name) || !strcmp("-fy", name)) _fixedy = atoi(value); else if(!strcmp("mod", name) || !strcmp("-m", name)) set_mod(value); else if(!strcmp("key", name) || !strcmp("-k", name)) set_key(value); else if(!strcmp("shell", name) || !strcmp("-sh", name)) strcpy(_shell, value); else if(!strcmp("emulation", name) || !strcmp("-e", name)) strcpy(_emulation, value); else if(!strcmp("lines", name) || !strcmp("-bl", name)) _lines = atoi(value); else if(!strcmp("showtab", name) || !strcmp("-st", name)) { if(!strcasecmp(value, "always")) _showtab = TABS_ALWAYS; else if(!strcasecmp(value, "never")) _showtab = TABS_NEVER; } else if(!strcmp("tabpos", name) || !strcmp("-tp", name)) _tabpos = read_pos(value); else if(!strcmp("tablabel", name) || !strcmp("-tl", name)) strcpy(_termname, value); else if(g_str_has_prefix(name, "color") || g_str_has_prefix(name, "-c")) { g_strcanon(name, "0123456789", ' '); g_strchug(name); parse_hex_color(value, &_palette[atoi(name)]); read_colors++; } else if(!strcmp("tabfill", name) || !strcmp("-tf", name)) _tabfill = parse_bool_str(value, _tabfill); else if(!strcmp("allowbold", name) || !strcmp("-ab", name)) _allowbold = parse_bool_str(value, _allowbold); else if(!strcmp("keymod", name) || !strcmp("-km", name)) { char **list; GdkModifierType tmp = 0; int i = 0; list = g_strsplit_set(value, "+", -1); while(list[i] != NULL) tmp = tmp | parse_mod(list[i++]); g_strfreev(list); if(tmp != 0) _keymod = tmp; } else if(!strcmp("autohide", name) || !strcmp("-ah", name)) _autohide = parse_bool_str(value, _autohide); else if(!strcmp("scroll", name) || !strcmp("-sc", name)) _scrolloutput = parse_bool_str(value, _scrolloutput); else if(!strcmp("allowreorder", name) || !strcmp("-ar", name)) _allowreorder = parse_bool_str(value, _allowreorder); else if(!strcmp("cursorBlink", name) || !strcmp("-ub", name)) _cursor_blink = parse_bool_str(value, _cursor_blink); else if(!strcmp("cursorColor", name) || !strcmp("-uc", name)) { if(!parse_hex_color(value, &_cursor_color)) gdk_color_parse("white", &_cursor_color); } else if (!strcmp("cursorShape", name) || !strcmp("-us", name)) { if (!strcmp("block", name)) { _cursor_shape = VTE_CURSOR_SHAPE_BLOCK; } else if (!strcmp("ibeam", name)) { _cursor_shape = VTE_CURSOR_SHAPE_IBEAM; } else if (!strcmp("underline", name)) { _cursor_shape = VTE_CURSOR_SHAPE_UNDERLINE; } } } } void conf_parse_size(char *value, int *fixed, int *percentage) { if(strchr(value, '%') != NULL) { char tmp[(strlen(value) - 1) * sizeof(char)]; strncpy(tmp, value, (strlen(value) - 1) * sizeof(char)); tmp[strlen(value) - 1] = '\0'; *percentage = atoi(tmp); } else *fixed = atoi(value); } void conf_init(void) { gboolean keyoption = FALSE; Display *dpy; char basename[12] = "/.Xdefaults"; char *filename; char *op; int i; Option o; char color[8]; init_default_values(); dpy = gdk_x11_display_get_xdisplay(gdk_display_get_default()); XrmInitialize(); filename = strcat(getpwuid(getuid())->pw_dir, basename); XrmSetDatabase(dpy, XrmGetFileDatabase(filename)); for(i = 0; i < OPTION_COUNT - 1; i++) { o = options[i]; if((op = XGetDefault(dpy, "stjerm", o.long_name))) read_value(o.long_name, op); } for(i = 0; i < 16; i++) { sprintf(color, "color%d", i); if((op = XGetDefault(dpy, "stjerm", color))) read_value(color, op); } for(i = 1; i < sargc; i++) { if(sargv != NULL) { if(!strcmp(sargv[i], "--help")) { print_help(); exit(1); } else if(!strcmp(sargv[i], "--info")) { print_info(); exit(1); } else if(!strcmp(sargv[i], "--version")) { print_version(); exit(1); } else if(!strcmp("--toggle", sargv[i])) { kill(get_stjerm_pid(), SIGUSR1); exit(1); } } if(i + 1>= sargc) break; read_value(sargv[i], sargv[i + 1]); } if(keyoption == FALSE && _key == 0) { printf("hint: you started stjerm without specifying a shortcut key\n" " to show/hide stjerm run stjerm with the toggle option\n" " like this: stjerm --toggle"); } struct stat st; if(stat(_shell, &st) != 0) { fprintf(stderr, "error: the shell '%s' can't be opened\n", _shell); exit(1); } if(_lines < 0) { fprintf(stderr, "error: a scrollback line count < 0 is not allowed\n"); exit(1); } if(keyoption == TRUE && _key == 0) { fprintf(stderr, "error: wrong shortcut key is defined\n"); exit(1); } if(read_colors > 0 && read_colors < 16) { fprintf(stderr, "error: read only %d colors, not 16\n" "specify a complete color palette\n", read_colors); exit(1); } signal(SIGUSR1, (__sighandler_t) mainwindow_toggle); conf_find_position(); } void conf_find_position(void) { int scrw = gdk_screen_get_width(gdk_screen_get_default()); int scrh = gdk_screen_get_height(gdk_screen_get_default()); int offset_x = 0; int offset_y = 0; GdkDisplay *gdk_dpy = gdk_display_get_default(); Display *dpy = gdk_x11_display_get_xdisplay(gdk_dpy); /* Xinerama base event code and base error code */ int xr_event_basep, xr_error_basep; if(XineramaQueryExtension(dpy, &xr_event_basep, &xr_error_basep) && XineramaIsActive(dpy)) { /* Calculate offsets to add to get correct values on Xinerama screens */ XineramaScreenInfo *xsi; int screens; int cur_x; int cur_y; int i; /* Get data about Xinerama screens */ xsi = XineramaQueryScreens(dpy, &screens); /* Get cursor position */ gdk_display_get_pointer(gdk_dpy, NULL, &cur_x, &cur_y, NULL); /* "Default" case: if the cursor is in a blackout zone, do as if it were on the first screen */ scrw = xsi[0].width; scrh = xsi[0].height; offset_x = xsi[0].x_org; offset_y = xsi[0].y_org; /* Now the other cases, beginning from the 2nd screen */ for(i=1; i < screens; i++) { /* Coords of this screen */ int min_x = xsi[i].x_org; int max_x = min_x + xsi[i].width; int min_y = xsi[i].y_org; int max_y = min_y + xsi[i].height; /* Is the cursor on this screen? */ if((min_x <= cur_x) && (cur_x <= max_x) && (min_y <= cur_y) && (cur_y <= max_y)) { /* Set the offsets and dimensions */ scrw = xsi[i].width; scrh = xsi[i].height; offset_x = xsi[i].x_org; offset_y = xsi[i].y_org; break; } } /* Cleanup */ XFree(xsi); } /* Recalculate window width and height if needed */ if(_width_percent > 0) _width = (_width_percent * scrw)/100; if(_height_percent > 0) _height = (_height_percent * scrh)/100; if(_pos == POS_TOP) { _posx = (scrw - _width) / 2; _posy = 0; } else if(_pos == POS_BOTTOM) { _posx = (scrw - _width) / 2; _posy = scrh - _height; } else if(_pos == POS_LEFT) { _posx = 0; _posy = (scrh - _height) / 2; } else if(_pos == POS_RIGHT) { _posx = scrw - _width; _posy = (scrh - _height) / 2; } else if (_pos == POS_TOPLEFT) { _posx = 0; _posy = 0; } else if(_pos == POS_TOPRIGHT) { _posx = scrw - _width; _posy = 0; } else if(_pos == POS_BOTTOMLEFT) { _posx = 0; _posy = scrh - _height; } else if(_pos == POS_BOTTOMRIGHT) { _posx = scrw - _width; _posy = scrh - _height; } _posx += offset_x; _posy += offset_y; if(_fixedx > -1) _posx = _fixedx; if(_fixedy > -1) _posy = _fixedy; } char* conf_get_font(void) { return _font; } float conf_get_opacity(void) { return _opacity; } GdkColor conf_get_bg(void) { return _bg; } GdkColor conf_get_fg(void) { return _fg; } int conf_get_border(void) { return _border; } unsigned int conf_get_mod(void) { return _mod; } KeySym conf_get_key(void) { return _key; } int conf_get_width(void) { return _width; } int conf_get_height(void) { return _height; } void conf_get_position(int *x, int *y) { conf_find_position(); *x = _posx; *y = _posy; } int conf_get_scrollbar(void) { return _scrollpos; } char* conf_get_shell(void) { return _shell; } char* conf_get_emulation(void) { return _emulation; } int conf_get_lines(void) { return _lines; } int conf_get_show_tab(void) { return _showtab; } char* conf_get_term_name(void) { return _termname; } GtkPositionType conf_get_tab_pos(void) { return _tabpos; } GdkColor* conf_get_color_palette(void) { if(read_colors <= 0) return NULL; else return _palette; } gboolean conf_get_tab_fill(void) { return _tabfill; } gboolean conf_get_allow_bold(void) { return _allowbold; } GdkModifierType conf_get_key_mod(void) { return _keymod; } gboolean conf_get_auto_hide(void) { return _autohide; } char* conf_get_bg_image(void) { if(!strcmp(_bgimage, "")) return NULL; else return _bgimage; } gboolean conf_get_scroll_on_output(void) { return _scrolloutput; } gboolean conf_get_allow_reorder(void) { return _allowreorder; } gboolean conf_get_cursor_blink(void) { return _cursor_blink; } VteTerminalCursorShape conf_get_cursor_shape(void) { return _cursor_shape; } GdkColor conf_get_cursor_color(void) { return _cursor_color; } stjerm-0.16/src/.svn/text-base/Makefile.am.svn-base0000444000175000017500000000061012002351334022006 0ustar kwilsonkwilsonSTJERM_VERSION = 0.16 bin_PROGRAMS = stjerm stjerm_SOURCES = main.c mainwindow.c config.c term.c \ popupmenu.c shortcut.c INCLUDES= -Wall\ -DSTJERM_VERSION=\"$(STJERM_VERSION)\" LIBS = @glib_LIBS@ @LIBS@\ @gtk_LIBS@\ @gthread_LIBS@\ @vte_LIBS@ AM_CFLAGS = @CFLAGS@\ @glib_CFLAGS@\ @gtk_CFLAGS@\ @gthread_CFLAGS@\ @vte_CFLAGS@ stjerm-0.16/src/.svn/text-base/main.c.svn-base0000444000175000017500000000726212002351334021054 0ustar kwilsonkwilson/* * main.c * This file is part of Stjerm * * Copyright (C) 2007-2010 - Kristopher Wilson, Stjepan Glavina and Markus Groß * * Stjerm is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Stjerm is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Stjerm; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA */ #include #include "stjerm.h" int sargc; char **sargv; extern Option options[OPTION_COUNT]; void print_help(void); void print_info(void); void print_version(void); void print_help(void) { int i = 0; Option o; printf("stjerm version %s\n" "Usage: %s [action] [options]\n\n" "Actions are:\n" " --help\tDisplay this menu\n" " --info\tDisplay .Xdefault options\n" " --version\tDisplay the current application version\n" " --toggle\tShow/Hide the current stjerm instance\n" "(When using an action command, the options are ignored)\n\n" "Options are:\n", STJERM_VERSION, sargv[0]); for(i = 0; i < OPTION_COUNT; i++) { o = options[i]; printf(" %s %s\t%s\n", o.short_name, o.var_type, o.desc); } printf("\t\tYou may specify no palette, or a complete one with 16 total colors\n" "\t\tFor this you have to use -c0, -c1, ..., -c15.\n\n"); printf("Note: any colors in hex codes are entered without the leading '#'.\n\n" "Examples: %s -fn \"Bitstream Vera Sans Mono 12\" -bg white -k F12 -sh /bin/bash\n" " %s -bg black -fg green -w 800 -h 405 -s right -m alt -k f -l 10000\n" " %s -b thick -w 500 -p left -t best -o 90 -m shift -k tab -sh /bin/zsh\n\n" "Use --info to get a list of available .Xdefaults options for stjerm.\n", sargv[0], sargv[0], sargv[0]); } void print_info(void) { int i = 0; Option o; printf("stjerm version %s\n" "Usage: %s [action] [options]\n\n" "Actions are:\n" " --help\tDisplay command line options menu\n" " --info\tDisplay .Xdefault options\n" " --version\tDisplay current application version\n" " --toggle\tShow/Hide the current stjerm instance\n" "(When using an action command, the .Xdefaults options are ignored)\n\n" "The .Xdefault options are read from ~/.Xdefaults.\n" "To specify an option in .Xdefaults use this syntax:\n" "stjerm.OPTION: VALUE\n" "Example: stjerm.key: f12\n\n" "Available .Xdefaults options:\n", STJERM_VERSION, sargv[0]); for(i = 0; i < OPTION_COUNT; i++) { o = options[i]; printf(" %s: \t%s \t%s\n", o.long_name, o.var_type, o.desc); } printf("\t\t\t\tYou may specify no palette, or a complete one with 16 total colors.\n" "\t\t\t\tFor this you have to use color0, color1, ..., color15.\n"); } void print_version(void) { printf("stjerm %s\n", STJERM_VERSION); } int main(int argc, char *argv[]) { sargc = argc; sargv = argv; if (!g_thread_supported()) g_thread_init(NULL); gdk_threads_init(); gtk_init(&argc, &argv); conf_init(); build_mainwindow(); gdk_threads_enter(); gtk_main(); gdk_threads_leave(); return 0; } stjerm-0.16/src/.svn/text-base/mainwindow.c.svn-base0000444000175000017500000004734512002351334022312 0ustar kwilsonkwilson/* * mainwindow.c * This file is part of Stjerm * * Copyright (C) 2007-2010 - Kristopher Wilson, Stjepan Glavina and Markus Groß * * Stjerm is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Stjerm is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Stjerm; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include "stjerm.h" extern GtkWidget *popupmenu; extern GtkWidget *close_tab; extern gboolean popupmenu_shown; GtkWidget *mainwindow; int activetab; int tabcount; GArray* tabs; GtkNotebook* tabbar; Window mw_xwin; static Display *dpy = 0; Atom opacityatom; gboolean screen_is_composited; gboolean fullscreen; gboolean toggled; void build_mainwindow(void); void mainwindow_toggle(int sig); void mainwindow_create_tab(void); void mainwindow_close_tab(GtkWidget *term); void mainwindow_toggle_fullscreen(void); int handle_x_error(Display *dpy, XErrorEvent *evt); static GRegex **uri_regex; static guint uri_regex_count; static void mainwindow_reset_position(void); static void mainwindow_focus_terminal(void); static void mainwindow_show(GtkWidget*, gpointer); static void mainwindow_focus_out_event(GtkWindow*, GdkEventFocus*, gpointer); static gboolean mainwindow_expose_event(GtkWidget*, GdkEventExpose*, gpointer); static void mainwindow_destroy(GtkWidget*, gpointer); static void mainwindow_window_title_changed(VteTerminal *vteterminal, gpointer user_data); static void mainwindow_switch_tab(GtkNotebook *notebook, GtkNotebookPage *page, guint page_num, gpointer user_data); static void mainwindow_goto_tab(gint i); static void mainwindow_next_tab(GtkWidget *widget, gpointer user_data); static void mainwindow_prev_tab(GtkWidget *widget, gpointer user_data); static void mainwindow_new_tab(GtkWidget *widget, gpointer user_data); static void mainwindow_delete_tab(GtkWidget *widget, gpointer user_data); static gint mainwindow_copy(GtkWidget *widget, gpointer user_data); static gint mainwindow_paste(GtkWidget *widget, gpointer user_data); static gint mainwindow_tab_at_xy(GtkNotebook *notebook, gint abs_x, gint abs_y); static void mainwindow_notebook_clicked(GtkWidget *widget, GdkEventButton *event, gpointer func_data); static void mainwindow_tab_moved(GtkWidget *notebook, GtkWidget *page, guint page_num, gpointer user_data); void build_mainwindow(void) { guint ic; uri_regex_count = G_N_ELEMENTS(uri_patterns); uri_regex = g_new0(GRegex*, uri_regex_count); for(ic = 0; ic < uri_regex_count; ++ic) { GError *error = NULL; uri_regex[ic] = g_regex_new(uri_patterns[ic].pattern, uri_patterns[ic].flags | G_REGEX_OPTIMIZE, 0, &error); if(error) { g_message("%s", error->message); g_error_free (error); } } mainwindow = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_widget_set_app_paintable(mainwindow, TRUE); gtk_widget_set_size_request(mainwindow, conf_get_width(), conf_get_height()); gtk_window_set_decorated(GTK_WINDOW(mainwindow), FALSE); gtk_window_set_skip_taskbar_hint(GTK_WINDOW(mainwindow), TRUE); gtk_window_set_skip_pager_hint(GTK_WINDOW(mainwindow), TRUE); gtk_window_set_resizable(GTK_WINDOW(mainwindow), TRUE); mainwindow_reset_position(); fullscreen = FALSE; toggled = FALSE; GtkAccelGroup* accel_group; GClosure *new_tab, *delete_tab, *next_tab, *prev_tab, *delete_all, *maximize, *copy, *paste; GClosure *goto_tab_closure[10]; long i; accel_group = gtk_accel_group_new(); gtk_window_add_accel_group(GTK_WINDOW(mainwindow), accel_group); maximize = g_cclosure_new_swap(G_CALLBACK(mainwindow_toggle_fullscreen), NULL, NULL); gtk_accel_group_connect(accel_group, GDK_F11, 0, GTK_ACCEL_VISIBLE, maximize); new_tab = g_cclosure_new_swap(G_CALLBACK(mainwindow_new_tab), NULL, NULL); gtk_accel_group_connect(accel_group, 't', conf_get_key_mod(), GTK_ACCEL_VISIBLE, new_tab); delete_tab = g_cclosure_new_swap(G_CALLBACK(mainwindow_delete_tab), NULL, NULL); gtk_accel_group_connect(accel_group, 'w', conf_get_key_mod(), GTK_ACCEL_VISIBLE, delete_tab); next_tab = g_cclosure_new_swap(G_CALLBACK(mainwindow_next_tab), NULL, NULL); gtk_accel_group_connect(accel_group, GDK_Page_Up, conf_get_key_mod(), GTK_ACCEL_VISIBLE, next_tab); prev_tab = g_cclosure_new_swap(G_CALLBACK(mainwindow_prev_tab), NULL, NULL); gtk_accel_group_connect(accel_group, GDK_Page_Down, conf_get_key_mod(), GTK_ACCEL_VISIBLE, prev_tab); delete_all = g_cclosure_new_swap(G_CALLBACK(mainwindow_destroy), NULL, NULL); gtk_accel_group_connect(accel_group, 'q', conf_get_key_mod(), GTK_ACCEL_VISIBLE, delete_all); /* tab hotkeys, inspired by Tilda -- thanks to castorinop for the patch */ for(i = 0; i < 10; i++) { goto_tab_closure[i] = g_cclosure_new_swap(G_CALLBACK(mainwindow_goto_tab), (gpointer) i, NULL); gtk_accel_group_connect(accel_group, '0' + ((i+1)%10), GDK_MOD1_MASK, GTK_ACCEL_VISIBLE, goto_tab_closure[i]); } copy = g_cclosure_new_swap(G_CALLBACK(mainwindow_copy), NULL, NULL); gtk_accel_group_connect(accel_group, 'c', conf_get_key_mod(), GTK_ACCEL_VISIBLE, copy); paste = g_cclosure_new_swap(G_CALLBACK(mainwindow_paste), NULL, NULL); gtk_accel_group_connect(accel_group, 'v', conf_get_key_mod(), GTK_ACCEL_VISIBLE, paste); activetab = -1; tabs = g_array_new(TRUE, FALSE, sizeof(VteTerminal*)); tabcount = 0; GtkVBox* mainbox = GTK_VBOX(gtk_vbox_new(FALSE, 0)); tabbar = GTK_NOTEBOOK(gtk_notebook_new()); g_signal_connect(G_OBJECT(tabbar), "switch-page", G_CALLBACK(mainwindow_switch_tab), NULL); g_signal_connect(G_OBJECT(tabbar), "page-reordered", G_CALLBACK(mainwindow_tab_moved), NULL); if(conf_get_opacity() < 100) { GdkScreen *screen = gdk_screen_get_default(); GdkColormap *colormap = gdk_screen_get_rgba_colormap(screen); screen_is_composited = (colormap != NULL && gdk_screen_is_composited(screen)); if(screen_is_composited) { gtk_widget_set_colormap(GTK_WIDGET(mainwindow), colormap); gdk_screen_set_default_colormap(screen, colormap); } } gtk_box_pack_start(GTK_BOX(mainbox), GTK_WIDGET(tabbar), TRUE, TRUE, 0); mainwindow_create_tab(); gtk_widget_show_all(GTK_WIDGET(mainbox)); gtk_container_add(GTK_CONTAINER(mainwindow), GTK_WIDGET(mainbox)); int border = conf_get_border(); if(border == BORDER_THIN) gtk_container_set_border_width(GTK_CONTAINER(mainwindow), 1); else if(border == BORDER_THICK) gtk_container_set_border_width(GTK_CONTAINER(mainwindow), 5); if(border != BORDER_NONE) g_signal_connect(G_OBJECT(mainwindow), "expose-event", G_CALLBACK(mainwindow_expose_event), NULL); if(conf_get_auto_hide()) g_signal_connect(G_OBJECT(mainwindow), "focus-out-event", G_CALLBACK(mainwindow_focus_out_event), NULL); g_signal_connect(G_OBJECT(mainwindow), "show", G_CALLBACK(mainwindow_show), NULL); g_signal_connect(G_OBJECT(mainwindow), "destroy", G_CALLBACK(mainwindow_destroy), NULL); g_signal_connect_after(G_OBJECT(tabbar), "button_press_event", G_CALLBACK(mainwindow_notebook_clicked), NULL); gtk_notebook_set_show_border(tabbar, FALSE); gtk_notebook_set_scrollable(tabbar, TRUE); if (conf_get_show_tab() == TABS_ONE|| conf_get_show_tab() == TABS_NEVER) gtk_notebook_set_show_tabs(tabbar, FALSE); gtk_notebook_set_tab_pos(tabbar, conf_get_tab_pos()); gtk_notebook_set_homogeneous_tabs(tabbar, FALSE); XSetErrorHandler(handle_x_error); init_key(); grab_key(); g_thread_create((GThreadFunc)wait_key, NULL, FALSE, NULL); } void mainwindow_notebook_clicked(GtkWidget *widget, GdkEventButton *event, gpointer func_data) { gint tabclicked = mainwindow_tab_at_xy(GTK_NOTEBOOK(widget), event->x, event->y); if(tabclicked > -1) gtk_notebook_set_current_page(GTK_NOTEBOOK(widget), tabclicked); else if(event->type == GDK_2BUTTON_PRESS) mainwindow_create_tab(); if(event->button == 3) { popupmenu_shown = TRUE; gtk_menu_popup(GTK_MENU(popupmenu), NULL, NULL, NULL, NULL, event->button, event->time); } } /* This code adapted from gnome-terminal */ static gint mainwindow_tab_at_xy(GtkNotebook *notebook, gint x, gint y) { GtkPositionType tab_pos; int page_num = 0; GtkWidget *page; tab_pos = gtk_notebook_get_tab_pos(notebook); if(notebook->first_tab == NULL) return -1; while((page = gtk_notebook_get_nth_page(notebook, page_num))) { GtkWidget *screen; gint max_x, max_y; screen = gtk_notebook_get_tab_label(notebook, page); g_return_val_if_fail(screen != NULL, -1); if(!GTK_WIDGET_MAPPED(GTK_WIDGET(screen))) { page_num++; continue; } max_x = screen->allocation.x + screen->allocation.width; max_y = screen->allocation.y + screen->allocation.height; if(((tab_pos == GTK_POS_TOP) || (tab_pos == GTK_POS_BOTTOM)) && (x <= max_x)) return page_num; else if(((tab_pos == GTK_POS_LEFT) || (tab_pos == GTK_POS_RIGHT)) && (y <= max_y)) return page_num; page_num++; } return -1; } void mainwindow_create_tab(void) { GtkWidget* tmp_term = build_term(); GtkVScrollbar *sbar= NULL; GtkHBox *tmp_box = GTK_HBOX(gtk_hbox_new(FALSE, 0)); if(conf_get_scrollbar() == -1) gtk_box_pack_start(GTK_BOX(tmp_box), tmp_term, TRUE, TRUE, 0); else if(conf_get_scrollbar() == POS_LEFT) { sbar = GTK_VSCROLLBAR(gtk_vscrollbar_new(vte_terminal_get_adjustment( VTE_TERMINAL(tmp_term)))); gtk_box_pack_start(GTK_BOX(tmp_box), GTK_WIDGET(sbar), FALSE, FALSE, 0); gtk_box_pack_end(GTK_BOX(tmp_box), GTK_WIDGET(tmp_term), TRUE, TRUE, 0); } else // (conf_get_scrollbar() == POS_RIGHT) { sbar = GTK_VSCROLLBAR(gtk_vscrollbar_new(vte_terminal_get_adjustment( VTE_TERMINAL(tmp_term)))); gtk_box_pack_start(GTK_BOX(tmp_box), GTK_WIDGET(tmp_term), TRUE, TRUE, 0); gtk_box_pack_end(GTK_BOX(tmp_box), GTK_WIDGET(sbar), FALSE, FALSE, 0); } char buffer [100]; sprintf(buffer, "%s %d", conf_get_term_name(), activetab + 1); GtkLabel* tmp_label = GTK_LABEL(gtk_label_new(buffer)); if(conf_get_opacity() < 100) { if(screen_is_composited) { vte_terminal_set_background_transparent(VTE_TERMINAL(tmp_term), FALSE); vte_terminal_set_opacity(VTE_TERMINAL(tmp_term), conf_get_opacity()/100 * 0xffff); } else { vte_terminal_set_background_saturation(VTE_TERMINAL(tmp_term), 1.0 - conf_get_opacity()/100); if(conf_get_bg_image() == NULL) vte_terminal_set_background_transparent(VTE_TERMINAL(tmp_term), TRUE); } } if(conf_get_opacity() < 100 && screen_is_composited) { vte_terminal_set_background_transparent(VTE_TERMINAL(tmp_term), FALSE); vte_terminal_set_opacity(VTE_TERMINAL(tmp_term), conf_get_opacity()/100 * 0xffff); } g_signal_connect(G_OBJECT(tmp_term), "window-title-changed", G_CALLBACK(mainwindow_window_title_changed), tmp_label); g_array_append_val(tabs, tmp_term); tabcount++; gtk_widget_show_all(GTK_WIDGET(tmp_box)); gtk_notebook_append_page(tabbar, GTK_WIDGET(tmp_box), GTK_WIDGET(tmp_label)); if(conf_get_tab_fill()) gtk_container_child_set(GTK_CONTAINER(tabbar), GTK_WIDGET(tmp_box), "tab-expand", TRUE, "tab-fill", TRUE, NULL); if(conf_get_show_tab() == TABS_ONE&& tabcount > 1) gtk_notebook_set_show_tabs(tabbar, TRUE); activetab = tabcount - 1; gtk_notebook_set_current_page(tabbar, activetab); if(conf_get_allow_reorder()) gtk_notebook_set_tab_reorderable(tabbar, GTK_WIDGET(tmp_box), TRUE); guint i; for(i = 0; i < uri_regex_count; ++i) { int tag = vte_terminal_match_add_gregex(VTE_TERMINAL(tmp_term), uri_regex[i], 0); vte_terminal_match_set_cursor_type(VTE_TERMINAL(tmp_term), tag, GDK_HAND2); } if(tabcount > 1) gtk_widget_set_sensitive(close_tab, TRUE); } void mainwindow_close_tab(GtkWidget *term) { // Look for the right tab... int thetab = activetab; if(term != NULL) { int i; for(i = 0; i < tabs->len; i++) { if(g_array_index(tabs, GtkWidget *, i) == term) { thetab = i; break; } } } g_array_remove_index(tabs, thetab); tabcount--; gtk_notebook_remove_page(tabbar, thetab); activetab = gtk_notebook_get_current_page(tabbar); if(tabcount == 1 && conf_get_show_tab() == TABS_ONE) gtk_notebook_set_show_tabs(tabbar, FALSE); if (tabcount == 0) mainwindow_create_tab(); if(tabcount == 1) gtk_widget_set_sensitive(GTK_WIDGET(close_tab), FALSE); } void mainwindow_toggle(int sig) { if((!sig && GTK_WIDGET_VISIBLE(mainwindow)) || (sig && toggled)) { gdk_threads_enter(); gtk_widget_hide(GTK_WIDGET(mainwindow)); gdk_flush(); gdk_threads_leave(); toggled = FALSE; return; } toggled = TRUE; gdk_threads_enter(); /* reset the window position before displaying it to avoid flickering if the windos is moved */ mainwindow_reset_position(); if(gtk_window_is_active(GTK_WINDOW(mainwindow)) == FALSE) gtk_window_present(GTK_WINDOW(mainwindow)); else gtk_widget_show(mainwindow); gtk_window_stick(GTK_WINDOW(mainwindow)); gtk_window_set_keep_above(GTK_WINDOW(mainwindow), TRUE); gdk_window_focus(mainwindow->window, gtk_get_current_event_time()); gdk_flush(); gdk_threads_leave(); } void mainwindow_toggle_fullscreen(void) { if(fullscreen) { gtk_window_unfullscreen(GTK_WINDOW(mainwindow)); mainwindow_reset_position(); } else gtk_window_fullscreen(GTK_WINDOW(mainwindow)); fullscreen = !fullscreen; mainwindow_focus_terminal(); } static void mainwindow_reset_position(void) { int x, y; conf_get_position(&x, &y); gtk_window_move(GTK_WINDOW(mainwindow), x, y); gtk_window_resize(GTK_WINDOW(mainwindow), conf_get_width(), conf_get_height()); } static void mainwindow_show(GtkWidget *widget, gpointer userdata) { if(dpy != NULL) return; mw_xwin = GDK_WINDOW_XWINDOW(GTK_WIDGET(mainwindow)->window); dpy = GDK_DISPLAY_XDISPLAY(gdk_display_get_default()); } static void mainwindow_focus_out_event(GtkWindow* window, GdkEventFocus* event, gpointer userdata) { int revert; Window w; XGetInputFocus(dpy, &w, &revert); if (w == mw_xwin) return; // focus wasn't lost just by pressing the shortcut key if(popupmenu_shown == TRUE) return; // focus wasn't lost by popping up popupmenu gtk_widget_hide(GTK_WIDGET(mainwindow)); } static gboolean mainwindow_expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer user_data) { gint winw, winh; gtk_window_get_size(GTK_WINDOW(widget), &winw, &winh); gdk_draw_rectangle(widget->window, widget->style->black_gc, FALSE, 0, 0, winw-1, winh-1); if(conf_get_border() == BORDER_THIN) return FALSE; gdk_draw_rectangle(widget->window, widget->style->bg_gc[GTK_STATE_SELECTED], TRUE, 1, 1, winw -2, winh -2); gdk_draw_rectangle(widget->window, widget->style->bg_gc[GTK_STATE_NORMAL], TRUE, 5, 5, winw-10, winh-10); return FALSE; } static void mainwindow_destroy(GtkWidget *widget, gpointer user_data) { g_array_free(tabs, TRUE); gtk_main_quit(); } static void mainwindow_window_title_changed(VteTerminal *vteterminal, gpointer user_data) { if(vteterminal != NULL && user_data != NULL) gtk_label_set_label(GTK_LABEL(user_data), vte_terminal_get_window_title(vteterminal)); } static void mainwindow_switch_tab(GtkNotebook *notebook, GtkNotebookPage *page, guint page_num, gpointer user_data) { activetab = page_num; } static void mainwindow_goto_tab(gint i) { gtk_notebook_set_current_page(tabbar, i); activetab = gtk_notebook_get_current_page(tabbar); mainwindow_focus_terminal(); } static void mainwindow_next_tab(GtkWidget *widget, gpointer user_data) { if(gtk_notebook_get_current_page(tabbar) == (tabcount - 1)) gtk_notebook_set_current_page(tabbar, 0); else gtk_notebook_next_page(tabbar); activetab = gtk_notebook_get_current_page(tabbar); mainwindow_focus_terminal(); } static void mainwindow_prev_tab(GtkWidget *widget, gpointer user_data) { if(gtk_notebook_get_current_page(tabbar) == (0)) gtk_notebook_set_current_page(tabbar, (tabcount - 1)); else gtk_notebook_prev_page(tabbar); activetab = gtk_notebook_get_current_page(tabbar); mainwindow_focus_terminal(); } static void mainwindow_new_tab(GtkWidget *widget, gpointer user_data) { mainwindow_create_tab(); mainwindow_focus_terminal(); } static void mainwindow_delete_tab(GtkWidget *widget, gpointer user_data) { mainwindow_close_tab(NULL); if(tabcount > 0) mainwindow_focus_terminal(); } int handle_x_error(Display *dpy, XErrorEvent *evt) { if(evt->error_code == BadAccess|| evt->error_code == BadValue || evt->error_code == BadWindow) { fprintf(stderr, "error: unable to grab key, is stjerm is already running with the same key?\n"); exit(1); } return 0; } static void mainwindow_tab_moved(GtkWidget *notebook, GtkWidget *page, guint page_num, gpointer user_data) { GList *children = gtk_container_get_children(GTK_CONTAINER(page)); GtkWidget *term = GTK_WIDGET(children->data); GArray *newtabs = g_array_new(TRUE, FALSE, sizeof(VteTerminal*)); int i; for(i = 0; i < tabcount; i++) { GtkWidget *element = g_array_index(tabs, GtkWidget *, i); if(i == page_num) { g_array_append_val(newtabs, term); g_array_append_val(newtabs, element); } else if(element == term) continue; else g_array_append_val(newtabs, element); } g_array_free(tabs, TRUE); tabs = newtabs; activetab = page_num; } static void mainwindow_focus_terminal(void) { if (activetab >= 0) gtk_window_set_focus(GTK_WINDOW(mainwindow), GTK_WIDGET(g_array_index(tabs, VteTerminal*, activetab))); } static gint mainwindow_copy(GtkWidget *widget, gpointer user_data) { vte_terminal_copy_clipboard (g_array_index(tabs, VteTerminal*, activetab)); return TRUE; } static gint mainwindow_paste(GtkWidget *widget, gpointer user_data) { vte_terminal_paste_clipboard (g_array_index(tabs, VteTerminal*, activetab)); return TRUE; } static void mainwindow_set_terminal_opacity(int value) { } stjerm-0.16/src/.svn/text-base/stjerm.h.svn-base0000444000175000017500000001142212002351334021432 0ustar kwilsonkwilson/* * stjerm.h * This file is part of Stjerm * * Copyright (C) 2007-2010 - Kristopher Wilson, Stjepan Glavina and Markus Groß * * Stjerm is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Stjerm is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Stjerm; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA */ #ifndef __STJERM_H__ #define __STJERM_H__ #include #include #include #define TERM_ICONIFY_WINDOW 0 #define TERM_DEICONIFY_WINDOW 1 #define TERM_RAISE_WINDOW 2 #define TERM_LOWER_WINDOW 3 #define TERM_MAXIMIZE_WINDOW 4 #define TERM_RESTORE_WINDOW 5 #define TERM_REFRESH_WINDOW 6 #define TERM_RESIZE_WINDOW 7 #define TERM_MOVE_WINDOW 8 #define BORDER_THIN 0 #define BORDER_THICK 1 #define BORDER_NONE 2 #define POS_TOP 0 #define POS_BOTTOM 1 #define POS_LEFT 2 #define POS_RIGHT 3 #define POS_TOPLEFT 4 #define POS_TOPRIGHT 5 #define POS_BOTTOMLEFT 6 #define POS_BOTTOMRIGHT 7 #define TABS_NEVER 0 #define TABS_ONE 1 #define TABS_ALWAYS 2 #define OPTION_COUNT 30 // The following defines borrowed from gnome-terminal: #define USERCHARS "-[:alnum:]" #define USERCHARS_CLASS "[" USERCHARS "]" #define PASSCHARS_CLASS "[-[:alnum:]\\Q,?;.:/!%$^*&~\"#'\\E]" #define HOSTCHARS_CLASS "[-[:alnum:]]" #define HOST HOSTCHARS_CLASS "+(\\." HOSTCHARS_CLASS "+)*" #define PORT "(?:\\:[[:digit:]]{1,5})?" #define PATHCHARS_CLASS "[-[:alnum:]\\Q_$.+!*,;@&=?/~#%\\E]" #define PATHTERM_CLASS "[^\\Q]'.}>) \t\r\n,\"\\E]" #define SCHEME "(?:news:|telnet:|nntp:|file:\\/|https?:|ftps?:|sftp:|webcal:)" #define USERPASS USERCHARS_CLASS "+(?:" PASSCHARS_CLASS "+)?" #define URLPATH "(?:(/"PATHCHARS_CLASS"+(?:[(]"PATHCHARS_CLASS"*[)])*"PATHCHARS_CLASS"*)*"PATHTERM_CLASS")?" typedef struct { char long_name[18]; char short_name[12]; char var_type[12]; char desc[150]; } Option; typedef enum { URL_TYPE_HTTP, URL_TYPE_EMAIL, URL_TYPE_NEWS } UrlTypes; typedef struct { const char *pattern; UrlTypes url_type; GRegexCompileFlags flags; } RegExPattern; typedef struct { int tag; char *text; } CursorMatch; // The following patterns borrowed from gnome-terminal: static const RegExPattern uri_patterns[] = { {"news:[[:alnum:]\\Q^_{|}~!\"#$%&'()*+,./;:=?`\\E]+", URL_TYPE_NEWS, G_REGEX_CASELESS }, {SCHEME "//(?:" USERPASS "\\@)?" HOST PORT URLPATH, URL_TYPE_HTTP, G_REGEX_CASELESS}, {"(?:www|ftp)" HOSTCHARS_CLASS "*\\." HOST PORT URLPATH , URL_TYPE_HTTP, G_REGEX_CASELESS}, {"(?:mailto:)?" USERCHARS_CLASS "[" USERCHARS ".]*\\@" HOSTCHARS_CLASS "+\\." HOST, URL_TYPE_EMAIL, G_REGEX_CASELESS}, }; extern void print_help(void); extern void print_info(void); extern void print_version(void); extern void build_mainwindow(void); extern GtkWidget* build_term(void); extern void build_popupmenu(void); extern void mainwindow_toggle(int sig); extern void mainwindow_create_tab(void); extern void mainwindow_close_tab(GtkWidget *); extern void mainwindow_toggle_fullscreen(void); extern void init_key(void); extern void grab_key(void); extern void wait_key(void); extern void buildprefswindow(void); extern void conf_init(void); extern char* conf_get_font(void); extern float conf_get_opacity(void); extern GdkColor conf_get_bg(void); extern GdkColor conf_get_fg(void); extern int conf_get_border(void); extern unsigned int conf_get_mod(void); extern KeySym conf_get_key(void); extern int conf_get_width(void); extern int conf_get_height(void); extern void conf_get_position(int*, int*); extern int conf_get_scrollbar(void); extern char* conf_get_shell(void); extern char* conf_get_emulation(void); extern int conf_get_lines(void); extern int conf_get_show_tab(void); extern char* conf_get_term_name(void); extern GtkPositionType conf_get_tab_pos(void); extern GdkColor* conf_get_color_palette(void); extern gboolean conf_get_tab_fill(void); extern gboolean conf_get_allow_bold(void); extern GdkModifierType conf_get_key_mod(void); extern gboolean conf_get_auto_hide(void); extern char* conf_get_bg_image(void); extern gboolean conf_get_allow_reorder(void); extern gboolean conf_get_scroll_on_output(); extern gboolean conf_get_cursor_blink(void); extern GdkColor conf_get_cursor_color(void); extern VteTerminalCursorShape conf_get_cursor_shape(void); #endif /* __STJERM_H__ */ stjerm-0.16/src/.svn/dir-prop-base0000444000175000017500000000007412002351334016734 0ustar kwilsonkwilsonK 10 svn:ignore V 34 .deps Makefile.in Makefile stjerm END stjerm-0.16/src/.svn/all-wcprops0000444000175000017500000000140412002351334016531 0ustar kwilsonkwilsonK 25 svn:wc:ra_dav:version-url V 27 /svn/!svn/ver/311/trunk/src END main.c K 25 svn:wc:ra_dav:version-url V 34 /svn/!svn/ver/267/trunk/src/main.c END config.c K 25 svn:wc:ra_dav:version-url V 36 /svn/!svn/ver/311/trunk/src/config.c END term.c K 25 svn:wc:ra_dav:version-url V 34 /svn/!svn/ver/311/trunk/src/term.c END popupmenu.c K 25 svn:wc:ra_dav:version-url V 39 /svn/!svn/ver/311/trunk/src/popupmenu.c END Makefile.am K 25 svn:wc:ra_dav:version-url V 39 /svn/!svn/ver/311/trunk/src/Makefile.am END stjerm.h K 25 svn:wc:ra_dav:version-url V 36 /svn/!svn/ver/311/trunk/src/stjerm.h END shortcut.c K 25 svn:wc:ra_dav:version-url V 38 /svn/!svn/ver/267/trunk/src/shortcut.c END mainwindow.c K 25 svn:wc:ra_dav:version-url V 40 /svn/!svn/ver/311/trunk/src/mainwindow.c END stjerm-0.16/src/.svn/tmp/0000775000175000017500000000000012002351334015150 5ustar kwilsonkwilsonstjerm-0.16/src/.svn/tmp/text-base/0000775000175000017500000000000012002351334017044 5ustar kwilsonkwilsonstjerm-0.16/src/.svn/tmp/props/0000775000175000017500000000000012002351334016313 5ustar kwilsonkwilsonstjerm-0.16/src/.svn/tmp/prop-base/0000775000175000017500000000000012002351334017040 5ustar kwilsonkwilsonstjerm-0.16/src/.svn/props/0000775000175000017500000000000012002351334015513 5ustar kwilsonkwilsonstjerm-0.16/src/.svn/entries0000444000175000017500000000270712002351334015746 0ustar kwilsonkwilson10 dir 311 https://stjerm-terminal.googlecode.com/svn/trunk/src https://stjerm-terminal.googlecode.com/svn 2012-07-20T21:49:01.022135Z 311 kristopherwilson has-props 2d50db9f-3d56-0410-a9df-075c8fe9c84e stjerm.h file 2012-07-20T21:51:24.333722Z f5a5042e1535c096ad2651b2dde1a3af 2012-07-20T21:49:01.022135Z 311 kristopherwilson 4882 shortcut.c file 2012-07-20T21:51:24.333722Z f8c414bff80f25fc7405038dafae5745 2010-08-24T17:07:50.929757Z 267 kristopherwilson 2641 mainwindow.c file 2012-07-20T21:51:24.337724Z 4f6e1ea2136b5cb5e469d5ce558022df 2012-07-20T21:49:01.022135Z 311 kristopherwilson 20197 main.c file 2012-07-20T21:51:24.333722Z 8e10e86e5f9ddf4d8385d508b692b341 2010-08-24T17:07:50.929757Z 267 kristopherwilson 3762 config.c file 2012-07-20T21:51:24.333722Z 9b3f63bf5ea52c9c3988cc10fc600f66 2012-07-20T21:49:01.022135Z 311 kristopherwilson 23305 term.c file 2012-07-20T21:51:24.333722Z 892ac28b8c2fa07cf82fdb1670e23f50 2012-07-20T21:49:01.022135Z 311 kristopherwilson 8775 popupmenu.c file 2012-07-20T21:51:24.333722Z df8cf4b35b418cd8c6e8324b5e1c637f 2012-07-20T21:49:01.022135Z 311 kristopherwilson 3453 Makefile.am file 2012-07-20T21:51:24.333722Z a6a4668d6ce5650292c371ae5d1116cc 2012-07-20T21:49:01.022135Z 311 kristopherwilson 392 stjerm-0.16/src/.svn/prop-base/0000775000175000017500000000000012002351334016240 5ustar kwilsonkwilsonstjerm-0.16/src/main.c0000664000175000017500000000726212002351334014563 0ustar kwilsonkwilson/* * main.c * This file is part of Stjerm * * Copyright (C) 2007-2010 - Kristopher Wilson, Stjepan Glavina and Markus Groß * * Stjerm is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Stjerm is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Stjerm; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA */ #include #include "stjerm.h" int sargc; char **sargv; extern Option options[OPTION_COUNT]; void print_help(void); void print_info(void); void print_version(void); void print_help(void) { int i = 0; Option o; printf("stjerm version %s\n" "Usage: %s [action] [options]\n\n" "Actions are:\n" " --help\tDisplay this menu\n" " --info\tDisplay .Xdefault options\n" " --version\tDisplay the current application version\n" " --toggle\tShow/Hide the current stjerm instance\n" "(When using an action command, the options are ignored)\n\n" "Options are:\n", STJERM_VERSION, sargv[0]); for(i = 0; i < OPTION_COUNT; i++) { o = options[i]; printf(" %s %s\t%s\n", o.short_name, o.var_type, o.desc); } printf("\t\tYou may specify no palette, or a complete one with 16 total colors\n" "\t\tFor this you have to use -c0, -c1, ..., -c15.\n\n"); printf("Note: any colors in hex codes are entered without the leading '#'.\n\n" "Examples: %s -fn \"Bitstream Vera Sans Mono 12\" -bg white -k F12 -sh /bin/bash\n" " %s -bg black -fg green -w 800 -h 405 -s right -m alt -k f -l 10000\n" " %s -b thick -w 500 -p left -t best -o 90 -m shift -k tab -sh /bin/zsh\n\n" "Use --info to get a list of available .Xdefaults options for stjerm.\n", sargv[0], sargv[0], sargv[0]); } void print_info(void) { int i = 0; Option o; printf("stjerm version %s\n" "Usage: %s [action] [options]\n\n" "Actions are:\n" " --help\tDisplay command line options menu\n" " --info\tDisplay .Xdefault options\n" " --version\tDisplay current application version\n" " --toggle\tShow/Hide the current stjerm instance\n" "(When using an action command, the .Xdefaults options are ignored)\n\n" "The .Xdefault options are read from ~/.Xdefaults.\n" "To specify an option in .Xdefaults use this syntax:\n" "stjerm.OPTION: VALUE\n" "Example: stjerm.key: f12\n\n" "Available .Xdefaults options:\n", STJERM_VERSION, sargv[0]); for(i = 0; i < OPTION_COUNT; i++) { o = options[i]; printf(" %s: \t%s \t%s\n", o.long_name, o.var_type, o.desc); } printf("\t\t\t\tYou may specify no palette, or a complete one with 16 total colors.\n" "\t\t\t\tFor this you have to use color0, color1, ..., color15.\n"); } void print_version(void) { printf("stjerm %s\n", STJERM_VERSION); } int main(int argc, char *argv[]) { sargc = argc; sargv = argv; if (!g_thread_supported()) g_thread_init(NULL); gdk_threads_init(); gtk_init(&argc, &argv); conf_init(); build_mainwindow(); gdk_threads_enter(); gtk_main(); gdk_threads_leave(); return 0; } stjerm-0.16/src/shortcut.c0000664000175000017500000000512112002351334015502 0ustar kwilsonkwilson/* * shortcut.c * This file is part of Stjerm * * Copyright (C) 2007-2010 - Kristopher Wilson, Stjepan Glavina and Markus Groß * * Stjerm is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Stjerm is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Stjerm; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA */ #include #include #include #include #include "stjerm.h" static Display *dpy; Window root; int screen; KeySym opt_key; unsigned int modmask; unsigned int numlockmask; void init_key(void); void grab_key(void); void wait_key(void); void init_key(void) { if(!(dpy = XOpenDisplay(NULL))) { fprintf(stderr, "error: can not open display %s", XDisplayName(NULL)); exit(1); } screen = DefaultScreen(dpy); root = RootWindow(dpy, screen); opt_key = conf_get_key(); modmask = conf_get_mod(); int i, j; XModifierKeymap *modmap = XGetModifierMapping(dpy); for(i = 0; i < 8; i++) { for(j = 0; j < modmap->max_keypermod; j++) { if(modmap->modifiermap[i * modmap->max_keypermod + j] == XKeysymToKeycode(dpy, XK_Num_Lock)) numlockmask = (1 << i); } } XFreeModifiermap(modmap); } void grab_key(void) { XGrabKey(dpy, XKeysymToKeycode(dpy, opt_key), modmask, root, True, GrabModeAsync, GrabModeAsync); XGrabKey(dpy, XKeysymToKeycode(dpy, opt_key), LockMask|modmask, root, True, GrabModeAsync, GrabModeAsync); if(numlockmask) { XGrabKey(dpy, XKeysymToKeycode(dpy, opt_key), numlockmask|modmask, root, True, GrabModeAsync, GrabModeAsync); XGrabKey(dpy, XKeysymToKeycode(dpy, opt_key), numlockmask|LockMask |modmask, root, True, GrabModeAsync, GrabModeAsync); } } void wait_key(void) { XEvent event; while(1) { XNextEvent(dpy, &event); if(event.type == KeyPress) { if(XKeycodeToKeysym(dpy, event.xkey.keycode, 0) == opt_key) mainwindow_toggle(0); } } } stjerm-0.16/src/term.c0000664000175000017500000002110712002351334014600 0ustar kwilsonkwilson/* * term.c * This file is part of Stjerm * * Copyright (C) 2007-2010 - Kristopher Wilson, Stjepan Glavina and Markus Groß * * Stjerm is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Stjerm is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Stjerm; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA */ #include #include #include "stjerm.h" extern GtkWidget *mainwindow; extern GtkNotebook* tabbar; extern GtkWidget *popupmenu; extern gboolean popupmenu_shown; GtkWidget* build_term(void); static void term_connect_signals(GtkWidget*); static gboolean term_button_press(GtkWidget*, GdkEventButton*, gpointer); static void term_eof_or_child_exited(VteTerminal*, gpointer); static void term_app_request(VteTerminal*, gpointer); //static void term_app_request_resize_move(VteTerminal*, guint, guint, gpointer); static void term_fork_command(VteTerminal*, char*); GtkWidget* build_term(void) { if(!popupmenu) build_popupmenu(); GtkWidget* term = vte_terminal_new(); term_fork_command(VTE_TERMINAL(term), conf_get_shell()); if (conf_get_bg_image() != NULL) vte_terminal_set_background_image_file(VTE_TERMINAL(term), conf_get_bg_image()); GdkColor fore, back; fore = conf_get_fg(); back = conf_get_bg(); GdkColor *palette = conf_get_color_palette(); if(palette == NULL) vte_terminal_set_colors(VTE_TERMINAL(term), &fore, &back, NULL, 0); else vte_terminal_set_colors(VTE_TERMINAL(term), &fore, &back, palette, 16); #if VTE_CHECK_VERSION(0,25,0) vte_pty_set_term(vte_terminal_get_pty_object(VTE_TERMINAL(term)), conf_get_emulation()); #endif vte_terminal_set_background_tint_color(VTE_TERMINAL(term), &back); vte_terminal_set_allow_bold(VTE_TERMINAL(term), conf_get_allow_bold()); vte_terminal_set_scroll_on_output(VTE_TERMINAL(term), conf_get_scroll_on_output()); vte_terminal_set_scroll_on_keystroke(VTE_TERMINAL(term), TRUE); vte_terminal_set_font_from_string(VTE_TERMINAL(term), conf_get_font()); vte_terminal_set_scrollback_lines(VTE_TERMINAL(term), conf_get_lines()); vte_terminal_set_backspace_binding(VTE_TERMINAL(term), VTE_ERASE_ASCII_DELETE); vte_terminal_set_word_chars(VTE_TERMINAL(term), "-A-Za-z0-9_$.+!*(),;:@&=?/~#%"); GdkColor cursor = conf_get_cursor_color(); vte_terminal_set_cursor_blink_mode(VTE_TERMINAL(term), conf_get_cursor_blink() ? VTE_CURSOR_BLINK_ON : VTE_CURSOR_BLINK_OFF); vte_terminal_set_cursor_shape(VTE_TERMINAL(term), conf_get_cursor_shape()); vte_terminal_set_color_cursor(VTE_TERMINAL(term), &cursor); term_connect_signals(term); return term; } static void term_connect_signals(GtkWidget *term) { g_signal_connect_swapped(G_OBJECT(term), "button-press-event", G_CALLBACK(term_button_press), NULL); g_signal_connect (G_OBJECT(term), "eof", G_CALLBACK(term_eof_or_child_exited), NULL); g_signal_connect (G_OBJECT(term), "child-exited", G_CALLBACK(term_eof_or_child_exited), NULL); g_signal_connect(G_OBJECT(term), "iconify-window", G_CALLBACK(term_app_request), (gpointer)TERM_ICONIFY_WINDOW); g_signal_connect(G_OBJECT(term), "deiconify-window", G_CALLBACK(term_app_request), (gpointer)TERM_DEICONIFY_WINDOW); g_signal_connect(G_OBJECT(term), "raise-window", G_CALLBACK(term_app_request), (gpointer)TERM_RAISE_WINDOW); g_signal_connect(G_OBJECT(term), "lower-window", G_CALLBACK(term_app_request), (gpointer)TERM_LOWER_WINDOW); g_signal_connect(G_OBJECT(term), "maximize-window", G_CALLBACK(term_app_request), (gpointer)TERM_MAXIMIZE_WINDOW); g_signal_connect(G_OBJECT(term), "restore-window", G_CALLBACK(term_app_request), (gpointer)TERM_RESTORE_WINDOW); g_signal_connect(G_OBJECT(term), "refresh-window", G_CALLBACK(term_app_request), (gpointer)TERM_REFRESH_WINDOW); /*g_signal_connect(G_OBJECT(term), "resize-window", G_CALLBACK(term_app_request_resize_move), (gpointer)TERM_RESIZE_WINDOW); g_signal_connect(G_OBJECT(term), "move-window", G_CALLBACK(term_app_request_resize_move), (gpointer)TERM_MOVE_WINDOW);*/ } static CursorMatch term_cursor_match_pattern(GdkEventButton* event) { int tag = -1; gint page = gtk_notebook_get_current_page(GTK_NOTEBOOK(tabbar)); GList *children = gtk_container_get_children(GTK_CONTAINER(gtk_notebook_get_nth_page(GTK_NOTEBOOK(tabbar), page))); GtkWidget *vte = GTK_WIDGET(children->data); glong column = ((glong) (event->x) / vte_terminal_get_char_width(VTE_TERMINAL(vte))); glong row = ((glong) (event->y) / vte_terminal_get_char_height(VTE_TERMINAL(vte))); char* current_match = vte_terminal_match_check(VTE_TERMINAL(vte), column, row, &tag); CursorMatch match; match.tag = tag; match.text = current_match; return match; } static gboolean term_button_press(GtkWidget *widget, GdkEventButton *event, gpointer user_data) { if(event->type == GDK_BUTTON_PRESS && event->button == 3) { popupmenu_shown = TRUE; gtk_menu_popup(GTK_MENU(popupmenu), NULL, NULL, NULL, NULL, event->button, event->time); } else if (event->button == 1) { GError *error = NULL; CursorMatch match = term_cursor_match_pattern(event); if(match.tag >= 0) { gtk_show_uri(NULL, match.text, event->time, &error); } } return FALSE; } static void term_eof_or_child_exited(VteTerminal *term, gpointer user_data) { if(vte_terminal_get_child_exit_status(term) != 0) { /* restart the terminal if it crashed */ vte_terminal_reset(VTE_TERMINAL(term), FALSE, TRUE); term_fork_command(VTE_TERMINAL(term), conf_get_shell()); } else { /* else close the tab */ mainwindow_close_tab(GTK_WIDGET(term)); } } static void term_app_request(VteTerminal *term, gpointer user_data) { int event = GPOINTER_TO_INT(user_data); if(event == TERM_ICONIFY_WINDOW) gdk_window_iconify(GTK_WIDGET(mainwindow)->window); if(event == TERM_DEICONIFY_WINDOW) gdk_window_deiconify(GTK_WIDGET(mainwindow)->window); if(event == TERM_RAISE_WINDOW) gdk_window_raise(GTK_WIDGET(mainwindow)->window); if(event == TERM_LOWER_WINDOW) gdk_window_lower(GTK_WIDGET(mainwindow)->window); if(event == TERM_MAXIMIZE_WINDOW) gdk_window_maximize(GTK_WIDGET(mainwindow)->window); if(event == TERM_RESTORE_WINDOW) gdk_window_unmaximize(GTK_WIDGET(mainwindow)->window); if(event == TERM_REFRESH_WINDOW) { GdkRectangle rect; rect.x = rect.y = 0; rect.width = mainwindow->allocation.width; rect.height = mainwindow->allocation.height; gdk_window_invalidate_rect(GTK_WIDGET(mainwindow)->window, &rect, TRUE); } } /*static void term_app_request_resize_move(VteTerminal *term, guint x, guint y, gpointer user_data) { // FIXME I can't get this function to call. It may be unused? int event = GPOINTER_TO_INT(user_data); if(event == TERM_RESIZE_WINDOW) { gint owidth, oheight, xpad, ypad; gtk_window_get_size(GTK_WINDOW(mainwindow), &owidth, &oheight); owidth -= term->char_width * term->column_count; oheight -= term->char_height * term->row_count; vte_terminal_get_padding(term, &xpad, &ypad);= owidth -= xpad; oheight -= ypad; gtk_window_resize(GTK_WINDOW(mainwindow), x+owidth, y+oheight); } if(event == TERM_MOVE_WINDOW) gdk_window_move(GTK_WIDGET(mainwindow)->window, x, y); }*/ static void term_fork_command(VteTerminal *term, char *cmd) { #if VTE_CHECK_VERSION(0,25,0) char **argv = NULL; g_shell_parse_argv(cmd, NULL, &argv, NULL); vte_terminal_fork_command_full(term, VTE_PTY_DEFAULT, NULL, argv, NULL, G_SPAWN_CHILD_INHERITS_STDIN|G_SPAWN_SEARCH_PATH|G_SPAWN_FILE_AND_ARGV_ZERO, NULL, NULL, NULL, NULL); #else vte_terminal_fork_command(term, cmd, NULL, NULL, "", TRUE, TRUE, TRUE); #endif } stjerm-0.16/src/Makefile.am0000664000175000017500000000061012002351334015515 0ustar kwilsonkwilsonSTJERM_VERSION = 0.16 bin_PROGRAMS = stjerm stjerm_SOURCES = main.c mainwindow.c config.c term.c \ popupmenu.c shortcut.c INCLUDES= -Wall\ -DSTJERM_VERSION=\"$(STJERM_VERSION)\" LIBS = @glib_LIBS@ @LIBS@\ @gtk_LIBS@\ @gthread_LIBS@\ @vte_LIBS@ AM_CFLAGS = @CFLAGS@\ @glib_CFLAGS@\ @gtk_CFLAGS@\ @gthread_CFLAGS@\ @vte_CFLAGS@ stjerm-0.16/AUTHORS0000664000175000017500000000026312002351334013746 0ustar kwilsonkwilsonCopyright (C) 2008 - Kristopher Wilson Copyright (C) 2007 - Stjepan Glavina Copyright (C) 2007 - Markus Gross stjerm-0.16/INSTALL0000664000175000017500000000067212002351334013733 0ustar kwilsonkwilsonInstallation Instructions ************************* The source code comes with a script autogen.sh that will handle running autoconf and automake. Run this command and react appropriately to any errors: ./autogen.sh Assuming that was successful, you can then continue to: ./configure make make install To install stjerm to a specific location or your own choosing: ./configure --prefix=/usr/local make make install stjerm-0.16/doc/0000775000175000017500000000000012002351334013442 5ustar kwilsonkwilsonstjerm-0.16/doc/stjerm.80000664000175000017500000001146112002351334015042 0ustar kwilsonkwilson.TH STJERM "8" "Last Change: 7 Jul 2012" "stjerm 0.16" "" .SH NAME stjerm \- quake\-style terminal emulator .SH SYNOPSIS .B stjerm [-OPTION] [-OPTION] ... [-OPTION] .SH DESCRIPTION .B stjerm is a quake\-style terminal. It is minimalistic and works well with compiz. .B stjerm can be configured via commandline or the .Xdefaults file. The following list of options displays the .Xdefaults option first and then the commandline option. The commandline options have a higher priority and thus override the .Xdefaults options. .SH NOTES If you run \fBstjerm\fR with an action it will not parse other commandline options and will exit. If you specify a hex color on the commandline you have to ommit the \fB#\fR char. Otherwise the option will not get parsed. This restriction only affects the commandline options, not the .Xdefaults options. .SH ACTIONS .TP .B "\-\-help" Displays menu with commandline options. .TP .B "\-\-info" Displays menu with .Xdefaults options. .TP .B "\-\-version" Display the current application version. .TP .B "\-\-toggle" Show/hide the current \fBstjerm\fR instance. .SH OPTIONS .TP .B "key, \-k" Shortcut key which shows and hides \fBstjerm\fR (eg: f12). If you don't specify a shortcut key, you can only show/hide \fBstjerm\fR if you run \fBstjerm\fR with \fI\-\-toggle\fR. .TP .B "mod, \-m" Modifier key, which has to be pressed in combination with the shortcut key to show/hide .B stjerm : shift, control, alt, windows, none. Default: \fInone\fR. .TP .B "keymod, \-km" Modifier for keyboard shortcuts. Can be a combination (with +) of modifiers (eg: control+alt). Default: \fIcontrol+shift\fR. .TP .B "autohide, \-ah" Whether or not to hide stjerm when it looses focus. Default: \fItrue\fR. .TP .B "font, \-fn" Terminal font and size (eg: Sans 10). Default: \fIBitstream Vera Sans Mono 10\fR. .TP .B "background, \-bg" Background color of the terminal. If the terminal is transparent this is the tint color. Default: \fIBlack\fR. .TP .B "foreground, \-fg" Foreground color of the terminal. This is the font color. Default: \fIWhite\fR. .TP .B "allowbold, \-ab" Allow bold fonts or not. Default: \fItrue\fR .TP .B "border, \-b" Border type: thin, thick, none. Default: \fInone\fR. .TP .B "opacity, \-o" Opacity (range: 10 - 100). If compositing is enabled \fBstjerm\fR will use real transparency. Otherwise you get pseudo\-transparency. .TP .B "bgimage, \-bgimg" Background image file. Specify the filename. Default: \fIdisabled\fR. .TP .B "width, \-w" Window width, either as an integer or a percentage (eg, 50%). Default: \fI800\fR. .TP .B "height, \-h" Window height, either as an integer or a percentage (eg, 50%). Default: \fI400\fR. .TP .B "position, \-p" Window position: top, bottom, left, right. Default: \fItop\fR. .TP .B "scrollbar, \-s" Scrollbar position: left, right, none. Default: \fInone\fR. .TP .B "shell, \-sh" Terminal shell. Default: the user's default shell. .TP .B "lines, \-l" Scrollback lines. 0 to disable scrollback. Default: \fI1000\fR. .TP .B "showtab, \-st" Tabbar visibility: never, one, always. One means the tabbar is visible if more than one tab is opened. Default: \fIone\fR. .TP .B "tabpos, \-tp" Tabbar position: top, bottom, left, right. Default: \fIbottom\fR. .TP .B "tablabel, \-tl" Label of the tabs. The terminal number gets appended automatically. Default: \fIterm\fR. .TP .B "tabfill, \-tf" Whether tabs fill whole tabbar space. Default: \fItrue\fR. .TP .B "scroll, \-sc" Whether to scroll the terminal on output. Default: \fItrue\fR. .TP .B "colorX, \-cX" Specify color X of the terminals color palette. You may specify no palette, or a complete one with 16 total colors. For this you have to use \-c0, \-c1, ..., \-c15 or the equivalent color0, color1,... color15. .TP .B "fixedX, \-fX" Overrides the calculated horizontal position of the window. Specifies the location of the left of the window. .TP .B "fixedY, \-fY" Overrides the calculated vertical position of the window. Specifies the location of the top of the window. .TP .B "allowreorder, \-ar" Allows the tabs of the tab bar to be reordered. .TP .B "cursorBlink, \-ub" Should the cursor blink? Default: true. .TP .B "cursorColor, \-uc" The color of the cursor. Default: white .TP .B "cursorShape, \-us" Cursor shape, one of [block,ibeam,underline]. Default: block .SH EXAMPLES To run stjerm with F12 as shortcut key, the opacity of 60 and a green foreground color, use: stjerm \-k f12 \-o 60 \-fg 66ff11 To specify the same options in the .Xdefaults file, write this in your .Xdefaults file: stjerm.key: f12 stjerm.opacity: 60 stjerm.foreground: #66ff11 .SH "REPORTING BUGS" Report bugs to . .SH COPYRIGHT Copyright \(co 2007-2011 Kristopher Wilson, Stjepan Glavina and Markus Gross This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. stjerm-0.16/doc/.svn/0000775000175000017500000000000012002351334014326 5ustar kwilsonkwilsonstjerm-0.16/doc/.svn/text-base/0000775000175000017500000000000012002351334016222 5ustar kwilsonkwilsonstjerm-0.16/doc/.svn/text-base/stjerm.8.svn-base0000444000175000017500000001146112002351334021333 0ustar kwilsonkwilson.TH STJERM "8" "Last Change: 7 Jul 2012" "stjerm 0.16" "" .SH NAME stjerm \- quake\-style terminal emulator .SH SYNOPSIS .B stjerm [-OPTION] [-OPTION] ... [-OPTION] .SH DESCRIPTION .B stjerm is a quake\-style terminal. It is minimalistic and works well with compiz. .B stjerm can be configured via commandline or the .Xdefaults file. The following list of options displays the .Xdefaults option first and then the commandline option. The commandline options have a higher priority and thus override the .Xdefaults options. .SH NOTES If you run \fBstjerm\fR with an action it will not parse other commandline options and will exit. If you specify a hex color on the commandline you have to ommit the \fB#\fR char. Otherwise the option will not get parsed. This restriction only affects the commandline options, not the .Xdefaults options. .SH ACTIONS .TP .B "\-\-help" Displays menu with commandline options. .TP .B "\-\-info" Displays menu with .Xdefaults options. .TP .B "\-\-version" Display the current application version. .TP .B "\-\-toggle" Show/hide the current \fBstjerm\fR instance. .SH OPTIONS .TP .B "key, \-k" Shortcut key which shows and hides \fBstjerm\fR (eg: f12). If you don't specify a shortcut key, you can only show/hide \fBstjerm\fR if you run \fBstjerm\fR with \fI\-\-toggle\fR. .TP .B "mod, \-m" Modifier key, which has to be pressed in combination with the shortcut key to show/hide .B stjerm : shift, control, alt, windows, none. Default: \fInone\fR. .TP .B "keymod, \-km" Modifier for keyboard shortcuts. Can be a combination (with +) of modifiers (eg: control+alt). Default: \fIcontrol+shift\fR. .TP .B "autohide, \-ah" Whether or not to hide stjerm when it looses focus. Default: \fItrue\fR. .TP .B "font, \-fn" Terminal font and size (eg: Sans 10). Default: \fIBitstream Vera Sans Mono 10\fR. .TP .B "background, \-bg" Background color of the terminal. If the terminal is transparent this is the tint color. Default: \fIBlack\fR. .TP .B "foreground, \-fg" Foreground color of the terminal. This is the font color. Default: \fIWhite\fR. .TP .B "allowbold, \-ab" Allow bold fonts or not. Default: \fItrue\fR .TP .B "border, \-b" Border type: thin, thick, none. Default: \fInone\fR. .TP .B "opacity, \-o" Opacity (range: 10 - 100). If compositing is enabled \fBstjerm\fR will use real transparency. Otherwise you get pseudo\-transparency. .TP .B "bgimage, \-bgimg" Background image file. Specify the filename. Default: \fIdisabled\fR. .TP .B "width, \-w" Window width, either as an integer or a percentage (eg, 50%). Default: \fI800\fR. .TP .B "height, \-h" Window height, either as an integer or a percentage (eg, 50%). Default: \fI400\fR. .TP .B "position, \-p" Window position: top, bottom, left, right. Default: \fItop\fR. .TP .B "scrollbar, \-s" Scrollbar position: left, right, none. Default: \fInone\fR. .TP .B "shell, \-sh" Terminal shell. Default: the user's default shell. .TP .B "lines, \-l" Scrollback lines. 0 to disable scrollback. Default: \fI1000\fR. .TP .B "showtab, \-st" Tabbar visibility: never, one, always. One means the tabbar is visible if more than one tab is opened. Default: \fIone\fR. .TP .B "tabpos, \-tp" Tabbar position: top, bottom, left, right. Default: \fIbottom\fR. .TP .B "tablabel, \-tl" Label of the tabs. The terminal number gets appended automatically. Default: \fIterm\fR. .TP .B "tabfill, \-tf" Whether tabs fill whole tabbar space. Default: \fItrue\fR. .TP .B "scroll, \-sc" Whether to scroll the terminal on output. Default: \fItrue\fR. .TP .B "colorX, \-cX" Specify color X of the terminals color palette. You may specify no palette, or a complete one with 16 total colors. For this you have to use \-c0, \-c1, ..., \-c15 or the equivalent color0, color1,... color15. .TP .B "fixedX, \-fX" Overrides the calculated horizontal position of the window. Specifies the location of the left of the window. .TP .B "fixedY, \-fY" Overrides the calculated vertical position of the window. Specifies the location of the top of the window. .TP .B "allowreorder, \-ar" Allows the tabs of the tab bar to be reordered. .TP .B "cursorBlink, \-ub" Should the cursor blink? Default: true. .TP .B "cursorColor, \-uc" The color of the cursor. Default: white .TP .B "cursorShape, \-us" Cursor shape, one of [block,ibeam,underline]. Default: block .SH EXAMPLES To run stjerm with F12 as shortcut key, the opacity of 60 and a green foreground color, use: stjerm \-k f12 \-o 60 \-fg 66ff11 To specify the same options in the .Xdefaults file, write this in your .Xdefaults file: stjerm.key: f12 stjerm.opacity: 60 stjerm.foreground: #66ff11 .SH "REPORTING BUGS" Report bugs to . .SH COPYRIGHT Copyright \(co 2007-2011 Kristopher Wilson, Stjepan Glavina and Markus Gross This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. stjerm-0.16/doc/.svn/text-base/Makefile.am.svn-base0000444000175000017500000000005412002351333021765 0ustar kwilsonkwilsonman_MANS = stjerm.8 EXTRA_DIST = $(man_MANS)stjerm-0.16/doc/.svn/dir-prop-base0000444000175000017500000000005712002351334016713 0ustar kwilsonkwilsonK 10 svn:ignore V 21 Makefile Makefile.in END stjerm-0.16/doc/.svn/all-wcprops0000444000175000017500000000036612002351334016515 0ustar kwilsonkwilsonK 25 svn:wc:ra_dav:version-url V 27 /svn/!svn/ver/311/trunk/doc END Makefile.am K 25 svn:wc:ra_dav:version-url V 39 /svn/!svn/ver/225/trunk/doc/Makefile.am END stjerm.8 K 25 svn:wc:ra_dav:version-url V 36 /svn/!svn/ver/311/trunk/doc/stjerm.8 END stjerm-0.16/doc/.svn/tmp/0000775000175000017500000000000012002351334015126 5ustar kwilsonkwilsonstjerm-0.16/doc/.svn/tmp/text-base/0000775000175000017500000000000012002351334017022 5ustar kwilsonkwilsonstjerm-0.16/doc/.svn/tmp/props/0000775000175000017500000000000012002351333016270 5ustar kwilsonkwilsonstjerm-0.16/doc/.svn/tmp/prop-base/0000775000175000017500000000000012002351333017015 5ustar kwilsonkwilsonstjerm-0.16/doc/.svn/props/0000775000175000017500000000000012002351333015470 5ustar kwilsonkwilsonstjerm-0.16/doc/.svn/entries0000444000175000017500000000101512002351334015713 0ustar kwilsonkwilson10 dir 311 https://stjerm-terminal.googlecode.com/svn/trunk/doc https://stjerm-terminal.googlecode.com/svn 2012-07-20T21:49:01.022135Z 311 kristopherwilson has-props 2d50db9f-3d56-0410-a9df-075c8fe9c84e Makefile.am file 2012-07-20T21:51:24.021566Z f5aba8f71f5bdcaede3eb2766946459e 2007-09-01T19:18:06.895971Z 225 mgross 44 stjerm.8 file 2012-07-20T21:51:24.021566Z 6e9a7233f0c6a9a91fe8a761c7b66ef7 2012-07-20T21:49:01.022135Z 311 kristopherwilson 4913 stjerm-0.16/doc/.svn/prop-base/0000775000175000017500000000000012002351333016215 5ustar kwilsonkwilsonstjerm-0.16/doc/Makefile.am0000664000175000017500000000005412002351334015475 0ustar kwilsonkwilsonman_MANS = stjerm.8 EXTRA_DIST = $(man_MANS)stjerm-0.16/configure.ac0000664000175000017500000000221612002351334015164 0ustar kwilsonkwilson# Process this file with autoconf to produce a configure script. # some parts are taken from configure.ac from gmpc-svn # (see: sarine.nl/gmpc) AC_INIT(src) AC_PREREQ(2.59) AM_INIT_AUTOMAKE([stjerm], [0.16], kristopherwilson@gmail.com) #AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS) AC_CONFIG_SRCDIR([src/mainwindow.c]) AC_CONFIG_HEADER([config.h]) # Checks for programs. AC_PROG_CC # Checks for libraries. AC_SUBST(GLIB_REQUIRED) AC_SUBST(GTK_REQUIRED) # glib PKG_CHECK_MODULES([glib], glib-2.0 >= 2.10) AC_SUBST(glib_LIBS) AC_SUBST(glib_CFLAGS) #gtk PKG_CHECK_MODULES([gtk], gtk+-2.0 >= 2.10) AC_SUBST(gtk_LIBS) AC_SUBST(gtk_CFLAGS) # gthread PKG_CHECK_MODULES([gthread], gthread-2.0) AC_SUBST(gthread_LIBS) AC_SUBST(gthread_CFLAGS) # gthread PKG_CHECK_MODULES([vte], vte >= 0.20) AC_SUBST(vte_LIBS) AC_SUBST(vte_CFLAGS) # Checks for header files. AC_PATH_X AC_HEADER_STDC AC_CHECK_HEADERS([stdlib.h string.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_TYPE_PID_T # Checks for library functions. AC_TYPE_SIGNAL AC_FUNC_STAT AC_OUTPUT([Makefile doc/Makefile src/Makefile]) echo "ready. type make to build..." stjerm-0.16/COPYING0000664000175000017500000004310312002351334013731 0ustar kwilsonkwilson GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. stjerm-0.16/autogen.sh0000775000175000017500000000160612002351334014701 0ustar kwilsonkwilson#!/bin/sh # This was borrowed from Tilda (see tilda.sourceforge.net). # Here is the message from the Tilda autogen.sh: # This was borrowed from Gaim (see gaim.sf.net) and modified # for our purposes. Thanks guys! echo "This will do all the autotools stuff so that you can build" echo "stjerm successfully." echo echo "When it is finished, take the usual steps to install:" echo "./configure" echo "make" echo "make install" echo (automake --version) < /dev/null > /dev/null 2>&1 || { echo; echo "You must have automake installed to compile stjerm"; echo; exit; } (autoconf --version) < /dev/null > /dev/null 2>&1 || { echo; echo "You must have autoconf installed to compile stjerm"; echo; exit; } echo "Generating configuration files for stjerm, please wait..." echo; aclocal $ACLOCAL_FLAGS || exit; autoheader || exit; automake --add-missing --copy; autoconf || exit; automake || exit; stjerm-0.16/README0000664000175000017500000000032312002351334013553 0ustar kwilsonkwilsonRequirements ------------ pkgconfig, gtk2, vte Installation ------------ ./autogen.sh make sudo make install Running ------------ Simply run: stjerm and all available options will be listed. stjerm-0.16/.svn/0000775000175000017500000000000012002351334013561 5ustar kwilsonkwilsonstjerm-0.16/.svn/text-base/0000775000175000017500000000000012002351334015455 5ustar kwilsonkwilsonstjerm-0.16/.svn/text-base/README.svn-base0000444000175000017500000000032312002351334020044 0ustar kwilsonkwilsonRequirements ------------ pkgconfig, gtk2, vte Installation ------------ ./autogen.sh make sudo make install Running ------------ Simply run: stjerm and all available options will be listed. stjerm-0.16/.svn/text-base/autogen.sh.svn-base0000444000175000017500000000160612002351334021167 0ustar kwilsonkwilson#!/bin/sh # This was borrowed from Tilda (see tilda.sourceforge.net). # Here is the message from the Tilda autogen.sh: # This was borrowed from Gaim (see gaim.sf.net) and modified # for our purposes. Thanks guys! echo "This will do all the autotools stuff so that you can build" echo "stjerm successfully." echo echo "When it is finished, take the usual steps to install:" echo "./configure" echo "make" echo "make install" echo (automake --version) < /dev/null > /dev/null 2>&1 || { echo; echo "You must have automake installed to compile stjerm"; echo; exit; } (autoconf --version) < /dev/null > /dev/null 2>&1 || { echo; echo "You must have autoconf installed to compile stjerm"; echo; exit; } echo "Generating configuration files for stjerm, please wait..." echo; aclocal $ACLOCAL_FLAGS || exit; autoheader || exit; automake --add-missing --copy; autoconf || exit; automake || exit; stjerm-0.16/.svn/text-base/AUTHORS.svn-base0000444000175000017500000000026312002351333020236 0ustar kwilsonkwilsonCopyright (C) 2008 - Kristopher Wilson Copyright (C) 2007 - Stjepan Glavina Copyright (C) 2007 - Markus Gross stjerm-0.16/.svn/text-base/ChangeLog.svn-base0000444000175000017500000000676012002351334020751 0ustar kwilsonkwilson15 Jul 2012 Kristopher Wilson correcting INSTALL to be more accurate fixing issue with keyboard shortcut copy + paste 08 Jul 2012 Kristopher Wilson fixing unescaped dashes in manpage (barygin) added cursorBlink, cursorColor and cursorShape options 22 Dec 2011 Kristopher Wilson new tab launches when closing the last tab 19 Jul 2010 Kristopher Wilson released version 0.15 03 Oct 2010 Kristopher Wilson fixed errors and warnings with vte 0.26.0 added terminal emulation option which defaults to xterm fixed incorrect behavior after reordering tabs fixed several run time error messages added reordering of tabs 01 Oct 2010 Kristopher Wilson fixed a bug with closing the first tab causing stjerm to exit (c.krooss) 27 Sep 2010 Kristopher Wilson fixed a bug with closing stjerm via 'exit' or Ctrl+D (c.krooss) 31 Aug 2010 Kristopher Wilson released version 0.14 30 Aug 2010 Kristopher Wilson close tab menu item is no longer available when only one tab is open, no longer exits application right clicking on the notebook bar will display the popup menu right clicking on a tab will now select that tab double clicking on empty space in the notebook bar will open a new tab 24 Aug 2010 Kristopher Wilson released version 0.13 23 Aug 2010 Kristopher Wilson fixed fullscreen functionality bugs added --version action merged widthpercent and heightpercent into width and height options, respectively updated man page and --info and --help actions 17 Aug 2010 Kristopher Wilson released version 0.12 added ability to drag and drop tabs for sorting added ability to specify width and height as a percentage (thomas.jost) added character selection string for better highlighting fixed behavior issue when typing exit (thomas.jost) added tab hotkey feature (thomas.jost) added keyboard copy and paste functionality (andfagiani) added clickable link functionality 09 Oct 2007 Markus Gross fixed --toggle (again) 08 Oct 2007 Markus Gross added fullscreen keyboard shortcut and popupmenu item fixed --toggle option fixed weird characters appearing when using shortcuts updated manpage 07 Oct 2007 Markus Gross added scroll on output option added background image option 03 Oct 2007 Markus Gross added "autohide" option, this enables/disables the hiding of stjerm when it looses focus 01 Oct 2007 Markus Gross bumped up version to 0.10 added english manpage added "keymod" option to set the modifiers for keyboard shortcuts small code cleanups 31 Oct 2007 Markus Gross added tinting of background image with background color added "allowbold" option to enable/disable bold fonts added "tabfill" option to let tabs fill up all space added intelligent boolean value parsing (now "yes", "1" and "true" evalute to TRUE, and opposites evaluate to FALSE) 17 Oct 2007 Markus Gross added --info to display .Xdefaults options renamed -tablabel to -tl renamed -showtab to -st 16 Oct 2007 Markus Gross added autotools build system added --toggle command line option added full .Xdefaults support added -cX (colorX) option to set color palette dropped .stjermrc usage stjerm-0.16/.svn/text-base/configure.ac.svn-base0000444000175000017500000000221612002351333021454 0ustar kwilsonkwilson# Process this file with autoconf to produce a configure script. # some parts are taken from configure.ac from gmpc-svn # (see: sarine.nl/gmpc) AC_INIT(src) AC_PREREQ(2.59) AM_INIT_AUTOMAKE([stjerm], [0.16], kristopherwilson@gmail.com) #AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS) AC_CONFIG_SRCDIR([src/mainwindow.c]) AC_CONFIG_HEADER([config.h]) # Checks for programs. AC_PROG_CC # Checks for libraries. AC_SUBST(GLIB_REQUIRED) AC_SUBST(GTK_REQUIRED) # glib PKG_CHECK_MODULES([glib], glib-2.0 >= 2.10) AC_SUBST(glib_LIBS) AC_SUBST(glib_CFLAGS) #gtk PKG_CHECK_MODULES([gtk], gtk+-2.0 >= 2.10) AC_SUBST(gtk_LIBS) AC_SUBST(gtk_CFLAGS) # gthread PKG_CHECK_MODULES([gthread], gthread-2.0) AC_SUBST(gthread_LIBS) AC_SUBST(gthread_CFLAGS) # gthread PKG_CHECK_MODULES([vte], vte >= 0.20) AC_SUBST(vte_LIBS) AC_SUBST(vte_CFLAGS) # Checks for header files. AC_PATH_X AC_HEADER_STDC AC_CHECK_HEADERS([stdlib.h string.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_TYPE_PID_T # Checks for library functions. AC_TYPE_SIGNAL AC_FUNC_STAT AC_OUTPUT([Makefile doc/Makefile src/Makefile]) echo "ready. type make to build..." stjerm-0.16/.svn/text-base/COPYING.svn-base0000444000175000017500000004310312002351334020222 0ustar kwilsonkwilson GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. stjerm-0.16/.svn/text-base/INSTALL.svn-base0000444000175000017500000000067212002351334020224 0ustar kwilsonkwilsonInstallation Instructions ************************* The source code comes with a script autogen.sh that will handle running autoconf and automake. Run this command and react appropriately to any errors: ./autogen.sh Assuming that was successful, you can then continue to: ./configure make make install To install stjerm to a specific location or your own choosing: ./configure --prefix=/usr/local make make install stjerm-0.16/.svn/text-base/Makefile.am.svn-base0000444000175000017500000000002212002351334021214 0ustar kwilsonkwilsonSUBDIRS = doc src stjerm-0.16/.svn/text-base/NEWS.svn-base0000444000175000017500000000000012002351334017653 0ustar kwilsonkwilsonstjerm-0.16/.svn/dir-prop-base0000444000175000017500000000050112002351334016140 0ustar kwilsonkwilsonK 10 svn:ignore V 165 stjerm .cproject .project autom4te.cache config.h aclocal.m4 config.h.in config.log config.status configure depcomp install-sh Makefile Makefile.in missing stamp-h1 K 13 svn:mergeinfo V 103 /branches/0.13-devel:257-266 /branches/0.14-devel:270-275 /branches/0.15:284-293 /branches/0.16:297-310 END stjerm-0.16/.svn/all-wcprops0000444000175000017500000000144312002351334015745 0ustar kwilsonkwilsonK 25 svn:wc:ra_dav:version-url V 23 /svn/!svn/ver/311/trunk END COPYING K 25 svn:wc:ra_dav:version-url V 30 /svn/!svn/ver/51/trunk/COPYING END Makefile.am K 25 svn:wc:ra_dav:version-url V 35 /svn/!svn/ver/256/trunk/Makefile.am END autogen.sh K 25 svn:wc:ra_dav:version-url V 34 /svn/!svn/ver/209/trunk/autogen.sh END NEWS K 25 svn:wc:ra_dav:version-url V 28 /svn/!svn/ver/209/trunk/NEWS END README K 25 svn:wc:ra_dav:version-url V 30 /svn/!svn/ver/252/trunk/README END configure.ac K 25 svn:wc:ra_dav:version-url V 36 /svn/!svn/ver/311/trunk/configure.ac END AUTHORS K 25 svn:wc:ra_dav:version-url V 31 /svn/!svn/ver/252/trunk/AUTHORS END INSTALL K 25 svn:wc:ra_dav:version-url V 31 /svn/!svn/ver/311/trunk/INSTALL END ChangeLog K 25 svn:wc:ra_dav:version-url V 33 /svn/!svn/ver/311/trunk/ChangeLog END stjerm-0.16/.svn/tmp/0000775000175000017500000000000012002351334014361 5ustar kwilsonkwilsonstjerm-0.16/.svn/tmp/text-base/0000775000175000017500000000000012002351334016255 5ustar kwilsonkwilsonstjerm-0.16/.svn/tmp/props/0000775000175000017500000000000012002351333015523 5ustar kwilsonkwilsonstjerm-0.16/.svn/tmp/prop-base/0000775000175000017500000000000012002351333016250 5ustar kwilsonkwilsonstjerm-0.16/.svn/props/0000775000175000017500000000000012002351333014723 5ustar kwilsonkwilsonstjerm-0.16/.svn/entries0000444000175000017500000000311612002351334015152 0ustar kwilsonkwilson10 dir 311 https://stjerm-terminal.googlecode.com/svn/trunk https://stjerm-terminal.googlecode.com/svn 2012-07-20T21:49:01.022135Z 311 kristopherwilson has-props 2d50db9f-3d56-0410-a9df-075c8fe9c84e INSTALL file 2012-07-20T21:51:24.425768Z 3e04c20c4c2aed47dd781b15bd051736 2012-07-20T21:49:01.022135Z 311 kristopherwilson 442 src dir ChangeLog file 2012-07-20T21:51:24.425768Z 9d07ed1f7ee7f347c5209c43733c6c00 2012-07-20T21:49:01.022135Z 311 kristopherwilson 3568 COPYING file 2012-07-20T21:51:24.425768Z 751419260aa954499f7abaabaa882bbe 2007-02-01T08:21:58.134377Z 51 stjepan 17987 Makefile.am file 2012-07-20T21:51:24.425768Z 0f67684e67fc7246c80d82f4e6501b82 2010-08-20T17:00:48.647087Z 256 kristopherwilson 18 autogen.sh file 2012-07-20T21:51:24.425768Z 759f7ad02fbb327d6466b5b636f2a4a6 2007-08-16T13:32:33.305353Z 209 mgross has-props 902 NEWS file 2012-07-20T21:51:24.425768Z d41d8cd98f00b204e9800998ecf8427e 2007-08-16T13:32:33.305353Z 209 mgross 0 README file 2012-07-20T21:51:24.425768Z 18d94be93bc3d72e29c197803bd8c379 2010-06-04T20:20:53.142551Z 252 kristopherwilson 211 configure.ac file 2012-07-20T21:51:24.425768Z b52ce24720a7f67eddf383b5a9af276a 2012-07-20T21:49:01.022135Z 311 kristopherwilson 1166 doc dir AUTHORS file 2012-07-20T21:51:24.425768Z 5700924eaa3e4b9c9989805003aec552 2010-06-04T20:20:53.142551Z 252 kristopherwilson 179 stjerm-0.16/.svn/prop-base/0000775000175000017500000000000012002351334015451 5ustar kwilsonkwilsonstjerm-0.16/.svn/prop-base/autogen.sh.svn-base0000444000175000017500000000003612002351334021157 0ustar kwilsonkwilsonK 14 svn:executable V 1 * END stjerm-0.16/Makefile.am0000664000175000017500000000002212002351334014723 0ustar kwilsonkwilsonSUBDIRS = doc src stjerm-0.16/ChangeLog0000664000175000017500000000676012002351334014460 0ustar kwilsonkwilson15 Jul 2012 Kristopher Wilson correcting INSTALL to be more accurate fixing issue with keyboard shortcut copy + paste 08 Jul 2012 Kristopher Wilson fixing unescaped dashes in manpage (barygin) added cursorBlink, cursorColor and cursorShape options 22 Dec 2011 Kristopher Wilson new tab launches when closing the last tab 19 Jul 2010 Kristopher Wilson released version 0.15 03 Oct 2010 Kristopher Wilson fixed errors and warnings with vte 0.26.0 added terminal emulation option which defaults to xterm fixed incorrect behavior after reordering tabs fixed several run time error messages added reordering of tabs 01 Oct 2010 Kristopher Wilson fixed a bug with closing the first tab causing stjerm to exit (c.krooss) 27 Sep 2010 Kristopher Wilson fixed a bug with closing stjerm via 'exit' or Ctrl+D (c.krooss) 31 Aug 2010 Kristopher Wilson released version 0.14 30 Aug 2010 Kristopher Wilson close tab menu item is no longer available when only one tab is open, no longer exits application right clicking on the notebook bar will display the popup menu right clicking on a tab will now select that tab double clicking on empty space in the notebook bar will open a new tab 24 Aug 2010 Kristopher Wilson released version 0.13 23 Aug 2010 Kristopher Wilson fixed fullscreen functionality bugs added --version action merged widthpercent and heightpercent into width and height options, respectively updated man page and --info and --help actions 17 Aug 2010 Kristopher Wilson released version 0.12 added ability to drag and drop tabs for sorting added ability to specify width and height as a percentage (thomas.jost) added character selection string for better highlighting fixed behavior issue when typing exit (thomas.jost) added tab hotkey feature (thomas.jost) added keyboard copy and paste functionality (andfagiani) added clickable link functionality 09 Oct 2007 Markus Gross fixed --toggle (again) 08 Oct 2007 Markus Gross added fullscreen keyboard shortcut and popupmenu item fixed --toggle option fixed weird characters appearing when using shortcuts updated manpage 07 Oct 2007 Markus Gross added scroll on output option added background image option 03 Oct 2007 Markus Gross added "autohide" option, this enables/disables the hiding of stjerm when it looses focus 01 Oct 2007 Markus Gross bumped up version to 0.10 added english manpage added "keymod" option to set the modifiers for keyboard shortcuts small code cleanups 31 Oct 2007 Markus Gross added tinting of background image with background color added "allowbold" option to enable/disable bold fonts added "tabfill" option to let tabs fill up all space added intelligent boolean value parsing (now "yes", "1" and "true" evalute to TRUE, and opposites evaluate to FALSE) 17 Oct 2007 Markus Gross added --info to display .Xdefaults options renamed -tablabel to -tl renamed -showtab to -st 16 Oct 2007 Markus Gross added autotools build system added --toggle command line option added full .Xdefaults support added -cX (colorX) option to set color palette dropped .stjermrc usage stjerm-0.16/NEWS0000664000175000017500000000000012002351334013362 0ustar kwilsonkwilson