Skip to content

Commit 0284f81

Browse files
author
Benjamin Berg
committed
Initial commit
0 parents  commit 0284f81

18 files changed

+1154
-0
lines changed

Diff for: COPYING

+675
Large diffs are not rendered by default.

Diff for: build-aux/meson/postinstall.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env python3
2+
3+
from os import environ, path
4+
from subprocess import call
5+
6+
prefix = environ.get('MESON_INSTALL_PREFIX', '/usr/local')
7+
datadir = path.join(prefix, 'share')
8+
destdir = environ.get('DESTDIR', '')
9+
10+
# Package managers set this so we don't need to run
11+
if not destdir:
12+
print('Updating icon cache...')
13+
call(['gtk-update-icon-cache', '-qtf', path.join(datadir, 'icons', 'hicolor')])
14+
15+
print('Updating desktop database...')
16+
call(['update-desktop-database', '-q', path.join(datadir, 'applications')])
17+
18+
print('Compiling GSettings schemas...')
19+
call(['glib-compile-schemas', path.join(datadir, 'glib-2.0', 'schemas')])
20+
21+

Diff for: data/meson.build

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
desktop_file = i18n.merge_file(
2+
input: 'org.gnome.Screencast.desktop.in',
3+
output: 'org.gnome.Screencast.desktop',
4+
type: 'desktop',
5+
po_dir: '../po',
6+
install: true,
7+
install_dir: join_paths(get_option('datadir'), 'applications')
8+
)
9+
10+
desktop_utils = find_program('desktop-file-validate', required: false)
11+
if desktop_utils.found()
12+
test('Validate desktop file', desktop_utils,
13+
args: [desktop_file]
14+
)
15+
endif
16+
17+
appstream_file = i18n.merge_file(
18+
input: 'org.gnome.Screencast.appdata.xml.in',
19+
output: 'org.gnome.Screencast.appdata.xml',
20+
po_dir: '../po',
21+
install: true,
22+
install_dir: join_paths(get_option('datadir'), 'appdata')
23+
)
24+
25+
appstream_util = find_program('appstream-util', required: false)
26+
if appstream_util.found()
27+
test('Validate appstream file', appstream_util,
28+
args: ['validate', appstream_file]
29+
)
30+
endif
31+
32+
install_data('org.gnome.Screencast.gschema.xml',
33+
install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas')
34+
)
35+
36+
compile_schemas = find_program('glib-compile-schemas', required: false)
37+
if compile_schemas.found()
38+
test('Validate schema file', compile_schemas,
39+
args: ['--strict', '--dry-run', meson.current_source_dir()]
40+
)
41+
endif

Diff for: data/org.gnome.Screencast.appdata.xml.in

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<component type="desktop">
3+
<id>org.gnome.Screencast.desktop</id>
4+
<metadata_license>CC0-1.0</metadata_license>
5+
<project_license>GPL-3.0-or-later</project_license>
6+
<description>
7+
</description>
8+
</component>

Diff for: data/org.gnome.Screencast.desktop.in

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[Desktop Entry]
2+
Name=gnome-screencast
3+
Exec=gnome-screencast
4+
Terminal=false
5+
Type=Application
6+
Categories=GTK;
7+
StartupNotify=true

Diff for: data/org.gnome.Screencast.gschema.xml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<schemalist gettext-domain="gnome-screencast">
3+
<schema id="org.gnome.Screencast" path="/org/gnome/screencast/">
4+
</schema>
5+
</schemalist>

Diff for: meson.build

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
project('gnome-screencast', 'c', version: '0.1.0',
2+
meson_version: '>= 0.40.0',
3+
)
4+
5+
i18n = import('i18n')
6+
7+
config_h = configuration_data()
8+
config_h.set_quoted('PACKAGE_VERSION', meson.project_version())
9+
config_h.set_quoted('GETTEXT_PACKAGE', 'gnome-screencast')
10+
config_h.set_quoted('LOCALEDIR', join_paths(get_option('prefix'), get_option('localedir')))
11+
configure_file(
12+
output: 'gnome-screencast-config.h',
13+
configuration: config_h,
14+
)
15+
add_project_arguments([
16+
'-I' + meson.build_root(),
17+
], language: 'c')
18+
19+
subdir('data')
20+
subdir('src')
21+
subdir('po')
22+
23+
meson.add_install_script('build-aux/meson/postinstall.py')

Diff for: po/LINGUAS

Whitespace-only changes.

Diff for: po/POTFILES

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
data/org.gnome.Screencast.desktop.in
2+
data/org.gnome.Screencast.appdata.xml.in
3+
data/org.gnome.Screencast.gschema.xml
4+
src/gnome-screencast-window.ui
5+
src/main.c
6+
src/gnome-screencast-window.c
7+

Diff for: po/meson.build

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
i18n.gettext('gnome-screencast', preset: 'glib')

Diff for: scripts/uncrustify.cfg

+139
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
newlines lf
2+
3+
input_tab_size 8
4+
output_tab_size 8
5+
6+
string_escape_char 92
7+
string_escape_char2 0
8+
9+
# indenting
10+
indent_columns 2
11+
indent_with_tabs 0
12+
indent_align_string True
13+
indent_brace 2
14+
indent_braces false
15+
indent_braces_no_func True
16+
indent_func_call_param false
17+
indent_func_def_param false
18+
indent_func_proto_param false
19+
indent_switch_case 0
20+
indent_case_brace 2
21+
indent_paren_close 1
22+
23+
# spacing
24+
sp_arith Add
25+
sp_assign Add
26+
sp_enum_assign Add
27+
sp_bool Add
28+
sp_compare Add
29+
sp_inside_paren Remove
30+
sp_inside_fparens Remove
31+
sp_func_def_paren Force
32+
sp_func_proto_paren Force
33+
sp_paren_paren Remove
34+
sp_balance_nested_parens False
35+
sp_paren_brace Remove
36+
sp_before_square Remove
37+
sp_before_squares Remove
38+
sp_inside_square Remove
39+
sp_before_ptr_star Add
40+
sp_between_ptr_star Remove
41+
sp_after_comma Add
42+
sp_before_comma Remove
43+
sp_after_cast Add
44+
sp_sizeof_paren Add
45+
sp_not Remove
46+
sp_inv Remove
47+
sp_addr Remove
48+
sp_member Remove
49+
sp_deref Remove
50+
sp_sign Remove
51+
sp_incdec Remove
52+
sp_attribute_paren remove
53+
sp_macro Force
54+
sp_func_call_paren Force
55+
sp_func_call_user_paren Remove
56+
set func_call_user _ N_ C_ g_autoptr g_auto
57+
sp_brace_typedef add
58+
sp_cond_colon add
59+
sp_cond_question add
60+
sp_defined_paren remove
61+
62+
# alignment
63+
align_keep_tabs False
64+
align_with_tabs False
65+
align_on_tabstop False
66+
align_number_left True
67+
align_func_params True
68+
align_var_def_span 0
69+
align_var_def_amp_style 1
70+
align_var_def_colon true
71+
align_enum_equ_span 0
72+
align_var_struct_span 2
73+
align_var_def_star_style 2
74+
align_var_def_amp_style 2
75+
align_typedef_span 2
76+
align_typedef_func 0
77+
align_typedef_star_style 2
78+
align_typedef_amp_style 2
79+
80+
# newlines
81+
nl_assign_leave_one_liners True
82+
nl_enum_leave_one_liners False
83+
nl_func_leave_one_liners False
84+
nl_if_leave_one_liners False
85+
nl_end_of_file Add
86+
nl_assign_brace Remove
87+
nl_func_var_def_blk 1
88+
nl_fcall_brace Add
89+
nl_enum_brace Remove
90+
nl_struct_brace Force
91+
nl_union_brace Force
92+
nl_if_brace Force
93+
nl_brace_else Force
94+
nl_elseif_brace Force
95+
nl_else_brace Add
96+
nl_for_brace Force
97+
nl_while_brace Force
98+
nl_do_brace Force
99+
nl_brace_while Force
100+
nl_switch_brace Force
101+
nl_before_case True
102+
nl_after_case False
103+
nl_func_type_name Force
104+
nl_func_proto_type_name Remove
105+
nl_func_paren Remove
106+
nl_func_decl_start Remove
107+
nl_func_decl_args Force
108+
nl_func_decl_end Remove
109+
nl_fdef_brace Force
110+
nl_after_return False
111+
nl_define_macro False
112+
nl_create_if_one_liner False
113+
nl_create_for_one_liner False
114+
nl_create_while_one_liner False
115+
nl_after_semicolon True
116+
nl_multi_line_cond true
117+
118+
# mod
119+
# I'd like these to be remove, but that removes brackets in if { if { foo } }, which i dislike
120+
# Not clear what to do about that...
121+
mod_full_brace_for Remove
122+
mod_full_brace_if Remove
123+
mod_full_brace_if_chain True
124+
mod_full_brace_while Remove
125+
mod_full_brace_do Remove
126+
mod_full_brace_nl 3
127+
mod_paren_on_return Remove
128+
129+
# line splitting
130+
#code_width = 78
131+
ls_for_split_full True
132+
ls_func_split_full True
133+
134+
# positioning
135+
pos_bool Trail
136+
pos_conditional Trail
137+
138+
# custom keywords
139+
set FOR udev_list_entry_foreach

Diff for: scripts/uncrustify.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
SRCROOT=`git rev-parse --show-toplevel`
3+
CFG="$SRCROOT/scripts/uncrustify.cfg"
4+
echo "srcroot: $SRCROOT"
5+
pushd "$SRCROOT"
6+
uncrustify -c "$CFG" --no-backup `git ls-tree --name-only -r HEAD | grep \\\.[ch]$ | grep -v gvdb | grep -v build/`
7+
popd

Diff for: src/gnome-screencast-window.c

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/* gnome-screencast-window.c
2+
*
3+
* Copyright 2018 Benjamin Berg
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
*/
18+
19+
#include "gnome-screencast-config.h"
20+
#include "gnome-screencast-window.h"
21+
22+
struct _GnomeScreencastWindow
23+
{
24+
GtkApplicationWindow parent_instance;
25+
26+
/* Template widgets */
27+
GtkHeaderBar *header_bar;
28+
GtkLabel *label;
29+
};
30+
31+
G_DEFINE_TYPE (GnomeScreencastWindow, gnome_screencast_window, GTK_TYPE_APPLICATION_WINDOW)
32+
33+
static void
34+
gnome_screencast_window_class_init (GnomeScreencastWindowClass *klass)
35+
{
36+
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
37+
38+
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/screencast/gnome-screencast-window.ui");
39+
gtk_widget_class_bind_template_child (widget_class, GnomeScreencastWindow, header_bar);
40+
gtk_widget_class_bind_template_child (widget_class, GnomeScreencastWindow, label);
41+
}
42+
43+
static void
44+
gnome_screencast_window_init (GnomeScreencastWindow *self)
45+
{
46+
gtk_widget_init_template (GTK_WIDGET (self));
47+
}

Diff for: src/gnome-screencast-window.h

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/* gnome-screencast-window.h
2+
*
3+
* Copyright 2018 Benjamin Berg
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
*/
18+
19+
#pragma once
20+
21+
#include <gtk/gtk.h>
22+
23+
G_BEGIN_DECLS
24+
25+
#define GNOME_SCREENCAST_TYPE_WINDOW (gnome_screencast_window_get_type ())
26+
G_DECLARE_FINAL_TYPE (GnomeScreencastWindow, gnome_screencast_window, GNOME_SCREENCAST, WINDOW, GtkApplicationWindow)
27+
28+
G_END_DECLS

Diff for: src/gnome-screencast-window.ui

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<interface>
3+
<requires lib="gtk+" version="3.20"/>
4+
<template class="GnomeScreencastWindow" parent="GtkApplicationWindow">
5+
<property name="default-width">600</property>
6+
<property name="default-height">300</property>
7+
<child type="titlebar">
8+
<object class="GtkHeaderBar" id="header_bar">
9+
<property name="visible">True</property>
10+
<property name="show-close-button">True</property>
11+
<property name="title">Hello, World!</property>
12+
</object>
13+
</child>
14+
<child>
15+
<object class="GtkLabel" id="label">
16+
<property name="label">Hello, World!</property>
17+
<property name="visible">True</property>
18+
<attributes>
19+
<attribute name="weight" value="bold"/>
20+
<attribute name="scale" value="2"/>
21+
</attributes>
22+
</object>
23+
</child>
24+
</template>
25+
</interface>

Diff for: src/gnome-screencast.gresource.xml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<gresources>
3+
<gresource prefix="/org/gnome/screencast">
4+
<file>gnome-screencast-window.ui</file>
5+
</gresource>
6+
</gresources>

0 commit comments

Comments
 (0)