-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: http://sanoi.webfactional.com/trunk@3 79def182-f41f-0410-b320-e94a04284523
- Loading branch information
Jonas
committed
Apr 20, 2007
0 parents
commit 91c713d
Showing
23 changed files
with
2,460 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
0.0.1 Sat Oct 14 13:56:06 CEST 2006 - Jonas Broms <[email protected]> | ||
* Initial SVN import | ||
* Added scons build scripts (originally from telepathy-inspector) | ||
* Added functions in fama-conn-manager.c | ||
* Added functions in fama-dbus.c | ||
* Added data-type FamaConnectionManager in fama-common.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
How to install (the flags are optional): | ||
|
||
$ scons PREFIX=/what/ever DEBUG=yes | ||
$ scons install | ||
|
||
|
||
If you see this error: | ||
------------------------------------------------------------------ | ||
Generating configuration header src/fama-config.h from | ||
src/fama-config.h.in...scons: *** [src/fama-config.h] Exception | ||
Traceback (most recent call last): | ||
File "/usr/lib/scons/SCons/Taskmaster.py", line 171, in execute | ||
self.targets[0].build() | ||
File "/usr/lib/scons/SCons/Node/__init__.py", line 297, in build | ||
apply(executor, (self, exitstatfunc), kw) | ||
File "/usr/lib/scons/SCons/Executor.py", line 125, in __call__ | ||
self.do_execute(target, exitstatfunc, kw) | ||
File "/usr/lib/scons/SCons/Executor.py", line 118, in do_execute | ||
kw) | ||
File "/usr/lib/scons/SCons/Action.py", line 342, in __call__ | ||
stat = self.execute(target, source, env) | ||
File "/usr/lib/scons/SCons/Action.py", line 674, in execute | ||
result = self.execfunction(target=target, source=rsources, env=env) | ||
File "/home/yourname/fama-interface/build_functions.py", line 28, in | ||
BuildConfigHeader | ||
config_h.write(config_h_in.read() % env.config_header_vars) | ||
AttributeError: 'SConsEnvironment' object has no attribute | ||
'config_header_vars' | ||
scons: building terminated because of errors. | ||
------------------------------------------------------------ | ||
|
||
It means you have to re-configure, use "scons CONFIGURE=yes" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import os | ||
from build_functions import CheckPKGConfig, CheckPKG, CheckPackages, SaveDictionary | ||
|
||
SConsignFile() | ||
|
||
env = Environment(ENV = os.environ) | ||
|
||
# Variables | ||
|
||
# [library_name, lirary_minimum_version] | ||
libraries = [ | ||
['glib-2.0', '2.0.0'], | ||
['gobject-2.0', '2.0.0'], | ||
] | ||
|
||
options_filename = 'build_options' | ||
|
||
application_version_string = '0.0.1-pre-alpha' | ||
|
||
# Get our configuration options: | ||
opts = Options(options_filename) | ||
opts.Add('PREFIX', 'Directory to install under', '/usr/local') | ||
opts.Add('NCURSESW', 'Path to the ncursesw include path', '/usr/include/ncursesw') | ||
opts.Add(BoolOption('CONFIGURE', 'Whether the build should be (re)configured', 'yes')) | ||
opts.Add(BoolOption('DEBUG', 'Whether debugging information should be produced', 'no')) | ||
opts.Update(env) | ||
opts.Save(options_filename, env) | ||
|
||
Help(opts.GenerateHelpText(env)) | ||
|
||
# Compiler options | ||
|
||
if env['CC'] == 'gcc': | ||
|
||
env['CCFLAGS'] += ' -Wall' | ||
|
||
if env['DEBUG'] == True: | ||
env['CCFLAGS'] += ' -g' | ||
|
||
|
||
# Configuration: | ||
|
||
if env['CONFIGURE'] == True: | ||
conf = Configure (env, custom_tests = { 'CheckPKGConfig' : CheckPKGConfig, | ||
'CheckPKG' : CheckPKG }) | ||
|
||
if not conf.CheckPKGConfig('0.15.0'): | ||
print 'pkg-config >= 0.15.0 not found.' | ||
Exit(1) | ||
|
||
if not CheckPackages (conf, libraries): | ||
Exit (1) | ||
|
||
env = conf.Finish() | ||
|
||
env['CONFIGURE'] = 'no' # If this point has been reached it's because the configuration was successful | ||
opts.Save(options_filename, env) | ||
|
||
# Configuration header file. | ||
env.config_header_vars = { | ||
# This is where you put all of your custom configuration values. | ||
'data_dir_prefix' : os.path.join (env['PREFIX'], 'share', 'fama', ''), | ||
'version_string' : application_version_string | ||
} | ||
SaveDictionary ('config_header_vars', env.config_header_vars) | ||
|
||
# Now, build: | ||
|
||
for library_name, library_version in libraries: | ||
env.ParseConfig ('pkg-config --cflags --libs ' + library_name) | ||
|
||
|
||
# Append path to ncursesw directory | ||
|
||
|
||
SConscript(['src/SConscript'], 'env options_filename') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Check pgk-config existence and its version | ||
def CheckPKGConfig(context, version): | ||
context.Message( 'Checking for pkg-config... ' ) | ||
ret = context.TryAction('pkg-config --atleast-pkgconfig-version=%s' % version)[0] | ||
context.Result( ret ) | ||
return ret | ||
|
||
# Check whether a given package is installed using pkg-config | ||
def CheckPKG (context, library_name, library_version): | ||
context.Message ('Checking for %s >= %s...' % (library_name, library_version) ) | ||
ret = context.TryAction ('pkg-config --print-errors --exists \'%s >= %s\'' % (library_name, library_version))[0] | ||
context.Result (ret) | ||
return ret | ||
|
||
# Check a list of package names | ||
def CheckPackages (conf, library_list): | ||
for library_name, library_version in library_list: | ||
if not conf.CheckPKG(library_name, library_version): | ||
return False | ||
return True | ||
|
||
def BuildConfigHeader (target, source, env): | ||
|
||
for a_target, a_source in zip(target, source): | ||
print "Generating configuration header %s from %s..." % (a_target, a_source), | ||
config_h = file(str(a_target), "w") | ||
config_h_in = file(str(a_source), "r") | ||
config_h.write(config_h_in.read() % env.config_header_vars) | ||
config_h_in.close() | ||
config_h.close() | ||
print "done" | ||
|
||
def SaveDictionary (filename, dic): | ||
dic_file = file (filename, 'w') | ||
|
||
for key, val in dic.items(): | ||
dic_file.write ("%s - %s\n" % (key, val)) | ||
|
||
dic_file.close () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-bad -bap -bbo -nbc -br -ce -cdw -i4 -ip4 -sob -ts4 -ut -ts4 -ncs -nbc -di1 -lp -ppi0 -l130 -bbo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import os | ||
|
||
from build_functions import BuildConfigHeader | ||
|
||
|
||
source_files = Split("""ui-contactlist.c | ||
ui-interface.c | ||
ui-keyfile.c | ||
main.c | ||
ui-signal.c | ||
ui-color.c | ||
ui-log.c | ||
ui-textwrap.c | ||
ui-stdin-handler.c | ||
ui-command-line.c | ||
ui-command.c | ||
ui-window.c | ||
ui-utf8.c""") | ||
|
||
Import ('env options_filename') | ||
|
||
env.Append (LIBS = ['panelw', 'ncursesw']) | ||
env.Append(CPPPATH = env['NCURSESW']) | ||
|
||
install_dir = os.path.join (env['PREFIX'], 'bin') | ||
|
||
env.Depends('fama-config.h', os.path.join ('..', 'config_header_vars')) | ||
env.Command('fama-config.h', 'fama-config.h.in', BuildConfigHeader) | ||
|
||
program = env.Program ('fama', source_files) | ||
program_install = env.Install (install_dir, program) | ||
env.Alias ('install', program_install) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
#ifndef COMMON_H | ||
#define COMMON_H 1 | ||
|
||
#define _GNU_SOURCE 1 | ||
|
||
#include <glib.h> | ||
#include <glib-object.h> | ||
|
||
#include <wchar.h> | ||
#include <ncurses.h> | ||
#include <panel.h> | ||
|
||
typedef enum { | ||
WindowTypeMain, | ||
WindowTypeConversation, | ||
} FamaWindowType; | ||
|
||
typedef struct { | ||
WINDOW *ncwin; | ||
PANEL *ncpanel; | ||
|
||
wchar_t *title; | ||
GPtrArray *messages; | ||
FamaWindowType type; | ||
gboolean is_updated; | ||
} FamaWindow; | ||
|
||
typedef struct { | ||
gint attr; | ||
wchar_t *title; | ||
wchar_t *message; | ||
} FamaMessage; | ||
|
||
|
||
typedef struct { | ||
gint borders; | ||
gint command_line; | ||
gint window_title; | ||
gint message_heading; | ||
gint message_text; | ||
gint status_available; | ||
gint status_away; | ||
gint status_busy; | ||
gint status_idle; | ||
gint status_offline; | ||
gint status_other; | ||
} ColorSettings; | ||
|
||
typedef gboolean(*CommandFunc) (gint argc, gchar ** argv); | ||
|
||
/* Main.c */ | ||
gboolean init_all(gpointer data); | ||
void stop_main_loop(void); | ||
|
||
/* Interface.c */ | ||
|
||
void destroy_interface(); | ||
void init_interface(); | ||
void draw_interface(); | ||
void redraw_interface(); | ||
|
||
int get_max_y(); | ||
int get_max_x(); | ||
|
||
/* Contactlist.c */ | ||
void contactlist_set_width(gint); | ||
gint contactlist_get_width(); | ||
void contactlist_draw(); | ||
void contactlist_destroy(); | ||
void contactlist_add_category(const wchar_t *); | ||
void contactlist_add_item(guint, const wchar_t *, int); | ||
void contactlist_scroll(gint); | ||
|
||
/* Utf8.c */ | ||
wchar_t *utf8_to_wchar(const gchar *, wchar_t *, gsize); | ||
gchar *utf8_from_wchar(const wchar_t *, gchar *, gsize); | ||
void set_interface_encoding(gchar *); | ||
gchar *get_interface_encoding(void); | ||
|
||
|
||
/* Message.c */ | ||
GPtrArray *textwrap_new(wchar_t *); | ||
void textwrap_destroy(); | ||
gint textwrap_append(GPtrArray *, const wchar_t *, guint); | ||
|
||
/* Signal.c */ | ||
void signal_handler_setup(); | ||
|
||
/* Stdin-handler.c */ | ||
void stdin_handler_setup(); | ||
|
||
/* Command-line.c */ | ||
void commandline_init(); | ||
void commandline_add_wch(wchar_t); | ||
void commandline_update_width(); | ||
wchar_t *commandline_get_buffer(); | ||
void commandline_draw(); | ||
void commandline_move_cursor(gint); | ||
void commandline_delete(); | ||
|
||
/* Keyfile.c */ | ||
gint keyfile_read(); | ||
gint keyfile_write(); | ||
GKeyFile *keyfile_get(); | ||
|
||
/* Window.c */ | ||
FamaWindow *window_new(FamaWindowType); | ||
void window_append_rows(FamaWindow *, GPtrArray *, gint); | ||
void window_add_message(FamaWindow *, wchar_t *, gint, wchar_t *); | ||
FamaWindow *window_get_current(); | ||
FamaWindow *window_get_index(gint); | ||
void window_set_current(FamaWindow *); | ||
void window_set_title(FamaWindow *, wchar_t *); | ||
void window_draw_title_bar(); | ||
void window_destroy(FamaWindow *); | ||
void window_resize_all(); | ||
|
||
/* Log.c */ | ||
void log_init(); | ||
void log_get_time(gchar *, gsize); | ||
|
||
/* Command.c */ | ||
void command_init(); | ||
void command_add(gchar *, CommandFunc); | ||
gboolean command_execute(gint, gchar **); | ||
|
||
/* Color.c */ | ||
void color_init(); | ||
ColorSettings *color_get(); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#ifndef FAMA_CONFIG_H | ||
#define FAMA_CONFIG_H | ||
|
||
#define DATA_DIR_PREFIX "%(data_dir_prefix)s" | ||
|
||
#define VERSION_STRING "%(version_string)s" | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
for i in `find ./ -name "*.[hc]"`; do | ||
echo $i; | ||
indent -br -brs -bad -bap -bbb -ncs -ce -npcs -nbbo -cdb -sc -i8 -l80 "$i"; | ||
done; | ||
|
||
for i in `find ./ -name "*~"`; do | ||
rm "$i" | ||
done |
Oops, something went wrong.